FastLED 3.9.3
|
Manages and renders multiple visual effects (Fx) for LED strips.
The FxEngine class is responsible for:
Definition at line 37 of file fx_engine.h.
#include <fx_engine.h>
Public Types | |
typedef FixedMap< int, FxRef, FASTLED_FX_ENGINE_MAX_FX > | IntFxMap |
Public Member Functions | |
FxEngine (uint16_t numLeds) | |
Constructs an FxEngine with the specified number of LEDs. | |
~FxEngine () | |
Destructor for FxEngine. | |
int | addFx (FxRef effect) |
Adds a new effect to the engine. | |
int | addVideo (Video video, XYMap xymap) |
Adds a new video effect to the engine. | |
int | addFx (Fx &effect) |
Adds a new effect to the engine. | |
FxRef | removeFx (int index) |
Requests removal of an effect from the engine, which might not happen immediately (for example the Fx needs to finish a transition). | |
FxRef | getFx (int index) |
Retrieves an effect from the engine without removing it. | |
int | getCurrentFxId () const |
bool | draw (uint32_t now, CRGB *outputBuffer) |
Renders the current effect or transition to the output buffer. | |
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. | |
IntFxMap & | _getEffects () |
void | setTimeScale (float timeScale) |
Sets the time scale for the TimeWarp object. | |
typedef FixedMap<int, FxRef, FASTLED_FX_ENGINE_MAX_FX> FxEngine::IntFxMap |
Definition at line 39 of file fx_engine.h.
|
inline |
Constructs an FxEngine with the specified number of LEDs.
numLeds | The number of LEDs in the strip. |
Definition at line 136 of file fx_engine.h.
|
inline |
Destructor for FxEngine.
Definition at line 143 of file fx_engine.h.
|
inline |
Definition at line 117 of file fx_engine.h.
|
inline |
Adds a new effect to the engine.
Allocate from static memory. This is not reference tracked and an object passed in must never be deleted, as the engine will use a non tracking Ref which may outlive a call to removeFx() and the engine will thefore not know that an object has been deleted. But if it's a static object that's then the object probably wasn't going to be deleted anyway.
Definition at line 75 of file fx_engine.h.
|
inline |
Adds a new effect to the engine.
effect | Pointer to the effect to be added. |
Definition at line 145 of file fx_engine.h.
Adds a new video effect to the engine.
video | The video to be added. |
xymap | The XYMap to be added. |
Definition at line 158 of file fx_engine.h.
|
inline |
Renders the current effect or transition to the output buffer.
now | The current time in milliseconds. |
outputBuffer | The buffer to render the effect into. |
Definition at line 213 of file fx_engine.h.
|
inline |
Definition at line 92 of file fx_engine.h.
|
inline |
Retrieves an effect from the engine without removing it.
index | The id of the effect to retrieve. |
Definition at line 204 of file fx_engine.h.
|
inline |
Transitions to the next effect in the sequence.
duration | The duration of the transition in milliseconds. |
Definition at line 164 of file fx_engine.h.
|
inline |
Requests removal of an effect from the engine, which might not happen immediately (for example the Fx needs to finish a transition).
index | The index of the effect to remove. |
Definition at line 183 of file fx_engine.h.
|
inline |
Sets the next effect to transition to.
index | The index of the effect to transition to. |
duration | The duration of the transition in milliseconds. |
Definition at line 173 of file fx_engine.h.
|
inline |
Sets the time scale for the TimeWarp object.
timeScale | The new time scale value. |
Definition at line 123 of file fx_engine.h.