summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrgba64.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-11 11:13:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-04-10 09:15:59 +0000
commit60e8519544b9194d4a44db61fb5b0b10572282cc (patch)
tree46fcacacf6c81725ebeb5a9a543783e4bb03d409 /src/gui/painting/qrgba64.h
parent853cba729bc2bbac254ee36be6d42241eb92fd21 (diff)
Solid and gradients in high color accuracy
This patch updates the internal color precisions of solids and gradients to 16bit per color. This makes it possible to render at higher precision on non-premultiplied ARGB32, the RGB30 formats and any other hi-color formats if more are added. [ChangeLog][QtGui][Painting] Internal precision of solids and gradients is now up to 16bit per color. Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
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); }