|
FastLED 3.10.6
|
| void fl::oklabToXyzQ16 | ( | const i32(&) | lab[3], |
| i32(&) | out_xyz[3] ) |
OKLab (s16.16) -> XYZ (s16.16).
The inverse of xyzToOklabQ16.
Not bit-exact in round trip: both directions round to nearest and the cube root truncates. oklabToXyzQ16(xyzToOklabQ16(v)) returns within 32 ULP over the working domain.
The other order degrades near black. OKLab cube-roots the cone responses, and that root's derivative, 1 / (3 * lms^(2/3)), diverges as a response approaches zero: around L = 0.05 it is roughly 1200, so any error in the response is hugely amplified coming back out. Restricted to in-gamut colours the worst measured round trip there is about 300 ULP. This is conditioning rather than representation – carrying lms or XYZ at Q32 was measured and does not fix it – and it costs the P7 mapper nothing. tests/fl/gfx/oklab_q16.cpp pins both ends.
Definition at line 134 of file oklab_q16.cpp.hpp.
References FL_NO_EXCEPT, and kOklabQ16MaxMagnitude.
Referenced by fl::anonymous_namespace{gamut_map.cpp.hpp}::chromaCandidateXyz(), mapAndAllocateRgbwQ16(), and mapAndAllocateRgbwwQ16().
Here is the caller graph for this function: