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

◆ blurRows()

void fl::blurRows ( CRGB * leds,
fl::u8 width,
fl::u8 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 85 of file blur.cpp.

86 {
87
88 /* for( fl::u8 row = 0; row < height; row++) {
89 CRGB* rowbase = leds + (row * width);
90 blur1d( rowbase, width, blur_amount);
91 }
92 */
93 // blur rows same as columns, for irregular matrix
94 fl::u8 keep = 255 - blur_amount;
95 fl::u8 seep = blur_amount >> 1;
96 for (fl::u8 row = 0; row < height; row++) {
97 CRGB carryover = CRGB::Black;
98 for (fl::u8 i = 0; i < width; i++) {
99 CRGB cur = leds[xyMap.mapToIndex(i, row)];
100 CRGB part = cur;
101 part.nscale8(seep);
102 cur.nscale8(keep);
103 cur += carryover;
104 if (i)
105 leds[xyMap.mapToIndex(i - 1, row)] += part;
106 leds[xyMap.mapToIndex(i, row)] = cur;
107 carryover = part;
108 }
109 }
110}
CRGB leds[NUM_LEDS]
fl::XYMap xyMap
Definition ColorBoost.h:57
unsigned char u8
Definition int.h:17
CRGB & nscale8(fl::u8 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>
Definition crgb.h:567
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

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: