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

◆ kOklabQ16MaxCubeRoot

i32 fl::anonymous_namespace{oklab_q16.cpp.hpp}::kOklabQ16MaxCubeRoot = 16 * 65536
constexpr

Signed cube of an s16.16 raw value, rounding to nearest at each step.

Inputs are clamped first, so the largest magnitude squared is 2^36 and the product with the third factor is 2^38 – comfortably inside i64. Largest cube-rooted LMS the inverse will cube, as an s16.16 raw value.

This is where the inverse's overflow risk actually lives, so this is where it is bounded – rather than by narrowing the OKLab domain, which would silently truncate colours the forward transform can produce.

16.0 cubes to 4096, and the final matrix widens that by at most 3 * 1.5869 to about 19 500 – an s16.16 raw value of 1.28e9, inside i32 with room to spare. The bound does not bind on real input: XYZ (0, 0, 24), the most extreme case anyone has produced here, has a largest root of 2.5.

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

Referenced by signedCubeQ16().