summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrgba64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qrgba64.h')
-rw-r--r--src/gui/painting/qrgba64.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/painting/qrgba64.h b/src/gui/painting/qrgba64.h
index 2ea09e6bd6..51ce4ab10d 100644
--- a/src/gui/painting/qrgba64.h
+++ b/src/gui/painting/qrgba64.h
@@ -88,6 +88,9 @@ public:
return fromRgba(rgb >> 16, rgb >> 8, rgb, rgb >> 24);
}
+ Q_DECL_CONSTEXPR bool isOpaque() const { return c.alpha == 0xffff; }
+ Q_DECL_CONSTEXPR bool isTransparent() const { return c.alpha == 0; }
+
Q_DECL_CONSTEXPR quint16 red() const { return c.red; }
Q_DECL_CONSTEXPR quint16 green() const { return c.green; }
Q_DECL_CONSTEXPR quint16 blue() const { return c.blue; }
@@ -133,6 +136,12 @@ public:
return rgba;
}
+ QRgba64 operator=(quint64 _rgba)
+ {
+ rgba = _rgba;
+ return *this;
+ }
+
private:
static Q_DECL_CONSTEXPR uint div_257_floor(uint x) { return (x - (x >> 8)) >> 8; }
static Q_DECL_CONSTEXPR uint div_257(uint x) { return div_257_floor(x + 128); }