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

◆ blurColumns()

void fl::blurColumns ( CRGB * leds,
uint8_t width,
uint8_t 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 111 of file blur.cpp.

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