From ebc4bb23630a3ea8076e9c81e3a3cb6eee0ada60 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 23 Jul 2024 23:36:19 -0600 Subject: [PATCH] wayland: Switch to v4 of the color management protocol --- gdk/wayland/gdkwaylandcolor.c | 241 ++--- gdk/wayland/meson.build | 2 +- ...ment-v2.xml => xx-color-management-v4.xml} | 842 +++++++++++------- 3 files changed, 663 insertions(+), 422 deletions(-) rename gdk/wayland/protocol/{xx-color-management-v2.xml => xx-color-management-v4.xml} (61%) diff --git a/gdk/wayland/gdkwaylandcolor.c b/gdk/wayland/gdkwaylandcolor.c index 745489d42d..ae87397dd5 100644 --- a/gdk/wayland/gdkwaylandcolor.c +++ b/gdk/wayland/gdkwaylandcolor.c @@ -2,27 +2,27 @@ #include "gdkwaylandcolor-private.h" #include "gdksurface-wayland-private.h" -#include +#include struct _GdkWaylandColor { - struct xx_color_manager_v2 *color_manager; + struct xx_color_manager_v4 *color_manager; struct { unsigned int intents; unsigned int features; unsigned int transfers; unsigned int primaries; } color_manager_supported; - struct xx_image_description_v2 *srgb; - struct xx_image_description_v2 *srgb_linear; - struct xx_image_description_v2 *rec2100_pq; - struct xx_image_description_v2 *rec2100_linear; + struct xx_image_description_v4 *srgb; + struct xx_image_description_v4 *srgb_linear; + struct xx_image_description_v4 *rec2100_pq; + struct xx_image_description_v4 *rec2100_linear; }; static void -xx_color_manager_v2_supported_intent (void *data, - struct xx_color_manager_v2 *xx_color_manager_v2, +xx_color_manager_v4_supported_intent (void *data, + struct xx_color_manager_v4 *xx_color_manager_v2, uint32_t render_intent) { GdkWaylandColor *color = data; @@ -31,8 +31,8 @@ xx_color_manager_v2_supported_intent (void *data, } static void -xx_color_manager_v2_supported_feature (void *data, - struct xx_color_manager_v2 *xx_color_manager_v2, +xx_color_manager_v4_supported_feature (void *data, + struct xx_color_manager_v4 *xx_color_manager_v2, uint32_t feature) { GdkWaylandColor *color = data; @@ -41,8 +41,8 @@ xx_color_manager_v2_supported_feature (void *data, } static void -xx_color_manager_v2_supported_tf_named (void *data, - struct xx_color_manager_v2 *xx_color_manager_v2, +xx_color_manager_v4_supported_tf_named (void *data, + struct xx_color_manager_v4 *xx_color_manager_v2, uint32_t tf) { GdkWaylandColor *color = data; @@ -51,8 +51,8 @@ xx_color_manager_v2_supported_tf_named (void *data, } static void -xx_color_manager_v2_supported_primaries_named (void *data, - struct xx_color_manager_v2 *xx_color_manager_v2, +xx_color_manager_v4_supported_primaries_named (void *data, + struct xx_color_manager_v4 *xx_color_manager_v2, uint32_t primaries) { GdkWaylandColor *color = data; @@ -60,11 +60,11 @@ xx_color_manager_v2_supported_primaries_named (void *data, color->color_manager_supported.primaries |= (1 << primaries); } -static struct xx_color_manager_v2_listener color_manager_listener = { - xx_color_manager_v2_supported_intent, - xx_color_manager_v2_supported_feature, - xx_color_manager_v2_supported_tf_named, - xx_color_manager_v2_supported_primaries_named, +static struct xx_color_manager_v4_listener color_manager_listener = { + xx_color_manager_v4_supported_intent, + xx_color_manager_v4_supported_feature, + xx_color_manager_v4_supported_tf_named, + xx_color_manager_v4_supported_primaries_named, }; GdkWaylandColor * @@ -78,10 +78,10 @@ gdk_wayland_color_new (struct wl_registry *registry, color->color_manager = wl_registry_bind (registry, id, - &xx_color_manager_v2_interface, + &xx_color_manager_v4_interface, MIN (version, 2)); - xx_color_manager_v2_add_listener (color->color_manager, + xx_color_manager_v4_add_listener (color->color_manager, &color_manager_listener, color); @@ -91,11 +91,11 @@ gdk_wayland_color_new (struct wl_registry *registry, void gdk_wayland_color_free (GdkWaylandColor *color) { - g_clear_pointer (&color->color_manager, xx_color_manager_v2_destroy); - g_clear_pointer (&color->srgb, xx_image_description_v2_destroy); - g_clear_pointer (&color->srgb_linear, xx_image_description_v2_destroy); - g_clear_pointer (&color->rec2100_pq, xx_image_description_v2_destroy); - g_clear_pointer (&color->rec2100_linear, xx_image_description_v2_destroy); + g_clear_pointer (&color->color_manager, xx_color_manager_v4_destroy); + g_clear_pointer (&color->srgb, xx_image_description_v4_destroy); + g_clear_pointer (&color->srgb_linear, xx_image_description_v4_destroy); + g_clear_pointer (&color->rec2100_pq, xx_image_description_v4_destroy); + g_clear_pointer (&color->rec2100_linear, xx_image_description_v4_destroy); g_free (color); } @@ -107,25 +107,25 @@ gdk_wayland_color_get_color_manager (GdkWaylandColor *color) static void std_image_desc_failed (void *data, - struct xx_image_description_v2 *desc, + struct xx_image_description_v4 *desc, uint32_t cause, const char *msg) { g_warning ("Failed to get one of the standard image descriptions: %s", msg); - xx_image_description_v2_destroy (desc); + xx_image_description_v4_destroy (desc); } static void std_image_desc_ready (void *data, - struct xx_image_description_v2 *desc, + struct xx_image_description_v4 *desc, uint32_t identity) { - struct xx_image_description_v2 **ptr = data; + struct xx_image_description_v4 **ptr = data; *ptr = desc; } -static struct xx_image_description_v2_listener std_image_desc_listener = { +static struct xx_image_description_v4_listener std_image_desc_listener = { std_image_desc_failed, std_image_desc_ready, }; @@ -134,19 +134,19 @@ static void create_image_desc (GdkWaylandColor *color, uint32_t primaries, uint32_t tf, - struct xx_image_description_v2 **out_desc) + struct xx_image_description_v4 **out_desc) { - struct xx_image_description_creator_params_v2 *creator; - struct xx_image_description_v2 *desc; + struct xx_image_description_creator_params_v4 *creator; + struct xx_image_description_v4 *desc; - creator = xx_color_manager_v2_new_parametric_creator (color->color_manager); + creator = xx_color_manager_v4_new_parametric_creator (color->color_manager); - xx_image_description_creator_params_v2_set_primaries_named (creator, primaries); - xx_image_description_creator_params_v2_set_tf_named (creator, tf); + xx_image_description_creator_params_v4_set_primaries_named (creator, primaries); + xx_image_description_creator_params_v4_set_tf_named (creator, tf); - desc = xx_image_description_creator_params_v2_create (creator); + desc = xx_image_description_creator_params_v4_create (creator); - xx_image_description_v2_add_listener (desc, &std_image_desc_listener, out_desc); + xx_image_description_v4_add_listener (desc, &std_image_desc_listener, out_desc); } gboolean @@ -158,7 +158,7 @@ gdk_wayland_color_prepare (GdkWaylandColor *color) "perceptual", "relative", "saturation", "absolute", "relative-bpc" }; const char *features[] = { - "icc-v2-v4", "parametric", "set-primaries", "set-tf-power", + "icc-v4-v4", "parametric", "set-primaries", "set-tf-power", "set-mastering-display-primaries", "extended-target-volume" }; const char *tf[] = { @@ -196,47 +196,47 @@ gdk_wayland_color_prepare (GdkWaylandColor *color) } if (color->color_manager && - !(color->color_manager_supported.intents & (1 << XX_COLOR_MANAGER_V2_RENDER_INTENT_PERCEPTUAL))) + !(color->color_manager_supported.intents & (1 << XX_COLOR_MANAGER_V4_RENDER_INTENT_PERCEPTUAL))) { GDK_DEBUG (MISC, "Not using color management: Missing perceptual render intent"); - g_clear_pointer (&color->color_manager, xx_color_manager_v2_destroy); + g_clear_pointer (&color->color_manager, xx_color_manager_v4_destroy); } if (color->color_manager && - (!(color->color_manager_supported.features & (1 << XX_COLOR_MANAGER_V2_FEATURE_PARAMETRIC)) || - !(color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_SRGB)) || - !(color->color_manager_supported.primaries & (1 << XX_COLOR_MANAGER_V2_PRIMARIES_SRGB)))) + (!(color->color_manager_supported.features & (1 << XX_COLOR_MANAGER_V4_FEATURE_PARAMETRIC)) || + !(color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_SRGB)) || + !(color->color_manager_supported.primaries & (1 << XX_COLOR_MANAGER_V4_PRIMARIES_SRGB)))) { GDK_DEBUG (MISC, "Not using color management: Can't create srgb image description"); - g_clear_pointer (&color->color_manager, xx_color_manager_v2_destroy); + g_clear_pointer (&color->color_manager, xx_color_manager_v4_destroy); } if (color->color_manager) { create_image_desc (color, - XX_COLOR_MANAGER_V2_PRIMARIES_SRGB, - XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_SRGB, + XX_COLOR_MANAGER_V4_PRIMARIES_SRGB, + XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_SRGB, &color->srgb); - if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR)) + if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR)) create_image_desc (color, - XX_COLOR_MANAGER_V2_PRIMARIES_SRGB, - XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR, + XX_COLOR_MANAGER_V4_PRIMARIES_SRGB, + XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR, &color->srgb_linear); - if (color->color_manager_supported.primaries & (1 << XX_COLOR_MANAGER_V2_PRIMARIES_BT2020)) + if (color->color_manager_supported.primaries & (1 << XX_COLOR_MANAGER_V4_PRIMARIES_BT2020)) { - if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_ST2084_PQ)) + if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_ST2084_PQ)) create_image_desc (color, - XX_COLOR_MANAGER_V2_PRIMARIES_BT2020, - XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_ST2084_PQ, + XX_COLOR_MANAGER_V4_PRIMARIES_BT2020, + XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_ST2084_PQ, &color->rec2100_pq); - if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR)) + if (color->color_manager_supported.transfers & (1 << XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR)) create_image_desc (color, - XX_COLOR_MANAGER_V2_PRIMARIES_BT2020, - XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR, + XX_COLOR_MANAGER_V4_PRIMARIES_BT2020, + XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR, &color->rec2100_linear); } } @@ -247,7 +247,8 @@ gdk_wayland_color_prepare (GdkWaylandColor *color) struct _GdkWaylandColorSurface { GdkWaylandColor *color; - struct xx_color_management_surface_v2 *surface; + struct xx_color_management_surface_v4 *surface; + struct xx_color_management_feedback_surface_v4 *feedback; GdkColorStateChanged callback; gpointer data; }; @@ -256,16 +257,17 @@ typedef struct { GdkWaylandColorSurface *surface; - struct xx_image_description_v2 *image_desc; - struct xx_image_description_info_v2 *info; + struct xx_image_description_v4 *image_desc; + struct xx_image_description_info_v4 *info; int32_t icc; uint32_t icc_size; - uint32_t r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y; + int32_t r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y; uint32_t primaries; uint32_t tf_power; uint32_t tf_named; - uint32_t target_r_x, target_r_y, target_g_x, target_g_y, target_b_x, target_b_y, target_w_x, target_w_y; + uint32_t min_lum, max_lum, ref_lum; + int32_t target_r_x, target_r_y, target_g_x, target_g_y, target_b_x, target_b_y, target_w_x, target_w_y; uint32_t target_min_lum, target_max_lum; uint32_t target_max_cll, target_max_fall; @@ -274,6 +276,7 @@ typedef struct unsigned int has_primaries_named : 1; unsigned int has_tf_power : 1; unsigned int has_tf_named : 1; + unsigned int has_luminances : 1; unsigned int has_target_primaries : 1; unsigned int has_target_luminance : 1; unsigned int has_target_max_cll : 1; @@ -287,23 +290,23 @@ gdk_color_state_from_image_description_bits (ImageDescription *desc) if (desc->has_primaries_named && desc->has_tf_named) { - if (desc->primaries == XX_COLOR_MANAGER_V2_PRIMARIES_SRGB && - desc->tf_named == XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_SRGB) + if (desc->primaries == XX_COLOR_MANAGER_V4_PRIMARIES_SRGB && + desc->tf_named == XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_SRGB) { cs = GDK_COLOR_STATE_SRGB; } - else if (desc->primaries == XX_COLOR_MANAGER_V2_PRIMARIES_SRGB && - desc->tf_named == XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR) + else if (desc->primaries == XX_COLOR_MANAGER_V4_PRIMARIES_SRGB && + desc->tf_named == XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR) { cs = GDK_COLOR_STATE_SRGB_LINEAR; } - else if (desc->primaries == XX_COLOR_MANAGER_V2_PRIMARIES_BT2020 && - desc->tf_named == XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_ST2084_PQ) + else if (desc->primaries == XX_COLOR_MANAGER_V4_PRIMARIES_BT2020 && + desc->tf_named == XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_ST2084_PQ) { cs = GDK_COLOR_STATE_REC2100_PQ; } - else if (desc->primaries == XX_COLOR_MANAGER_V2_PRIMARIES_BT2020 && - desc->tf_named == XX_COLOR_MANAGER_V2_TRANSFER_FUNCTION_LINEAR) + else if (desc->primaries == XX_COLOR_MANAGER_V4_PRIMARIES_BT2020 && + desc->tf_named == XX_COLOR_MANAGER_V4_TRANSFER_FUNCTION_LINEAR) { cs = GDK_COLOR_STATE_REC2100_LINEAR; } @@ -314,7 +317,7 @@ gdk_color_state_from_image_description_bits (ImageDescription *desc) static void image_desc_info_done (void *data, - struct xx_image_description_info_v2 *info) + struct xx_image_description_info_v4 *info) { ImageDescription *desc = data; GdkWaylandColorSurface *self = desc->surface; @@ -327,14 +330,14 @@ image_desc_info_done (void *data, gdk_color_state_unref (cs); - xx_image_description_v2_destroy (desc->image_desc); - xx_image_description_info_v2_destroy (desc->info); + xx_image_description_v4_destroy (desc->image_desc); + xx_image_description_info_v4_destroy (desc->info); g_free (desc); } static void image_desc_info_icc_file (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, int32_t icc, uint32_t icc_size) { @@ -347,11 +350,11 @@ image_desc_info_icc_file (void *data, static void image_desc_info_primaries (void *data, - struct xx_image_description_info_v2 *info, - uint32_t r_x, uint32_t r_y, - uint32_t g_x, uint32_t g_y, - uint32_t b_x, uint32_t b_y, - uint32_t w_x, uint32_t w_y) + struct xx_image_description_info_v4 *info, + int32_t r_x, int32_t r_y, + int32_t g_x, int32_t g_y, + int32_t b_x, int32_t b_y, + int32_t w_x, int32_t w_y) { ImageDescription *desc = data; @@ -364,7 +367,7 @@ image_desc_info_primaries (void *data, static void image_desc_info_primaries_named (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t primaries) { ImageDescription *desc = data; @@ -375,7 +378,7 @@ image_desc_info_primaries_named (void *data, static void image_desc_info_tf_power (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t tf_power) { ImageDescription *desc = data; @@ -386,7 +389,7 @@ image_desc_info_tf_power (void *data, static void image_desc_info_tf_named (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t tf) { ImageDescription *desc = data; @@ -395,13 +398,28 @@ image_desc_info_tf_named (void *data, desc->has_tf_named = 1; } +static void +image_desc_info_luminances (void *data, + struct xx_image_description_info_v4 *info, + uint32_t min_lum, + uint32_t max_lum, + uint32_t ref_lum) +{ + ImageDescription *desc = data; + + desc->min_lum = min_lum; + desc->max_lum = max_lum; + desc->ref_lum = ref_lum; + desc->has_luminances = 1; +} + static void image_desc_info_target_primaries (void *data, - struct xx_image_description_info_v2 *info, - uint32_t r_x, uint32_t r_y, - uint32_t g_x, uint32_t g_y, - uint32_t b_x, uint32_t b_y, - uint32_t w_x, uint32_t w_y) + struct xx_image_description_info_v4 *info, + int32_t r_x, int32_t r_y, + int32_t g_x, int32_t g_y, + int32_t b_x, int32_t b_y, + int32_t w_x, int32_t w_y) { ImageDescription *desc = data; @@ -414,7 +432,7 @@ image_desc_info_target_primaries (void *data, static void image_desc_info_target_luminance (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t min_lum, uint32_t max_lum) { @@ -427,7 +445,7 @@ image_desc_info_target_luminance (void *data, static void image_desc_info_target_max_cll (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t max_cll) { ImageDescription *desc = data; @@ -438,7 +456,7 @@ image_desc_info_target_max_cll (void *data, static void image_desc_info_target_max_fall (void *data, - struct xx_image_description_info_v2 *info, + struct xx_image_description_info_v4 *info, uint32_t max_fall) { ImageDescription *desc = data; @@ -447,13 +465,14 @@ image_desc_info_target_max_fall (void *data, desc->has_target_max_fall = 1; } -static struct xx_image_description_info_v2_listener info_listener = { +static struct xx_image_description_info_v4_listener info_listener = { image_desc_info_done, image_desc_info_icc_file, image_desc_info_primaries, image_desc_info_primaries_named, image_desc_info_tf_power, image_desc_info_tf_named, + image_desc_info_luminances, image_desc_info_target_primaries, image_desc_info_target_luminance, image_desc_info_target_max_cll, @@ -462,7 +481,7 @@ static struct xx_image_description_info_v2_listener info_listener = { static void image_desc_failed (void *data, - struct xx_image_description_v2 *image_desc, + struct xx_image_description_v4 *image_desc, uint32_t cause, const char *msg) { @@ -471,30 +490,30 @@ image_desc_failed (void *data, self->callback (self, GDK_COLOR_STATE_SRGB, self->data); - xx_image_description_v2_destroy (desc->image_desc); + xx_image_description_v4_destroy (desc->image_desc); g_free (desc); } static void image_desc_ready (void *data, - struct xx_image_description_v2 *image_desc, + struct xx_image_description_v4 *image_desc, uint32_t identity) { ImageDescription *desc = data; - desc->info = xx_image_description_v2_get_information (image_desc); + desc->info = xx_image_description_v4_get_information (image_desc); - xx_image_description_info_v2_add_listener (desc->info, &info_listener, desc); + xx_image_description_info_v4_add_listener (desc->info, &info_listener, desc); } -static const struct xx_image_description_v2_listener image_desc_listener = { +static const struct xx_image_description_v4_listener image_desc_listener = { image_desc_failed, image_desc_ready }; static void preferred_changed (void *data, - struct xx_color_management_surface_v2 *color_mgmt_surface) + struct xx_color_management_feedback_surface_v4 *feedback) { GdkWaylandColorSurface *self = data; ImageDescription *desc; @@ -503,12 +522,12 @@ preferred_changed (void *data, desc->surface = self; - desc->image_desc = xx_color_management_surface_v2_get_preferred (self->surface); + desc->image_desc = xx_color_management_feedback_surface_v4_get_preferred (self->feedback); - xx_image_description_v2_add_listener (desc->image_desc, &image_desc_listener, desc); + xx_image_description_v4_add_listener (desc->image_desc, &image_desc_listener, desc); } -static const struct xx_color_management_surface_v2_listener color_listener = { +static const struct xx_color_management_feedback_surface_v4_listener color_listener = { preferred_changed, }; @@ -524,12 +543,13 @@ gdk_wayland_color_surface_new (GdkWaylandColor *color, self->color = color; - self->surface = xx_color_manager_v2_get_surface (color->color_manager, wl_surface); + self->surface = xx_color_manager_v4_get_surface (color->color_manager, wl_surface); + self->feedback = xx_color_manager_v4_get_feedback_surface (color->color_manager, wl_surface); self->callback = callback; self->data = data; - xx_color_management_surface_v2_add_listener (self->surface, &color_listener, self); + xx_color_management_feedback_surface_v4_add_listener (self->feedback, &color_listener, self); return self; } @@ -537,13 +557,14 @@ gdk_wayland_color_surface_new (GdkWaylandColor *color, void gdk_wayland_color_surface_free (GdkWaylandColorSurface *self) { - xx_color_management_surface_v2_destroy (self->surface); + xx_color_management_surface_v4_destroy (self->surface); + xx_color_management_feedback_surface_v4_destroy (self->feedback); g_free (self); } -static struct xx_image_description_v2 * +static struct xx_image_description_v4 * gdk_wayland_color_get_image_description (GdkWaylandColor *color, GdkColorState *cs) { @@ -563,16 +584,16 @@ void gdk_wayland_color_surface_set_color_state (GdkWaylandColorSurface *self, GdkColorState *cs) { - struct xx_image_description_v2 *desc; + struct xx_image_description_v4 *desc; desc = gdk_wayland_color_get_image_description (self->color, cs); if (desc) - xx_color_management_surface_v2_set_image_description (self->surface, + xx_color_management_surface_v4_set_image_description (self->surface, desc, - XX_COLOR_MANAGER_V2_RENDER_INTENT_PERCEPTUAL); + XX_COLOR_MANAGER_V4_RENDER_INTENT_PERCEPTUAL); else - xx_color_management_surface_v2_unset_image_description (self->surface); + xx_color_management_surface_v4_unset_image_description (self->surface); } gboolean diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build index 6281c76cc0..706da22c83 100644 --- a/gdk/wayland/meson.build +++ b/gdk/wayland/meson.build @@ -149,7 +149,7 @@ proto_sources = [ { 'name': 'xx-color-management', 'stability': 'private', - 'version': 2, + 'version': 4, }, ] diff --git a/gdk/wayland/protocol/xx-color-management-v2.xml b/gdk/wayland/protocol/xx-color-management-v4.xml similarity index 61% rename from gdk/wayland/protocol/xx-color-management-v2.xml rename to gdk/wayland/protocol/xx-color-management-v4.xml index fcd4107d10..17f217cee6 100644 --- a/gdk/wayland/protocol/xx-color-management-v2.xml +++ b/gdk/wayland/protocol/xx-color-management-v4.xml @@ -4,7 +4,8 @@ Copyright 2019 Sebastian Wick Copyright 2019 Erwin Burema Copyright 2020 AMD - Copyright 2020, 2022, 2023 Collabora, Ltd. + Copyright 2020-2024 Collabora, Ltd. + Copyright 2024 Xaver Hugl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -64,7 +65,7 @@ protocol. - + A global interface used for getting color management extensions for wl_surface and wl_output objects, and for creating client defined image @@ -75,13 +76,16 @@ - Destroy the xx_color_manager_v2 object. This does not affect any other + Destroy the xx_color_manager_v4 object. This does not affect any other objects in any way. - + + @@ -89,17 +93,21 @@ See the ICC.1:2022 specification from the International Color Consortium for more details about rendering intents. - The principles of ICC defined rendering intents apply with all types - of image descriptions, not only those with ICC file profiles. + The principles of ICC defined rendering intents apply with all types of + image descriptions, not only those with ICC file profiles. Compositors must support the perceptual rendering intent. Other rendering intents are optional. - - - - + + + + @@ -107,18 +115,23 @@ - - - - - + + + + + + - The compositor supports set_mastering_display_primaries request - with a target color volume fully contained inside the primary - color volume. + The compositor supports set_mastering_display_primaries request with a + target color volume fully contained inside the primary color volume. - + The compositor additionally supports target color volumes that extend outside of the primary color volume. @@ -131,19 +144,23 @@ - Named color primaries used to encode well-known sets of primaries. - H.273 is the authority, when it comes to the exact values of primaries and authoritative specifications, - where an equivalent code point exists. + Named color primaries used to encode well-known sets of primaries. H.273 + is the authority, when it comes to the exact values of primaries and + authoritative specifications, where an equivalent code point exists. + Descriptions do list the specifications for convenience. + Color primaries as defined by - Rec. ITU-R BT.709-6 - - Rec. ITU-R BT.1361-0 conventional colour gamut system and extended colour gamut system (historical) + - Rec. ITU-R BT.1361-0 conventional colour gamut system and extended + colour gamut system (historical) - IEC 61966-2-1 sRGB or sYCC - IEC 61966-2-4 - - Society of Motion Picture and Television Engineers (SMPTE) RP 177 (1993) Annex B + - Society of Motion Picture and Television Engineers (SMPTE) RP 177 + (1993) Annex B Equivalent to H.273 ColourPrimaries code point 1. @@ -151,8 +168,10 @@ Color primaries as defined by - Rec. ITU-R BT.470-6 System M (historical) - - United States National Television System Committee 1953 Recommendation for transmission standards for color television - - United States Federal Communications Commission (2003) Title 47 Code of Federal Regulations 73.682 (a)(20) + - United States National Television System Committee 1953 + Recommendation for transmission standards for color television + - United States Federal Communications Commission (2003) Title 47 Code + of Federal Regulations 73.682 (a)(20) Equivalent to H.273 ColourPrimaries code point 4. @@ -193,7 +212,8 @@ - Color primaries as defined as the maximum of the CIE 1931 XYZ color space by + Color primaries as defined as the maximum of the CIE 1931 XYZ color + space by - SMPTE ST 428-1 - (CIE 1931 XYZ as in ISO 11664-1) Equivalent to H.273 ColourPrimaries code point 10. @@ -201,27 +221,36 @@ - Color primaries as defined by Digital Cinema System and published in SMPTE RP 431-2 (2011). - Equivalent to H.273 ColourPrimaries code point 11. + Color primaries as defined by Digital Cinema System and published in + SMPTE RP 431-2 (2011). Equivalent to H.273 ColourPrimaries code point + 11. - Color primaries as defined by Digital Cinema System and published in SMPTE EG 432-1 (2010). + Color primaries as defined by Digital Cinema System and published in + SMPTE EG 432-1 (2010). Equivalent to H.273 ColourPrimaries code point 12. - Color primaries as defined by Adobe as "Adobe RGB" and later published by ISO 12640-4 (2011). + Color primaries as defined by Adobe as "Adobe RGB" and later published + by ISO 12640-4 (2011). - Named Transfer Functions. + Named transfer functions used to encode well-known transfer + characteristics. H.273 is the authority, when it comes to the exact + formulas and authoritative specifications, where an equivalent code + point exists. + + Descriptions do list the specifications for convenience. + Transfer characteristics as defined by @@ -234,8 +263,10 @@ Transfer characteristics as defined by - Rec. ITU-R BT.470-6 System M (historical) - - United States National Television System Committee 1953 Recommendation for transmission standards for color television - - United States Federal Communications Commission (2003) Title 47 Code of Federal Regulations 73.682 (a) (20) + - United States National Television System Committee 1953 + Recommendation for transmission standards for color television + - United States Federal Communications Commission (2003) Title 47 Code + of Federal Regulations 73.682 (a) (20) - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM Equivalent to H.273 TransferCharacteristics code point 4. @@ -290,14 +321,16 @@ Transfer characteristics as defined by - IEC 61966-2-1 sRGB - Equivalent to H.273 TransferCharacteristics code point 13 with MatrixCoefficients set to 0. + Equivalent to H.273 TransferCharacteristics code point 13 with + MatrixCoefficients set to 0. Transfer characteristics as defined by - IEC 61966-2-1 sYCC - Equivalent to H.273 TransferCharacteristics code point 13 with MatrixCoefficients set to anything but 0. + Equivalent to H.273 TransferCharacteristics code point 13 with + MatrixCoefficients set to anything but 0. @@ -306,6 +339,11 @@ - SMPTE ST 2084 (2014) for 10-, 12-, 14- and 16-bit systems - Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system Equivalent to H.273 TransferCharacteristics code point 16. + + This TF implies these default luminances + - primary color volume minimum: 0.005 cd/m² + - primary color volume maximum: 10000 cd/m² + - reference white: 203 cd/m² @@ -321,31 +359,55 @@ - ARIB STD-B67 (2015) - Rec. ITU-R BT.2100-2 hybrid log-gamma (HLG) system Equivalent to H.273 TransferCharacteristics code point 18. + + This TF implies these default luminances + - primary color volume minimum: 0.005 cd/m² + - primary color volume maximum: 1000 cd/m² + - reference white: 203 cd/m² + Note: HLG is a scene referred signal. All absolute luminance values + used here for HLG assume a 1000 cd/m² display. - This creates a new xx_color_management_output_v2 object for the + This creates a new xx_color_management_output_v4 object for the given wl_output. - See the xx_color_management_output_v2 interface for more details. + See the xx_color_management_output_v4 interface for more details. - + - This creates a new color xx_color_management_surface_v2 object for the + If a xx_color_management_surface_v4 object already exists for the given + wl_surface, the protocol error surface_exists is raised. + + This creates a new color xx_color_management_surface_v4 object for the given wl_surface. - See the xx_color_management_surface_v2 interface for more details. + See the xx_color_management_surface_v4 interface for more details. - + + + + + + + This creates a new color xx_color_management_feedback_surface_v4 object + for the given wl_surface. + + See the xx_color_management_feedback_surface_v4 interface for more + details. + + + @@ -354,15 +416,15 @@ Makes a new ICC-based image description creator object with all properties initially unset. The client can then use the object's interface to define all the required properties for an image description - and finally create a xx_image_description_v2 object. + and finally create a xx_image_description_v4 object. This request can be used when the compositor advertises - xx_color_manager_v2.feature.icc_v2_v4. + xx_color_manager_v4.feature.icc_v2_v4. Otherwise this request raises the protocol error unsupported_feature. - @@ -371,22 +433,22 @@ Makes a new parametric image description creator object with all properties initially unset. The client can then use the object's interface to define all the required properties for an image description - and finally create a xx_image_description_v2 object. + and finally create a xx_image_description_v4 object. This request can be used when the compositor advertises - xx_color_manager_v2.feature.parametric. + xx_color_manager_v4.feature.parametric. Otherwise this request raises the protocol error unsupported_feature. - - When this object is created, it shall immediately send this event - once for each rendering intent the compositor supports. + When this object is created, it shall immediately send this event once + for each rendering intent the compositor supports. - When this object is created, it shall immediately send this event - once for each compositor supported feature listed in the enumeration. + When this object is created, it shall immediately send this event once + for each compositor supported feature listed in the enumeration. - + - When this object is created, it shall immediately send this event - once for each named transfer function the compositor - supports with the parametric image description creator. + When this object is created, it shall immediately send this event once + for each named transfer function the compositor supports with the + parametric image description creator. - + - When this object is created, it shall immediately send this event - once for each named set of primaries the compositor - supports with the parametric image description creator. + When this object is created, it shall immediately send this event once + for each named set of primaries the compositor supports with the + parametric image description creator. - + - + - A xx_color_management_output_v2 describes the color properties of an + A xx_color_management_output_v4 describes the color properties of an output. - The xx_color_management_output_v2 is associated with the wl_output global + The xx_color_management_output_v4 is associated with the wl_output global underlying the wl_output object. Therefore the client destroying the wl_output object has no impact, but the compositor removing the output - global makes the xx_color_management_output_v2 object inert. + global makes the xx_color_management_output_v4 object inert. - Destroy the color xx_color_management_output_v2 object. This does not + Destroy the color xx_color_management_output_v4 object. This does not affect any remaining protocol objects. - This event is sent whenever the image description of the - output changed, followed by one wl_output.done event common to - output events across all extensions. + This event is sent whenever the image description of the output changed, + followed by one wl_output.done event common to output events across all + extensions. - If the client wants to use the updated image description, it needs - to do get_image_description again, because image description objects - are immutable. + If the client wants to use the updated image description, it needs to do + get_image_description again, because image description objects are + immutable. - This creates a new xx_image_description_v2 object for the current image description - of the output. There always is exactly one image description active for an - output so the client should destroy the image description created by earlier - invocations of this request. This request is usually sent as a reaction - to the image_description_changed event or when creating a - xx_color_management_output_v2 object. + This creates a new xx_image_description_v4 object for the current image + description of the output. There always is exactly one image description + active for an output so the client should destroy the image description + created by earlier invocations of this request. This request is usually + sent as a reaction to the image_description_changed event or when + creating a xx_color_management_output_v4 object. - The created xx_image_description_v2 object preserves the image description - of the output from the time the object was created. + The image description of an output represents the color encoding the + output expects. There might be performance and power advantages, as well + as improved color reproduction, if a content update matches the image + description of the output it is being shown on. If a content update is + shown on any other output than the one it matches the image description + of, then the color reproduction on those outputs might be considerably + worse. + + The created xx_image_description_v4 object preserves the image + description of the output from the time the object was created. The resulting image description object allows get_information request. - If this protocol object is inert, the resulting image - description object shall immediately deliver the - xx_image_description_v2.failed event with the no_output cause. + If this protocol object is inert, the resulting image description object + shall immediately deliver the xx_image_description_v4.failed event with + the no_output cause. If the interface version is inadequate for the output's image - description, meaning that the client does not support all the - events needed to deliver the crucial information, the resulting image + description, meaning that the client does not support all the events + needed to deliver the crucial information, the resulting image description object shall immediately deliver the - xx_image_description_v2.failed event with the low_version cause. + xx_image_description_v4.failed event with the low_version cause. Otherwise the object shall immediately deliver the ready event. - + - + - A xx_color_management_surface_v2 allows the client to set the color + A xx_color_management_surface_v4 allows the client to set the color space and HDR properties of a surface. - If the wl_surface associated with the xx_color_management_surface_v2 is - destroyed, the xx_color_management_surface_v2 object becomes inert. + If the wl_surface associated with the xx_color_management_surface_v4 is + destroyed, the xx_color_management_surface_v4 object becomes inert. - Destroy the xx_color_management_surface_v2 object. - - When the last xx_color_management_surface_v2 object for a wl_surface - is destroyed, it does the same as unset_image_description. + Destroy the xx_color_management_surface_v4 object and do the same as + unset_image_description. - - - + + @@ -517,12 +590,21 @@ It is the client's responsibility to understand the image description it sets on a surface, and to provide content that matches that image - description. + description. Compositors might convert images to match their own or any + other image descriptions. + + Image description whose creation gracefully failed (received + xx_image_description_v4.failed) are forbidden in this request, and in + such case the protocol error image_description is raised. + + All image descriptions whose creation succeeded (received + xx_image_description_v4.ready) are allowed and must always be accepted + by the compositor. A rendering intent provides the client's preference on how content colors should be mapped to each output. The render_intent value must be one advertised by the compositor with - xx_color_manager_v2.render_intent event, otherwise the protocol error + xx_color_manager_v4.render_intent event, otherwise the protocol error render_intent is raised. By default, a surface does not have an associated image description @@ -532,8 +614,10 @@ requirements. - - + @@ -541,20 +625,40 @@ This request removes any image description from the surface. See set_image_description for how a compositor handles a surface without - an image description. This is double-buffered state, see + an image description. This is double-buffered state, see wl_surface.commit. + + + + + A xx_color_management_feedback_surface_v4 allows the client to get the + preferred color description of a surface. + + If the wl_surface associated with this object is destroyed, the + xx_color_management_feedback_surface_v4 object becomes inert. + + + + + Destroy the xx_color_management_feedback_surface_v4 object. + + + + + + + - + The preferred image description is the one which likely has the most performance and/or quality benefits for the compositor if used by the client for its wl_surface contents. This event is sent whenever the compositor changes the wl_surface's preferred image description. - This is not an initial event. - This event is merely a notification. When the client wants to know what the preferred image description is, it shall use the get_preferred request. @@ -572,15 +676,21 @@ If this protocol object is inert, the protocol error inert is raised. - This creates a new xx_image_description_v2 object for the currently + The preferred image description represents the compositor's preferred + color encoding for this wl_surface at the current time. There might be + performance and power advantages, as well as improved color + reproduction, if the image description of a content update matches the + preferred image description. + + This creates a new xx_image_description_v4 object for the currently preferred image description for the wl_surface. The client should stop using and destroy the image descriptions created by earlier invocations of this request for the associated wl_surface. This request is usually sent as a reaction to the preferred_changed - event or when creating a xx_color_management_surface_v2 object if - the client is capable of adapting to image descriptions. + event or when creating a xx_color_management_feedback_surface_v4 object + if the client is capable of adapting to image descriptions. - The created xx_image_description_v2 object preserves the preferred image + The created xx_image_description_v4 object preserves the preferred image description of the wl_surface from the time the object was created. The resulting image description object allows get_information request. @@ -589,18 +699,19 @@ description, meaning that the client does not support all the events needed to deliver the crucial information, the resulting image description object shall immediately deliver the - xx_image_description_v2.failed event with the low_version cause, + xx_image_description_v4.failed event with the low_version cause, otherwise the object shall immediately deliver the ready event. - + - + This type of object is used for collecting all the information required - to create a xx_image_description_v2 object from an ICC file. A complete + to create a xx_image_description_v4 object from an ICC file. A complete set of required parameters consists of these properties: - ICC file @@ -618,11 +729,16 @@ - - - - - + + + + + @@ -637,18 +753,19 @@ If the particular combination of the information is not supported by the compositor, the resulting image description object shall - immediately deliver the xx_image_description_v2.failed event with the + immediately deliver the xx_image_description_v4.failed event with the 'unsupported' cause. If a valid image description was created from the - information, the xx_image_description_v2.ready event will eventually + information, the xx_image_description_v4.ready event will eventually be sent instead. - This request destroys the xx_image_description_creator_icc_v2 object. + This request destroys the xx_image_description_creator_icc_v4 object. The resulting image description object does not allow get_information request. - + @@ -656,37 +773,36 @@ Sets the ICC profile file to be used as the basis of the image description. - The data shall be found through the given fd at the given offset, - having the given length. The fd must seekable and readable. Violating - these requirements raises the bad_fd protocol error. + The data shall be found through the given fd at the given offset, having + the given length. The fd must seekable and readable. Violating these + requirements raises the bad_fd protocol error. If reading the data fails due to an error independent of the client, the - compositor shall send the xx_image_description_v2.failed event on the - created xx_image_description_v2 with the 'operating_system' cause. + compositor shall send the xx_image_description_v4.failed event on the + created xx_image_description_v4 with the 'operating_system' cause. - The maximum size of the ICC profile is 4 MB. If length is greater - than that or zero, the protocol error bad_size is raised. - If offset + length exceeds the file size, the protocol error - out_of_file is raised. + The maximum size of the ICC profile is 4 MB. If length is greater than + that or zero, the protocol error bad_size is raised. If offset + length + exceeds the file size, the protocol error out_of_file is raised. A compositor may read the file at any time starting from this request and only until whichever happens first: - - If create request was issued, the xx_image_description_v2 object + - If create request was issued, the xx_image_description_v4 object delivers either failed or ready event; or - if create request was not issued, this - xx_image_description_creator_icc_v2 object is destroyed. + xx_image_description_creator_icc_v4 object is destroyed. A compositor shall not modify the contents of the file, and the fd may be sealed for writes and size changes. The client must ensure to its best ability that the data does not change while the compositor is reading it. - The data must represent a valid ICC profile. - The ICC profile version must be 2 or 4, it must be a 3 channel profile - and the class must be 'display'. - Violating these requirements will not result in a protocol error but - will eventually send the xx_image_description_v2.failed event on the - created xx_image_description_v2 with the 'unsupported' cause. + The data must represent a valid ICC profile. The ICC profile version + must be 2 or 4, it must be a 3 channel profile and the class must be + Display or ColorSpace. Violating these requirements will not result in a + protocol error but will eventually send the + xx_image_description_v4.failed event on the created + xx_image_description_v4 with the 'unsupported' cause. See the International Color Consortium specification ICC.1:2022 for more details about ICC profiles. @@ -695,22 +811,27 @@ already_set is raised. - - - + + + - + This type of object is used for collecting all the parameters required - to create a xx_image_description_v2 object. A complete set of required + to create a xx_image_description_v4 object. A complete set of required parameters consists of these properties: - transfer characteristic function (tf) - chromaticities of primaries and white point (primary color volume) The following properties are optional and have a well-defined default if not explicitly set: + - primary color volume luminance range + - reference white luminance level - mastering display primaries and white point (target color volume) - mastering luminance range - maximum content light level @@ -730,13 +851,22 @@ - - - - - - - + + + + + + + + @@ -748,56 +878,68 @@ complete, the protocol error incomplete_set is raised. For the definition of a complete set, see the description of this interface. + Also, the combination of the parameter set is verified. If the set is + not consistent, the protocol error inconsistent_set is raised. + If the particular combination of the parameter set is not supported by the compositor, the resulting image description object shall - immediately deliver the xx_image_description_v2.failed event with the + immediately deliver the xx_image_description_v4.failed event with the 'unsupported' cause. If a valid image description was created from the - parameter set, the xx_image_description_v2.ready event will eventually + parameter set, the xx_image_description_v4.ready event will eventually be sent instead. - This request destroys the xx_image_description_creator_params_v2 + This request destroys the xx_image_description_creator_params_v4 object. The resulting image description object does not allow get_information request. - + - Sets the transfer characteristic using explicitly enumerated named functions. + Sets the transfer characteristic using explicitly enumerated named + functions. - Only names advertised with xx_color_manager_v2 - event supported_tf_named are allowed. Other values shall raise the - protocol error invalid_tf. + When the resulting image description is attached to an image, the + content should be encoded and decoded according to the industry standard + practices for the transfer characteristic. + + Only names advertised with xx_color_manager_v4 event supported_tf_named + are allowed. Other values shall raise the protocol error invalid_tf. If transfer characteristic has already been set on this object, the protocol error already_set is raised. - + - Sets the color component transfer characteristic to a power curve - with the given exponent. This curve represents the conversion from - electrical to optical pixel or color values. + Sets the color component transfer characteristic to a power curve with + the given exponent. This curve represents the conversion from electrical + to optical pixel or color values. - The curve exponent shall be multiplied by 10000 to get the argument - eexp value to carry the precision of 4 decimals. + When the resulting image description is attached to an image, the + content should be encoded with the inverse of the power curve. - The curve exponent must be at least 1.0 and at most 10.0. Otherwise - the protocol error invalid_tf is raised. + The curve exponent shall be multiplied by 10000 to get the argument eexp + value to carry the precision of 4 decimals. + + The curve exponent must be at least 1.0 and at most 10.0. Otherwise the + protocol error invalid_tf is raised. If transfer characteristic has already been set on this object, the protocol error already_set is raised. This request can be used when the compositor advertises - xx_color_manager_v2.feature.set_tf_power. Otherwise this request raises - the protocol error invalid_tf. + xx_color_manager_v4.feature.set_tf_power. Otherwise this request raises + the protocol error unsupported_feature. @@ -806,45 +948,99 @@ Sets the color primaries and white point using explicitly named sets. - This describes the primary color volume which is the basis - for color value encoding. + This describes the primary color volume which is the basis for color + value encoding. - Only names advertised with xx_color_manager_v2 - event supported_primaries_named are allowed. Other values shall raise the + Only names advertised with xx_color_manager_v4 event + supported_primaries_named are allowed. Other values shall raise the protocol error invalid_primaries. If primaries have already been set on this object, the protocol error already_set is raised. - + - Sets the color primaries and white point using CIE 1931 xy - chromaticity coordinates. This describes the primary color volume - which is the basis for color value encoding. + Sets the color primaries and white point using CIE 1931 xy chromaticity + coordinates. This describes the primary color volume which is the basis + for color value encoding. - Each coordinate value is multiplied by 10000 to get the argument - value to carry precision of 4 decimals. + Each coordinate value is multiplied by 10000 to get the argument value + to carry precision of 4 decimals. If primaries have already been set on this object, the protocol error already_set is raised. This request can be used if the compositor advertises - xx_color_manager_v2.feature.set_primaries. Otherwise this request - raises the protocol error invalid_primaries. + xx_color_manager_v4.feature.set_primaries. Otherwise this request raises + the protocol error unsupported_feature. - - - - - - - - + + + + + + + + + + + + + Sets the primary color volume luminance range and the reference white + luminance level. + + The default luminances are + - primary color volume minimum: 0.2 cd/m² + - primary color volume maximum: 80 cd/m² + - reference white: 80 cd/m² + + Setting a named transfer characteristic can imply other default + luminances. + + The default luminances get overwritten when this request is used. + + 'min_lum' and 'max_lum' specify the minimum and maximum luminances of + the primary color volume as reproduced by the targeted display. + + 'reference_lum' specifies the luminance of the reference white as + reproduced by the targeted display, and reflects the targeted viewing + environment. + + Compositors should make sure that all content is anchored, meaning that + an input signal level of 'reference_lum' on one image description and + another input signal level of 'reference_lum' on another image + description should produce the same output level, even though the + 'reference_lum' on both image representations can be different. + + If 'max_lum' is less than the 'reference_lum', or 'reference_lum' is + less than or equal to 'min_lum', the protocol error invalid_luminance is + raised. + + The minimum luminance is multiplied by 10000 to get the argument + 'min_lum' value and carries precision of 4 decimals. The maximum + luminance and reference white luminance values are unscaled. + + If the primary color volume luminance range and the reference white + luminance level have already been set on this object, the protocol error + already_set is raised. + + This request can be used if the compositor advertises + xx_color_manager_v4.feature.set_luminances. Otherwise this request + raises the protocol error unsupported_feature. + + + + + @@ -855,8 +1051,8 @@ The mastering display primaries define the target color volume. - If mastering display primaries are not explicitly set, the target - color volume is assumed to be equal to the primary color volume. + If mastering display primaries are not explicitly set, the target color + volume is assumed to be equal to the primary color volume. The target color volume is defined by all tristimulus values between 0.0 and 1.0 (inclusive) of the color space defined by the given mastering @@ -875,36 +1071,35 @@ has to be chosen (e.g. floating point to exceed the primary color volume, or abusing limited quantization range as with xvYCC). - Each coordinate value is multiplied by 10000 to get the argument - value to carry precision of 4 decimals. + Each coordinate value is multiplied by 10000 to get the argument value + to carry precision of 4 decimals. - If mastering display primaries have already been set on this object, - the protocol error already_set is raised. + If mastering display primaries have already been set on this object, the + protocol error already_set is raised. This request can be used if the compositor advertises - xx_color_manager_v2.feature.set_mastering_display_primaries. - Otherwise this request raises the protocol error invalid_mastering. - The advertisement implies support only for target color - volumes fully contained within the primary color volume. + xx_color_manager_v4.feature.set_mastering_display_primaries. Otherwise + this request raises the protocol error unsupported_feature. The + advertisement implies support only for target color volumes fully + contained within the primary color volume. - If a compositor additionally supports target color volume exceeding - the primary color volume, it must advertise - xx_color_manager_v2.feature.extended_target_volume. - If a client uses target color volume exceeding the primary color volume - and the compositor does not support it, the result is implementation - defined. Compositors are recommended to detect this case and fail the - image description gracefully, but it may as well result in color - artifacts. + If a compositor additionally supports target color volume exceeding the + primary color volume, it must advertise + xx_color_manager_v4.feature.extended_target_volume. If a client uses + target color volume exceeding the primary color volume and the + compositor does not support it, the result is implementation defined. + Compositors are recommended to detect this case and fail the image + description gracefully, but it may as well result in color artifacts. - - - - - - - - + + + + + + + + @@ -913,11 +1108,6 @@ process as the minimum and maximum absolute luminance L. This is compatible with the SMPTE ST 2086 definition of HDR static metadata. - This can only be set when set_tf_cicp is used to set the transfer - characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system. - Otherwise, 'create' request shall raise inconsistent_set protocol - error. - The mastering luminance range is undefined by default. If max L is less than or equal to min L, the protocol error @@ -953,8 +1143,7 @@ This can only be set when set_tf_cicp is used to set the transfer characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system. - Otherwise, 'create' request shall raise inconsistent_set protocol - error. + Otherwise, 'create' request shall raise inconsistent_set protocol error. max_fall is undefined by default. @@ -963,15 +1152,15 @@ - + - An image description carries information about the color encoding used - on a surface when attached to a wl_surface via - xx_color_management_surface_v2.set_image_description. A compositor can - use this information to decode pixel values into colorimetrically - meaningful quantities. + An image description carries information about the color encoding used on + a surface when attached to a wl_surface via + xx_color_management_surface_v4.set_image_description. A compositor can use + this information to decode pixel values into colorimetrically meaningful + quantities. - Note, that the xx_image_description_v2 object is not ready to be used + Note, that the xx_image_description_v4 object is not ready to be used immediately after creation. The object eventually delivers either the 'ready' or the 'failed' event, specified in all requests creating it. The object is deemed "ready" after receiving the 'ready' event. @@ -981,61 +1170,70 @@ protocol error. Attempts to use an object which is not ready through other interfaces shall raise protocol errors defined there. - Once created and regardless of how it was created, a xx_image_description_v2 - object always refers to one fixed image description. It cannot change - after creation. + Once created and regardless of how it was created, a + xx_image_description_v4 object always refers to one fixed image + description. It cannot change after creation. Destroy this object. It is safe to destroy an object which is not ready. - Destroying a xx_image_description_v2 object has no side-effects, not - even if a xx_color_management_surface_v2.set_image_description has - not yet been followed by a wl_surface.commit. + Destroying a xx_image_description_v4 object has no side-effects, not + even if a xx_color_management_surface_v4.set_image_description has not + yet been followed by a wl_surface.commit. - - + + - - - - + + + + - If creating a xx_image_description_v2 object fails for a reason that - is not defined as a protocol error, this event is sent. - The requests that create image description objects define whether - and when this can occur. Only such creation requests can trigger this - event. This event cannot be triggered after the image description was + If creating a xx_image_description_v4 object fails for a reason that is + not defined as a protocol error, this event is sent. + + The requests that create image description objects define whether and + when this can occur. Only such creation requests can trigger this event. + This event cannot be triggered after the image description was successfully formed. - Once this event has been sent, the xx_image_description_v2 object will + Once this event has been sent, the xx_image_description_v4 object will never become ready and it can only be destroyed. - - + + - Once this event has been sent, the xx_image_description_v2 object is + Once this event has been sent, the xx_image_description_v4 object is deemed "ready". Ready objects can be used to send requests and can be used through other interfaces. - Every ready xx_image_description_v2 protocol object refers to an + Every ready xx_image_description_v4 protocol object refers to an underlying image description record in the compositor. Multiple protocol objects may end up referring to the same record. Clients may identify these "copies" by comparing their id numbers: if the numbers from two @@ -1044,15 +1242,15 @@ cannot have the same id number simultaneously. The id number does not change during the lifetime of the image description record. - The id number is valid only as long as the protocol object is alive. - If all protocol objects referring to the same image description record - are destroyed, the id number may be recycled for a different image + The id number is valid only as long as the protocol object is alive. If + all protocol objects referring to the same image description record are + destroyed, the id number may be recycled for a different image description record. Image description id number is not a protocol object id. Zero is - reserved as an invalid id number. It shall not be possible for a - client to refer to an image description by its id number in protocol. - The id numbers might not be portable between Wayland connections. + reserved as an invalid id number. It shall not be possible for a client + to refer to an image description by its id number in protocol. The id + numbers might not be portable between Wayland connections. This identity allows clients to de-duplicate image description records and avoid get_information request if they already have the image @@ -1064,7 +1262,7 @@ - Creates a xx_image_description_info_v2 object which delivers the + Creates a xx_image_description_info_v4 object which delivers the information that makes up the image description. Not all image description protocol objects allow get_information @@ -1073,20 +1271,21 @@ error no_information is raised. - + - + Sends all matching events describing an image description object exactly once and finally sends the 'done' event. - Once a xx_image_description_info_v2 object has delivered a 'done' event - it is automatically destroyed. + Once a xx_image_description_info_v4 object has delivered a 'done' event it + is automatically destroyed. - Every xx_image_description_info_v2 created from the same - xx_image_description_v2 shall always return the exact same data. + Every xx_image_description_info_v4 created from the same + xx_image_description_v4 shall always return the exact same data. @@ -1114,41 +1313,42 @@ - Delivers the primary color volume primaries and white point - using CIE 1931 xy chromaticity coordinates. + Delivers the primary color volume primaries and white point using CIE + 1931 xy chromaticity coordinates. - Each coordinate value is multiplied by 10000 to get the argument - value to carry precision of 4 decimals. + Each coordinate value is multiplied by 10000 to get the argument value + to carry precision of 4 decimals. - - - - - - - - + + + + + + + + - Delivers the primary color volume primaries and white point using a + Delivers the primary color volume primaries and white point using an explicitly enumerated named set. - + - The color component transfer characteristic of this image description - is a pure power curve. This event provides the exponent of the power + The color component transfer characteristic of this image description is + a pure power curve. This event provides the exponent of the power function. This curve represents the conversion from electrical to optical pixel or color values. - The curve exponent has been multiplied by 10000 to get the argument - eexp value to carry the precision of 4 decimals. + The curve exponent has been multiplied by 10000 to get the argument eexp + value to carry the precision of 4 decimals. @@ -1160,46 +1360,64 @@ named function. - + + + + + + Delivers the primary color volume luminance range and the reference + white luminance level. + + The minimum luminance is multiplied by 10000 to get the argument + 'min_lum' value and carries precision of 4 decimals. The maximum + luminance and reference white luminance values are unscaled. + + + + + - Provides the color primaries and white point of the target - color volume using CIE 1931 xy chromaticity coordinates. This is - compatible with the SMPTE ST 2086 definition of HDR static metadata - for mastering displays. + Provides the color primaries and white point of the target color volume + using CIE 1931 xy chromaticity coordinates. This is compatible with the + SMPTE ST 2086 definition of HDR static metadata for mastering displays. - While primary color volume is about how color is encoded, the - target color volume is the actually displayable color volume. - If target color volume is equal to the primary color volume, - then this event is not sent. + While primary color volume is about how color is encoded, the target + color volume is the actually displayable color volume. If target color + volume is equal to the primary color volume, then this event is not + sent. - Each coordinate value is multiplied by 10000 to get the argument - value to carry precision of 4 decimals. + Each coordinate value is multiplied by 10000 to get the argument value + to carry precision of 4 decimals. - - - - - - - - + + + + + + + + - Provides the luminance range that the image description is targeting - as the minimum and maximum absolute luminance L. This is compatible - with the SMPTE ST 2086 definition of HDR static metadata. + Provides the luminance range that the image description is targeting as + the minimum and maximum absolute luminance L. This is compatible with + the SMPTE ST 2086 definition of HDR static metadata. This luminance range is only theoretical and may not correspond to the luminance of light emitted on an actual display. - Min L value is multiplied by 10000 to get the argument min_lum value - and carry precision of 4 decimals. Max L value is unscaled for max_lum. + Min L value is multiplied by 10000 to get the argument min_lum value and + carry precision of 4 decimals. Max L value is unscaled for max_lum. @@ -1215,7 +1433,8 @@ luminance of light emitted on an actual display. - + @@ -1227,7 +1446,8 @@ luminance of light emitted on an actual display. - +