Commit 397c34ae authored by Vitaly Prosyak's avatar Vitaly Prosyak
Browse files

Added pre-multiplied alpha and specification update


Signed-off-by: Vitaly Prosyak's avatarVitaly Prosyak <vitaly.prosyak@amd.com>
parent 03d5ad02
......@@ -4,6 +4,7 @@
<copyright>
Copyright © 2019 Sebastian Wick
Copyright © 2019 Erwin Burema
Copyright © 2020 Vitaly Prosyak
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
......@@ -59,16 +60,17 @@
<request name="create_color_space">
<description summary="create a color space object">
Create a color space object from an ICC profile.
<!-- FIXME what exactly are the restrictions on the fd? In weston I only
check for O_NONBLOCK then continue to read from it and post a wl
error any read error.
Should we accept files of every size? If the compositor should
chose a size limit we might have to make color space creation a two
step process -->
We accept files maxsize 4MB, it is enough for display profile v4.3
to have several rendering intents.
<!--
We need to have a mechanism where the compositor can reject ICC profiles gracefully rather than
"killing" the application. We can list some ICC file requirements in the protocol specification.
We consider that it's too much to ask clients to validate arbitrary ICC profiles before trying to push them to the
compositor, e.g. when displaying images with attached profiles.
-->
The description of the color space to create is send in the form of an
ICC profile as a file descriptor in the argument icc. The fd must be
compatible with O_NONBLOCK and the compositor will not modify it.
seekable and the compositor will not modify it.
The ICC profile version must be 2 or 4, it must be a 3 channel profile
and the class must be 'input', 'output', 'abstract' or 'display'.
......@@ -166,12 +168,10 @@
the the display can not display anything brighter than reference white.
A value of 3.0 means that the reference white is at one third of the
highest luminance the display can produce.
The value in the event is the EDR value multiplied by 1000.
</description>
<arg name="value" type="fixed" summary="EDR value"/>
<arg name="value" type="uint" summary="EDR value * 1000"/>
</event>
<!-- TODO: reference display information. send if reference display. send valid primaries + EDR -->
<request name="destroy" type="destructor">
<description summary="destroy the color management output">
Destroy the color zwp_color_management_output_v1 object.
......@@ -201,7 +201,13 @@
<entry name="absolute" value="3" summary="ICC-absolute colorimetric"/>
<entry name="relative_bpc" value="4" summary="media-relative colorimetric + black point compensation"/>
</enum>
<enum name="alpha_mode">
<description summary="premultiplied_alpha">
Specifies if alpha is apllied or not
</description>
<entry name="straight" value="0"/>
<entry name="premultiplied" value="1"/>
</enum>
<request name="set_color_space">
<description summary="set the color space">
Set the color space of the underlying surface. The color space is double
......@@ -209,13 +215,10 @@
corresponding wl_surface is called.
The render intent gives the compositor a hint what to optimize for in
color space transformations.
<!-- FIXME figure out if we actually want un-premultiplied.
KMS plane blending, GL/VK ROPs, custom blend shaders -->
The corresponding buffer is expected to contain un-premultiplied pixels
when a color space is set with this request.
color space transformations. We expect alpha channel is linear.
{ R, G, B } = OETF(r, g, b), that is, { r, g, b } is a color in linear-light.
straight: { a, OEFT(r, g, b) }
premultiplied (as used in Wayland and elsewhere): { a, a*OETF(r, g, b) }
If a surface has no color space set, sRGB and an arbitrary render intent
will be assumed.
......@@ -229,6 +232,7 @@
</description>
<arg name="color_space" type="object" interface="zwp_color_space_v1" allow-null="true"/>
<arg name="render_intent" type="uint" enum="render_intent"/>
<arg name="alpha_mode" type="uint" enum="alpha_mode" summary="color channel alpha mode"/>
</request>
<request name="set_extended_dynamic_range">
......@@ -255,30 +259,31 @@
to match the EDRs of the output the surface is shown on.
There might be performance benefits by providing the image tone mapped
to the correct EDR value of an output it is shown on.
The EDR value is multiplied by 1000.
</description>
<arg name="value" type="fixed" summary="EDR value"/>
<arg name="value" type="uint" summary="EDR value * 1000"/>
</request>
<request name="set_hdr_metadata">
<description summary="set the HDR metadata for a surface">
Set some optional HDR metadata for the associated wl_surface. The HDR
metadata state is double buffered and will be applied on the next
wl_surface.commit.
wl_surface.commit. The value of all parameters are multiplied by 1000.
The default value for each argument is zero. All arguments are optional.
</description>
<arg name="display_primary_r_x" type="fixed" summary="Red primary X"/>
<arg name="display_primary_r_y" type="fixed" summary="Red primary Y"/>
<arg name="display_primary_g_x" type="fixed" summary="Green primary X"/>
<arg name="display_primary_g_y" type="fixed" summary="Green primary Y"/>
<arg name="display_primary_b_x" type="fixed" summary="Blue primary X"/>
<arg name="display_primary_b_y" type="fixed" summary="Blue primary Y"/>
<arg name="white_point_x" type="fixed" summary="White point X"/>
<arg name="white_point_y" type="fixed" summary="White point Y"/>
<arg name="min_luminance" type="fixed" summary="Minimum luminance"/>
<arg name="max_luminance" type="fixed" summary="Maximum luminance"/>
<arg name="max_cll" type="uint" summary="Maximum content light level"/>
<arg name="max_fall" type="uint" summary="Maximum frame-average light level"/>
<arg name="display_primary_r_x" type="uint" summary="Red primary X * 1000"/>
<arg name="display_primary_r_y" type="uint" summary="Red primary Y * 1000"/>
<arg name="display_primary_g_x" type="uint" summary="Green primary X * 1000"/>
<arg name="display_primary_g_y" type="uint" summary="Green primary Y * 1000"/>
<arg name="display_primary_b_x" type="uint" summary="Blue primary X * 1000"/>
<arg name="display_primary_b_y" type="uint" summary="Blue primary Y * 1000"/>
<arg name="white_point_x" type="uint" summary="White point X * 1000"/>
<arg name="white_point_y" type="uint" summary="White point Y * 1000"/>
<arg name="min_luminance" type="uint" summary="Minimum luminance * 1000"/>
<arg name="max_luminance" type="uint" summary="Maximum luminance * 1000"/>
<arg name="max_cll" type="uint" summary="Maximum content light level * 1000"/>
<arg name="max_fall" type="uint" summary="Maximum frame-average light level * 1000"/>
</request>
<event name="preferred_color_space">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment