63 const u8 threshold = kTemporalDitherThresholds[phase];
64 for (
int i = 0; i < 3; ++i) {
68 for (
int i = 0; i < 3; ++i) {
77#if !FL_PLATFORM_HAS_TINY_MEMORY
84 for (
int i = 0; i < 3; ++i) {
94 u8* b1_out,
u8* b2_out,
108 const u8 threshold = kTemporalDitherThresholds[phase];
109 for (
int i = 0; i < 4; ++i)
112 for (
int i = 0; i < 4; ++i) codes[i] =
quantize(drives[i]);
115 codes[
mSlot2], codes[3], b0_out, b1_out,
120 u8* b1_out,
u8* b2_out,
125 mController.loadAndScaleRGBWW(rgbww, b0_out, b1_out, b2_out,
136 const u8 threshold = kTemporalDitherThresholds[phase];
137 for (
int i = 0; i < 5; ++i)
140 for (
int i = 0; i < 5; ++i) codes[i] =
quantize(drives[i]);
143 codes[
mSlot2], codes[3], codes[4], b0_out,
144 b1_out, b2_out, b3_out, b4_out);
147#if FASTLED_HD_COLOR_MIXING
151void ColorManagedPixelSource::loadRGBScaleAndBrightness(
173 if (drive >= 65536) {
180 const u32 exact =
static_cast<u32
>(drive) * 255u;
181 const u32 base = exact >> 16;
182 const u32 fraction = exact & 0xFFFFu;
184 base + (fraction > (
static_cast<u32
>(threshold) << 8) ? 1u : 0u);
185 return static_cast<u8>(code > 255u ? 255u : code);
192 if (drive >= 65536) {
195 return static_cast<u8>((
static_cast<i32
>(drive) * 255 + 32768) >> 16);
198#if !FL_PLATFORM_HAS_TINY_MEMORY
203 if (drive >= 65536) {
209 return static_cast<u16
>(
210 (
static_cast<i64>(drive) * 65535 + 32768) >> 16);
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
CLEDController * controller
void loadAndScaleRGB(u8 *b0_out, u8 *b1_out, u8 *b2_out) FL_NO_EXCEPT
The colour-managed path.
void loadAndScaleRGBW(const Rgbw &rgbw, u8 *b0_out, u8 *b1_out, u8 *b2_out, u8 *b3_out) FL_NO_EXCEPT
Physical RGBW solve when a matching profile is bound; otherwise the legacy RGB-to-RGBW conversion.
StreamingPipelineQ16 & mPipeline
bool temporalDitherEnabled() const FL_NO_EXCEPT
True when the channel asked for dither this frame.
ColorManagedPixelSource(PixelController< RGB > &controller, EOrder order, ColorPipelineFrameRef pipeline, u8 dither_phase) FL_NO_EXCEPT
dither_phase is where this frame sits in the temporal-dither cycle.
void setFlux(u8 brightness) FL_NO_EXCEPT
Frame-local brightness is applied to the source's owned pipeline on shared tiers; only managed iterat...
static u8 quantize(i32 drive) FL_NO_EXCEPT
s16.16 drive to an 8-bit code, rounding to nearest.
static u16 quantize16(i32 drive) FL_NO_EXCEPT
quantize onto the 16-bit wire.
void loadAndScaleRGB16(u16 *b0_out, u16 *b1_out, u16 *b2_out) FL_NO_EXCEPT
The same pixel, quantized once to 16 bits instead of to 8 (P8, #4042).
PixelController< RGB > & mController
void loadAndScaleRGBWW(Rgbww rgbww, u8 *b0_out, u8 *b1_out, u8 *b2_out, u8 *b3_out, u8 *b4_out) FL_NO_EXCEPT
Physical two-white solve when a matching RGBWW profile is bound; otherwise the legacy conversion.
static u8 quantizeDithered(i32 drive, u8 threshold) FL_NO_EXCEPT
quantize with the pipeline's temporal dither (P8, C5): floor(x) or floor(x) + 1 of the exact code x,...
static FluxScalar fromBrightness(u8 brightness) FL_NO_EXCEPT
setBrightness(b) as the linear flux scalar b/255.
A linear flux scalar in s16.16.
Shared temporal-dither phase tracking.
constexpr u8 kTemporalDitherThresholds[8]
u8 ditherFrame() FL_NO_EXCEPT
Return the temporal-dither phase shared by all controllers in this frame.
void rgbww_partial_reorder(EOrderWW ww_placement, u8 b0, u8 b1, u8 b2, u8 ww, u8 wc, u8 *out_b0, u8 *out_b1, u8 *out_b2, u8 *out_b3, u8 *out_b4) FL_NO_EXCEPT
Dispatch RGB->RGBWW for a given mode.
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)
void setPipelineFluxQ16(StreamingPipelineQ16 *pipeline, FluxScalar flux) FL_NO_EXCEPT
Set the composed brightness-and-power scalar for the frames that follow.
InputGamut g FL_NO_EXCEPT
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
void processPixelWideQ16(const StreamingPipelineQ16 &pipeline, u8 r, u8 g, u8 b, i32(&drives)[5]) FL_NO_EXCEPT
Like processPixelQ16, but solves the physical 4/5-emitter hull.
StreamingPipelineQ16 & ColorPipelineFrameRef
void processPixelQ16(const StreamingPipelineQ16 &pipeline, u8 r, u8 g, u8 b, i32(&drives)[3]) FL_NO_EXCEPT
One pixel: an RGB8 code triple to three physical emitter drives in s16.16.
Base definition for an LED controller.
#define RGB_BYTE2(RO)
Gets the color channel for byte 2.
#define RGB_BYTE1(RO)
Gets the color channel for byte 1.
#define RGB_BYTE0(RO)
Gets the color channel for byte 0.
#define FL_PLATFORM_HAS_TINY_MEMORY
Per-strip RGBWW configuration.