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

◆ blurRows()

void blurRows ( CRGB * leds,
uint8_t width,
uint8_t height,
fract8 blur_amount,
const fl::XYMap & xymap )

Perform a blur1d() on every row of a rectangular matrix.

See also
blur1d()
Parameters
ledsa pointer to the LED array to blur
widththe width of the matrix
heightthe height of the matrix
blur_amountthe amount of blur to apply

Definition at line 483 of file colorutils.cpp.

484{
485
486/* for( uint8_t row = 0; row < height; row++) {
487 CRGB* rowbase = leds + (row * width);
488 blur1d( rowbase, width, blur_amount);
489 }
490*/
491 // blur rows same as columns, for irregular matrix
492 uint8_t keep = 255 - blur_amount;
493 uint8_t seep = blur_amount >> 1;
494 for( uint8_t row = 0; row < height; row++) {
495 CRGB carryover = CRGB::Black;
496 for( uint8_t i = 0; i < width; i++) {
497 CRGB cur = leds[xyMap.mapToIndex(i,row)];
498 CRGB part = cur;
499 part.nscale8( seep);
500 cur.nscale8( keep);
501 cur += carryover;
502 if( i) leds[xyMap.mapToIndex(i-1,row)] += part;
503 leds[xyMap.mapToIndex(i,row)] = cur;
504 carryover = part;
505 }
506 }
507}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
XYMap xyMap(HEIGHT, WIDTH, SERPENTINE)
CRGB & nscale8(uint8_t scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
Definition crgb.cpp:72
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:499
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

References CRGB::Black, leds, CRGB::nscale8(), and xyMap.

Referenced by blur2d().

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