clutter/color-state-params: Ignore explicit max_lum on EOTF_PQ

This is a requirement from the wayland color management:

"With transfer_function.st2084_pq the given 'max_lum' value is
ignored, and 'max_lum' is taken as 'min_lum' + 10000 cd/m²."

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4304>
This commit is contained in:
Joan Torres 2025-02-26 17:52:38 +01:00
parent 62df470837
commit 565cff5cb9
2 changed files with 5 additions and 2 deletions

View File

@ -1621,7 +1621,10 @@ clutter_color_state_params_new_full (ClutterContext *context,
{
color_state_params->luminance.type = CLUTTER_LUMINANCE_TYPE_EXPLICIT;
color_state_params->luminance.min = min_lum;
color_state_params->luminance.max = max_lum;
if (transfer_function == CLUTTER_TRANSFER_FUNCTION_PQ)
color_state_params->luminance.max = min_lum + 10000.0f;
else
color_state_params->luminance.max = max_lum;
color_state_params->luminance.ref = ref_lum;
}
else

View File

@ -105,7 +105,7 @@ color_management (void)
lum = clutter_color_state_params_get_luminance (color_state_params);
g_assert_cmpuint (lum->type, ==, CLUTTER_LUMINANCE_TYPE_EXPLICIT);
g_assert_cmpfloat_with_epsilon (lum->min, 0.005f, TEST_COLOR_EPSILON);
g_assert_cmpfloat_with_epsilon (lum->max, 10000.0f, TEST_COLOR_EPSILON);
g_assert_cmpfloat_with_epsilon (lum->max, lum->min + 10000.0f, TEST_COLOR_EPSILON);
g_assert_cmpfloat_with_epsilon (lum->ref, 303.0f, TEST_COLOR_EPSILON);
emit_sync_event (1);