One-dimensional blur filter.
Spreads light to 2 line neighbors.
- 0 = no spread at all
- 64 = moderate spreading
- 172 = maximum smooth, even spreading
- 173..255 = wider spreading, but increasing flicker
Total light is NOT entirely conserved, so many repeated calls to 'blur' will also result in the light fading, eventually all the way to black; this is by design so that it can be used to (slowly) clear the LEDs to black.
- Parameters
-
leds | a pointer to the LED array to blur |
numLeds | the number of LEDs to blur |
blur_amount | the amount of blur to apply |
Definition at line 454 of file colorutils.cpp.
455{
456 uint8_t keep = 255 - blur_amount;
457 uint8_t seep = blur_amount >> 1;
459 for( uint16_t i = 0; i < numLeds; ++i) {
464 cur += carryover;
465 if( i)
leds[i-1] += part;
467 carryover = part;
468 }
469}
CRGB & nscale8(uint8_t scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Representation of an RGB pixel (Red, Green, Blue)
References CRGB::Black, leds, and CRGB::nscale8().
Referenced by loop().