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

◆ rgb_2_rgbw() [1/2]

FASTLED_FORCE_INLINE void fl::rgb_2_rgbw ( RGBW_MODE mode,
u16 w_color_temperature,
u8 r,
u8 g,
u8 b,
u8 r_scale,
u8 g_scale,
u8 b_scale,
u8 * out_r,
u8 * out_g,
u8 * out_b,
u8 * 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 317 of file rgbw.h.

319 {
320 switch (mode) {
323 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale,
324 g_scale, b_scale, out_r, out_g, out_b,
325 out_w);
326 return;
328 rgb_2_rgbw_exact(w_color_temperature, r, g, b, r_scale, g_scale,
329 b_scale, out_r, out_g, out_b, out_w);
330 return;
332 rgb_2_rgbw_white_boosted(w_color_temperature, r, g, b, r_scale, g_scale,
333 b_scale, out_r, out_g, out_b, out_w);
334 return;
336 rgb_2_rgbw_max_brightness(w_color_temperature, r, g, b, r_scale,
337 g_scale, b_scale, out_r, out_g, out_b, out_w);
338 return;
340 rgb_2_rgbw_user_function(w_color_temperature, r, g, b, r_scale, g_scale,
341 b_scale, out_r, out_g, out_b, out_w);
342 return;
344 rgb_2_rgbw_colorimetric(w_color_temperature, r, g, b, r_scale, g_scale,
345 b_scale, out_r, out_g, out_b, out_w);
346 return;
348 rgb_2_rgbw_colorimetric_boosted(w_color_temperature, r, g, b, r_scale,
349 g_scale, b_scale, out_r, out_g, out_b,
350 out_w);
351 return;
352 }
353 rgb_2_rgbw_null_white_pixel(w_color_temperature, r, g, b, r_scale, g_scale,
354 b_scale, out_r, out_g, out_b, out_w);
355}
void rgb_2_rgbw_colorimetric_boosted(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w) FL_NOEXCEPT
Definition rgbw.cpp.hpp:527
@ kRGBWUserFunction
Definition rgbw.h:29
@ kRGBWNullWhitePixel
Definition rgbw.h:16
@ kRGBWColorimetricBoosted
Definition rgbw.h:25
@ kRGBWMaxBrightness
Definition rgbw.h:19
@ kRGBWColorimetric
Definition rgbw.h:24
@ kRGBWBoostedWhite
Definition rgbw.h:18
@ kRGBWExactColors
Definition rgbw.h:17
@ kRGBWInvalid
Definition rgbw.h:15
void rgb_2_rgbw_exact(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w)
Converts RGB to RGBW using a color transfer method from saturated color channels to white.
Definition rgbw.cpp.hpp:80
void rgb_2_rgbw_null_white_pixel(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w)
Converts RGB to RGBW with the W channel set to black, always.
Definition rgbw.cpp.hpp:106
void rgb_2_rgbw_user_function(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w)
Definition rgbw.cpp.hpp:177
void rgb_2_rgbw_white_boosted(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w)
Converts RGB to RGBW with a boosted white channel.
Definition rgbw.cpp.hpp:118
void rgb_2_rgbw_colorimetric(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w) FL_NOEXCEPT
Definition rgbw.cpp.hpp:516
void rgb_2_rgbw_max_brightness(u16 w_color_temperature, u8 r, u8 g, u8 b, u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w)
The minimum brigthness of the RGB channels is used to set the W channel.
Definition rgbw.cpp.hpp:95

References FL_NOEXCEPT, kRGBWBoostedWhite, kRGBWColorimetric, kRGBWColorimetricBoosted, kRGBWExactColors, kRGBWInvalid, kRGBWMaxBrightness, kRGBWNullWhitePixel, kRGBWUserFunction, rgb_2_rgbw_colorimetric(), rgb_2_rgbw_colorimetric_boosted(), 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: