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

◆ rgb_2_rgbw() [1/2]

FASTLED_FORCE_INLINE void fl::rgb_2_rgbw ( RGBW_MODE mode,
uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW using one of the functions.

Dynamic version of the rgb_w_rgbw function with less chance for the compiler to optimize.

Definition at line 149 of file rgbw.h.

151 {
152 switch (mode) {
153 case kRGBWInvalid:
155 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale,
156 g_scale, b_scale, out_r, out_g, out_b,
157 out_w);
158 return;
159 case kRGBWExactColors:
160 rgb_2_rgbw_exact(w_color_temperature, r, g, b, r_scale, g_scale,
161 b_scale, out_r, out_g, out_b, out_w);
162 return;
164 rgb_2_rgbw_white_boosted(w_color_temperature, r, g, b, r_scale, g_scale,
165 b_scale, out_r, out_g, out_b, out_w);
166 return;
168 rgb_2_rgbw_max_brightness(w_color_temperature, r, g, b, r_scale,
169 g_scale, b_scale, out_r, out_g, out_b, out_w);
170 return;
172 rgb_2_rgbw_user_function(w_color_temperature, r, g, b, r_scale, g_scale,
173 b_scale, out_r, out_g, out_b, out_w);
174 return;
175 }
176 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale, g_scale,
177 b_scale, out_r, out_g, out_b, out_w);
178}
void rgb_2_rgbw_user_function(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Definition rgbw.cpp:126
void rgb_2_rgbw_exact(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW using a color transfer method from saturated color channels to white.
Definition rgbw.cpp:41
@ kRGBWMaxBrightness
Definition rgbw.h:18
@ kRGBWBoostedWhite
Definition rgbw.h:17
@ kRGBWInvalid
Definition rgbw.h:14
@ kRGBWUserFunction
Definition rgbw.h:19
@ kRGBWNullWhitePixel
Definition rgbw.h:15
@ kRGBWExactColors
Definition rgbw.h:16
void rgb_2_rgbw_null_white_pixel(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW with the W channel set to black, always.
Definition rgbw.cpp:67
void rgb_2_rgbw_max_brightness(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
The minimum brigthness of the RGB channels is used to set the W channel.
Definition rgbw.cpp:56
void rgb_2_rgbw_white_boosted(uint16_t w_color_temperature, uint8_t r, uint8_t g, uint8_t b, uint8_t r_scale, uint8_t g_scale, uint8_t b_scale, uint8_t *out_r, uint8_t *out_g, uint8_t *out_b, uint8_t *out_w)
Converts RGB to RGBW with a boosted white channel.
Definition rgbw.cpp:79

References kRGBWBoostedWhite, kRGBWExactColors, kRGBWInvalid, kRGBWMaxBrightness, kRGBWNullWhitePixel, kRGBWUserFunction, rgb_2_rgbw_exact(), rgb_2_rgbw_max_brightness(), rgb_2_rgbw_null_white_pixel(), rgb_2_rgbw_user_function(), and rgb_2_rgbw_white_boosted().

Referenced by PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW(), and rgb_2_rgbw().

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