|
| FFXBase (uint16_t initSize, unsigned long initInterval, unsigned long minRefresh, unsigned long maxRefresh) |
|
| FFXBase (uint16_t initSize, unsigned long initInterval) |
|
| FFXBase (uint16_t initSize, uint8_t initSpeed, unsigned long minRefresh, unsigned long maxRefresh) |
|
| FFXBase (uint16_t initSize, uint8_t initSpeed) |
|
| FFXBase (uint16_t initSize) |
|
void | initialize (uint16_t initSize) |
|
String | getFXName () |
|
uint8_t | getFXID () |
|
virtual void | setInterval (unsigned long newInterval) override |
|
virtual void | setColor (CRGB newColor) |
|
MovementType | getMovement () |
|
FFXBase::MovementType | getCurrMovement (uint16_t cycle) |
|
void | setMovement (MovementType newMovement) |
|
FFXColor & | getFXColor () |
|
CRGB | getColor () |
|
void | setFXColor (FFXColor &newColor) |
|
uint16_t | mirror (uint16_t index) |
|
void | rotateForward (CRGB *bufLeds, uint16_t steps) |
|
void | rotateBackward (CRGB *bufLeds, uint16_t steps) |
|
uint16_t | addOffsetWithWrap (uint16_t index, uint16_t offset) |
|
uint16_t | subtractOffsetWithWrap (uint16_t index, uint16_t offset) |
|
uint16_t | getNextPhase () |
|
uint16_t | getNextVPhase () |
|
uint16_t | getPrevPhase () |
|
uint16_t | getPrevVphase () |
|
uint16_t | getCurrPhase () |
|
uint16_t | getCurrVPhase () |
|
unsigned long | getCurrCycle () |
|
unsigned long | getCurrVCycle () |
|
uint16_t | getMovementPhase () |
|
uint16_t | getMovementVPhase () |
|
uint16_t | getNumLeds () |
|
uint16_t | getVCycleRange () |
|
uint16_t | setVCycleRange (uint16_t newRange) |
|
virtual int | timingDelta (uint8_t phase, unsigned long sourceMillis) |
|
int | timingDelta (unsigned long sourceMillis) |
|
virtual void | onEachSecond (unsigned long secsRunning) |
|
virtual void | onCycleStart (CRGB *currFrame) |
|
virtual void | onCycleEnd (CRGB *currFrame) |
|
virtual void | whileFrozen (CRGB *currFrame) |
|
virtual void | onVCycleStart (CRGB *currFrame) |
|
virtual void | onVCycleEnd (CRGB *currFrame) |
|
virtual void | onBrightness (uint8_t newBrightness) |
|
virtual void | initLeds (CRGB *bufLeds) |
|
virtual void | writeNextFrame (CRGB *frameBuffer)=0 |
|
void | vCycleStart (CRGB *currFrame) |
|
void | vCycleEnd (CRGB *currFrame) |
|
void | cycleStart (CRGB *currFrame) |
|
void | cycleEnd (CRGB *currFrame) |
|
void | freeze () |
|
void | unFreeze () |
|
bool | isFrozen () |
|
void | update (CRGB *frameBuffer) |
|
boolean | isUpdated () |
|
void | setUpdated (boolean newValue) |
|
| FFXStateNotifier () |
|
virtual | ~FFXStateNotifier () |
|
void | addObserver (FFXStateObserver *obs) |
|
void | notify (String source, String attribute, String value) |
|
| FlexTimer (unsigned long minInterval, unsigned long maxInterval, unsigned long initInterval, boolean initStart) |
|
| FlexTimer (unsigned long initInterval, boolean initStart) |
|
| FlexTimer (unsigned long initInterval) |
|
| FlexTimer (unsigned long minInterval, unsigned long maxInterval, bool initStart, uint8_t initSpeed) |
|
virtual void | onStart (unsigned long currMillis) override |
|
virtual void | onStep (unsigned long currMillis) override |
|
void | setStartExpired (boolean newVal) |
|
boolean | getStartExpired () |
|
unsigned long | getRangeMin () |
|
unsigned long | getRangeMax () |
|
void | setRange (unsigned long minInterval, unsigned long maxInterval) |
|
virtual void | setSpeed (uint8_t newSpeed) |
|
virtual uint8_t | getSpeed () |
|
void | addDelta (long delta) |
|
virtual unsigned long | getLastUp () override |
|
unsigned long | getCurrInterval () |
|
unsigned long | getSteps () |
|
| StepTimer () |
|
| StepTimer (unsigned long initInterval, boolean startImmediate) |
|
| StepTimer (unsigned long initInterval) |
|
virtual | ~StepTimer () |
|
void | start () |
|
void | start (unsigned long currMillis) |
|
void | step () |
|
void | step (unsigned long currMillis) |
|
void | stop () |
|
bool | isStarted () |
|
bool | isUp (unsigned long currMillis) |
|
bool | isUp () |
|
unsigned long | nextUp () |
|
unsigned long | timeRemaining (unsigned long currMillis) |
|
unsigned long | timeRemaining () |
|
unsigned long | getRollovers () |
|
unsigned long | timeSinceStarted (unsigned long currMillis) |
|
unsigned long | timeSinceStarted () |
|
unsigned long | timeSinceTriggered (unsigned long currMillis) |
|
unsigned long | timeSinceTriggered () |
|
virtual void | setIntervalImmediate (unsigned long newInterval) |
|
unsigned long | getInterval () |
|
|
static String | movementTypeStr (MovementType mvt) |
|
static String | fadeMethodStr (FadeType value) |
|
static uint8_t | alphaBlend (uint8_t a, uint8_t b, uint8_t alpha) |
|
static CRGB | alphaBlend (CRGB &a, CRGB &b, uint8_t alpha, FadeType ftUp=LINEAR, FadeType ftDown=LINEAR) |
|
static void | alphaBlend (CRGB *a, CRGB *b, CRGB *dest, uint16_t num, uint8_t alpha, FadeType ftUp=LINEAR, FadeType ftDown=LINEAR) |
|
static uint16_t | mirror (uint16_t index, uint16_t range) |
|
static void | rotateBufferForwardWithWrap (CRGB *source, CRGB *dest, uint8_t numLeds, uint8_t steps) |
|
static void | rotateBufferBackwardWithWrap (CRGB *source, CRGB *dest, uint16_t numLeds, uint16_t steps) |
|
static uint8_t | intervalToSpeed (unsigned long intv, unsigned long rMin, unsigned long rMax) |
|
static unsigned long | speedToInterval (uint8_t speed, unsigned long rMin, unsigned long rMax) |
|
static unsigned long | addOffsetWithWrap (unsigned long index, unsigned long offset, unsigned long maximum) |
|
static unsigned long | addOffsetWithWrap (unsigned long index, unsigned long offset) |
|
static unsigned long | subtractOffsetWithWrap (unsigned long index, unsigned long offset, unsigned long maximum) |
|
FFXBase - Base class for all LED Strip animation effects.
All static and animated effects should inherit from this class. The 2 key functions to override/implement in descendant classes are:
initLeds( CRGB *buffer ) writeNextFrame( CRGB *buffer )
Most effects can be written by simply overriding one or both of the above methods (see FXCoreEffects.h for examples).
FFXBase is a descendent of the FlexTimer class which allows for setting the speed/timing of the animation. FXBase also inherits from FXStateNotifier, which provides a means for sending state notification changes to any descendant of the FXStateObserver class (defined here as well). FXSegment, which is the "container" for all FXBase objects, is a descendent of FXStateObserver, so changes to timing or other state info can be pushed back to the "parent" segment.
Phase/Cycle - Each effect has a phase and a cycle, the cycle is one complete iteration from 1 to numLeds - the phase being the current index of that iteration.
VPhase/VCycle - We can also define a "virtual" phase and cycle which allows have a cycle that is larger or smaller than the number of LEDs on a strip. A larger VCycle is useful if we want to do additional things at either end of a cycle (i.e. where an animation will scroll off the end of the strip without wrapping around immediately. A smaller VCycle can be used if an animation needs fewer phases to complete (ex: quickly switching between to colors, jiggling back and forth, etc.) A VCycle is established by calling setVCycleRange()
MovementType is defined here, then used by descendant classes to determine the type of movement for a given effect.
FFXBase also provides several "utility" methods for performing common operations used in animated effects:
Rotate pixels within a CRGB Buffer, wrapping around at the ends: rotateBufferForwardwithWrap( ... ) rotateBufferBackwardWithWrap( ... )
Calculate the "mirror" image position of a given pixel (i.e. same distance from center, on the other side):
mirror( uint16_t position )
Several virtual methods are provided, which can be overriden in descendent classes
onEachSecond(unsigned long) // called for each elapsed second while effect is running (udpate() called within a loop) onCycleStart() onCycleEnd() onVCycleStart() onVCycleEnd() onBrightness() // called when brightness is changed (by FXXSegment) whileFrozen() // called each time update() is called while effect is "Frozen"/paused