FastLED 3.10.8
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 406 of file rgbw.h.

408 {
409 switch (cfg.rgbw_mode) {
413 g_scale, b_scale, out_r, out_g, out_b,
414 out_w);
415 return;
417 rgb_2_rgbw_exact(cfg.white_color_temp, r, g, b, r_scale, g_scale,
418 b_scale, out_r, out_g, out_b, out_w);
419 return;
421 rgb_2_rgbw_white_boosted(cfg.white_color_temp, r, g, b, r_scale, g_scale,
422 b_scale, out_r, out_g, out_b, out_w);
423 return;
425 rgb_2_rgbw_max_brightness(cfg.white_color_temp, r, g, b, r_scale,
426 g_scale, b_scale, out_r, out_g, out_b, out_w);
427 return;
429 rgb_2_rgbw_user_function(cfg.white_color_temp, r, g, b, r_scale, g_scale,
430 b_scale, out_r, out_g, out_b, out_w);
431 return;
433 rgb_2_rgbw_colorimetric(cfg, r, g, b, r_scale, g_scale,
434 b_scale, out_r, out_g, out_b, out_w);
435 return;
437 rgb_2_rgbw_colorimetric_boosted(cfg, r, g, b, r_scale,
438 g_scale, b_scale, out_r, out_g, out_b,
439 out_w);
440 return;
441 }
442 rgb_2_rgbw_null_white_pixel(cfg.white_color_temp, r, g, b, r_scale, g_scale,
443 b_scale, out_r, out_g, out_b, out_w);
444}
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) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:181
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) FL_NO_EXCEPT
Converts RGB to RGBW with the W channel set to black, always.
Definition rgbw.cpp.hpp:110
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:638
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) FL_NO_EXCEPT
Converts RGB to RGBW using a color transfer method from saturated color channels to white.
Definition rgbw.cpp.hpp:84
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) FL_NO_EXCEPT
The minimum brigthness of the RGB channels is used to set the W channel.
Definition rgbw.cpp.hpp:99
InputGamut g
Definition rgbw.h:125
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:649
@ kRGBWUserFunction
Definition rgbw.h:31
@ kRGBWNullWhitePixel
Definition rgbw.h:18
@ kRGBWColorimetricBoosted
Definition rgbw.h:27
@ kRGBWMaxBrightness
Definition rgbw.h:21
@ kRGBWColorimetric
Definition rgbw.h:26
@ kRGBWBoostedWhite
Definition rgbw.h:20
@ kRGBWExactColors
Definition rgbw.h:19
@ kRGBWInvalid
Definition rgbw.h:17
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) FL_NO_EXCEPT
Converts RGB to RGBW with a boosted white channel.
Definition rgbw.cpp.hpp:122
RGBW_MODE rgbw_mode
Definition rgbw.h:252
u16 white_color_temp
Definition rgbw.h:250

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(), rgb_2_rgbw(), and fl::detail::anonymous_namespace{rgbw.cpp.hpp}::rgbw_convert_pixel().

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