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

◆ internal_builtin_five_bit_hd_gamma_bitshift()

void fl::internal_builtin_five_bit_hd_gamma_bitshift ( CRGB colors,
CRGB colors_scale,
fl::u8 global_brightness,
CRGB * out_colors,
fl::u8 * out_power_5bit )
inline

Definition at line 92 of file five_bit_hd_gamma.h.

94 {
95
96 if (global_brightness == 0) {
97 *out_colors = CRGB(0, 0, 0);
98 *out_power_5bit = 0;
99 return;
100 }
101
102 // Step 1: Gamma Correction
103 u16 r16, g16, b16;
104 five_bit_hd_gamma_function(colors, &r16, &g16, &b16);
105
106 // Step 2: Color correction step comes after gamma correction. These values
107 // are assumed to be be relatively close to 255.
108 if (colors_scale.r != 0xff) {
109 r16 = scale16by8(r16, colors_scale.r);
110 }
111 if (colors_scale.g != 0xff) {
112 g16 = scale16by8(g16, colors_scale.g);
113 }
114 if (colors_scale.b != 0xff) {
115 b16 = scale16by8(b16, colors_scale.b);
116 }
117
118 five_bit_bitshift(r16, g16, b16, global_brightness, out_colors,
119 out_power_5bit);
120}
LIB8STATIC_ALWAYS_INLINE uint16_t scale16by8(uint16_t i, fract8 scale)
Scale a 16-bit unsigned value by an 8-bit value, which is treated as the numerator of a fraction whos...
Definition scale8.h:478
void five_bit_hd_gamma_function(CRGB color, u16 *r16, u16 *g16, u16 *b16)
void five_bit_bitshift(u16 r16, u16 g16, u16 b16, fl::u8 brightness, CRGB *out, fl::u8 *out_power_5bit)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

References five_bit_bitshift(), five_bit_hd_gamma_function(), and scale16by8().

Referenced by five_bit_hd_gamma_bitshift().

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