Skip to content

wp_image_description_v1¤

wayland.wp_image_description_v1 ¤

Colorimetric image description

An image description carries information about the color encoding used on a surface when attached to a wl_surface via wp_color_management_surface_v1.set_image_description. A compositor can use this information to decode pixel values into colorimetrically meaningful quantities.

Note, that the wp_image_description_v1 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.

An object which is not ready is illegal to use, it can only be destroyed. Any other request in this interface shall result in the 'not_ready' 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 wp_image_description_v1 object always refers to one fixed image description. It cannot change after creation.

Methods:

  • destroy

    Destroy the image description

  • get_information

    Get information about the image description

  • on_failed

    Graceful error on creating the image description.

  • on_ready

    Indication that the object is ready to be used.

error ¤

Protocol errors

cause ¤

Generic reason for failure

events

failed ¤

failed(cause: cause, msg: str) -> None

Graceful error on creating the image description

If creating a wp_image_description_v1 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 wp_image_description_v1 object will never become ready and it can only be destroyed.

Parameters:

  • cause ¤

    (cause) –

    Generic reason

  • msg ¤

    (str) –

    Ad hoc human-readable explanation

ready ¤

ready(identity: int) -> None

Indication that the object is ready to be used

Once this event has been sent, the wp_image_description_v1 object is deemed "ready". Ready objects can be used to send requests and can be used through other interfaces.

Every ready wp_image_description_v1 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 protocol objects are identical, the protocol objects refer to the same image description record. Two different image description records 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 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. A compositor shall not send an invalid id number.

This identity allows clients to de-duplicate image description records and avoid get_information request if they already have the image description information.

Parameters:

  • identity ¤

    (int) –

    Image description id number

destroy ¤

destroy() -> None

Destroy the image description

Destroy this object. It is safe to destroy an object which is not ready.

Destroying a wp_image_description_v1 object has no side-effects, not even if a wp_color_management_surface_v1.set_image_description has not yet been followed by a wl_surface.commit.

get_information ¤

get_information() -> wp_image_description_info_v1

Get information about the image description

Creates a wp_image_description_info_v1 object which delivers the information that makes up the image description.

Not all image description protocol objects allow get_information request. Whether it is allowed or not is defined by the request that created the object. If get_information is not allowed, the protocol error no_information is raised.

Returns:

on_failed ¤

on_failed(cause: cause, msg: str) -> None

Graceful error on creating the image description.

Override to handle wayland.wp_image_description_v1.events.failed.

on_ready ¤

on_ready(identity: int) -> None

Indication that the object is ready to be used.

Override to handle wayland.wp_image_description_v1.events.ready.