@@ -464,7 +464,7 @@ Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynami
464
464
each with an associated level of HDR headroom.
465
465
The actual value is computed by interpolating between these two colors,
466
466
based on the current amount of HDR headroom,
467
- as described in [#headroom-interpolation] .
467
+ as described in [[ #headroom-interpolation] ] .
468
468
469
469
<div class="informative">
470
470
This is a similar mechanism to gain maps,
@@ -478,7 +478,7 @@ Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynami
478
478
Its syntax is as follows:
479
479
480
480
<pre class='prod'>
481
- <dfn>hdr-color()</dfn> = color-hdr([ <<color>> && <<number [1 ,infinity]>> ? ]#{2})
481
+ <dfn>hdr-color()</dfn> = color-hdr([ <<color>> && <<number [0 ,infinity]>> ? ]#{2})
482
482
</pre>
483
483
484
484
<div class="example" id="ex-hdr-color-simple">
@@ -507,14 +507,23 @@ Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynami
507
507
508
508
</div>
509
509
510
- <h3 id="# headroom-interpolation">
510
+ <h3 id="headroom-interpolation">
511
511
Interpolating colors based on headroom
512
512
</h3>
513
513
514
514
To interpolate between a color <var> c1</var> at headroom <var> H1</var>
515
- and a color <var> c2</var> at headroom <var> H2</var>
515
+ and a color <var> c2</var> at headroom <var> H2</var> ,
516
+ giving result color <var> cxyz</var> ,
516
517
when the target headroom is <var> H</var> :
517
-
518
+
519
+ 1. Let <var> c1xyz</var> be <var> c1</var> converted to D65 CIE XYZ
520
+ 2. Let <var> c2xyz</var> be <var> c2</var> converted to D65 CIE XYZ
521
+ 3. Let <var> w1</var> = clamp((log(<var> H</var> ) - log(<var> H2</var> )) / (log(<var> H1</var> ) - log(<var> H2</var> )), 0, 1)
522
+ 4. Let <var> w2</var> = clamp((log(<var> H</var> ) - log(<var> H1</var> )) / (log(<var> H2</var> ) - log(<var> H1</var> )), 0, 1)
523
+ Note that <var> w2</var> = 1 - <var> w1</var>
524
+ 5. Let <var> eps</var> = 0.001 (one JND in linear-light space)
525
+ 6. Let <var> cxyz</var> = pow(<var> c1xyz</var> + <var> eps</var> , <var> w1</var> ) * pow(<var> c2xyz</var> + <var> eps</var> , <var> w2</var> ) - <var> eps</var>
526
+
518
527
519
528
<h2 id="color-function">
520
529
Specifying Predefined and Custom Color Spaces: the ''color()'' Function
0 commit comments