|
FastLED 3.10.6
|
|
constexpr |
Largest magnitude either direction accepts, as an s16.16 raw value (64.0).
Not a theoretical bound – the working domain really does get large. An emitter profile normalized to unit luminance per emitter, which is what EmitterProfile carries, puts the blue emitter's Z near 13 (see device_solve.h), so a saturated blue at a few times unit drive reaches XYZ in the tens. An earlier revision clamped at 4.0 on the assumption that XYZ stayed inside [0, 2]; the P7 gamut mapper found that wrong immediately, and silently, by producing identical OKLab for targets 30x apart in luminance.
The two directions share one bound deliberately. They compose – the mapper feeds the forward transform's output straight back into the inverse – so a tighter limit on one silently truncates the other's range. XYZ (0, 0, 24) is inside the forward's domain and produces a = -4.08, which a 4.0 bound on the inverse would have clamped, returning a different colour with no indication.
Overflow is prevented where it actually threatens – at the cube inside the inverse – rather than by squeezing this. See kOklabQ16MaxCubeRoot in the implementation.
Definition at line 40 of file oklab_q16.h.
Referenced by buildGamutMapFromSolveQ16(), buildGamutMapRgbwFromSolveQ16(), buildGamutMapRgbwwFromSolveQ16(), oklabToXyzQ16(), and xyzToOklabQ16().