From 6f79597f134788c02d22b4d7efabc6251c3735b2 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 12 Aug 2024 02:26:56 +0200 Subject: [PATCH] core/colorspace: match default luminances with the Wayland protocol It wasn't feasible to do it before, because it made SDR black far too bright, but with black point compensation the result looks as users expect it --- autotests/test_colorspaces.cpp | 10 +++++----- src/core/colorspace.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autotests/test_colorspaces.cpp b/autotests/test_colorspaces.cpp index f9e6714134..4875607475 100644 --- a/autotests/test_colorspaces.cpp +++ b/autotests/test_colorspaces.cpp @@ -141,15 +141,15 @@ void TestColorspaces::testColorPipeline_data() QTest::addRow("sRGB -> rec.2020 relative colorimetric") << ColorDescription(NamedColorimetry::BT709, TransferFunction(TransferFunction::gamma22), TransferFunction::defaultReferenceLuminanceFor(TransferFunction::gamma22), 0, std::nullopt, std::nullopt) << ColorDescription(NamedColorimetry::BT2020, TransferFunction(TransferFunction::PerceptualQuantizer), 500, 0, std::nullopt, std::nullopt) - << QVector3D(0.044, 0.044, 0.044) - << QVector3D(0.517, 0.517, 0.517) - << QVector3D(0.677, 0.677, 0.677) + << QVector3D(0.06729, 0.06729, 0.06729) + << QVector3D(0.51667, 0.51667, 0.51667) + << QVector3D(0.67658, 0.67658, 0.67658) << RenderingIntent::RelativeColorimetric; QTest::addRow("sRGB -> scRGB relative colorimetric") << ColorDescription(NamedColorimetry::BT709, TransferFunction(TransferFunction::gamma22), TransferFunction::defaultReferenceLuminanceFor(TransferFunction::gamma22), 0, std::nullopt, std::nullopt) << ColorDescription(NamedColorimetry::BT709, TransferFunction(TransferFunction::linear, 0, 80), 80, 0, std::nullopt, std::nullopt) - << QVector3D(0.0001, 0.0001, 0.0001) - << QVector3D(0.2177376408240310, 0.2177376408240310, 0.2177376408240310) + << QVector3D(0.00025, 0.00025, 0.00025) + << QVector3D(0.217833, 0.217833, 0.217833) << QVector3D(1, 1, 1) << RenderingIntent::RelativeColorimetric; } diff --git a/src/core/colorspace.cpp b/src/core/colorspace.cpp index 58cab0a018..1e48cfbe3e 100644 --- a/src/core/colorspace.cpp +++ b/src/core/colorspace.cpp @@ -377,7 +377,7 @@ double TransferFunction::defaultMinLuminanceFor(Type type) switch (type) { case Type::sRGB: case Type::gamma22: - return 0.01; + return 0.02; case Type::linear: return 0; case Type::PerceptualQuantizer: @@ -391,7 +391,7 @@ double TransferFunction::defaultMaxLuminanceFor(Type type) switch (type) { case Type::sRGB: case Type::gamma22: - return 100; + return 80; case Type::linear: return 1; case Type::PerceptualQuantizer: @@ -409,7 +409,7 @@ double TransferFunction::defaultReferenceLuminanceFor(Type type) return 80; case Type::sRGB: case Type::gamma22: - return 100; + return 80; } Q_UNREACHABLE(); }