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

◆ rgb_2_rgbw() [1/2]

FASTLED_FORCE_INLINE void 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 150 of file rgbw.h.

153 {
154 switch (mode) {
155 case kRGBWInvalid:
157 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale,
158 g_scale, b_scale, out_r, out_g, out_b,
159 out_w);
160 return;
161 case kRGBWExactColors:
162 rgb_2_rgbw_exact(w_color_temperature, r, g, b, r_scale, g_scale,
163 b_scale, out_r, out_g, out_b, out_w);
164 return;
166 rgb_2_rgbw_white_boosted(w_color_temperature, r, g, b, r_scale, g_scale,
167 b_scale, out_r, out_g, out_b, out_w);
168 return;
170 rgb_2_rgbw_max_brightness(w_color_temperature, r, g, b, r_scale,
171 g_scale, b_scale, out_r, out_g, out_b, out_w);
172 return;
174 rgb_2_rgbw_user_function(w_color_temperature, r, g, b, r_scale, g_scale,
175 b_scale, out_r, out_g, out_b, out_w);
176 return;
177 }
178 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale, g_scale,
179 b_scale, out_r, out_g, out_b, out_w);
180}
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:66
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:125
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:55
@ kRGBWMaxBrightness
Definition rgbw.h:20
@ kRGBWNullWhitePixel
Definition rgbw.h:17
@ kRGBWInvalid
Definition rgbw.h:16
@ kRGBWUserFunction
Definition rgbw.h:21
@ kRGBWBoostedWhite
Definition rgbw.h:19
@ kRGBWExactColors
Definition rgbw.h:18
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:78
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:40

References FASTLED_FORCE_INLINE, 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: