MCPcopy Create free account
hub / github.com/FastLED/FastLED / mapWaveToLEDs

Method mapWaveToLEDs

src/fl/fx/2d/wave.cpp.hpp:71–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69} // namespace
70
71void WaveCrgbGradientMap::mapWaveToLEDs(const XYMap &xymap,
72 WaveSimulation2D &waveSim, fl::span<CRGB> leds) {
73 BatchDraw batch(leds, &mGradient);
74 const fl::u32 width = waveSim.getWidth();
75 const fl::u32 height = waveSim.getHeight();
76 for (fl::u32 y = 0; y < height; y++) {
77 for (fl::u32 x = 0; x < width; x++) {
78 fl::u32 idx = xymap(x, y);
79 u8 value8 = waveSim.getu8(x, y);
80 batch.push(idx, value8);
81 }
82 }
83 batch.flush();
84}
85
86} // namespace fl

Callers

nothing calls this directly

Calls 5

getWidthMethod · 0.45
getHeightMethod · 0.45
getu8Method · 0.45
pushMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected