From e2c91dd77bd85cdcb8e316a0f582e4f36ea4bcfb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 11 Feb 2015 11:12:43 +0100 Subject: Introduce QRgba64 structure for 64bit RGBA values This structure is meant to replace QRgb where higher precision is needed. Change-Id: I49d441e2133371a8b91c2e6af0c137bcc5fcb9ed Reviewed-by: Gunnar Sletta --- src/gui/painting/qcolor.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui/painting/qcolor.h') diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index 06c218365b..9175875310 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -37,6 +37,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -63,6 +64,7 @@ public: QColor(Qt::GlobalColor color); QColor(int r, int g, int b, int a = 255); QColor(QRgb rgb); + QColor(QRgba64 rgba64); QColor(const QString& name); QColor(const char *name); QColor(const QColor &color); // ### Qt 6: remove, the trivial one is fine. @@ -109,6 +111,9 @@ public: QRgb rgba() const; void setRgba(QRgb rgba); + QRgba64 rgba64() const; + void setRgba64(QRgba64 rgba); + QRgb rgb() const; void setRgb(QRgb rgb); @@ -173,6 +178,9 @@ public: static QColor fromRgb(int r, int g, int b, int a = 255); static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0); + static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX); + static QColor fromRgba64(QRgba64 rgba); + static QColor fromHsv(int h, int s, int v, int a = 255); static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0); -- cgit v1.2.3