# This file has been autogenerated by the pywayland scanner

# Copyright 2019 Sebastian Wick
# Copyright 2019 Erwin Burema
# Copyright 2020 AMD
# Copyright 2020-2024 Collabora, Ltd.
# Copyright 2024 Xaver Hugl
# 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.

from __future__ import annotations

import enum

from pywayland.protocol_core import Argument, ArgumentType, Global, Interface, Proxy, Resource

from .wayland import WlOutput
from .wayland import WlOutputProxy
from .wayland import WlSurface
from .wayland import WlSurfaceProxy


class WpColorManagementOutputV1(Interface):
    """Output color properties

    A :class:`WpColorManagementOutputV1` describes the color properties of an
    output.

    The :class:`WpColorManagementOutputV1` is associated with the
    :class:`~pywayland.protocol.wayland.WlOutput` global underlying the
    :class:`~pywayland.protocol.wayland.WlOutput` object. Therefore the client
    destroying the :class:`~pywayland.protocol.wayland.WlOutput` object has no
    impact, but the compositor removing the output global makes the
    :class:`WpColorManagementOutputV1` object inert.
    """

    name = "wp_color_management_output_v1"
    version = 3


class WpColorManagementSurfaceFeedbackV1(Interface):
    """Color management extension to a surface

    A :class:`WpColorManagementSurfaceFeedbackV1` allows the client to get the
    preferred image description of a surface.

    If the :class:`~pywayland.protocol.wayland.WlSurface` associated with this
    object is destroyed, the :class:`WpColorManagementSurfaceFeedbackV1` object
    becomes inert.
    """

    name = "wp_color_management_surface_feedback_v1"
    version = 3

    class error(enum.IntEnum):
        inert = 0
        unsupported_feature = 1


class WpColorManagementSurfaceV1(Interface):
    """Color management extension to a surface

    A :class:`WpColorManagementSurfaceV1` allows the client to set the color
    space and HDR properties of a surface.

    If the :class:`~pywayland.protocol.wayland.WlSurface` associated with the
    :class:`WpColorManagementSurfaceV1` is destroyed, the
    :class:`WpColorManagementSurfaceV1` object becomes inert.
    """

    name = "wp_color_management_surface_v1"
    version = 3

    class error(enum.IntEnum):
        render_intent = 0
        image_description = 1
        inert = 2


class WpColorManagerV1(Interface):
    """Color manager singleton

    A singleton global interface used for getting color management extensions
    for :class:`~pywayland.protocol.wayland.WlSurface` and
    :class:`~pywayland.protocol.wayland.WlOutput` objects, and for creating
    client defined image description objects. The extension interfaces allow
    getting the image description of outputs and setting the image description
    of surfaces.

    Compositors should never remove this global.
    """

    name = "wp_color_manager_v1"
    version = 3

    class error(enum.IntEnum):
        unsupported_feature = 0
        surface_exists = 1

    class render_intent(enum.IntEnum):
        perceptual = 0
        relative = 1
        saturation = 2
        absolute = 3
        relative_bpc = 4
        absolute_no_adaptation = 5

    class feature(enum.IntEnum):
        icc_v2_v4 = 0
        parametric = 1
        set_primaries = 2
        set_tf_power = 3
        set_luminances = 4
        set_mastering_display_primaries = 5
        extended_target_volume = 6
        windows_scrgb = 7
        windows_bt2100 = 8

    class primaries(enum.IntEnum):
        srgb = 1
        pal_m = 2
        pal = 3
        ntsc = 4
        generic_film = 5
        bt2020 = 6
        cie1931_xyz = 7
        dci_p3 = 8
        display_p3 = 9
        adobe_rgb = 10

    class transfer_function(enum.IntEnum):
        bt1886 = 1
        gamma22 = 2
        gamma28 = 3
        st240 = 4
        ext_linear = 5
        log_100 = 6
        log_316 = 7
        xvycc = 8
        srgb = 9
        ext_srgb = 10
        st2084_pq = 11
        st428 = 12
        hlg = 13
        compound_power_2_4 = 14


class WpImageDescriptionCreatorIccV1(Interface):
    """Holder of image description icc information

    This type of object is used for collecting all the information required to
    create a
    :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
    object from an ICC file. A complete set of required parameters consists of
    these properties: - ICC file

    Each required property must be set exactly once if the client is to create
    an image description. The set requests verify that a property was not
    already set. The create request verifies that all required properties are
    set. There may be several alternative requests for setting each property,
    and in that case the client must choose one of them.

    Once all properties have been set, the create request must be used to
    create the image description object, destroying the creator in the process.

    The link between a pixel value (a device value in ICC) and its respective
    colorimetry is defined by the details of the particular ICC profile. Those
    details also determine when colorimetry becomes undefined.
    """

    name = "wp_image_description_creator_icc_v1"
    version = 3

    class error(enum.IntEnum):
        incomplete_set = 0
        already_set = 1
        bad_fd = 2
        bad_size = 3
        out_of_file = 4


class WpImageDescriptionCreatorParamsV1(Interface):
    """Holder of image description parameters

    This type of object is used for collecting all the parameters required to
    create a
    :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
    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

    The following properties are optional and will be ignored if not explicitly
    set: - maximum content light level - maximum frame-average light level

    Each required property must be set exactly once if the client is to create
    an image description. The set requests verify that a property was not
    already set. The create request verifies that all required properties are
    set. There may be several alternative requests for setting each property,
    and in that case the client must choose one of them.

    Once all properties have been set, the create request must be used to
    create the image description object, destroying the creator in the process.

    A viewer, who is viewing the display defined by the resulting image
    description (the viewing environment included), is assumed to be fully
    adapted to the primary color volume's white point.

    Any of the following conditions will cause the colorimetry of a pixel to
    become undefined: - Values outside of the defined range of the transfer
    characteristic. - Tristimulus that exceeds the target color volume. - If
    extended_target_volume is not supported: tristimulus that exceeds the
    primary color volume.

    The closest correspondence to an image description created through this
    interface is the Display class of profiles in ICC.
    """

    name = "wp_image_description_creator_params_v1"
    version = 3

    class error(enum.IntEnum):
        incomplete_set = 0
        already_set = 1
        unsupported_feature = 2
        invalid_tf = 3
        invalid_primaries_named = 4
        invalid_luminance = 5


class WpImageDescriptionInfoV1(Interface):
    """Colorimetric image description information

    Sends all matching events describing an image description object exactly
    once and finally sends the 'done' event.

    This means - if the image description is parametric, it must send   -
    primaries   - named_primaries, if applicable   - at least one of tf_power
    and tf_named, as applicable   - luminances   - target_primaries   -
    target_luminance - if the image description is parametric, it may send, if
    applicable,   - target_max_cll   - target_max_fall - if the image
    description contains an ICC profile, it must send the   icc_file event

    Once a :class:`WpImageDescriptionInfoV1` object has delivered a 'done'
    event it is automatically destroyed.

    Every :class:`WpImageDescriptionInfoV1` created from the same
    :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1` shall
    always return the exact same data.
    """

    name = "wp_image_description_info_v1"
    version = 3


class WpImageDescriptionReferenceV1(Interface):
    """Reference to an image description

    This object is a reference to an image description. This interface is
    frozen at version 1 to allow other protocols to create
    :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
    objects.

    The :func:`WpColorManagerV1.get_image_description()
    <pywayland.protocol.color_management_v1.WpColorManagerV1.get_image_description>`
    request can be used to retrieve the underlying image description.
    """

    name = "wp_image_description_reference_v1"
    version = 1


class WpImageDescriptionV1(Interface):
    """Colorimetric image description

    An image description carries information about the pixel color encoding and
    its intended display and viewing environment. The image description is
    attached to a :class:`~pywayland.protocol.wayland.WlSurface` via
    :func:`WpColorManagementSurfaceV1.set_image_description()
    <pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1.set_image_description>`.
    A compositor can use this information to decode pixel values into
    colorimetrically meaningful quantities, which allows the compositor to
    transform the surface contents to become suitable for various displays and
    viewing environments.

    Note, that the :class:`WpImageDescriptionV1` 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
    :class:`WpImageDescriptionV1` object always refers to one fixed image
    description. It cannot change after creation.
    """

    name = "wp_image_description_v1"
    version = 3

    class error(enum.IntEnum):
        not_ready = 0
        no_information = 1

    class cause(enum.IntEnum):
        low_version = 0
        unsupported = 1
        operating_system = 2
        no_output = 3


class WpColorManagementOutputV1Resource(Resource[WpColorManagementOutputV1]):
    interface = WpColorManagementOutputV1

    @WpColorManagementOutputV1.event()
    def image_description_changed(self) -> None:
        """Image description changed

        This event is sent whenever the image description of the output
        changed, followed by one :func:`WlOutput.done()
        <pywayland.protocol.wayland.WlOutput.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.
        """
        self._post_event(0)


class WpColorManagementSurfaceFeedbackV1Resource(Resource[WpColorManagementSurfaceFeedbackV1]):
    interface = WpColorManagementSurfaceFeedbackV1

    @WpColorManagementSurfaceFeedbackV1.event(
        Argument(ArgumentType.Uint),
    )
    def preferred_changed(self, identity: int) -> None:
        """The preferred image description changed (32-bit)

        Starting from interface version 2, 'preferred_changed2' is sent instead
        of this event. See the 'preferred_changed2' event for the definition.

        :param identity:
            the 32-bit image description id number
        :type identity:
            `ArgumentType.Uint`
        """
        self._post_event(0, identity)

    @WpColorManagementSurfaceFeedbackV1.event(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
        version=2,
    )
    def preferred_changed2(self, identity_hi: int, identity_lo: int) -> None:
        """The preferred image description changed

        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 :class:`~pywayland.protocol.wayland.WlSurface` contents.
        This event is sent whenever the compositor changes the wl_surface's
        preferred image description.

        This event sends the identity of the new preferred state as the
        argument, so clients who are aware of the image description already can
        reuse it. Otherwise, if the client client wants to know what the
        preferred image description is, it shall use the get_preferred request.

        The preferred image description is not automatically used for anything.
        It is only a hint, and clients may set any valid image description with
        set_image_description, but there might be performance and color
        accuracy improvements by providing the
        :class:`~pywayland.protocol.wayland.WlSurface` contents in the
        preferred image description. Therefore clients that can, should render
        according to the preferred image description

        :param identity_hi:
            high 32 bits of the 64-bit image description id number
        :type identity_hi:
            `ArgumentType.Uint`
        :param identity_lo:
            low 32 bits of the 64-bit image description id number
        :type identity_lo:
            `ArgumentType.Uint`
        """
        self._post_event(1, identity_hi, identity_lo)


class WpColorManagementSurfaceV1Resource(Resource[WpColorManagementSurfaceV1]):
    interface = WpColorManagementSurfaceV1


class WpColorManagerV1Resource(Resource[WpColorManagerV1]):
    interface = WpColorManagerV1

    @WpColorManagerV1.event(
        Argument(ArgumentType.Uint),
    )
    def supported_intent(self, render_intent: int) -> None:
        """Supported rendering intent

        When this object is created, it shall immediately send this event once
        for each rendering intent the compositor supports.

        A compositor must not advertise intents that are deprecated in the
        bound version of the interface.

        :param render_intent:
            rendering intent
        :type render_intent:
            `ArgumentType.Uint`
        """
        self._post_event(0, render_intent)

    @WpColorManagerV1.event(
        Argument(ArgumentType.Uint),
    )
    def supported_feature(self, feature: int) -> None:
        """Supported features

        When this object is created, it shall immediately send this event once
        for each compositor supported feature listed in the enumeration.

        A compositor must not advertise features that are deprecated in the
        bound version of the interface.

        :param feature:
            supported feature
        :type feature:
            `ArgumentType.Uint`
        """
        self._post_event(1, feature)

    @WpColorManagerV1.event(
        Argument(ArgumentType.Uint),
    )
    def supported_tf_named(self, tf: int) -> None:
        """Supported named transfer characteristic

        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.

        A compositor must not advertise transfer functions that are deprecated
        in the bound version of the interface.

        :param tf:
            Named transfer function
        :type tf:
            `ArgumentType.Uint`
        """
        self._post_event(2, tf)

    @WpColorManagerV1.event(
        Argument(ArgumentType.Uint),
    )
    def supported_primaries_named(self, primaries: int) -> None:
        """Supported named primaries

        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 compositor must not advertise names that are deprecated in the bound
        version of the interface.

        :param primaries:
            Named color primaries
        :type primaries:
            `ArgumentType.Uint`
        """
        self._post_event(3, primaries)

    @WpColorManagerV1.event()
    def done(self) -> None:
        """All features have been sent

        This event is sent when all supported rendering intents, features,
        transfer functions and named primaries have been sent.
        """
        self._post_event(4)


class WpImageDescriptionCreatorIccV1Resource(Resource[WpImageDescriptionCreatorIccV1]):
    interface = WpImageDescriptionCreatorIccV1


class WpImageDescriptionCreatorParamsV1Resource(Resource[WpImageDescriptionCreatorParamsV1]):
    interface = WpImageDescriptionCreatorParamsV1


class WpImageDescriptionInfoV1Resource(Resource[WpImageDescriptionInfoV1]):
    interface = WpImageDescriptionInfoV1

    @WpImageDescriptionInfoV1.event()
    def done(self) -> None:
        """End of information

        Signals the end of information events and destroys the object.
        """
        self._post_event(0)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.FileDescriptor),
        Argument(ArgumentType.Uint),
    )
    def icc_file(self, icc: int, icc_size: int) -> None:
        """Icc profile matching the image description

        The icc argument provides a file descriptor to the client which may be
        memory-mapped to provide the ICC profile matching the image
        description. The fd is read-only, and if mapped then it must be mapped
        with MAP_PRIVATE by the client.

        The ICC profile version and other details are determined by the
        compositor. There is no provision for a client to ask for a specific
        kind of a profile.

        :param icc:
            ICC profile file descriptor
        :type icc:
            `ArgumentType.FileDescriptor`
        :param icc_size:
            ICC profile size, in bytes
        :type icc_size:
            `ArgumentType.Uint`
        """
        self._post_event(1, icc, icc_size)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
    )
    def primaries(self, r_x: int, r_y: int, g_x: int, g_y: int, b_x: int, b_y: int, w_x: int, w_y: int) -> None:
        """Primaries as chromaticity coordinates

        Delivers the primary color volume primaries and white point using CIE
        1931 xy chromaticity coordinates.

        Each coordinate value is multiplied by 1 million to get the argument
        value to carry precision of 6 decimals.

        :param r_x:
            Red x * 1M
        :type r_x:
            `ArgumentType.Int`
        :param r_y:
            Red y * 1M
        :type r_y:
            `ArgumentType.Int`
        :param g_x:
            Green x * 1M
        :type g_x:
            `ArgumentType.Int`
        :param g_y:
            Green y * 1M
        :type g_y:
            `ArgumentType.Int`
        :param b_x:
            Blue x * 1M
        :type b_x:
            `ArgumentType.Int`
        :param b_y:
            Blue y * 1M
        :type b_y:
            `ArgumentType.Int`
        :param w_x:
            White x * 1M
        :type w_x:
            `ArgumentType.Int`
        :param w_y:
            White y * 1M
        :type w_y:
            `ArgumentType.Int`
        """
        self._post_event(2, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
    )
    def primaries_named(self, primaries: int) -> None:
        """Named primaries

        Delivers the primary color volume primaries and white point using an
        explicitly enumerated named set.

        :param primaries:
            named primaries
        :type primaries:
            `ArgumentType.Uint`
        """
        self._post_event(3, primaries)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
    )
    def tf_power(self, eexp: int) -> None:
        """Transfer characteristic as a power curve

        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.

        :param eexp:
            the exponent * 10000
        :type eexp:
            `ArgumentType.Uint`
        """
        self._post_event(4, eexp)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
    )
    def tf_named(self, tf: int) -> None:
        """Named transfer characteristic

        Delivers the transfer characteristic using an explicitly enumerated
        named function.

        :param tf:
            named transfer function
        :type tf:
            `ArgumentType.Uint`
        """
        self._post_event(5, tf)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
    )
    def luminances(self, min_lum: int, max_lum: int, reference_lum: int) -> None:
        """Primary color volume luminance range and reference white

        Delivers the primary color volume luminance range and the reference
        white luminance level. These values include the minimum display
        emission and ambient flare luminances, assumed to be optically additive
        and have the chromaticity of the primary color volume white point.

        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.

        :param min_lum:
            minimum luminance (cd/m²) * 10000
        :type min_lum:
            `ArgumentType.Uint`
        :param max_lum:
            maximum luminance (cd/m²)
        :type max_lum:
            `ArgumentType.Uint`
        :param reference_lum:
            reference white luminance (cd/m²)
        :type reference_lum:
            `ArgumentType.Uint`
        """
        self._post_event(6, min_lum, max_lum, reference_lum)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
    )
    def target_primaries(self, r_x: int, r_y: int, g_x: int, g_y: int, b_x: int, b_y: int, w_x: int, w_y: int) -> None:
        """Target primaries as chromaticity coordinates

        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.

        Each coordinate value is multiplied by 1 million to get the argument
        value to carry precision of 6 decimals.

        :param r_x:
            Red x * 1M
        :type r_x:
            `ArgumentType.Int`
        :param r_y:
            Red y * 1M
        :type r_y:
            `ArgumentType.Int`
        :param g_x:
            Green x * 1M
        :type g_x:
            `ArgumentType.Int`
        :param g_y:
            Green y * 1M
        :type g_y:
            `ArgumentType.Int`
        :param b_x:
            Blue x * 1M
        :type b_x:
            `ArgumentType.Int`
        :param b_y:
            Blue y * 1M
        :type b_y:
            `ArgumentType.Int`
        :param w_x:
            White x * 1M
        :type w_x:
            `ArgumentType.Int`
        :param w_y:
            White y * 1M
        :type w_y:
            `ArgumentType.Int`
        """
        self._post_event(7, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
    )
    def target_luminance(self, min_lum: int, max_lum: int) -> None:
        """Target luminance range

        Provides the luminance range that the image description is targeting as
        the minimum and maximum absolute luminance L. These values include the
        minimum display emission and ambient flare luminances, assumed to be
        optically additive and have the chromaticity of the primary color
        volume white point. This should be 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.

        :param min_lum:
            min L (cd/m²) * 10000
        :type min_lum:
            `ArgumentType.Uint`
        :param max_lum:
            max L (cd/m²)
        :type max_lum:
            `ArgumentType.Uint`
        """
        self._post_event(8, min_lum, max_lum)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
    )
    def target_max_cll(self, max_cll: int) -> None:
        """Target maximum content light level

        Provides the targeted max_cll of the image description. max_cll is
        defined by CTA-861-H.

        This luminance is only theoretical and may not correspond to the
        luminance of light emitted on an actual display.

        :param max_cll:
            Maximum content light-level (cd/m²)
        :type max_cll:
            `ArgumentType.Uint`
        """
        self._post_event(9, max_cll)

    @WpImageDescriptionInfoV1.event(
        Argument(ArgumentType.Uint),
    )
    def target_max_fall(self, max_fall: int) -> None:
        """Target maximum frame-average light level

        Provides the targeted max_fall of the image description. max_fall is
        defined by CTA-861-H.

        This luminance is only theoretical and may not correspond to the
        luminance of light emitted on an actual display.

        :param max_fall:
            Maximum frame-average light level (cd/m²)
        :type max_fall:
            `ArgumentType.Uint`
        """
        self._post_event(10, max_fall)


class WpImageDescriptionReferenceV1Resource(Resource[WpImageDescriptionReferenceV1]):
    interface = WpImageDescriptionReferenceV1


class WpImageDescriptionV1Resource(Resource[WpImageDescriptionV1]):
    interface = WpImageDescriptionV1

    @WpImageDescriptionV1.event(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.String),
    )
    def failed(self, cause: int, msg: str) -> None:
        """Graceful error on creating the image description

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

        :param cause:
            generic reason
        :type cause:
            `ArgumentType.Uint`
        :param msg:
            ad hoc human-readable explanation
        :type msg:
            `ArgumentType.String`
        """
        self._post_event(0, cause, msg)

    @WpImageDescriptionV1.event(
        Argument(ArgumentType.Uint),
    )
    def ready(self, identity: int) -> None:
        """The object is ready to be used (32-bit)

        Starting from interface version 2, the 'ready2' event is sent instead
        of this event.

        For the definition of this event, see the 'ready2' event. The
        difference to this event is as follows.

        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.

        :param identity:
            the 32-bit image description id number
        :type identity:
            `ArgumentType.Uint`
        """
        self._post_event(1, identity)

    @WpImageDescriptionV1.event(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
        version=2,
    )
    def ready2(self, identity_hi: int, identity_lo: int) -> None:
        """The object is ready to be used

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

        Every ready :class:`WpImageDescriptionV1` 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.

        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.

        Compositors must not recycle image description id numbers.

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

        :param identity_hi:
            high 32 bits of the 64-bit image description id number
        :type identity_hi:
            `ArgumentType.Uint`
        :param identity_lo:
            low 32 bits of the 64-bit image description id number
        :type identity_lo:
            `ArgumentType.Uint`
        """
        self._post_event(2, identity_hi, identity_lo)


class WpColorManagementOutputV1Proxy(Proxy[WpColorManagementOutputV1]):
    interface = WpColorManagementOutputV1

    @WpColorManagementOutputV1.request()
    def destroy(self) -> None:
        """Destroy the color management output

        Destroy the color :class:`WpColorManagementOutputV1` object. This does
        not affect any remaining protocol objects.
        """
        self._marshal(0)
        self._destroy()

    @WpColorManagementOutputV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def get_image_description(self) -> WpImageDescriptionV1Proxy:
        """Get the image description of the output

        This creates a new
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        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
        :class:`WpColorManagementOutputV1` object.

        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
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        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
        :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.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 object shall immediately deliver the
        :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event with the low_version cause.

        Otherwise the object shall immediately deliver the ready event.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(1, WpImageDescriptionV1)
        return image_description


class WpColorManagementSurfaceFeedbackV1Proxy(Proxy[WpColorManagementSurfaceFeedbackV1]):
    interface = WpColorManagementSurfaceFeedbackV1

    @WpColorManagementSurfaceFeedbackV1.request()
    def destroy(self) -> None:
        """Destroy the color management interface for a surface

        Destroy the :class:`WpColorManagementSurfaceFeedbackV1` object.
        """
        self._marshal(0)
        self._destroy()

    @WpColorManagementSurfaceFeedbackV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def get_preferred(self) -> WpImageDescriptionV1Proxy:
        """Get the preferred image description

        If this protocol object is inert, the protocol error inert is raised.

        The preferred image description represents the compositor's preferred
        color encoding for this :class:`~pywayland.protocol.wayland.WlSurface`
        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
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        object for the currently preferred image description for the
        :class:`~pywayland.protocol.wayland.WlSurface`. The client should stop
        using and destroy the image descriptions created by earlier invocations
        of this request for the associated
        :class:`~pywayland.protocol.wayland.WlSurface`. This request is usually
        sent as a reaction to the preferred_changed event or when creating a
        :class:`WpColorManagementSurfaceFeedbackV1` object if the client is
        capable of adapting to image descriptions.

        The created
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        object preserves the preferred image description of the
        :class:`~pywayland.protocol.wayland.WlSurface` from the time the object
        was created.

        The resulting image description object allows get_information request.

        If the image description is parametric, the client should set it on its
        :class:`~pywayland.protocol.wayland.WlSurface` only if the image
        description is an exact match with the client content. Particularly if
        everything else matches, but the target color volume is greater than
        what the client needs, the client should create its own parameric image
        description with its exact parameters.

        If the interface version is inadequate for the preferred 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
        :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event with the low_version cause, otherwise the object shall
        immediately deliver the ready event.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(1, WpImageDescriptionV1)
        return image_description

    @WpColorManagementSurfaceFeedbackV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def get_preferred_parametric(self) -> WpImageDescriptionV1Proxy:
        """Get the preferred image description

        The same description as for get_preferred applies, except the returned
        image description is guaranteed to be parametric. This is meant for
        clients that can only deal with parametric image descriptions.

        If the compositor doesn't support parametric image descriptions, the
        unsupported_feature error is emitted.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(2, WpImageDescriptionV1)
        return image_description


class WpColorManagementSurfaceV1Proxy(Proxy[WpColorManagementSurfaceV1]):
    interface = WpColorManagementSurfaceV1

    @WpColorManagementSurfaceV1.request()
    def destroy(self) -> None:
        """Destroy the color management interface for a surface

        Destroy the :class:`WpColorManagementSurfaceV1` object and do the same
        as unset_image_description.
        """
        self._marshal(0)
        self._destroy()

    @WpColorManagementSurfaceV1.request(
        Argument(ArgumentType.Object, interface=WpImageDescriptionV1),
        Argument(ArgumentType.Uint),
    )
    def set_image_description(self, image_description: WpImageDescriptionV1Proxy, render_intent: int) -> None:
        """Set the surface image description

        If this protocol object is inert, the protocol error inert is raised.

        Set the image description of the underlying surface. The image
        description and rendering intent are double-buffered state, see
        :func:`WlSurface.commit()
        <pywayland.protocol.wayland.WlSurface.commit>`.

        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. Compositors might convert images to match their own or any
        other image descriptions.

        Image descriptions which are not ready (see
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`)
        are forbidden in this request, and in such case the protocol error
        image_description is raised.

        All image descriptions which are ready (see
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`)
        are allowed and must always be accepted by the compositor.

        When an image description is set on a surface, it establishes an
        explicit link between surface pixel values and surface colorimetry.
        This link may be undefined for some pixel values, see the image
        description creator interfaces for the conditions. Non-finite floating-
        point values (NaN, Inf) always have an undefined colorimetry.

        A rendering intent provides the client's preference on how surface
        colorimetry should be mapped to each output. The render_intent value
        must be one advertised by the compositor with
        :func:`WpColorManagerV1.render_intent()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.render_intent>`
        event, otherwise the protocol error render_intent is raised.

        By default, a surface does not have an associated image description nor
        a rendering intent. The handling of color on such surfaces is
        compositor implementation defined. Compositors should handle such
        surfaces as sRGB, but may handle them differently if they have specific
        requirements.

        Setting the image description has copy semantics; after this request,
        the image description can be immediately destroyed without affecting
        the pending state of the surface.

        :param image_description:
        :type image_description:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        :param render_intent:
            rendering intent
        :type render_intent:
            `ArgumentType.Uint`
        """
        self._marshal(1, image_description, render_intent)

    @WpColorManagementSurfaceV1.request()
    def unset_image_description(self) -> None:
        """Remove the surface image description

        If this protocol object is inert, the protocol error inert is raised.

        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
        :func:`WlSurface.commit()
        <pywayland.protocol.wayland.WlSurface.commit>`.
        """
        self._marshal(2)


class WpColorManagerV1Proxy(Proxy[WpColorManagerV1]):
    interface = WpColorManagerV1

    @WpColorManagerV1.request()
    def destroy(self) -> None:
        """Destroy the color manager

        Destroy the :class:`WpColorManagerV1` object. This does not affect any
        other objects in any way.
        """
        self._marshal(0)
        self._destroy()

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpColorManagementOutputV1),
        Argument(ArgumentType.Object, interface=WlOutput),
    )
    def get_output(self, output: WlOutputProxy) -> WpColorManagementOutputV1Proxy:
        """Create a color management interface for a :class:`~pywayland.protocol.wayland.WlOutput`

        This creates a new
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementOutputV1`
        object for the given :class:`~pywayland.protocol.wayland.WlOutput`.

        See the
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementOutputV1`
        interface for more details.

        :param output:
        :type output:
            :class:`~pywayland.protocol.wayland.WlOutput`
        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpColorManagementOutputV1`
        """
        id = self._marshal_constructor(1, WpColorManagementOutputV1, output)
        return id

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpColorManagementSurfaceV1),
        Argument(ArgumentType.Object, interface=WlSurface),
    )
    def get_surface(self, surface: WlSurfaceProxy) -> WpColorManagementSurfaceV1Proxy:
        """Create a color management interface for a :class:`~pywayland.protocol.wayland.WlSurface`

        If a
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1`
        object already exists for the given
        :class:`~pywayland.protocol.wayland.WlSurface`, the protocol error
        surface_exists is raised.

        This creates a new color
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1`
        object for the given :class:`~pywayland.protocol.wayland.WlSurface`.

        See the
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1`
        interface for more details.

        :param surface:
        :type surface:
            :class:`~pywayland.protocol.wayland.WlSurface`
        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1`
        """
        id = self._marshal_constructor(2, WpColorManagementSurfaceV1, surface)
        return id

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpColorManagementSurfaceFeedbackV1),
        Argument(ArgumentType.Object, interface=WlSurface),
    )
    def get_surface_feedback(self, surface: WlSurfaceProxy) -> WpColorManagementSurfaceFeedbackV1Proxy:
        """Create a color management feedback interface

        This creates a new color
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceFeedbackV1`
        object for the given :class:`~pywayland.protocol.wayland.WlSurface`.

        See the
        :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceFeedbackV1`
        interface for more details.

        :param surface:
        :type surface:
            :class:`~pywayland.protocol.wayland.WlSurface`
        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpColorManagementSurfaceFeedbackV1`
        """
        id = self._marshal_constructor(3, WpColorManagementSurfaceFeedbackV1, surface)
        return id

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionCreatorIccV1),
    )
    def create_icc_creator(self) -> WpImageDescriptionCreatorIccV1Proxy:
        """Make a new icc-based image description creator object

        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
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        object.

        This request can be used when the compositor advertises
        :func:`WpColorManagerV1.feature()`.icc_v2_v4. Otherwise this request
        raises the protocol error unsupported_feature.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionCreatorIccV1`
            -- the new creator object
        """
        obj = self._marshal_constructor(4, WpImageDescriptionCreatorIccV1)
        return obj

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionCreatorParamsV1),
    )
    def create_parametric_creator(self) -> WpImageDescriptionCreatorParamsV1Proxy:
        """Make a new parametric image description creator object

        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
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        object.

        This request can be used when the compositor advertises
        :func:`WpColorManagerV1.feature()`.parametric. Otherwise this request
        raises the protocol error unsupported_feature.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionCreatorParamsV1`
            -- the new creator object
        """
        obj = self._marshal_constructor(5, WpImageDescriptionCreatorParamsV1)
        return obj

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def create_windows_scrgb(self) -> WpImageDescriptionV1Proxy:
        """Create windows-scrgb image description object

        This creates a pre-defined image description for the so-called Windows-
        scRGB stimulus encoding. This comes from the Windows 10 handling of its
        own definition of an scRGB color space for an HDR screen driven in
        BT.2100/PQ signalling mode.

        Windows-scRGB uses sRGB (BT.709) color primaries and white point. The
        transfer characteristic is extended linear.

        The nominal color channel value range is extended, meaning it includes
        negative and greater than 1.0 values. Negative values are used to
        escape the sRGB color gamut boundaries. To make use of the extended
        range, the client needs to use a pixel format that can represent those
        values, e.g. floating-point 16 bits per channel.

        Nominal color value R=G=B=0.0 corresponds to BT.2100/PQ system 0 cd/m²,
        and R=G=B=1.0 corresponds to BT.2100/PQ system 80 cd/m². The maximum is
        R=G=B=125.0 corresponding to 10k cd/m².

        Windows-scRGB is displayed by Windows 10 by converting it to
        BT.2100/PQ, maintaining the CIE 1931 chromaticity and mapping the
        luminance as above. No adjustment is made to the signal to account for
        the viewing conditions.

        The reference white level of Windows-scRGB is unknown. If a reference
        white level must be assumed for compositor processing, it should be
        R=G=B=2.5375 corresponding to 203 cd/m² of Report ITU-R BT.2408-7.

        The target color volume of Windows-scRGB is unknown. The color gamut
        may be anything between sRGB and BT.2100.

        Note: EGL_EXT_gl_colorspace_scrgb_linear definition differs from
        Windows-scRGB by using R=G=B=1.0 as the reference white level, while
        Windows-scRGB reference white level is unknown or varies. However, it
        seems probable that Windows implements both
        EGL_EXT_gl_colorspace_scrgb_linear and Vulkan
        VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT as Windows-scRGB.

        This request can be used when the compositor advertises
        :func:`WpColorManagerV1.feature()`.windows_scrgb. Otherwise this
        request raises the protocol error unsupported_feature.

        The resulting image description object does not allow get_information
        request. The :func:`WpImageDescriptionV1.ready()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.ready>`
        event shall be sent.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(6, WpImageDescriptionV1)
        return image_description

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
        Argument(ArgumentType.Object, interface=WpImageDescriptionReferenceV1),
        version=2,
    )
    def get_image_description(self, reference: WpImageDescriptionReferenceV1Proxy) -> WpImageDescriptionV1Proxy:
        """Create an image description from a reference

        This request retrieves the image description backing a reference.

        The get_information request can be used if and only if the request that
        creates the reference allows it.

        :param reference:
        :type reference:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionReferenceV1`
        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(7, WpImageDescriptionV1, reference)
        return image_description

    @WpColorManagerV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
        version=3,
    )
    def create_windows_bt2100(self) -> WpImageDescriptionV1Proxy:
        """Create windows-bt.2100 image description object

        This creates a pre-defined image description for the so-called Windows-
        BT.2100 stimulus encoding. This comes from the Windows 10 handling of
        its own definition of a BT.2100 color space for an HDR screen driven in
        BT.2100/PQ signalling mode.

        Windows-BT.2100 uses BT.2020 color primaries and white point. The
        transfer characteristic is st2084_pq.

        Windows-BT.2100 is generally displayed by Windows 10 without any
        adjustments to the signal to account for viewing conditions.

        The reference white level of Windows-BT.2100 is unknown. If a reference
        white level must be assumed for compositor processing, it should be 203
        cd/m² of Report ITU-R BT.2408-7.

        The target color volume of Windows-BT.2100 is unknown. The color gamut
        may be anything up to BT.2100.

        This request can be used when the compositor advertises
        :func:`WpColorManagerV1.feature()`.windows_bt2100. Otherwise this
        request raises the protocol error unsupported_feature.

        The resulting image description object does not allow get_information
        request. The :func:`WpImageDescriptionV1.ready()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.ready>`
        event shall be sent.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(8, WpImageDescriptionV1)
        return image_description


class WpImageDescriptionCreatorIccV1Proxy(Proxy[WpImageDescriptionCreatorIccV1]):
    interface = WpImageDescriptionCreatorIccV1

    @WpImageDescriptionCreatorIccV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def create(self) -> WpImageDescriptionV1Proxy:
        """Create the image description object from icc data

        Create an image description object based on the ICC information
        previously set on this object. A compositor must parse the ICC data in
        some undefined but finite amount of time.

        The completeness of the parameter set is verified. If the set is not
        complete, the protocol error incomplete_set is raised. For the
        definition of a complete set, see the description of this interface.

        If the particular combination of the information is not supported by
        the compositor, the resulting image description object shall
        immediately deliver the :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event with the 'unsupported' cause. If a valid image description was
        created from the information, the :func:`WpImageDescriptionV1.ready()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.ready>`
        event will eventually be sent instead.

        This request destroys the :class:`WpImageDescriptionCreatorIccV1`
        object.

        The resulting image description object does not allow get_information
        request.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(0, WpImageDescriptionV1)
        return image_description

    @WpImageDescriptionCreatorIccV1.request(
        Argument(ArgumentType.FileDescriptor),
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
    )
    def set_icc_file(self, icc_profile: int, offset: int, length: int) -> None:
        """Set the icc profile file

        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 be 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 :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event on the created
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        with the 'operating_system' cause.

        The maximum size of the ICC profile is 32 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
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        object   delivers either failed or ready event; or - if create request
        was not issued, this   :class:`WpImageDescriptionCreatorIccV1` 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 or ColorSpace. Violating these requirements will not result in
        a protocol error, but will eventually send the
        :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event on the created
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        with the 'unsupported' cause.

        See the International Color Consortium specification ICC.1:2022 for
        more details about ICC profiles.

        If ICC file has already been set on this object, the protocol error
        already_set is raised.

        :param icc_profile:
            ICC profile
        :type icc_profile:
            `ArgumentType.FileDescriptor`
        :param offset:
            byte offset in fd to start of ICC data
        :type offset:
            `ArgumentType.Uint`
        :param length:
            length of ICC data in bytes
        :type length:
            `ArgumentType.Uint`
        """
        self._marshal(1, icc_profile, offset, length)


class WpImageDescriptionCreatorParamsV1Proxy(Proxy[WpImageDescriptionCreatorParamsV1]):
    interface = WpImageDescriptionCreatorParamsV1

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionV1),
    )
    def create(self) -> WpImageDescriptionV1Proxy:
        """Create the image description object using params

        Create an image description object based on the parameters previously
        set on this object.

        The completeness of the parameter set is verified. If the set is not
        complete, the protocol error incomplete_set is raised. For the
        definition of a complete set, see the description of this interface.

        When both max_cll and max_fall are set, max_fall must be less or equal
        to max_cll otherwise the invalid_luminance protocol error is raised.

        In version 1, these following conditions also result in the
        invalid_luminance protocol error. Version 2 and later do not have this
        requirement. - When max_cll is set, it must be greater than min L and
        less or equal   to max L of the mastering luminance range. - When
        max_fall is set, it must be greater than min L and less or equal   to
        max L of the mastering luminance range.

        If the particular combination of the parameter set is not supported by
        the compositor, the resulting image description object shall
        immediately deliver the :func:`WpImageDescriptionV1.failed()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.failed>`
        event with the 'unsupported' cause. If a valid image description was
        created from the parameter set, the :func:`WpImageDescriptionV1.ready()
        <pywayland.protocol.color_management_v1.WpImageDescriptionV1.ready>`
        event will eventually be sent instead.

        This request destroys the :class:`WpImageDescriptionCreatorParamsV1`
        object.

        The resulting image description object does not allow get_information
        request.

        :returns:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionV1`
        """
        image_description = self._marshal_constructor(0, WpImageDescriptionV1)
        return image_description

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
    )
    def set_tf_named(self, tf: int) -> None:
        """Named transfer characteristic

        Sets the transfer characteristic using explicitly enumerated named
        functions.

        When the resulting image description is attached to an image, the
        content should be decoded according to the industry standard practices
        for the transfer characteristic.

        Only names advertised with
        :class:`~pywayland.protocol.color_management_v1.WpColorManagerV1` 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.

        :param tf:
            named transfer function
        :type tf:
            `ArgumentType.Uint`
        """
        self._marshal(1, tf)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
    )
    def set_tf_power(self, eexp: int) -> None:
        """Transfer characteristic as a power curve

        Sets the color component transfer characteristic to a power curve with
        the given exponent. Negative values are handled by mirroring the
        positive half of the curve through the origin. The valid domain and
        range of the curve are all finite real numbers. This curve represents
        the conversion from electrical to optical color channel values.

        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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.feature>`.set_tf_power.
        Otherwise this request raises the protocol error unsupported_feature.

        :param eexp:
            the exponent * 10000
        :type eexp:
            `ArgumentType.Uint`
        """
        self._marshal(2, eexp)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
    )
    def set_primaries_named(self, primaries: int) -> None:
        """Named primaries

        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.

        Only names advertised with
        :class:`~pywayland.protocol.color_management_v1.WpColorManagerV1` event
        supported_primaries_named are allowed. Other values shall raise the
        protocol error invalid_primaries_named.

        If primaries have already been set on this object, the protocol error
        already_set is raised.

        :param primaries:
            named primaries
        :type primaries:
            `ArgumentType.Uint`
        """
        self._marshal(3, primaries)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
    )
    def set_primaries(self, r_x: int, r_y: int, g_x: int, g_y: int, b_x: int, b_y: int, w_x: int, w_y: int) -> None:
        """Primaries as chromaticity coordinates

        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 1 million to get the argument
        value to carry precision of 6 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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.feature>`.set_primaries.
        Otherwise this request raises the protocol error unsupported_feature.

        :param r_x:
            Red x * 1M
        :type r_x:
            `ArgumentType.Int`
        :param r_y:
            Red y * 1M
        :type r_y:
            `ArgumentType.Int`
        :param g_x:
            Green x * 1M
        :type g_x:
            `ArgumentType.Int`
        :param g_y:
            Green y * 1M
        :type g_y:
            `ArgumentType.Int`
        :param b_x:
            Blue x * 1M
        :type b_x:
            `ArgumentType.Int`
        :param b_y:
            Blue y * 1M
        :type b_y:
            `ArgumentType.Int`
        :param w_x:
            White x * 1M
        :type w_x:
            `ArgumentType.Int`
        :param w_y:
            White y * 1M
        :type w_y:
            `ArgumentType.Int`
        """
        self._marshal(4, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
    )
    def set_luminances(self, min_lum: int, max_lum: int, reference_lum: int) -> None:
        """Primary color volume luminance range and reference white

        Sets the primary color volume luminance range and the reference white
        luminance level. These values include the minimum display emission, but
        not external flare. The minimum display emission is assumed to have the
        chromaticity of the primary color volume white point.

        The default luminances from
        https://www.color.org/chardata/rgb/srgb.xalter 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. With
        transfer_function.st2084_pq the given 'max_lum' value is ignored, and
        'max_lum' is taken as 'min_lum' + 10000 cd/m².

        '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.

        'reference_lum' may be higher than 'max_lum'. In that case reaching the
        reference white output level in image content requires the
        'extended_target_volume' feature support.

        If 'max_lum' or 'reference_lum' are 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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.feature>`.set_luminances.
        Otherwise this request raises the protocol error unsupported_feature.

        :param min_lum:
            minimum luminance (cd/m²) * 10000
        :type min_lum:
            `ArgumentType.Uint`
        :param max_lum:
            maximum luminance (cd/m²)
        :type max_lum:
            `ArgumentType.Uint`
        :param reference_lum:
            reference white luminance (cd/m²)
        :type reference_lum:
            `ArgumentType.Uint`
        """
        self._marshal(5, min_lum, max_lum, reference_lum)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
        Argument(ArgumentType.Int),
    )
    def set_mastering_display_primaries(self, r_x: int, r_y: int, g_x: int, g_y: int, b_x: int, b_y: int, w_x: int, w_y: int) -> None:
        """Mastering display primaries as chromaticity coordinates

        Provides the color primaries and white point of the mastering display
        using CIE 1931 xy chromaticity coordinates. This is compatible with the
        SMPTE ST 2086 definition of HDR static metadata.

        The mastering display primaries and mastering display luminances define
        the target color volume.

        If mastering display primaries are not explicitly set, the target color
        volume is assumed to have the same primaries as 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 display primaries and white point. The colorimetry is
        identical between the container color space and the mastering display
        color space, including that no chromatic adaptation is applied even if
        the white points differ.

        The target color volume can exceed the primary color volume to allow
        for a greater color volume with an existing color space definition (for
        example scRGB). It can be smaller than the primary color volume to
        minimize gamut and tone mapping distances for big color spaces (HDR
        metadata).

        To make use of the entire target color volume a suitable pixel format
        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 1 million to get the argument
        value to carry precision of 6 decimals.

        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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.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.

        :param r_x:
            Red x * 1M
        :type r_x:
            `ArgumentType.Int`
        :param r_y:
            Red y * 1M
        :type r_y:
            `ArgumentType.Int`
        :param g_x:
            Green x * 1M
        :type g_x:
            `ArgumentType.Int`
        :param g_y:
            Green y * 1M
        :type g_y:
            `ArgumentType.Int`
        :param b_x:
            Blue x * 1M
        :type b_x:
            `ArgumentType.Int`
        :param b_y:
            Blue y * 1M
        :type b_y:
            `ArgumentType.Int`
        :param w_x:
            White x * 1M
        :type w_x:
            `ArgumentType.Int`
        :param w_y:
            White y * 1M
        :type w_y:
            `ArgumentType.Int`
        """
        self._marshal(6, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
        Argument(ArgumentType.Uint),
    )
    def set_mastering_luminance(self, min_lum: int, max_lum: int) -> None:
        """Display mastering luminance range

        Sets the luminance range that was used during the content mastering
        process as the minimum and maximum absolute luminance L. These values
        include the minimum display emission and ambient flare luminances,
        assumed to be optically additive and have the chromaticity of the
        primary color volume white point. This should be compatible with the
        SMPTE ST 2086 definition of HDR static metadata.

        The mastering display primaries and mastering display luminances define
        the target color volume.

        If mastering luminances are not explicitly set, the target color volume
        is assumed to have the same min and max luminances as the primary color
        volume.

        If max L is less than or equal to min L, the protocol error
        invalid_luminance is raised.

        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.

        This request can be used if the compositor advertises
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.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
        :func:`WpColorManagerV1.feature()
        <pywayland.protocol.color_management_v1.WpColorManagerV1.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.

        :param min_lum:
            min L (cd/m²) * 10000
        :type min_lum:
            `ArgumentType.Uint`
        :param max_lum:
            max L (cd/m²)
        :type max_lum:
            `ArgumentType.Uint`
        """
        self._marshal(7, min_lum, max_lum)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
    )
    def set_max_cll(self, max_cll: int) -> None:
        """Maximum content light level

        Sets the maximum content light level (max_cll) as defined by CTA-861-H.

        max_cll is undefined by default.

        :param max_cll:
            Maximum content light level (cd/m²)
        :type max_cll:
            `ArgumentType.Uint`
        """
        self._marshal(8, max_cll)

    @WpImageDescriptionCreatorParamsV1.request(
        Argument(ArgumentType.Uint),
    )
    def set_max_fall(self, max_fall: int) -> None:
        """Maximum frame-average light level

        Sets the maximum frame-average light level (max_fall) as defined by
        CTA-861-H.

        max_fall is undefined by default.

        :param max_fall:
            Maximum frame-average light level (cd/m²)
        :type max_fall:
            `ArgumentType.Uint`
        """
        self._marshal(9, max_fall)


class WpImageDescriptionInfoV1Proxy(Proxy[WpImageDescriptionInfoV1]):
    interface = WpImageDescriptionInfoV1


class WpImageDescriptionReferenceV1Proxy(Proxy[WpImageDescriptionReferenceV1]):
    interface = WpImageDescriptionReferenceV1

    @WpImageDescriptionReferenceV1.request()
    def destroy(self) -> None:
        """Destroy the reference

        Destroy this object. This has no effect on the referenced image
        description.
        """
        self._marshal(0)
        self._destroy()


class WpImageDescriptionV1Proxy(Proxy[WpImageDescriptionV1]):
    interface = WpImageDescriptionV1

    @WpImageDescriptionV1.request()
    def destroy(self) -> None:
        """Destroy the image description

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

        Destroying a :class:`WpImageDescriptionV1` object has no side-effects,
        not even if a :func:`WpColorManagementSurfaceV1.set_image_description()
        <pywayland.protocol.color_management_v1.WpColorManagementSurfaceV1.set_image_description>`
        has not yet been followed by a :func:`WlSurface.commit()
        <pywayland.protocol.wayland.WlSurface.commit>`.
        """
        self._marshal(0)
        self._destroy()

    @WpImageDescriptionV1.request(
        Argument(ArgumentType.NewId, interface=WpImageDescriptionInfoV1),
    )
    def get_information(self) -> WpImageDescriptionInfoV1Proxy:
        """Get information about the image description

        Creates a
        :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionInfoV1`
        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:
            :class:`~pywayland.protocol.color_management_v1.WpImageDescriptionInfoV1`
        """
        information = self._marshal_constructor(1, WpImageDescriptionInfoV1)
        return information


class WpColorManagementOutputV1Global(Global[WpColorManagementOutputV1]):
    interface = WpColorManagementOutputV1


class WpColorManagementSurfaceFeedbackV1Global(Global[WpColorManagementSurfaceFeedbackV1]):
    interface = WpColorManagementSurfaceFeedbackV1


class WpColorManagementSurfaceV1Global(Global[WpColorManagementSurfaceV1]):
    interface = WpColorManagementSurfaceV1


class WpColorManagerV1Global(Global[WpColorManagerV1]):
    interface = WpColorManagerV1


class WpImageDescriptionCreatorIccV1Global(Global[WpImageDescriptionCreatorIccV1]):
    interface = WpImageDescriptionCreatorIccV1


class WpImageDescriptionCreatorParamsV1Global(Global[WpImageDescriptionCreatorParamsV1]):
    interface = WpImageDescriptionCreatorParamsV1


class WpImageDescriptionInfoV1Global(Global[WpImageDescriptionInfoV1]):
    interface = WpImageDescriptionInfoV1


class WpImageDescriptionReferenceV1Global(Global[WpImageDescriptionReferenceV1]):
    interface = WpImageDescriptionReferenceV1


class WpImageDescriptionV1Global(Global[WpImageDescriptionV1]):
    interface = WpImageDescriptionV1


WpColorManagementOutputV1._gen_c()
WpColorManagementOutputV1.proxy_class = WpColorManagementOutputV1Proxy
WpColorManagementOutputV1.resource_class = WpColorManagementOutputV1Resource
WpColorManagementOutputV1.global_class = WpColorManagementOutputV1Global


WpColorManagementSurfaceFeedbackV1._gen_c()
WpColorManagementSurfaceFeedbackV1.proxy_class = WpColorManagementSurfaceFeedbackV1Proxy
WpColorManagementSurfaceFeedbackV1.resource_class = WpColorManagementSurfaceFeedbackV1Resource
WpColorManagementSurfaceFeedbackV1.global_class = WpColorManagementSurfaceFeedbackV1Global


WpColorManagementSurfaceV1._gen_c()
WpColorManagementSurfaceV1.proxy_class = WpColorManagementSurfaceV1Proxy
WpColorManagementSurfaceV1.resource_class = WpColorManagementSurfaceV1Resource
WpColorManagementSurfaceV1.global_class = WpColorManagementSurfaceV1Global


WpColorManagerV1._gen_c()
WpColorManagerV1.proxy_class = WpColorManagerV1Proxy
WpColorManagerV1.resource_class = WpColorManagerV1Resource
WpColorManagerV1.global_class = WpColorManagerV1Global


WpImageDescriptionCreatorIccV1._gen_c()
WpImageDescriptionCreatorIccV1.proxy_class = WpImageDescriptionCreatorIccV1Proxy
WpImageDescriptionCreatorIccV1.resource_class = WpImageDescriptionCreatorIccV1Resource
WpImageDescriptionCreatorIccV1.global_class = WpImageDescriptionCreatorIccV1Global


WpImageDescriptionCreatorParamsV1._gen_c()
WpImageDescriptionCreatorParamsV1.proxy_class = WpImageDescriptionCreatorParamsV1Proxy
WpImageDescriptionCreatorParamsV1.resource_class = WpImageDescriptionCreatorParamsV1Resource
WpImageDescriptionCreatorParamsV1.global_class = WpImageDescriptionCreatorParamsV1Global


WpImageDescriptionInfoV1._gen_c()
WpImageDescriptionInfoV1.proxy_class = WpImageDescriptionInfoV1Proxy
WpImageDescriptionInfoV1.resource_class = WpImageDescriptionInfoV1Resource
WpImageDescriptionInfoV1.global_class = WpImageDescriptionInfoV1Global


WpImageDescriptionReferenceV1._gen_c()
WpImageDescriptionReferenceV1.proxy_class = WpImageDescriptionReferenceV1Proxy
WpImageDescriptionReferenceV1.resource_class = WpImageDescriptionReferenceV1Resource
WpImageDescriptionReferenceV1.global_class = WpImageDescriptionReferenceV1Global


WpImageDescriptionV1._gen_c()
WpImageDescriptionV1.proxy_class = WpImageDescriptionV1Proxy
WpImageDescriptionV1.resource_class = WpImageDescriptionV1Resource
WpImageDescriptionV1.global_class = WpImageDescriptionV1Global
