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

◆ blurRows()

void fl::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 83 of file blur.cpp.

84 {
85
86 /* for( uint8_t row = 0; row < height; row++) {
87 CRGB* rowbase = leds + (row * width);
88 blur1d( rowbase, width, blur_amount);
89 }
90 */
91 // blur rows same as columns, for irregular matrix
92 uint8_t keep = 255 - blur_amount;
93 uint8_t seep = blur_amount >> 1;
94 for (uint8_t row = 0; row < height; row++) {
95 CRGB carryover = CRGB::Black;
96 for (uint8_t i = 0; i < width; i++) {
97 CRGB cur = leds[xyMap.mapToIndex(i, row)];
98 CRGB part = cur;
99 part.nscale8(seep);
100 cur.nscale8(keep);
101 cur += carryover;
102 if (i)
103 leds[xyMap.mapToIndex(i - 1, row)] += part;
104 leds[xyMap.mapToIndex(i, row)] = cur;
105 carryover = part;
106 }
107 }
108}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
XYMap xyMap(WIDTH, HEIGHT, false)
CRGB & nscale8(uint8_t scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
Definition crgb.cpp:88
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:504
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55

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: