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

◆ clampGamutDrives()

void fl::anonymous_namespace{gamut_map.cpp.hpp}::clampGamutDrives ( i32(&) drives[3])

Clamp drives into [0, 1].

The accepted candidate is already in range up to the rounding of the last inverse transform, which can leave a drive a few ULP outside. Clamping makes the postcondition exact rather than nearly true.

Definition at line 91 of file gamut_map.cpp.hpp.

91 {
92 for (int i = 0; i < 3; ++i) {
93 if (drives[i] < 0) {
94 drives[i] = 0;
95 } else if (drives[i] > kGamutFullDrive) {
96 drives[i] = kGamutFullDrive;
97 }
98 }
99}
constexpr i32 kGamutFullDrive
Full drive, as an s16.16 raw value.

References clampGamutDrives(), fl::FL_NO_EXCEPT, and kGamutFullDrive.

Referenced by clampGamutDrives().

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