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 128 of file five_bit_hd_gamma.cpp.

131 {
132
133 if (global_brightness == 0) {
134 *out_colors = CRGB(0, 0, 0);
135 *out_power_5bit = 0;
136 return;
137 }
138
139 // Step 1: Gamma Correction
140 uint16_t r16, g16, b16;
141 five_bit_hd_gamma_function(colors, &r16, &g16, &b16);
142
143 // Step 2: Color correction step comes after gamma correction. These values
144 // are assumed to be be relatively close to 255.
145 if (colors_scale.r != 0xff) {
146 r16 = scale16by8(r16, colors_scale.r);
147 }
148 if (colors_scale.g != 0xff) {
149 g16 = scale16by8(g16, colors_scale.g);
150 }
151 if (colors_scale.b != 0xff) {
152 b16 = scale16by8(b16, colors_scale.b);
153 }
154
155 five_bit_bitshift(r16, g16, b16, global_brightness, out_colors,
156 out_power_5bit);
157}
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:474
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:55

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: