From 181e96cae2db8ec0b87adc18db1c603bf41fc0ed Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 12 Jul 2019 10:33:07 +0200 Subject: Remove public d_func from QColorSpace Replaced with getter in private. Change-Id: I968eb45052a80b45750213cf6a0c08b5973dfc4d Reviewed-by: Eirik Aavitsland --- src/gui/painting/qcolorspace_p.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/painting/qcolorspace_p.h') diff --git a/src/gui/painting/qcolorspace_p.h b/src/gui/painting/qcolorspace_p.h index 95e0655d0c..75b74f062f 100644 --- a/src/gui/painting/qcolorspace_p.h +++ b/src/gui/painting/qcolorspace_p.h @@ -95,6 +95,17 @@ public: QColorSpacePrivate(const QColorSpacePrimaries &primaries, QColorSpace::TransferFunction fun, float gamma); QColorSpacePrivate(const QColorSpacePrivate &other) = default; + static QColorSpacePrivate *getWritable(QColorSpace &colorSpace) + { + colorSpace.d_ptr.detach(); + return colorSpace.d_ptr.data(); + } + + static const QColorSpacePrivate *get(const QColorSpace &colorSpace) + { + return colorSpace.d_ptr.data(); + } + void initialize(); void setToXyzMatrix(); void setTransferFunction(); -- cgit v1.2.3 From 76c097c4d7eb873052de031fbc2d21579aa3947a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 12 Jul 2019 18:18:21 +0200 Subject: Improve our color space terminology Replace our use of 'gamut' with 'primaries'. One is the axes of the color space, the other the volume of representable values. For the currently supported color spaces those are mostly equivalent, but when we later add support for scRgb, this would be misleading as it has the same primaries as sRGB but a much wider gamut, and we would like to use the same primaries/"gamut" id for it. Also few people would know what "the sRGB gamut" is, but "the sRGB primaries" is easily googable. Change-Id: I3348ccaae27a071ec77a4356331b9bbbf92e0d19 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qcolorspace_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/painting/qcolorspace_p.h') diff --git a/src/gui/painting/qcolorspace_p.h b/src/gui/painting/qcolorspace_p.h index 75b74f062f..2a40a0cfd8 100644 --- a/src/gui/painting/qcolorspace_p.h +++ b/src/gui/painting/qcolorspace_p.h @@ -66,7 +66,7 @@ class Q_GUI_EXPORT QColorSpacePrimaries { public: QColorSpacePrimaries() = default; - QColorSpacePrimaries(QColorSpace::Gamut gamut); + QColorSpacePrimaries(QColorSpace::Primaries primaries); QColorSpacePrimaries(QPointF whitePoint, QPointF redPoint, QPointF greenPoint, @@ -91,7 +91,7 @@ class QColorSpacePrivate : public QSharedData public: QColorSpacePrivate(); QColorSpacePrivate(QColorSpace::ColorSpaceId colorSpaceId); - QColorSpacePrivate(QColorSpace::Gamut gamut, QColorSpace::TransferFunction fun, float gamma); + QColorSpacePrivate(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma); QColorSpacePrivate(const QColorSpacePrimaries &primaries, QColorSpace::TransferFunction fun, float gamma); QColorSpacePrivate(const QColorSpacePrivate &other) = default; @@ -113,7 +113,7 @@ public: QColorTransform transformationToColorSpace(const QColorSpacePrivate *out) const; QColorSpace::ColorSpaceId id; - QColorSpace::Gamut gamut; + QColorSpace::Primaries primaries; QColorSpace::TransferFunction transferFunction; float gamma; QColorVector whitePoint; -- cgit v1.2.3