Skip to content

Commit a4b3a19

Browse files
committed
[css-color-hdr] Define serialization, bit depths
1 parent 9a45f14 commit a4b3a19

File tree

1 file changed

+94
-49
lines changed

1 file changed

+94
-49
lines changed

css-color-hdr/Overview.bs

Lines changed: 94 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -185,48 +185,48 @@ Introducing Headroom {#introducing-headroom}
185185
The 'dynamic-range-limit' property {#the-dynamic-range-limit-property}
186186
-------------------------------
187187

188-
<pre class='propdef'>
189-
Name: dynamic-range-limit
190-
Value: standard | high | constrained-high
191-
Initial: high
192-
Applies to: all elements
193-
Inherited: no
194-
Percentages: n/a
195-
Computed value: specified value
196-
Animation type: by computed value type
197-
Canonical order: per grammar
188+
<pre class='propdef'>
189+
Name: dynamic-range-limit
190+
Value: standard | high | constrained-high
191+
Initial: high
192+
Applies to: all elements
193+
Inherited: no
194+
Percentages: n/a
195+
Computed value: specified value
196+
Animation type: by computed value type
197+
Canonical order: per grammar
198+
</pre>
199+
200+
<dl dfn-type="value" dfn-for="dynamic-range-limit">
201+
<dt><dfn>standard</dfn>
202+
<dd>
203+
The highest luminance color
204+
that is displayed is the same as '
205+
media white, i.e. the CSS color ''white''.
206+
</dd>
207+
<dt><dfn>high</dfn>
208+
<dd>
209+
The highest peak luminance
210+
that is displayed is much greater than
211+
media white, i.e. the CSS color ''white'';
212+
the precise level is not specified.
213+
</dd>
214+
<dt><dfn>constrained-high</dfn>
215+
<dd>
216+
The highest peak luminance
217+
that is displayed is somewhat greater than
218+
media white, i.e. the CSS color ''white'',
219+
such that a mix of SDR and HDR content
220+
can be comfortably viewed together.
221+
</dd>
222+
</dl>
223+
224+
<div class="example" id="ex-hdr-limit-photogrid">
225+
<pre class="lang-css">
226+
body { dynamic-range-limit: standard; }
227+
div.photogrid img { dynamic-range-limit: constrained-high }
198228
</pre>
199-
200-
<dl dfn-type="value" dfn-for="dynamic-range-limit">
201-
<dt><dfn>standard</dfn>
202-
<dd>
203-
The highest luminance color
204-
that is displayed is the same as '
205-
media white, i.e. the CSS color ''white''.
206-
</dd>
207-
<dt><dfn>high</dfn>
208-
<dd>
209-
The highest peak luminance
210-
that is displayed is much greater than
211-
media white, i.e. the CSS color ''white'';
212-
the precise level is not specified.
213-
</dd>
214-
<dt><dfn>constrained-high</dfn>
215-
<dd>
216-
The highest peak luminance
217-
that is displayed is somewhat greater than
218-
media white, i.e. the CSS color ''white'',
219-
such that a mix of SDR and HDR content
220-
can be comfortably viewed together.
221-
</dd>
222-
</dl>
223-
224-
<div class="example" id="ex-hdr-limit-photogrid">
225-
<pre class="lang-css">
226-
body { dynamic-range-limit: standard; }
227-
div.photogrid img { dynamic-range-limit: constrained-high }
228-
</pre>
229-
</div>
229+
</div>
230230

231231
Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynamic-range-limit-mix}
232232
--------------------------------------------------------
@@ -291,14 +291,6 @@ Predefined color spaces for HDR: {#predefined-HDR}
291291
with each having a valid range of [0, 1]
292292
regardless of the actual bit depth (10 or 12 bits per component).
293293

294-
Issue: should this specification recommend that the CSS Object Model
295-
store these values in the 16-bit half-floating point representation
296-
(IEEE standard 754-2008.)
297-
from BT.2100 pp. 9-10? (or any wider representation, like float or double)?
298-
299-
Issue: should the values accept % as well as number? so 19% as well as 0.19.
300-
Probably yes.
301-
302294
The Perceptual Quantizer (PQ) electro-optical transfer function is used
303295
[[SMPTE-ST-2084]],[[!Rec_BT.2100]].
304296
PQ assumes a reference viewing condition
@@ -741,6 +733,59 @@ However, implementations may chose to incorporate
741733
a color re-rendering step (OOTF)
742734
to account for non-reference viewing conditions.
743735

736+
<!--
737+
██████ ████████ ████████ ████ ███ ██
738+
██ ██ ██ ██ ██ ██ ██ ██ ██
739+
██ ██ ██ ██ ██ ██ ██ ██
740+
██████ ██████ ████████ ██ ██ ██ ██
741+
██ ██ ██ ██ ██ █████████ ██
742+
██ ██ ██ ██ ██ ██ ██ ██ ██
743+
██████ ████████ ██ ██ ████ ██ ██ ████████
744+
-->
745+
746+
<h2 id='serializing-color-values'>
747+
Serializing <<color>> Values</h2>
748+
749+
<h3 id="serializing-color-function-values">
750+
Serializing values of the ''color()'' function</h3>
751+
752+
This section extends [[css-color-4#serializing-color-function-values]]
753+
754+
The serialized form of ''color()'' values
755+
is derived from the [=computed value=]
756+
and uses the ''color()'' form,
757+
with <a href="https://infra.spec.whatwg.org/#ascii-lowercase">ASCII lowercase</a>
758+
letters for the function name
759+
and the color space name.
760+
761+
The component values are serialized in base 10,
762+
as <<number>>.
763+
A single ASCII space character " "
764+
must be used as the separator
765+
between the component values,
766+
and also between the color space name and the first color component.
767+
768+
For the predefined HDR color spaces,
769+
the <em>minimum</em> precision for round-tripping is as follows:
770+
771+
<table class="data" id="predefined-precision-table">
772+
<tr><th>HDR color space</th><th>Minimum bits</th></tr>
773+
<tr>
774+
<td>''rec2100-pq'', ''rec2100-hlg''</td>
775+
<td>10</td>
776+
<!-- to conform to BT.2100 which recommends 12 but allows 10 -->
777+
</tr>
778+
<tr>
779+
<td>''rec2100-linear'', ''jzazbz'', ''jzczhz'', ''ictcp''</td>
780+
<td>16</td>
781+
</tr>
782+
</table>
783+
784+
(16bit, half-float, or float <em>per component</em>
785+
is recommended for internal storage).
786+
Values must be <a href="https://drafts.csswg.org/css-values-4/#combine-integers">rounded towards +∞</a>, not truncated.
787+
788+
744789

745790
<!-- Sample section {#sample-topic}
746791
==============================

0 commit comments

Comments
 (0)