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

◆ mapWaveToLEDs()

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

Implements fl::WaveCrgbMap.

Definition at line 49 of file wave.h.

49 {
50 const uint32_t width = waveSim.getWidth();
51 const uint32_t height = waveSim.getHeight();
52 for (uint32_t y = 0; y < height; y++) {
53 for (uint32_t x = 0; x < width; x++) {
54 uint32_t idx = xymap(x, y);
55 uint8_t value8 = waveSim.getu8(x, y);
56 leds[idx] = ColorFromPalette(mPalette, value8);
57 }
58 }
59 }
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)
CRGBPalette16 mPalette
Definition wave.h:62
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
Get a color from a palette.

References ColorFromPalette(), leds, mPalette, waveSim, x, xymap, and y.

+ Here is the call graph for this function: