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

◆ mapWaveToLEDs()

void fl::WaveCrgbGradientMap::mapWaveToLEDs ( const XYMap & xymap,
WaveSimulation2D & waveSim,
CRGB * leds )
overridevirtual

Implements fl::WaveCrgbMap.

Definition at line 49 of file wave.cpp.

50 {
51 BatchDraw batch(leds, &mGradient);
52 const fl::u32 width = waveSim.getWidth();
53 const fl::u32 height = waveSim.getHeight();
54 for (fl::u32 y = 0; y < height; y++) {
55 for (fl::u32 x = 0; x < width; x++) {
56 fl::u32 idx = xymap(x, y);
57 uint8_t value8 = waveSim.getu8(x, y);
58 batch.push(idx, value8);
59 }
60 }
61 batch.flush();
62}
CRGB leds[NUM_LEDS]
int y
Definition simple.h:93
int x
Definition simple.h:92
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
Gradient mGradient
Definition wave.h:60
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)

References leds, mGradient, waveSim(), x, xymap, and y.

+ Here is the call graph for this function: