color_representation_v1
-
# wp_color_representation_manager_v1
A singleton global interface used for getting color representation extensions for wl_surface. The extension interfaces allow setting the color representation of surfaces. Compositors should never remove this global.Requests
-
void wp_color_representation_manager_v1_destroy(struct wp_color_representation_manager_v1* wp_color_representation_manager_v1)Destroy the wp_color_representation_manager_v1 object. This does not affect any other objects in any way.
-
struct wp_color_representation_surface_v1* wp_color_representation_manager_v1_get_surface(struct wp_color_representation_manager_v1* wp_color_representation_manager_v1,struct wl_surface* surface)If a wp_color_representation_surface_v1 object already exists for the given wl_surface, the protocol error surface_exists is raised. This creates a new color wp_color_representation_surface_v1 object for the given wl_surface. See the wp_color_representation_surface_v1 interface for more details.
Events
-
uint32_t alpha_mode /* supported alpha mode */When this object is created, it shall immediately send this event once for each alpha mode the compositor supports. For the definition of the supported values, see the wp_color_representation_surface_v1::alpha_mode enum.
-
uint32_t coefficients /* supported matrix coefficients */uint32_t range /* full range flag */When this object is created, it shall immediately send this event once for each matrix coefficient and color range combination the compositor supports. For the definition of the supported values, see the wp_color_representation_surface_v1::coefficients and wp_color_representation_surface_v1::range enums.
-
This event is sent when all supported features have been sent.
Enums
-
WP_COLOR_REPRESENTATION_MANAGER_V1_ERROR_SURFACE_EXISTS /* color representation surface exists already */
-
-
# wp_color_representation_surface_v1
A wp_color_representation_surface_v1 allows the client to set the color representation metadata of a surface. By default, a surface does not have any color representation metadata set. The reconstruction of R, G, B signals on such surfaces is compositor implementation defined. The alpha mode is assumed to be premultiplied_electrical when the alpha mode is unset. If the wl_surface associated with the wp_color_representation_surface_v1 is destroyed, the wp_color_representation_surface_v1 object becomes inert.Requests
-
void wp_color_representation_surface_v1_destroy(struct wp_color_representation_surface_v1* wp_color_representation_surface_v1)Destroy the wp_color_representation_surface_v1 object. Destroying this object unsets all the color representation metadata from the surface. See the wp_color_representation_surface_v1 interface description for how a compositor handles a surface without color representation metadata. Unsetting is double-buffered state, see wl_surface.commit.
-
void wp_color_representation_surface_v1_set_alpha_mode(struct wp_color_representation_surface_v1* wp_color_representation_surface_v1,uint32_t alpha_mode /* alpha mode */)If this protocol object is inert, the protocol error inert is raised. Assuming an alpha channel exists, it is always linear. The alpha mode determines whether and how the color channels include pre-multiplied alpha. Using straight alpha might have performance benefits. Only alpha modes advertised by the compositor are allowed to be used as argument for this request. The "alpha_mode" protocol error is raised otherwise. Alpha mode is double buffered, see wl_surface.commit.
-
void wp_color_representation_surface_v1_set_coefficients_and_range(struct wp_color_representation_surface_v1* wp_color_representation_surface_v1,uint32_t coefficients, /* matrix coefficients */uint32_t range /* range */)If this protocol object is inert, the protocol error inert is raised. Set the matrix coefficients and video range which defines the formula and the related constants used to derive red, green and blue signals. Usually coefficients correspond to MatrixCoefficients code points in H.273. Only combinations advertised by the compositor are allowed to be used as argument for this request. The "coefficients" protocol error is raised otherwise. A call to wl_surface.commit verifies that the pixel format and the coefficients-range combination in the committed surface contents are compatible, if contents exist. The "pixel_format" protocol error is raised otherwise. A pixel format is compatible with the coefficients-range combination if the related equations and conventions as defined in H.273 can produce the color channels (RGB or YCbCr) of the pixel format. For the definition of the supported combination, see the wp_color_representation_surface_v1::coefficients and wp_color_representation_surface_v1::range enums. The coefficients-range combination is double-buffered, see wl_surface.commit.
-
void wp_color_representation_surface_v1_set_chroma_location(struct wp_color_representation_surface_v1* wp_color_representation_surface_v1,uint32_t chroma_location /* chroma sample location */)If this protocol object is inert, the protocol error inert is raised. Set the chroma location type which defines the position of downsampled chroma samples, corresponding to Chroma420SampleLocType code points in H.273. An invalid chroma location enum value raises the "chroma_location" protocol error. A call to wl_surface.commit verifies that the pixel format and chroma location type in the committed surface contents are compatible, if contents exist. The "pixel_format" protocol error is raised otherwise. For the definition of the supported chroma location types, see the wp_color_representation_surface_v1::chroma_location enum. The chroma location type is double-buffered, see wl_surface.commit.
Enums
-
WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_ALPHA_MODE /* unsupported alpha mode */WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_COEFFICIENTS /* unsupported coefficients */WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_PIXEL_FORMAT /* the pixel format and a set value are incompatible */WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_INERT /* forbidden request on inert object */WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_CHROMA_LOCATION /* invalid chroma location */
-
WP_COLOR_REPRESENTATION_SURFACE_V1_ALPHA_MODE_PREMULTIPLIED_ELECTRICALWP_COLOR_REPRESENTATION_SURFACE_V1_ALPHA_MODE_PREMULTIPLIED_OPTICALWP_COLOR_REPRESENTATION_SURFACE_V1_ALPHA_MODE_STRAIGHTSpecifies how the alpha channel affects the color channels.
-
WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_IDENTITYWP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_BT709WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_FCCWP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_BT601WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_SMPTE240WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_BT2020WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_BT2020_CLWP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_ICTCPNamed matrix coefficients used to encode well-known sets of coefficients. H.273 is the authority, when it comes to the exact values of coefficients and authoritative specifications, where an equivalent code point exists. A value of 0 is invalid and will never be present in the list of enums. Descriptions do list the specifications for convenience.
-
WP_COLOR_REPRESENTATION_SURFACE_V1_RANGE_FULL /* Full color range */WP_COLOR_REPRESENTATION_SURFACE_V1_RANGE_LIMITED /* Limited color range */Possible color range values. A value of 0 is invalid and will never be present in the list of enums.
-
WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_0WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_1WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_2WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_3WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_4WP_COLOR_REPRESENTATION_SURFACE_V1_CHROMA_LOCATION_TYPE_5Chroma sample location as defined by H.273 Chroma420SampleLocType. A value of 0 is invalid and will never be present in the list of enums. The descriptions list the matching Vulkan VkChromaLocation combinations for convenience.
-
Copyright Info
Copyright 2022 Simon Ser
Copyright 2022 Red Hat, Inc.
Copyright 2022 Collabora, Ltd.
Copyright 2022-2025 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.