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

◆ signedCubeQ16()

i32 fl::anonymous_namespace{oklab_q16.cpp.hpp}::signedCubeQ16 ( i32 raw)

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

112 {
113 const i32 clamped = clampOklabQ16(raw, kOklabQ16MaxCubeRoot);
114 const i64 magnitude = clamped < 0 ? -static_cast<i64>(clamped)
115 : static_cast<i64>(clamped);
116 const i64 squared = (magnitude * magnitude + 32768) >> 16;
117 const i64 cubed = (squared * magnitude + 32768) >> 16;
118 return clamped < 0 ? -static_cast<i32>(cubed) : static_cast<i32>(cubed);
119}
constexpr i32 kOklabQ16MaxCubeRoot
Signed cube of an s16.16 raw value, rounding to nearest at each step.
i32 clampOklabQ16(i32 value, i32 bound) FL_NO_EXCEPT
Clamp into a symmetric domain.
fl::i64 i64
Definition stdint.h:221

References clampOklabQ16(), fl::FL_NO_EXCEPT, kOklabQ16MaxCubeRoot, and signedCubeQ16().

Referenced by signedCubeQ16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: