summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolorspace.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2024-03-14 10:05:31 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2024-04-05 18:40:47 +0200
commit05b84673045a5f4432a6caa9bea08d8fba1e1a03 (patch)
tree68ecd72c6448dffe970f079120e5c6a14e4c4c63 /src/gui/painting/qcolorspace.h
parenta786404036990c595e25122fae5f710f12bc397b (diff)
Add color space model, making gray color spaces explicit
This also adds image conversion of both format and color space, which will also be required later for conversions to CMYK formats and color spaces. Change-Id: I578c0a010ffcdb4df4cf9080c0621fac8bc342bf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/painting/qcolorspace.h')
-rw-r--r--src/gui/painting/qcolorspace.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/painting/qcolorspace.h b/src/gui/painting/qcolorspace.h
index 848bc0898e..cbb1435c56 100644
--- a/src/gui/painting/qcolorspace.h
+++ b/src/gui/painting/qcolorspace.h
@@ -50,9 +50,17 @@ public:
ElementListProcessing,
};
Q_ENUM(TransformModel)
+ enum class ColorModel : uint8_t {
+ Undefined = 0,
+ Rgb = 1,
+ Gray = 2,
+ };
+ Q_ENUM(ColorModel)
QColorSpace() noexcept = default;
QColorSpace(NamedColorSpace namedColorSpace);
+ QColorSpace(const QPointF &whitePoint, TransferFunction transferFunction, float gamma = 0.0f);
+ QColorSpace(const QPointF &whitePoint, const QList<uint16_t> &transferFunctionTable);
QColorSpace(Primaries primaries, TransferFunction transferFunction, float gamma = 0.0f);
QColorSpace(Primaries primaries, float gamma);
QColorSpace(Primaries primaries, const QList<uint16_t> &transferFunctionTable);
@@ -104,8 +112,11 @@ public:
void setPrimaries(Primaries primariesId);
void setPrimaries(const QPointF &whitePoint, const QPointF &redPoint,
const QPointF &greenPoint, const QPointF &bluePoint);
+ void setWhitePoint(const QPointF &whitePoint);
+ QPointF whitePoint() const;
TransformModel transformModel() const noexcept;
+ ColorModel colorModel() const noexcept;
void detach();
bool isValid() const noexcept;
bool isValidTarget() const noexcept;