FastLED 3.10.6
Loading...
Searching...
No Matches

◆ xyzToOklabQ16()

void fl::xyzToOklabQ16 ( const i32(&) xyz[3],
i32(&) out_lab[3] )

XYZ (s16.16, D65-relative) -> OKLab (s16.16), L then a then b.

The cube root is fl::icbrt64, exact to within one ULP. That the exact root is what the mapper needs, and how much slack it has, is measured in docs/color-gamut-algorithm-selection.md.

Definition at line 123 of file oklab_q16.cpp.hpp.

123 {
124 const i32 clamped[3] = {clampOklabQ16(xyz[0], kOklabQ16MaxMagnitude),
125 clampOklabQ16(xyz[1], kOklabQ16MaxMagnitude),
126 clampOklabQ16(xyz[2], kOklabQ16MaxMagnitude)};
127 i32 lms[3];
128 dotOklabMatrixQ16(kLmsFromXyz, clamped, lms);
129 const i32 root[3] = {
130 signedCbrtQ16(lms[0]), signedCbrtQ16(lms[1]), signedCbrtQ16(lms[2])};
131 dotOklabMatrixQ16(kOklabFromLmsRoot, root, out_lab);
132}
void dotOklabMatrixQ16(const i32(&matrix)[3][3], const i32(&v)[3], i32(&out)[3]) FL_NO_EXCEPT
constexpr i32 kOklabQ16MaxMagnitude
Largest magnitude either direction accepts, as an s16.16 raw value (64.0).
Definition oklab_q16.h:40

References FL_NO_EXCEPT, and kOklabQ16MaxMagnitude.

Referenced by buildGamutMapFromSolveQ16(), buildGamutMapRgbwFromSolveQ16(), buildGamutMapRgbwwFromSolveQ16(), mapAndAllocateRgbwQ16(), mapAndAllocateRgbwwQ16(), and mapAndSolveDrivesQ16().

+ Here is the caller graph for this function: