From 3e747d769f63fde60f6095bd1ae7c651d4237f39 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 4 Jun 2016 18:36:00 +0200 Subject: Make Colour movabl;e and make Image contain a vector of Colour instead of raw char data. --- plugingui/image.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugingui/image.h') diff --git a/plugingui/image.h b/plugingui/image.h index 8d1fd59..4f591aa 100644 --- a/plugingui/image.h +++ b/plugingui/image.h @@ -27,6 +27,7 @@ #pragma once #include +#include #include "colour.h" #include "resource.h" @@ -46,7 +47,7 @@ public: size_t width() const; size_t height() const; - Colour getPixel(size_t x, size_t y) const; + const Colour& getPixel(size_t x, size_t y) const; private: void setError(); @@ -55,7 +56,8 @@ private: std::size_t _width{0}; std::size_t _height{0}; - unsigned char* image_data{nullptr}; + std::vector image_data; + Colour out_of_range{0.0f, 0.0f, 0.0f, 0.0f}; }; } // GUI:: -- cgit v1.2.3