10#include "fx/detail/fx_compositor.h"
11#include "fx/detail/fx_layer.h"
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);
85 int getCurrentFxId()
const {
return mCurrId; }
92 bool draw(uint32_t now,
CRGB *outputBuffer);
99 bool nextFx(uint16_t transition_ms = 500);
107 bool setNextFx(
int index, uint16_t duration);
110 IntFxMap& _getEffects() {
return mEffects; }
116 void setSpeed(
float scale) { mTimeFunction.setScale(scale); }
124 uint16_t mDuration = 0;
125 bool mDurationSet =
false;
126 bool mInterpolate =
true;
Manages and renders multiple visual effects (Fx) for LED strips.
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.
bool nextFx(uint16_t transition_ms=500)
Transitions to the next effect in the sequence.
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.
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.
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)