FastLED 3.10.8
Loading...
Searching...
No Matches
rgbw.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "fl/stl/stdint.h"
7
8#include "eorder.h"
10#include "fl/stl/noexcept.h"
11#include "fl/stl/shared_ptr.h"
12
13namespace fl {
14
15// Defined mode ordinals fit in one byte, as with RGBWW_MODE.
16enum class RGBW_MODE : u8 {
22 // Chromaticity-aware modes (issue #2545). Off by default at compile time:
23 // require `#define FASTLED_RGBW_COLORIMETRIC 1` to enable the real math
24 // path. Without the define, selecting either mode emits FL_WARN_ONCE and
25 // falls back to kRGBWExactColors.
28 // IMPORTANT: kRGBWUserFunction MUST remain the last enumerator. New modes
29 // are added immediately above this line so the user-function ordinal does
30 // not shift and the dispatch table can rely on it being the maximum value.
32};
33
34// Per-strip diode chromaticity + peak luminance, used by the colorimetric
35// modes. The default constant (`kRgbwDefaultProfile`) ships with the library
36// and uses datasheet-derived values for SK6812 RGBW3535 at 6000K. Users with a
37// colorimeter can build their own profile and pass it on the Rgbw setting used
38// by their controller.
39//
40// Source-space fields (input_xy_*, issue #2705) define the color space the
41// input RGB triple is interpreted in. The default profile (#2710) ships
42// with **native LED gamut + D65 white** — input primaries equal the LED's
43// own xy_r/g/b — so a saturated input like RGB=(255,0,0) reaches the LED
44// red diode at full drive and RGB=(255,255,255) lands on D65. Solvers
45// compute `X_t = M_src · source_rgb` where M_src is the standard CIE
46// primary-matrix construction from these four chromaticities.
47//
48// Users wanting standard color-space input semantics (Rec709 / sRGB,
49// Rec2020, DCI-P3 D65/D60) should opt in explicitly when creating the
50// owned profile, for example
51// `fl::color::make_diode_profile(profile, fl::color::InputGamut::Rec709)`.
52//
53// If input_xy_w[1] is left at 0.0f (the default for value-initialized
54// profiles `DiodeProfile{}`), solvers fall back to the legacy
55// interpretation in which the input RGB triple IS the device-emitter
56// drive coordinates — preserved for backward compatibility.
58 float xy_r[2]; // R diode chromaticity (CIE 1931 xy)
59 float xy_g[2]; // G diode chromaticity
60 float xy_b[2]; // B diode chromaticity
61 float xy_w[2]; // W diode chromaticity (at nominal_cct)
62 float lum_r; // R diode peak luminance (relative to W = 1.0)
63 float lum_g;
64 float lum_b;
65 float lum_w; // typically 1.0 by convention
66 int nominal_cct; // CCT at which xy_w was measured (e.g. 6000)
67
68 // Source / input color space (#2705). See above for default behavior.
69 float input_xy_r[2]; // source R primary chromaticity (default: native LED R)
70 float input_xy_g[2]; // source G primary chromaticity (default: native LED G)
71 float input_xy_b[2]; // source B primary chromaticity (default: native LED B)
72 float input_xy_w[2]; // source white chromaticity (default D65)
73};
74
75// Named source color spaces for opting into standard input-gamut semantics
76// (#2710). The default `kRgbwDefaultProfile` ships as `Native`; pick a
77// named gamut here when feeding content authored for that space (e.g.
78// sRGB / Rec.709 for ambilight, Rec.2020 for wide-gamut video, DCI-P3
79// for cinema-mastered material).
80enum class InputGamut : u8 {
81 Native = 0, // Input primaries == this profile's LED primaries + D65 white
82 Rec709, // sRGB / Rec.709 primaries + D65 white
83 Rec2020, // Rec.2020 (UHDTV) primaries + D65 white
84 DciP3D65, // DCI-P3 D65 — consumer display variant (e.g. Apple)
85 DciP3D60, // DCI-P3 D60 — ACES / cinema mastering variant
86};
87
88// Reconfigure `profile`'s input_xy_r/g/b/w to one of the named gamuts.
89// For `InputGamut::Native`, copies the profile's own xy_r/g/b into
90// input_xy_r/g/b and sets input_xy_w to D65. For named gamuts, uses the
91// standard published primary chromaticities + that gamut's reference white.
92// Mutates `profile` in place; subsequent solver calls observe the new gamut
93// (the cache is keyed on the profile address and rebuilds automatically).
94//
95// Takes a reference: the profile is required and is mutated, so there is no
96// meaningful "no profile" call. A nullable pointer would advertise an
97// optional argument that does not exist (FastLED#3234).
98void set_input_gamut(DiodeProfile& profile, InputGamut g) FL_NO_EXCEPT;
99
100// Same as the above, but lets you optionally override the input white point.
101// `white_xy` stays a POINTER because it is genuinely optional: either a
102// 2-float (x, y) chromaticity OR `nullptr` to fall back to the gamut's
103// standard reference white (equivalent to the 2-argument overload). Use the
104// override for niche cases (D50 photography workflow, D60 ACES cinema, a
105// custom calibration target) where the standard reference white doesn't
106// match your content.
107//
108// Spelled `const float*` rather than `const float[2]`: an array-spelled
109// parameter decays to a pointer anyway, so the extent would be an unenforced
110// promise, and this repo bans the misleading spelling outright (see
111// ci/tools/check_array_params.py). Nullability is the real contract here, so
112// the pointer says what it means; the required length lives in this comment
113// because no signature can encode both "exactly 2" and "or null".
114void set_input_gamut(DiodeProfile& profile, InputGamut g,
115 const float* white_xy) FL_NO_EXCEPT;
116
117// Deprecated pointer overloads -- kept so existing sketches calling
118// `set_input_gamut(&profile, ...)` keep compiling. They forward to the
119// reference forms above and preserve the historical silent no-op on
120// `nullptr`. Prefer the reference overloads in new code.
121FL_DEPRECATED("Pass the profile by reference: set_input_gamut(profile, g)")
123
124FL_DEPRECATED("Pass the profile by reference: set_input_gamut(profile, g, white_xy)")
126 const float white_xy[2]) FL_NO_EXCEPT;
127
128// Create an owned immutable profile. The gamut overload copies `profile`,
129// applies the named input gamut to that copy, and returns it as const shared
130// state suitable for storing on Rgbw.
132 const DiodeProfile& profile) FL_NO_EXCEPT;
134 const DiodeProfile& profile, InputGamut g) FL_NO_EXCEPT;
136 const DiodeProfile& profile, InputGamut g,
137 const float white_xy[2]) FL_NO_EXCEPT;
138
139// Default profile: SK6812 RGBW3535 @ ~6000K (datasheet wavelengths -> xy +
140// typical luminance ratios). Always declared so user code referencing it
141// compiles whether or not FASTLED_RGBW_COLORIMETRIC is defined.
143
144// Install a user-supplied profile. The pointer is stored — caller must keep
145// the DiodeProfile alive for as long as a colorimetric mode is active.
146// No-op when FASTLED_RGBW_COLORIMETRIC is undefined.
148
149// Currently active profile (defaults to &kRgbwDefaultProfile).
151
152// Interpolation scheme used by the colorimetric LUT (#2720). Bilinear stores
153// 4 channel values per grid cell (8 B/cell at i16 quantization) — cheapest in
154// flash/RAM. Hermite additionally stores ∂/∂t_x and ∂/∂t_y per channel
155// (24 B/cell, 3x storage) and reaches lower error at the same grid size,
156// enabling small grids (N=8..16) on memory-constrained targets.
157enum class RgbwLutInterp : u8 {
160};
161
162// Enable the 2D + 1D factored LUT path (issue #2545 Phase 2). When enabled,
163// the colorimetric modes use an interpolated LUT instead of solving per pixel.
164// Available whenever FASTLED_RGBW_COLORIMETRIC=1 — no separate
165// FASTLED_RGBW_COLORIMETRIC_LUT flag exists; gc-sections drops the LUT path
166// for sketches that never call this. `grid_n` is clamped to [4, 256] and
167// controls the LUT edge length. LUT is rebuilt whenever the active profile,
168// CCT, grid size, or interp scheme changes. Returns false on allocation
169// failure (or always false when FASTLED_RGBW_COLORIMETRIC is undefined).
170//
171// Memory cost = grid_n * grid_n * (interp == Hermite ? 24 : 8) bytes:
172// N=8 -> Bilinear 512 B / Hermite 1 536 B
173// N=16 -> Bilinear 2 048 B / Hermite 6 144 B
174// N=32 -> Bilinear 8 192 B / Hermite 24 576 B
175// N=64 -> Bilinear 32 KB / Hermite ~96 KB
176//
177// The single-arg overload preserves source compatibility and forwards to
178// RgbwLutInterp::Hermite (the historical default since #2707).
179bool enable_rgbw_colorimetric_lut(int grid_n,
182
183// Free the LUT and revert colorimetric calls to the closed-form solver.
185
186// Returns true if the LUT path is currently active.
188
189// Compile-time memory-cost accessor. Mirrors the storage math used by the
190// LUT builder so users can size their RAM/flash budget before calling
191// enable_rgbw_colorimetric_lut(). The runtime API clamps grid_n to [4, 256],
192// so this helper applies the same clamp so callers do not under-estimate
193// for grid_n < 4 or over-estimate for grid_n > 256. Returns 0 for grid_n < 1.
195 int grid_n, RgbwLutInterp interp) FL_NO_EXCEPT {
196 return (grid_n < 1)
197 ? 0UL
198 : (static_cast<unsigned long>(
199 grid_n < 4 ? 4 : (grid_n > 256 ? 256 : grid_n))
200 * static_cast<unsigned long>(
201 grid_n < 4 ? 4 : (grid_n > 256 ? 256 : grid_n))
202 * (interp == RgbwLutInterp::Hermite ? 24UL : 8UL));
203}
204
205enum {
207};
208
209struct Rgbw;
210
211namespace detail {
220using RgbwConvertFn = void (*)(const Rgbw& rgbw, const u8 (&raw)[3],
221 const u8 (&premix)[3], const u8 (&order)[3],
222 u8* b0, u8* b1, u8* b2, u8* b3);
225} // namespace detail
226
227struct Rgbw {
237 explicit Rgbw(u16 white_color_temp,
239 fl::EOrderW _w_placement,
240 const DiodeProfile& _profile,
241 fl::InputGamut input_gamut) FL_NO_EXCEPT
244 profile(fl::make_diode_profile(_profile, input_gamut)) {
246 }
247
251 fl::EOrderW w_placement = EOrderW::WDefault;
261
262 static u32 size_as_rgb(u32 num_of_rgbw_pixels) FL_NO_EXCEPT {
263 // The ObjectFLED controller expects the raw pixel byte data in
264 // multiples of 3. In the case of src data not a multiple of 3, then we
265 // need to add pad bytes so that the delegate controller doesn't walk
266 // off the end of the array and invoke a buffer overflow panic.
267 num_of_rgbw_pixels = (num_of_rgbw_pixels * 4 + 2) / 3;
268 u32 extra = num_of_rgbw_pixels % 3 ? 1 : 0;
269 num_of_rgbw_pixels += extra;
270 return num_of_rgbw_pixels;
271 }
272};
273
274struct RgbwInvalid : public Rgbw {
280 RgbwInvalid invalid;
281 return invalid;
282 }
283};
284
285struct RgbwDefault : public Rgbw {
291 RgbwDefault _default;
292 return _default;
293 }
294};
295
296struct RgbwWhiteIsOff : public Rgbw {
302 RgbwWhiteIsOff _default;
303 return _default;
304 }
305};
306
307// Build any colorimetric precomputation associated with this RGBW setting.
308// Controller/channel configuration calls this automatically. It is a no-op
309// for non-colorimetric modes and when FASTLED_RGBW_COLORIMETRIC is disabled.
311
312typedef void (*rgb_2_rgbw_function)(u16 w_color_temperature, u8 r,
313 u8 g, u8 b, u8 r_scale,
314 u8 g_scale, u8 b_scale,
315 u8 *out_r, u8 *out_g,
316 u8 *out_b, u8 *out_w);
317
331void rgb_2_rgbw_exact(u16 w_color_temperature, u8 r, u8 g,
332 u8 b, u8 r_scale, u8 g_scale,
333 u8 b_scale, u8 *out_r, u8 *out_g,
334 u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
335
344void rgb_2_rgbw_max_brightness(u16 w_color_temperature, u8 r,
345 u8 g, u8 b, u8 r_scale,
346 u8 g_scale, u8 b_scale, u8 *out_r,
347 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
348
354void rgb_2_rgbw_null_white_pixel(u16 w_color_temperature, u8 r,
355 u8 g, u8 b, u8 r_scale,
356 u8 g_scale, u8 b_scale,
357 u8 *out_r, u8 *out_g, u8 *out_b,
358 u8 *out_w) FL_NO_EXCEPT;
359
361void rgb_2_rgbw_white_boosted(u16 w_color_temperature, u8 r,
362 u8 g, u8 b, u8 r_scale,
363 u8 g_scale, u8 b_scale, u8 *out_r,
364 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
365
366void rgb_2_rgbw_user_function(u16 w_color_temperature, u8 r,
367 u8 g, u8 b, u8 r_scale,
368 u8 g_scale, u8 b_scale, u8 *out_r,
369 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
370
371// Strict sub-gamut colorimetric solver (gist sec 5, issue #2545). Maps the
372// input through the diode chromaticity model; routes the chromaticity to one
373// of the RGW / RBW / BGW sub-gamuts and solves the 3x3 system. Color-accurate
374// but uses fewer than all 4 channels per pixel. Requires
375// FASTLED_RGBW_COLORIMETRIC; stub falls back to rgb_2_rgbw_exact + warn-once
376// otherwise.
377void rgb_2_rgbw_colorimetric(u16 w_color_temperature, u8 r,
378 u8 g, u8 b, u8 r_scale,
379 u8 g_scale, u8 b_scale, u8 *out_r,
380 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
381void rgb_2_rgbw_colorimetric(const Rgbw& cfg, u8 r,
382 u8 g, u8 b, u8 r_scale,
383 u8 g_scale, u8 b_scale, u8 *out_r,
384 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
385
386// White-overdrive colorimetric solver (wx_lp_legacy from gist sec 9).
387// Closed-form scalar LP: maximize W subject to RGB residual >= 0. Brighter
388// than kRGBWColorimetric for in-gamut targets, same color accuracy. Requires
389// FASTLED_RGBW_COLORIMETRIC; stub falls back to rgb_2_rgbw_exact + warn-once
390// otherwise.
391void rgb_2_rgbw_colorimetric_boosted(u16 w_color_temperature, u8 r,
392 u8 g, u8 b, u8 r_scale,
393 u8 g_scale, u8 b_scale, u8 *out_r,
394 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
395void rgb_2_rgbw_colorimetric_boosted(const Rgbw& cfg, u8 r,
396 u8 g, u8 b, u8 r_scale,
397 u8 g_scale, u8 b_scale, u8 *out_r,
398 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT;
399
401
406rgb_2_rgbw(const Rgbw& cfg, u8 r, u8 g,
407 u8 b, u8 r_scale, u8 g_scale, u8 b_scale,
408 u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT {
409 switch (cfg.rgbw_mode) {
412 rgb_2_rgbw_null_white_pixel(cfg.white_color_temp, r, g, b, r_scale,
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}
445
447rgb_2_rgbw(RGBW_MODE mode, u16 w_color_temperature, u8 r, u8 g,
448 u8 b, u8 r_scale, u8 g_scale, u8 b_scale,
449 u8 *out_r, u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT {
450 // Plain value: this overload converts directly, it must not install the
451 // PixelIterator hook (or pay its call) per pixel (#4795).
453 cfg.white_color_temp = w_color_temperature;
454 cfg.rgbw_mode = mode;
455 rgb_2_rgbw(cfg, r, g, b, r_scale, g_scale, b_scale, out_r, out_g, out_b,
456 out_w);
457}
458
459// @brief Converts RGB to RGBW using one of the functions.
460template <RGBW_MODE MODE>
462rgb_2_rgbw(u16 w_color_temperature, u8 r, u8 g, u8 b,
463 u8 r_scale, u8 g_scale, u8 b_scale, u8 *out_r,
464 u8 *out_g, u8 *out_b, u8 *out_w) FL_NO_EXCEPT {
465 // We trust that the compiler will inline all of this.
466 rgb_2_rgbw(MODE, w_color_temperature, r, g, b, r_scale, g_scale, b_scale,
467 out_r, out_g, out_b, out_w);
468}
469
470// Assuming all RGB pixels are already ordered in native led ordering, then this
471// function will reorder them so that white is also the correct position.
472// b0-b2 are actually rgb that are already in native LED order.
473// and out_b0-out_b3 are the output RGBW in native LED chipset order.
474// w is the white component that needs to be inserted into the RGB data at
475// the correct position.
476void rgbw_partial_reorder(fl::EOrderW w_placement, u8 b0, u8 b1,
477 u8 b2, u8 w, u8 *out_b0,
478 u8 *out_b1, u8 *out_b2, u8 *out_b3) FL_NO_EXCEPT;
479
480} // namespace fl
Rgbw rgbw
#define FASTLED_FORCE_INLINE
#define FL_DEPRECATED(msg)
#define constexpr
Declares that it is possible to evaluate a value at compile time, introduced in C++11.
Definition cpp_compat.h:15
unsigned char u8
Definition stdint.h:131
void(*)(const Rgbw &rgbw, const u8(&raw)[3], const u8(&premix)[3], const u8(&order)[3], u8 *b0, u8 *b1, u8 *b2, u8 *b3) RgbwConvertFn
Per-pixel RGBW conversion: raw source-order RGB + premixed scale -> 4 wire bytes.
Definition rgbw.h:220
void enable_rgbw_conversion() FL_NO_EXCEPT
Installs the RGBW pixel conversion used by PixelIterator.
Definition rgbw.cpp.hpp:732
RgbwConvertFn rgbw_conversion() FL_NO_EXCEPT
Null until enable_rgbw_conversion() has run.
Definition rgbw.cpp.hpp:738
Compile-time linker keep-alive hook for a single fl::Bus.
Definition bus_info.h:57
Tag for constructing an inactive Rgbw without linking the RGBW encoder.
Definition rgbw.h:213
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
unsigned char u8
Definition stdint.h:131
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
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
constexpr unsigned long rgbw_colorimetric_lut_memory_bytes(int grid_n, RgbwLutInterp interp) FL_NO_EXCEPT
Definition rgbw.h:194
@ kRGBWDefaultColorTemp
Definition rgbw.h:206
const DiodeProfile kRgbwDefaultProfile
Definition rgbw.cpp.hpp:39
void rgbw_partial_reorder(EOrderW w_placement, u8 b0, u8 b1, u8 b2, u8 w, u8 *out_b0, u8 *out_b1, u8 *out_b2, u8 *out_b3) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:679
void prepare_rgbw_colorimetric(const Rgbw &) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:626
FASTLED_FORCE_INLINE void 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) FL_NO_EXCEPT
Converts RGB to RGBW using one of the functions.
Definition rgbw.h:406
InputGamut
Definition rgbw.h:80
fl::shared_ptr< const DiodeProfile > make_diode_profile(const DiodeProfile &profile) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:304
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
bool rgbw_colorimetric_lut_enabled() FL_NO_EXCEPT
Definition rgbw.cpp.hpp:634
RgbwLutInterp
Definition rgbw.h:157
void(* rgb_2_rgbw_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.h:312
void disable_rgbw_colorimetric_lut() FL_NO_EXCEPT
Definition rgbw.cpp.hpp:633
const DiodeProfile * get_rgbw_colorimetric_profile() FL_NO_EXCEPT
Definition rgbw.cpp.hpp:210
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
void set_rgbw_colorimetric_profile(const DiodeProfile *profile) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:203
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
RGBW_MODE
Definition rgbw.h:16
@ 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
EOrderW
Definition eorder.h:25
void set_input_gamut(DiodeProfile &profile_ref, InputGamut g, const float *white_xy) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:249
bool enable_rgbw_colorimetric_lut(int, RgbwLutInterp) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:628
void set_rgb_2_rgbw_function(rgb_2_rgbw_function func) FL_NO_EXCEPT
Definition rgbw.cpp.hpp:177
FL_DEPRECATED("Pass the profile by reference: set_input_gamut(profile, g)") void set_input_gamut(DiodeProfile *profile
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
Base definition for an LED controller.
Definition crgb.hpp:179
float input_xy_b[2]
Definition rgbw.h:71
float xy_g[2]
Definition rgbw.h:59
float input_xy_r[2]
Definition rgbw.h:69
float xy_b[2]
Definition rgbw.h:60
float input_xy_g[2]
Definition rgbw.h:70
float input_xy_w[2]
Definition rgbw.h:72
int nominal_cct
Definition rgbw.h:66
float lum_r
Definition rgbw.h:62
float xy_r[2]
Definition rgbw.h:58
float lum_b
Definition rgbw.h:64
float lum_w
Definition rgbw.h:65
float lum_g
Definition rgbw.h:63
float xy_w[2]
Definition rgbw.h:61
#define FL_NO_EXCEPT
Definition rgbw.h:227
Rgbw(u16 white_color_temp, fl::RGBW_MODE rgbw_mode, fl::EOrderW _w_placement, const DiodeProfile &_profile, fl::InputGamut input_gamut) FL_NO_EXCEPT
Definition rgbw.h:237
static u32 size_as_rgb(u32 num_of_rgbw_pixels) FL_NO_EXCEPT
Definition rgbw.h:262
RGBW_MODE rgbw_mode
Definition rgbw.h:252
FASTLED_FORCE_INLINE bool active() const FL_NO_EXCEPT
Definition rgbw.h:258
fl::shared_ptr< const DiodeProfile > profile
Optional override for the diode profile used by colorimetric modes.
Definition rgbw.h:257
Rgbw(detail::RgbwNoEncoder) FL_NO_EXCEPT
Inactive value that does not link the RGBW encoder (RgbwInvalid).
Definition rgbw.h:248
fl::EOrderW w_placement
Definition rgbw.h:251
Rgbw(u16 white_color_temp=fl::kRGBWDefaultColorTemp, fl::RGBW_MODE rgbw_mode=fl::RGBW_MODE::kRGBWExactColors, fl::EOrderW _w_placement=EOrderW::WDefault, fl::shared_ptr< const DiodeProfile > _profile=fl::shared_ptr< const DiodeProfile >()) FL_NO_EXCEPT
Definition rgbw.h:228
u16 white_color_temp
Definition rgbw.h:250
static Rgbw value() FL_NO_EXCEPT
Definition rgbw.h:290
RgbwDefault() FL_NO_EXCEPT
Definition rgbw.h:286
static Rgbw value() FL_NO_EXCEPT
Definition rgbw.h:279
RgbwInvalid() FL_NO_EXCEPT
Definition rgbw.h:275
static Rgbw value() FL_NO_EXCEPT
Definition rgbw.h:301
RgbwWhiteIsOff() FL_NO_EXCEPT
Definition rgbw.h:297