From 89d0a03c067b42155b1a2d310f8514f595abfd61 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Sun, 8 Sep 2019 15:38:56 +0200 Subject: Remove BT.2020 support from QColorSpace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BT.2020 is an HDR color space and its luminance range doesn't match that of the rest of the currently available color spaces. Without support for white-point luminance in 5.14, there would be a behavior change when luminance support is later introduced, so it is better to remove it now, and reintroduce it when the necessary handling of different luminance levels is available. Change-Id: Ie29e4dd757faae3ac91d4252e1206acce42801dc Reviewed-by: Tor Arne Vestbø --- src/gui/painting/qcolormatrix_p.h | 6 ------ src/gui/painting/qcolorspace.cpp | 31 +---------------------------- src/gui/painting/qcolorspace.h | 9 +++------ src/gui/painting/qcolortransferfunction_p.h | 4 ---- src/gui/painting/qicc.cpp | 3 --- 5 files changed, 4 insertions(+), 49 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qcolormatrix_p.h b/src/gui/painting/qcolormatrix_p.h index 66db95df7e..70d2137119 100644 --- a/src/gui/painting/qcolormatrix_p.h +++ b/src/gui/painting/qcolormatrix_p.h @@ -226,12 +226,6 @@ public: { 0.1351922452f, 0.7118769884f, 0.0000000000f }, { 0.0313525312f, 0.0000856627f, 0.8251883388f } }; } - static QColorMatrix toXyzFromBt2020() - { - return QColorMatrix { { 0.6506130099f, 0.2695676684f, -0.0018652577f }, - { 0.1865101457f, 0.6840794086f, 0.0172256753f }, - { 0.1270887405f, 0.0463530831f, 0.8098278046f } }; - } }; inline bool operator==(const QColorMatrix &m1, const QColorMatrix &m2) diff --git a/src/gui/painting/qcolorspace.cpp b/src/gui/painting/qcolorspace.cpp index 39ab358879..720c531e3f 100644 --- a/src/gui/painting/qcolorspace.cpp +++ b/src/gui/painting/qcolorspace.cpp @@ -70,12 +70,6 @@ QColorSpacePrimaries::QColorSpacePrimaries(QColorSpace::Primaries primaries) bluePoint = QPointF(0.150, 0.060); whitePoint = QColorVector::D65Chromaticity(); break; - case QColorSpace::Primaries::Bt2020: - redPoint = QPointF(0.708, 0.292); - greenPoint = QPointF(0.190, 0.797); - bluePoint = QPointF(0.131, 0.046); - whitePoint = QColorVector::D65Chromaticity(); - break; case QColorSpace::Primaries::AdobeRgb: redPoint = QPointF(0.640, 0.330); greenPoint = QPointF(0.210, 0.710); @@ -191,11 +185,6 @@ QColorSpacePrivate::QColorSpacePrivate(QColorSpace::NamedColorSpace namedColorSp transferFunction = QColorSpace::TransferFunction::ProPhotoRgb; description = QStringLiteral("ProPhoto RGB"); break; - case QColorSpace::Bt2020: - primaries = QColorSpace::Primaries::Bt2020; - transferFunction = QColorSpace::TransferFunction::Bt2020; - description = QStringLiteral("BT.2020"); - break; default: Q_UNREACHABLE(); } @@ -277,14 +266,6 @@ void QColorSpacePrivate::identifyColorSpace() } } break; - case QColorSpace::Primaries::Bt2020: - if (transferFunction == QColorSpace::TransferFunction::Bt2020) { - namedColorSpace = QColorSpace::Bt2020; - if (description.isEmpty()) - description = QStringLiteral("BT.2020"); - return; - } - break; default: break; } @@ -335,12 +316,6 @@ void QColorSpacePrivate::setTransferFunction() if (qFuzzyIsNull(gamma)) gamma = 1.8f; break; - case QColorSpace::TransferFunction::Bt2020: - trc[0].m_type = QColorTrc::Type::Function; - trc[0].m_fun = QColorTransferFunction::fromBt2020(); - if (qFuzzyIsNull(gamma)) - gamma = 1.961f; - break; case QColorSpace::TransferFunction::Custom: break; default: @@ -415,8 +390,6 @@ QColorTransform QColorSpacePrivate::transformationToColorSpace(const QColorSpace \l{http://www.color.org/chardata/rgb/DCIP3.xalter}{ICC registration of DCI-P3} \value ProPhotoRgb The Pro Photo RGB color space, also known as ROMM RGB is a very wide gamut color space. \l{http://www.color.org/chardata/rgb/rommrgb.xalter}{ICC registration of ROMM RGB} - \value Bt2020 BT.2020 also known as Rec.2020 is the color space of HDR TVs. - \l{http://www.color.org/chardata/rgb/BT2020.xalter}{ICC registration of BT.2020} */ /*! @@ -429,7 +402,6 @@ QColorTransform QColorSpacePrivate::transformationToColorSpace(const QColorSpace \value AdobeRgb The Adobe RGB primaries \value DciP3D65 The DCI-P3 primaries with the D65 whitepoint \value ProPhotoRgb The ProPhoto RGB primaries with the D50 whitepoint - \value Bt2020 The BT.2020 primaries */ /*! @@ -442,7 +414,6 @@ QColorTransform QColorSpacePrivate::transformationToColorSpace(const QColorSpace \value Gamma A transfer function that is a real gamma curve based on the value of gamma() \value SRgb The sRGB transfer function, composed of linear and gamma parts \value ProPhotoRgb The ProPhoto RGB transfer function, composed of linear and gamma parts - \value Bt2020 The BT.2020 transfer function, composed of linear and gamma parts */ /*! @@ -457,7 +428,7 @@ QColorSpace::QColorSpace() */ QColorSpace::QColorSpace(NamedColorSpace namedColorSpace) { - static QColorSpacePrivate *predefinedColorspacePrivates[QColorSpace::Bt2020 + 1]; + static QColorSpacePrivate *predefinedColorspacePrivates[QColorSpace::ProPhotoRgb + 1]; if (!predefinedColorspacePrivates[namedColorSpace]) { predefinedColorspacePrivates[namedColorSpace] = new QColorSpacePrivate(namedColorSpace); predefinedColorspacePrivates[namedColorSpace]->ref.ref(); diff --git a/src/gui/painting/qcolorspace.h b/src/gui/painting/qcolorspace.h index 11987b9a37..e6bc62d58a 100644 --- a/src/gui/painting/qcolorspace.h +++ b/src/gui/painting/qcolorspace.h @@ -59,8 +59,7 @@ public: SRgbLinear, AdobeRgb, DisplayP3, - ProPhotoRgb, - Bt2020, + ProPhotoRgb }; Q_ENUM(NamedColorSpace) enum class Primaries { @@ -68,8 +67,7 @@ public: SRgb, AdobeRgb, DciP3D65, - ProPhotoRgb, - Bt2020, + ProPhotoRgb }; Q_ENUM(Primaries) enum class TransferFunction { @@ -77,8 +75,7 @@ public: Linear, Gamma, SRgb, - ProPhotoRgb, - Bt2020, + ProPhotoRgb }; Q_ENUM(TransferFunction) diff --git a/src/gui/painting/qcolortransferfunction_p.h b/src/gui/painting/qcolortransferfunction_p.h index fd7cfa2b2b..0575dbd888 100644 --- a/src/gui/painting/qcolortransferfunction_p.h +++ b/src/gui/painting/qcolortransferfunction_p.h @@ -130,10 +130,6 @@ public: { return QColorTransferFunction(1.0f / 1.055f, 0.055f / 1.055f, 1.0f / 12.92f, 0.04045f, 0.0f, 0.0f, 2.4f); } - static QColorTransferFunction fromBt2020() - { - return QColorTransferFunction(1.0f / 1.0993f, 0.0993f / 1.0993f, 1.0f / 4.5f, 0.08145f, 0.0f, 0.0f, 2.2f); - } static QColorTransferFunction fromProPhotoRgb() { return QColorTransferFunction(1.0f, 0.0f, 1.0f / 16.0f, 16.0f / 512.0f, 0.0f, 0.0f, 1.8f); diff --git a/src/gui/painting/qicc.cpp b/src/gui/painting/qicc.cpp index 45b64de960..18f212f8e9 100644 --- a/src/gui/painting/qicc.cpp +++ b/src/gui/painting/qicc.cpp @@ -687,9 +687,6 @@ bool fromIccProfile(const QByteArray &data, QColorSpace *colorSpace) } else if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromDciP3D65()) { qCDebug(lcIcc) << "fromIccProfile: DCI-P3 D65 primaries detected"; colorspaceDPtr->primaries = QColorSpace::Primaries::DciP3D65; - } else if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromBt2020()) { - qCDebug(lcIcc) << "fromIccProfile: BT.2020 primaries detected"; - colorspaceDPtr->primaries = QColorSpace::Primaries::Bt2020; } if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromProPhotoRgb()) { qCDebug(lcIcc) << "fromIccProfile: ProPhoto RGB primaries detected"; -- cgit v1.2.3