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

◆ blurColumns()

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

Perform a blur1d() on every column 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 112 of file blur.cpp.

113 {
114 // blur columns
115 fl::u8 keep = 255 - blur_amount;
116 fl::u8 seep = blur_amount >> 1;
117 for (fl::u8 col = 0; col < width; ++col) {
118 CRGB carryover = CRGB::Black;
119 for (fl::u8 i = 0; i < height; ++i) {
120 CRGB cur = leds[xyMap.mapToIndex(col, i)];
121 CRGB part = cur;
122 part.nscale8(seep);
123 cur.nscale8(keep);
124 cur += carryover;
125 if (i)
126 leds[xyMap.mapToIndex(col, i - 1)] += part;
127 leds[xyMap.mapToIndex(col, i)] = cur;
128 carryover = part;
129 }
130 }
131}
CRGB leds[NUM_LEDS]
fl::XYMap xyMap
Definition ColorBoost.h:61
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: