From ab7ab9e52ab87963831f90ab25957d883878654d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 2 Jun 2016 21:00:37 +0200 Subject: New ImageCache class for reusing Image resources. --- plugingui/image.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugingui/image.h') diff --git a/plugingui/image.h b/plugingui/image.h index 92bd181..8d1fd59 100644 --- a/plugingui/image.h +++ b/plugingui/image.h @@ -33,12 +33,16 @@ namespace GUI { -class Image { +class Image +{ public: Image(const char* data, size_t size); Image(const std::string& filename); + Image(Image&& other); ~Image(); + Image& operator=(Image&& other); + size_t width() const; size_t height() const; @@ -49,8 +53,9 @@ private: void load(const char* data, size_t size); - size_t _width, _height; - unsigned char* image_data; + std::size_t _width{0}; + std::size_t _height{0}; + unsigned char* image_data{nullptr}; }; } // GUI:: -- cgit v1.2.3