FastLED 3.10.6
Loading...
Searching...
No Matches

◆ rgb_2_rgbw() [1/3]

FASTLED_FORCE_INLINE void fl::rgb_2_rgbw ( const Rgbw & cfg,
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 380 of file rgbw.h.

382 {
383 switch (cfg.rgbw_mode) {
387 g_scale, b_scale, out_r, out_g, out_b,
388 out_w);
389 return;
391 rgb_2_rgbw_exact(cfg.white_color_temp, r, g, b, r_scale, g_scale,
392 b_scale, out_r, out_g, out_b, out_w);
393 return;
395 rgb_2_rgbw_white_boosted(cfg.white_color_temp, r, g, b, r_scale, g_scale,
396 b_scale, out_r, out_g, out_b, out_w);
397 return;
399 rgb_2_rgbw_max_brightness(cfg.white_color_temp, r, g, b, r_scale,
400 g_scale, b_scale, out_r, out_g, out_b, out_w);
401 return;
403 rgb_2_rgbw_user_function(cfg.white_color_temp, r, g, b, r_scale, g_scale,
404 b_scale, out_r, out_g, out_b, out_w);
405 return;
407 rgb_2_rgbw_colorimetric(cfg, r, g, b, r_scale, g_scale,
408 b_scale, out_r, out_g, out_b, out_w);
409 return;
411 rgb_2_rgbw_colorimetric_boosted(cfg, r, g, b, r_scale,
412 g_scale, b_scale, out_r, out_g, out_b,
413 out_w);
414 return;
415 }
416 rgb_2_rgbw_null_white_pixel(cfg.white_color_temp, r, g, b, r_scale, g_scale,
417 b_scale, out_r, out_g, out_b, out_w);
418}
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:109
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_NO_EXCEPT
Definition rgbw.cpp.hpp:637
@ kRGBWUserFunction
Definition rgbw.h:30
@ kRGBWNullWhitePixel
Definition rgbw.h:17
@ kRGBWColorimetricBoosted
Definition rgbw.h:26
@ kRGBWMaxBrightness
Definition rgbw.h:20
@ kRGBWColorimetric
Definition rgbw.h:25
@ kRGBWBoostedWhite
Definition rgbw.h:19
@ kRGBWExactColors
Definition rgbw.h:18
@ kRGBWInvalid
Definition rgbw.h:16
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:83
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:98
InputGamut g
Definition rgbw.h:124
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_NO_EXCEPT
Definition rgbw.cpp.hpp:648
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:180
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:121
RGBW_MODE rgbw_mode
Definition rgbw.h:226
u16 white_color_temp
Definition rgbw.h:224

References FL_NO_EXCEPT, g, 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 calculate_unscaled_power_mW(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBWUnordered(), rgb_2_rgbw(), and rgb_2_rgbw().

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