wayland/frog colormanagement: don't change the reference luminance for relative transfer function

We only need to override the reference luminance for "absolute" transfer functions, because most
Vulkan apps - games - don't adhere to the standards in this aspect.
For relative transfer functions, the reference luminance should match the maximum luminance of the
transfer function.
This commit is contained in:
Xaver Hugl 2024-08-10 15:17:06 +02:00
parent cfc0f05c94
commit 992547fd10

View file

@ -159,7 +159,11 @@ void FrogColorManagementSurfaceV1::updateColorDescription()
{ {
if (m_surface) { if (m_surface) {
SurfaceInterfacePrivate *priv = SurfaceInterfacePrivate::get(m_surface); SurfaceInterfacePrivate *priv = SurfaceInterfacePrivate::get(m_surface);
priv->pending->colorDescription = ColorDescription(m_containerColorimetry, m_transferFunction, priv->preferredColorDescription.value_or(ColorDescription::sRGB).referenceLuminance(), 0, m_maxAverageLuminance, m_maxPeakBrightness, m_masteringColorimetry, Colorimetry::fromName(NamedColorimetry::BT709)); double referenceLuminance = m_transferFunction.maxLuminance;
if (!m_transferFunction.isRelative()) {
referenceLuminance = priv->preferredColorDescription.value_or(ColorDescription::sRGB).referenceLuminance();
}
priv->pending->colorDescription = ColorDescription(m_containerColorimetry, m_transferFunction, referenceLuminance, 0, m_maxAverageLuminance, m_maxPeakBrightness, m_masteringColorimetry, Colorimetry::fromName(NamedColorimetry::BT709));
priv->pending->colorDescriptionIsSet = true; priv->pending->colorDescriptionIsSet = true;
} }
} }