summaryrefslogtreecommitdiff
path: root/plugingui/image.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-06-02 21:00:37 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-06-02 21:00:37 +0200
commitab7ab9e52ab87963831f90ab25957d883878654d (patch)
tree2225a4382497889f43477429d2f6b696ce04bf8f /plugingui/image.h
parent1d6833cfcb0b5bf4890fa15b5013d7490af48f69 (diff)
New ImageCache class for reusing Image resources.
Diffstat (limited to 'plugingui/image.h')
-rw-r--r--plugingui/image.h11
1 files changed, 8 insertions, 3 deletions
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::