๐ Experiment: I told ChatGPT to write a detailed Wayland Protocol for displaying HDR content. Here's what it came up with.
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
(Don't take this seriously)
All I did was feed it the color-representation protocol and ask it to write a detailed Wayland protocol for displaying HDR content on a screen. I didn't give it any additional context other than asking it to rewrite everything with more examples and use cases. So this is the second iteration of the protocol it came up with.
Is this super useful? Maybe? I don't know. However, I thought it would be fun to share what it came up with. Have fun reading!
<?xml version="1.0" encoding="UTF-8"?> <protocol name="hdr_v1"> <copyright> Copyright 2023 OpenAI Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. </copyright> <description summary="HDR display protocol extension"> This protocol extension allows clients to provide HDR (High Dynamic Range) content to the compositor and enables the compositor to inform clients about the HDR capabilities of the display. The protocol is intended to be used in conjunction with the Wayland protocol for displaying video. The protocol uses the SMPTE ST 2086 metadata for mastering display color volume, and the HDR10+ static metadata for content encoding. These standards define the necessary metadata for accurately reproducing HDR content on an HDR display. The metadata includes information about the color gamut and luminance range of the display, as well as the color gamut and luminance range of the content. Example use cases for this protocol include displaying HDR video or images on an HDR display, or displaying HDR content from a game engine on an HDR display. </description> <interface name="wp_hdr_manager_v1" version="1"> <description summary="HDR factory"> This global is a wp_hdr_v1 factory. It is used to create wp_hdr_v1 objects that are tied to wl_surface objects and provide the metadata required to display HDR content. </description> <enum name="error"> <entry name="already_constructed" value="1" summary="HDR already constructed for this surface"/> <entry name="unsupported_format" value="2" summary="requested HDR format is not supported"/> </enum> <request name="destroy" type="destructor"> <description summary="destroy the manager"> Destroy the manager object. Existing objects created through this interface remain valid. </description> </request> <request name="create_surface"> <description summary="create an HDR object for a surface"> Create a wp_hdr_v1 object tied to a wl_surface. If a wp_hdr_v1 object already exists for this surface, the already_constructed protocol error must be sent by the compositor. </description> <arg name="hdr" type="new_id" interface="wp_hdr_v1"/> <arg name="surface" type="object" interface="wl_surface"/> </request> <event name="capabilities"> <description summary="HDR capabilities of the display"> This event advertises the HDR capabilities of the display. It includes the maximum display luminance, the maximum content light level, the display color depth, and the supported HDR encoding formats. The maximum display luminance is the maximum luminance that the display is capable of reproducing. It is measured in candelas per square meter (cd/m^2). The maximum content light level is the maximum luminance of any single pixel in the content. It is also measured in cd/m^2. The display color depth is the number of bits used to represent the color of each pixel. Higher color depths allow for more accurate reproduction of colors. The supported HDR encoding formats are the formats in which the content is encoded, as well as the corresponding static metadata type. The format specifies the color space and bit depth of the content, and the static metadata type specifies the metadata format used to encode the luminance range and color gamut information. </description> <arg name="max_display_luminance" type="uint" unit="cd/m^2" summary="maximum display luminance in candelas per square meter"/> <arg name="max_content_light_level" type="uint" color_depth="uint" unit="bits" summary="display color depth in bits per pixel"/> <arg name="formats" type="array" summary="supported HDR encoding formats"> <description summary="supported HDR encoding format"> This describes the supported HDR encoding format. It includes the format name and the static metadata type. </description> <arg name="format" type="string" summary="HDR encoding format name"/> <arg name="metadata_type" type="string" summary="static metadata type"/> </arg> </event> <event name="mastering_display_info"> <description summary="mastering display information"> This event advertises the mastering display information for the display. It includes the display primaries, white point, and luminance range. The display primaries are the chromaticity coordinates of the display's red, green, and blue color channels. They are represented as x and y chromaticity coordinates in the CIE 1931 color space. The white point is the chromaticity coordinate of the white point of the display. It is also represented as an x and y chromaticity coordinate in the CIE 1931 color space. The luminance range is the minimum and maximum luminance that the display is capable of reproducing. It is measured in cd/m^2. </description> <arg name="display_primaries" type="array" summary="display primaries"> <description summary="display primary color coordinate"> This describes the display primary color coordinate. It includes the x and y chromaticity coordinates, and the maximum display luminance. </description> <arg name="x" type="fixed" range="0.0 .. 1.0" summary="x chromaticity coordinate"/> <arg name="y" type="fixed" range="0.0 .. 1.0" summary="y chromaticity coordinate"/> <arg name="max_luminance" type="uint" unit="cd/m^2" summary="maximum display luminance in candelas per square meter"/> </arg> <arg name="white_point" type="array" summary="white point"> <description summary="white point color coordinate"> This describes the white point color coordinate. It includes the x and y chromaticity coordinates. </description> <arg name="x" type="fixed" range="0.0 .. 1.0" summary="x chromaticity coordinate"/> <arg name="y" type="fixed" range="0.0 .. 1.0" summary="y chromaticity coordinate"/> </arg> <arg name="min_luminance" type="uint" unit="cd/m^2" summary="minimum display luminance in candelas per square meter"/> <arg name="max_luminance" type="uint" unit="cd/m^2" summary="maximum display luminance in candelas per square meter"/> </event> <interface name="wp_hdr_v1" version="1"> <description summary="HDR surface information"> This event advertises the content light level information for the surface. It includes the maximum and average light levels of the content. The maximum content light level is the maximum luminance of any single pixel in the content. It is measured in cd/m^2. The average content light level is the average luminance of all the pixels in the content. It is also measured in cd/m^2. </event> <request name="set_static_metadata"> <description summary="set the static metadata for the surface"> Set the static metadata for the surface. This includes the format name and the static metadata payload. The format name specifies the format of the content. It specifies the color space and bit depth of the content. The static metadata payload is a binary blob that encodes the luminance range and color gamut information for the content. The format of the payload is specified by the static metadata type. </description> <arg name="format" type="string" summary="HDR encoding format name"/> <arg name="payload" type="array" summary="static metadata payload"/> </request> <request name="set_content_light_level"> <description summary="set the content light level for the surface"> Set the content light level for the surface. This includes the maximum and average light levels of the content. </description> <arg name="max_light_level" type="uint" unit="cd/m^2" summary="maximum content light level in candelas per square meter"/> <arg name="average_light_level" type="uint" unit="cd/m^2" summary="average content light level in candelas per square meter"/> </request> </interface> </protocol>
[link] [comments] ...