summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolorspace.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2024-02-22 14:45:22 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2024-04-12 21:53:54 +0200
commit25c96d547b4563cbfedcec6093d68116148d8599 (patch)
tree0935166af057f75d904dd22a77d99412aba18a41 /src/gui/painting/qcolorspace.cpp
parente794894ece0bcfc78fa4155cb01d825791ea102b (diff)
Add CMYK support to QColorSpace
[ChangeLog][QtGui][QColorSpace] Support for CMYK color spaces has been added. Change-Id: I2c684dbeee8b97fc90ca4e2a892349a7fa465d06 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/painting/qcolorspace.cpp')
-rw-r--r--src/gui/painting/qcolorspace.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/painting/qcolorspace.cpp b/src/gui/painting/qcolorspace.cpp
index 3ef1ebbeb5..058a6cb566 100644
--- a/src/gui/painting/qcolorspace.cpp
+++ b/src/gui/painting/qcolorspace.cpp
@@ -468,6 +468,7 @@ void QColorSpacePrivate::clearElementListProcessingForEdit()
Q_ASSERT(transferFunction == QColorSpace::TransferFunction::Custom);
transformModel = QColorSpace::TransformModel::ThreeComponentMatrix;
+ colorModel = QColorSpace::ColorModel::Rgb;
isPcsLab = false;
mAB.clear();
mBA.clear();
@@ -576,6 +577,8 @@ void QColorSpacePrivate::clearElementListProcessingForEdit()
\value Undefined No color model
\value Rgb An RGB color model with red, green, and blue colors. Can apply to RGB and grayscale data.
\value Gray A gray scale color model. Can only apply to grayscale data.
+ \value Cmyk Can only represent color data defined with cyan, magenta, yellow, and black colors.
+ In effect only QImage::Format_CMYK32. Note Cmyk color spaces will be TransformModel::ElementListProcessing.
*/
/*!
@@ -1151,7 +1154,8 @@ static bool compareElement(const QColorSpacePrivate::TransferElement &element,
{
return element.trc[0] == other.trc[0]
&& element.trc[1] == other.trc[1]
- && element.trc[2] == other.trc[2];
+ && element.trc[2] == other.trc[2]
+ && element.trc[3] == other.trc[3];
}
static bool compareElement(const QColorMatrix &element,
@@ -1175,6 +1179,8 @@ static bool compareElement(const QColorCLUT &element,
return false;
if (element.gridPointsZ != other.gridPointsZ)
return false;
+ if (element.gridPointsW != other.gridPointsW)
+ return false;
if (element.table.size() != other.table.size())
return false;
for (qsizetype i = 0; i < element.table.size(); ++i) {
@@ -1231,6 +1237,8 @@ bool QColorSpacePrivate::equals(const QColorSpacePrivate *other) const
if (!isThreeComponentMatrix()) {
if (isPcsLab != other->isPcsLab)
return false;
+ if (colorModel != other->colorModel)
+ return false;
if (mAB.count() != other->mAB.count())
return false;
if (mBA.count() != other->mBA.count())