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

◆ blurColumns()

void 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 510 of file colorutils.cpp.

511{
512 // blur columns
513 uint8_t keep = 255 - blur_amount;
514 uint8_t seep = blur_amount >> 1;
515 for( uint8_t col = 0; col < width; ++col) {
516 CRGB carryover = CRGB::Black;
517 for( uint8_t i = 0; i < height; ++i) {
518 CRGB cur = leds[xyMap.mapToIndex(col,i)];
519 CRGB part = cur;
520 part.nscale8( seep);
521 cur.nscale8( keep);
522 cur += carryover;
523 if( i) leds[xyMap.mapToIndex(col,i-1)] += part;
524 leds[xyMap.mapToIndex(col,i)] = cur;
525 carryover = part;
526 }
527 }
528}
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: