frog-color-management-v1.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <protocol name="frog_color_management_v1">
  3. <copyright>
  4. Copyright © 2023 Joshua Ashton for Valve Software
  5. Copyright © 2023 Xaver Hugl
  6. Permission is hereby granted, free of charge, to any person obtaining a
  7. copy of this software and associated documentation files (the "Software"),
  8. to deal in the Software without restriction, including without limitation
  9. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. and/or sell copies of the Software, and to permit persons to whom the
  11. Software is furnished to do so, subject to the following conditions:
  12. The above copyright notice and this permission notice (including the next
  13. paragraph) shall be included in all copies or substantial portions of the
  14. Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. DEALINGS IN THE SOFTWARE.
  22. </copyright>
  23. <description summary="experimental color management protocol">
  24. The aim of this color management extension is to get HDR games working quickly,
  25. and have an easy way to test implementations in the wild before the upstream
  26. protocol is ready to be merged.
  27. For that purpose it's intentionally limited and cut down and does not serve
  28. all uses cases.
  29. </description>
  30. <interface name="frog_color_management_factory_v1" version="1">
  31. <description summary="color management factory">
  32. The color management factory singleton creates color managed surface objects.
  33. </description>
  34. <request name="destroy" type="destructor"></request>
  35. <request name="get_color_managed_surface">
  36. <description summary="create color management interface for surface">
  37. </description>
  38. <arg name="surface" type="object" interface="wl_surface"
  39. summary="target surface"/>
  40. <arg name="callback" type="new_id" interface="frog_color_managed_surface"
  41. summary="new color managed surface object"/>
  42. </request>
  43. </interface>
  44. <interface name="frog_color_managed_surface" version="1">
  45. <description summary="color managed surface">
  46. Interface for changing surface color management and HDR state.
  47. An implementation must: support every part of the version
  48. of the frog_color_managed_surface interface it exposes.
  49. Including all known enums associated with a given version.
  50. </description>
  51. <request name="destroy" type="destructor">
  52. <description summary="destroy color managed surface">
  53. Destroying the color managed surface resets all known color
  54. state for the surface back to 'undefined' implementation-specific
  55. values.
  56. </description>
  57. </request>
  58. <enum name="transfer_function">
  59. <description summary="known transfer functions">
  60. Extended information on the transfer functions described
  61. here can be found in the Khronos Data Format specification:
  62. https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html
  63. </description>
  64. <entry name="undefined" value="0" summary="specifies undefined, implementation-specific handling of the surface's transfer function."/>
  65. <entry name="srgb" value="1" summary="specifies the sRGB non-linear EOTF. An implementation may: display this as Gamma 2.2 for the purposes of being consistent with content rendering across displays, rendering_intent and user expectations."/>
  66. <entry name="gamma_22" value="2" summary="specifies gamma 2.2 power curve as the EOTF"/>
  67. <entry name="st2084_pq" value="3" summary="specifies the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF"/>
  68. <entry name="scrgb_linear" value="4" summary="specifies the scRGB (extended sRGB) linear EOTF. Note: Primaries outside the gamut triangle specified can be expressed with negative values for this transfer function."/>
  69. </enum>
  70. <request name="set_known_transfer_function">
  71. <description summary="sets a known transfer function for a surface"/>
  72. <arg name="transfer_function" type="uint" enum="transfer_function" summary="transfer function for the surface"/>
  73. </request>
  74. <enum name="primaries">
  75. <description summary="known primaries"/>
  76. <entry name="undefined" value="0" summary="specifies undefined, implementation-specific handling"/>
  77. <entry name="rec709" value="1" summary="specifies Rec.709/sRGB primaries with D65 white point"/>
  78. <entry name="rec2020" value="2" summary="specifies Rec.2020/HDR10 primaries with D65 white point"/>
  79. </enum>
  80. <request name="set_known_container_color_volume">
  81. <description summary="sets the container color volume (primaries) for a surface"/>
  82. <arg name="primaries" type="uint" enum="primaries" summary="primaries for the surface"/>
  83. </request>
  84. <enum name="render_intent">
  85. <description summary="known render intents">
  86. Extended information on render intents described
  87. here can be found in ICC.1:2022:
  88. https://www.color.org/specification/ICC.1-2022-05.pdf
  89. </description>
  90. <entry name="perceptual" value="0" summary="perceptual"/>
  91. </enum>
  92. <request name="set_render_intent">
  93. <description summary="sets the render intent for a surface">
  94. NOTE: On a surface with "perceptual" (default) render intent, handling of the container's color volume
  95. is implementation-specific, and may differ between different transfer functions it is paired with:
  96. ie. sRGB + 709 rendering may have it's primaries widened to more of the available display's gamut
  97. to be be more pleasing for the viewer.
  98. Compared to scRGB Linear + 709 being treated faithfully as 709
  99. (including utilizing negatives out of the 709 gamut triangle)
  100. </description>
  101. <arg name="render_intent" type="uint" enum="render_intent" summary="render intent for the surface"/>
  102. </request>
  103. <request name="set_hdr_metadata">
  104. <description summary="set HDR metadata for a surface">
  105. Forwards HDR metadata from the client to the compositor.
  106. HDR Metadata Infoframe as per CTA 861.G spec.
  107. Usage of this HDR metadata is implementation specific and
  108. outside of the scope of this protocol.
  109. </description>
  110. <arg name="mastering_display_primary_red_x" type="uint">
  111. <description summary="red primary x coordinate">
  112. Mastering Red Color Primary X Coordinate of the Data.
  113. Coded as unsigned 16-bit values in units of
  114. 0.00002, where 0x0000 represents zero and 0xC350
  115. represents 1.0000.
  116. </description>
  117. </arg>
  118. <arg name="mastering_display_primary_red_y" type="uint">
  119. <description summary="red primary y coordinate">
  120. Mastering Red Color Primary Y Coordinate of the Data.
  121. Coded as unsigned 16-bit values in units of
  122. 0.00002, where 0x0000 represents zero and 0xC350
  123. represents 1.0000.
  124. </description>
  125. </arg>
  126. <arg name="mastering_display_primary_green_x" type="uint">
  127. <description summary="green primary x coordinate">
  128. Mastering Green Color Primary X Coordinate of the Data.
  129. Coded as unsigned 16-bit values in units of
  130. 0.00002, where 0x0000 represents zero and 0xC350
  131. represents 1.0000.
  132. </description>
  133. </arg>
  134. <arg name="mastering_display_primary_green_y" type="uint">
  135. <description summary="green primary y coordinate">
  136. Mastering Green Color Primary Y Coordinate of the Data.
  137. Coded as unsigned 16-bit values in units of
  138. 0.00002, where 0x0000 represents zero and 0xC350
  139. represents 1.0000.
  140. </description>
  141. </arg>
  142. <arg name="mastering_display_primary_blue_x" type="uint">
  143. <description summary="blue primary x coordinate">
  144. Mastering Blue Color Primary X Coordinate of the Data.
  145. Coded as unsigned 16-bit values in units of
  146. 0.00002, where 0x0000 represents zero and 0xC350
  147. represents 1.0000.
  148. </description>
  149. </arg>
  150. <arg name="mastering_display_primary_blue_y" type="uint">
  151. <description summary="blue primary y coordinate">
  152. Mastering Blue Color Primary Y Coordinate of the Data.
  153. Coded as unsigned 16-bit values in units of
  154. 0.00002, where 0x0000 represents zero and 0xC350
  155. represents 1.0000.
  156. </description>
  157. </arg>
  158. <arg name="mastering_white_point_x" type="uint">
  159. <description summary="white point x coordinate">
  160. Mastering White Point X Coordinate of the Data.
  161. These are coded as unsigned 16-bit values in units of
  162. 0.00002, where 0x0000 represents zero and 0xC350
  163. represents 1.0000.
  164. </description>
  165. </arg>
  166. <arg name="mastering_white_point_y" type="uint">
  167. <description summary="white point y coordinate">
  168. Mastering White Point Y Coordinate of the Data.
  169. These are coded as unsigned 16-bit values in units of
  170. 0.00002, where 0x0000 represents zero and 0xC350
  171. represents 1.0000.
  172. </description>
  173. </arg>
  174. <arg name="max_display_mastering_luminance" type="uint">
  175. <description summary="max display mastering luminance">
  176. Max Mastering Display Luminance.
  177. This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
  178. where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
  179. </description>
  180. </arg>
  181. <arg name="min_display_mastering_luminance" type="uint">
  182. <description summary="min display mastering luminance">
  183. Min Mastering Display Luminance.
  184. This value is coded as an unsigned 16-bit value in units of
  185. 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
  186. represents 6.5535 cd/m2.
  187. </description>
  188. </arg>
  189. <arg name="max_cll" type="uint">
  190. <description summary="max content light level">
  191. Max Content Light Level.
  192. This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
  193. where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
  194. </description>
  195. </arg>
  196. <arg name="max_fall" type="uint">
  197. <description summary="max frame average light level">
  198. Max Frame Average Light Level.
  199. This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
  200. where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
  201. </description>
  202. </arg>
  203. </request>
  204. <event name="preferred_metadata">
  205. <description summary="preferred metadata for a surface">
  206. Current preferred metadata for a surface.
  207. The application should use this information to tone-map its buffers
  208. to this target before committing.
  209. This metadata does not necessarily correspond to any physical output, but
  210. rather what the compositor thinks would be best for a given surface.
  211. </description>
  212. <arg name="transfer_function" type="uint" enum="transfer_function">
  213. <description summary="output's current transfer function">
  214. Specifies a known transfer function that corresponds to the
  215. output the surface is targeting.
  216. </description>
  217. </arg>
  218. <arg name="output_display_primary_red_x" type="uint">
  219. <description summary="red primary x coordinate">
  220. Output Red Color Primary X Coordinate of the Data.
  221. Coded as unsigned 16-bit values in units of
  222. 0.00002, where 0x0000 represents zero and 0xC350
  223. represents 1.0000.
  224. </description>
  225. </arg>
  226. <arg name="output_display_primary_red_y" type="uint">
  227. <description summary="red primary y coordinate">
  228. Output Red Color Primary Y Coordinate of the Data.
  229. Coded as unsigned 16-bit values in units of
  230. 0.00002, where 0x0000 represents zero and 0xC350
  231. represents 1.0000.
  232. </description>
  233. </arg>
  234. <arg name="output_display_primary_green_x" type="uint">
  235. <description summary="green primary x coordinate">
  236. Output Green Color Primary X Coordinate of the Data.
  237. Coded as unsigned 16-bit values in units of
  238. 0.00002, where 0x0000 represents zero and 0xC350
  239. represents 1.0000.
  240. </description>
  241. </arg>
  242. <arg name="output_display_primary_green_y" type="uint">
  243. <description summary="green primary y coordinate">
  244. Output Green Color Primary Y Coordinate of the Data.
  245. Coded as unsigned 16-bit values in units of
  246. 0.00002, where 0x0000 represents zero and 0xC350
  247. represents 1.0000.
  248. </description>
  249. </arg>
  250. <arg name="output_display_primary_blue_x" type="uint">
  251. <description summary="blue primary x coordinate">
  252. Output Blue Color Primary X Coordinate of the Data.
  253. Coded as unsigned 16-bit values in units of
  254. 0.00002, where 0x0000 represents zero and 0xC350
  255. represents 1.0000.
  256. </description>
  257. </arg>
  258. <arg name="output_display_primary_blue_y" type="uint">
  259. <description summary="blue primary y coordinate">
  260. Output Blue Color Primary Y Coordinate of the Data.
  261. Coded as unsigned 16-bit values in units of
  262. 0.00002, where 0x0000 represents zero and 0xC350
  263. represents 1.0000.
  264. </description>
  265. </arg>
  266. <arg name="output_white_point_x" type="uint">
  267. <description summary="white point x coordinate">
  268. Output White Point X Coordinate of the Data.
  269. These are coded as unsigned 16-bit values in units of
  270. 0.00002, where 0x0000 represents zero and 0xC350
  271. represents 1.0000.
  272. </description>
  273. </arg>
  274. <arg name="output_white_point_y" type="uint">
  275. <description summary="white point y coordinate">
  276. Output White Point Y Coordinate of the Data.
  277. These are coded as unsigned 16-bit values in units of
  278. 0.00002, where 0x0000 represents zero and 0xC350
  279. represents 1.0000.
  280. </description>
  281. </arg>
  282. <arg name="max_luminance" type="uint">
  283. <description summary="maximum luminance">
  284. Max Output Luminance
  285. The max luminance in nits that the output is capable of rendering in small areas.
  286. Content should: not exceed this value to avoid clipping.
  287. This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
  288. where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
  289. </description>
  290. </arg>
  291. <arg name="min_luminance" type="uint">
  292. <description summary="minimum luminance">
  293. Min Output Luminance
  294. The min luminance that the output is capable of rendering.
  295. Content should: not exceed this value to avoid clipping.
  296. This value is coded as an unsigned 16-bit value in units of
  297. 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
  298. represents 6.5535 cd/m2.
  299. </description>
  300. </arg>
  301. <arg name="max_full_frame_luminance" type="uint">
  302. <description summary="maximum full frame luminance">
  303. Max Full Frame Luminance
  304. The max luminance in nits that the output is capable of rendering for the
  305. full frame sustained.
  306. This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
  307. where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
  308. </description>
  309. </arg>
  310. </event>
  311. </interface>
  312. </protocol>