summaryrefslogtreecommitdiff
path: root/plugingui/colour.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-06-04 18:36:00 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-06-04 18:37:42 +0200
commit3e747d769f63fde60f6095bd1ae7c651d4237f39 (patch)
tree92a5955413dac91972edf32b1824739038704720 /plugingui/colour.h
parent538abc6cd8f4a5996640ec9800815fbac5c34b26 (diff)
Make Colour movabl;e and make Image contain a vector of Colour instead of raw char data.
Diffstat (limited to 'plugingui/colour.h')
-rw-r--r--plugingui/colour.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/plugingui/colour.h b/plugingui/colour.h
index a02a6b0..0e85bc6 100644
--- a/plugingui/colour.h
+++ b/plugingui/colour.h
@@ -31,18 +31,22 @@ namespace GUI {
class Colour {
public:
Colour();
+ Colour(float grey, float alpha = 1.0f);
+ Colour(float red, float green, float blue, float alpha = 1.0f);
+ Colour(Colour&& other);
+ Colour(const Colour& other);
+ ~Colour();
- Colour(float grey, float alpha = 1.0);
+ Colour& operator=(const Colour& other);
+ Colour& operator=(Colour&& other);
- Colour(float red,
- float green,
- float blue,
- float alpha = 1.0);
+ inline float red() const { return data[0]; }
+ inline float green() const { return data[1]; }
+ inline float blue() const { return data[2]; }
+ inline float alpha() const { return data[3]; }
- float red;
- float green;
- float blue;
- float alpha;
+private:
+ float *data{nullptr};
};
} // GUI::