Skip to content

Color management getters/events #4131

@Ralith

Description

@Ralith

Description

Applications (e.g. games, image viewers, video players) capable of native HDR output may be able to provide better visuals by querying the compositor and/or display's color reproduction capabilities and state. Useful information includes, but is not limited to, the minimum and maximum luminance and the reference white level. For example, this can help a game ensure its UI is displayed at the same brightness as the user's desktop GUI elements, and help minimize clipping/distortion of out-of-range luminance.

On Wayland, this is available via the recently merged color-management-v1 extension, in particular wp_color_management_output_v1::get_image_description and wp_color_management_output_v1::image_description_changed. On Windows, the reference white level is available via QueryDisplayConfig with DISPLAYCONFIG_SDR_WHITE_LEVEL, and other data is available in DXGI_OUTPUT_DESC1, though I'm not sure if DXGI APIs are usable from winit.

Additional research is needed to determine the full scope of metadata that should be exposed (e.g. are primary chromaticities useful?) to avoid future churn. The Wayland protocol has had a lot of thought put into it and may be a good model, and also cites relevant standards also used in image/video formats.

Graphics APIs already expose mechanisms to declare the properties of HDR content that an application actually generates, independent of the display, e.g. VK_EXT_hdr_metadata, so perhaps no special support from winit is required there although e.g. Wayland does seem to also have similar functionality. It's not immediately obvious how the two different mechanisms for applications to advertise this info interact.

Relevant platforms

Windows, Wayland

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions