23#ifndef FASTLED_FX_ENGINE_MAX_FX
24#define FASTLED_FX_ENGINE_MAX_FX 64
45 FxEngine(uint16_t numLeds,
bool interpolate=
true);
57 int addFx(FxPtr effect);
83 FxPtr
getFx(
int index);
92 bool draw(uint32_t now,
CRGB *outputBuffer);
99 bool nextFx(uint16_t transition_ms = 500);
107 bool setNextFx(
int index, uint16_t duration);
UISlider scale("Scale", 4,.1, 4,.1)
int addFx(FxPtr effect)
Adds a new effect to the engine.
void setSpeed(float scale)
Sets the speed of the fx engine, which will impact the speed of all effects.
~FxEngine()
Destructor for FxEngine.
fl::FixedMap< int, FxPtr, FASTLED_FX_ENGINE_MAX_FX > IntFxMap
bool nextFx(uint16_t transition_ms=500)
Transitions to the next effect in the sequence.
bool mDurationSet
Flag indicating if a new transition has been set.
FxCompositor mCompositor
Handles effect transitions and rendering.
int getCurrentFxId() const
int mCurrId
Id of the current effect.
bool setNextFx(int index, uint16_t duration)
Sets the next effect to transition to.
FxEngine(uint16_t numLeds, bool interpolate=true)
Constructs an FxEngine with the specified number of LEDs.
bool draw(uint32_t now, CRGB *outputBuffer)
Renders the current effect or transition to the output buffer.
IntFxMap mEffects
Collection of effects.
uint16_t mDuration
Duration of the current transition.
FxPtr removeFx(int index)
Requests removal of an effect from the engine, which might not happen immediately (for example the Fx...
FxPtr getFx(int index)
Retrieves an effect from the engine without removing it.
int addFx(Fx &effect)
Adds a new effect to the engine.
static Ptr NoTracking(T &referent)
Defines the red, green, and blue (RGB) pixel struct.
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)