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

◆ __builtin_five_bit_hd_gamma_bitshift()

void fl::__builtin_five_bit_hd_gamma_bitshift ( CRGB colors,
CRGB colors_scale,
uint8_t global_brightness,
CRGB * out_colors,
uint8_t * out_power_5bit )

Definition at line 130 of file five_bit_hd_gamma.cpp.

133 {
134
135 if (global_brightness == 0) {
136 *out_colors = CRGB(0, 0, 0);
137 *out_power_5bit = 0;
138 return;
139 }
140
141 // Step 1: Gamma Correction
142 uint16_t r16, g16, b16;
143 five_bit_hd_gamma_function(colors, &r16, &g16, &b16);
144
145 // Step 2: Color correction step comes after gamma correction. These values
146 // are assumed to be be relatively close to 255.
147 if (colors_scale.r != 0xff) {
148 r16 = scale16by8(r16, colors_scale.r);
149 }
150 if (colors_scale.g != 0xff) {
151 g16 = scale16by8(g16, colors_scale.g);
152 }
153 if (colors_scale.b != 0xff) {
154 b16 = scale16by8(b16, colors_scale.b);
155 }
156
157 five_bit_bitshift(r16, g16, b16, global_brightness, out_colors,
158 out_power_5bit);
159}
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:468
uint8_t five_bit_bitshift(uint16_t r16, uint16_t g16, uint16_t b16, uint8_t brightness, CRGB *out, uint8_t *out_power_5bit)
void five_bit_hd_gamma_function(CRGB color, uint16_t *r16, uint16_t *g16, uint16_t *b16)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

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: