FastLED 3.9.15
Loading...
Searching...
No Matches

◆ applyGamma_video() [3/3]

fl::u8 fl::applyGamma_video ( fl::u8 brightness,
float gamma )

Definition at line 1057 of file colorutils.cpp.

1057 {
1058 float orig;
1059 float adj;
1060 orig = (float)(brightness) / (255.0);
1061 adj = pow(orig, gamma) * (255.0);
1062 fl::u8 result = (fl::u8)(adj);
1063 if ((brightness > 0) && (result == 0)) {
1064 result = 1; // never gamma-adjust a positive number down to zero
1065 }
1066 return result;
1067}
UISlider brightness("Brightness", 128, 0, 255, 1)
Result type for promise operations.
unsigned char u8
Definition int.h:17

References brightness().

Referenced by applyGamma_video(), applyGamma_video(), napplyGamma_video(), napplyGamma_video(), napplyGamma_video(), and napplyGamma_video().

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