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 uint32_t width = waveSim.getWidth();
53 const uint32_t height = waveSim.getHeight();
54 for (uint32_t y = 0; y < height; y++) {
55 for (uint32_t x = 0; x < width; x++) {
56 uint32_t 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]
Definition Apa102.ino:11
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)
Gradient mGradient
Definition wave.h:57

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