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

◆ draw()

void fl::WaveFx::draw ( DrawContext context)
inlineoverridevirtual

Render wave to LED array.

Parameters
contextDraw context containing timestamp and LED buffer

Updates the wave simulation (if auto-update enabled) and maps wave values to LED colors using the current color mapper.

Implements fl::Fx.

Definition at line 341 of file wave.h.

341 {
342 // Update the wave simulation.
343 if (mAutoUpdates) {
344 mWaveSim.update();
345 }
346 // Map the wave values to the LEDs.
347 mCrgbMap->mapWaveToLEDs(mXyMap, mWaveSim, context.leds);
348 }
XYMap mXyMap
Definition fx2d.h:30
WaveCrgbMapPtr mCrgbMap
Definition wave.h:377
bool mAutoUpdates
Definition wave.h:378
WaveSimulation2D mWaveSim
Definition wave.h:376

References fl::DrawContext::leds, mAutoUpdates, mCrgbMap, mWaveSim, and fl::Fx2d::mXyMap.