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

◆ stepDithering()

template<EOrder RGB_ORDER, int LANES = 1, fl::u32 MASK = 0xFFFFFFFF>
FASTLED_FORCE_INLINE void PixelController< RGB_ORDER, LANES, MASK >::stepDithering ( )
inline

Step the dithering forward - creates triangular wave that toggles between pixels.

Note
If updating here, be sure to update the asm version in clockless_avr.h!

Definition at line 398 of file pixel_controller.h.

398 {
399 // Toggles d between two values: if d=2 and e=5, becomes 3, then back to 2, etc.
400 // This spreads dithering spatially along the strip, preventing visible patterns
401 d[0] = e[0] - d[0];
402 d[1] = e[1] - d[1];
403 d[2] = e[2] - d[2];
404 }
fl::u8 e[3]
[DITHER] Max dither range per R,G,B channel (inversely proportional to brightness)
fl::u8 d[3]
[DITHER] Current dither offset per R,G,B channel (toggles via stepDithering)

References d, e, and FASTLED_FORCE_INLINE.

Referenced by DMXSerialController< RGB_ORDER >::showPixels(), DMXSimpleController< DATA_PIN, RGB_ORDER >::showPixels(), HD108Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >::showPixels(), LPD6803Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >::showPixels(), P9813Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >::showPixels(), RGBWEmulatedController< CONTROLLER, RGB_ORDER >::showPixels(), APA102Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED, GAMMA_CORRECTION_MODE, START_FRAME, END_FRAME >::showPixelsDefault(), stepAdvanceAndLoadAndScale0(), stepAdvanceAndLoadAndScale0(), stepAdvanceAndLoadAndScale0(), and REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writePixels().

+ Here is the caller graph for this function: