FastFX  1.1.0
LED Strip Animation and Effects Framework for Arduino
FFXSegment Class Reference

#include <FFXSegment.h>

+ Inheritance diagram for FFXSegment:

Public Member Functions

 FFXSegment (String initTag, uint16_t initStartIdx, uint16_t initEndIdx, FFXBase *initEffect, CRGB *initFrame, FFXController *parentController)
 
virtual ~FFXSegment ()
 
virtual void onNotify (String source, String attribute, String value) override
 
FFXBasegetFX ()
 
void setFX (FFXBase *newFX)
 
FFXOverlaygetOverlay ()
 
void setOverlay (FFXOverlay *newOvl)
 
void removeOverlay ()
 
FFXControllergetController ()
 
bool isPrimary ()
 
uint16_t getStart ()
 
uint16_t getEnd ()
 
uint16_t getLength ()
 
uint16_t getBufferSize ()
 
FFXFrameProvidergetFrameProvider ()
 
bool isVisible ()
 
void setOpacity (uint8_t level)
 
uint8_t getOpacity ()
 
uint8_t getCurrentOpacity ()
 
FFXAFXFadergetOpacityObj ()
 
void setOpacityInterval (unsigned long newInterval)
 
bool isUpdated ()
 
void updateFrame (CRGB *frameBuffer)
 
void updateOverlay (CRGB *frameBuffer)
 
bool hasDimmer ()
 
void removeDimmer ()
 
void setBrightness (uint8_t newBrightness)
 
void setBrightnessInterval (unsigned long newInterval)
 
FFXAFDimmergetActiveDimmer ()
 
uint8_t getBrightness ()
 
uint8_t getCurrentBrightness ()
 
String getTag ()
 
void setTag (String newTag)
 
boolean isStateChanged ()
 
void resetStateChanged ()
 
boolean sameAs (FFXSegment &target)
 
boolean compareTag (const String &comp)
 
- Public Member Functions inherited from FFXStateObserver
 FFXStateObserver ()
 
virtual ~FFXStateObserver ()
 

Detailed Description

FFXSegment - Class for housing multiple effects in a single pixel array. Each segment contains a FXFrameProvider to handle updating the range of pixels it "contains" as well as both a local and global FX dimmer to manage brightness.

An FFXController will always have at least 1 segment - the Primary segment. This represents the entire array and is always considered to be visible. Subsequent segments are defined "over" this segment and may be 0-100% transparent. Each non-primary segment has an opacity controller, which sets the level of opacity/transparency. At opacity level of 0, the primary segment shows through 100%. At opacity 255, the segment shows at 100% and the underlying portion of the primary segment is not visible at all. The primary segment has no opacity control and calls to setOpacity() do nothing, while calls to getOpacity() always return 255.

Each segment may or may not have a brightness controller (dimmer). The primary segment will always have a brighness controller. Additional segments will "inherit" the brightness of the primary segment until a call to setBrightness() overrides this behavior. At that point, the segment has its own brightness controller and will remain independent from the primary segment's brightness. A subsequent call to removeDimmer() will remove the segments dimmer and revert back to using the brightness of the primary controller.

Constructor & Destructor Documentation

◆ FFXSegment()

FFXSegment::FFXSegment ( String  initTag,
uint16_t  initStartIdx,
uint16_t  initEndIdx,
FFXBase initEffect,
CRGB *  initFrame,
FFXController parentController 
)

◆ ~FFXSegment()

FFXSegment::~FFXSegment ( )
virtual

Member Function Documentation

◆ compareTag()

boolean FFXSegment::compareTag ( const String &  comp)
inline

◆ getActiveDimmer()

FFXAFDimmer * FFXSegment::getActiveDimmer ( )

◆ getBrightness()

uint8_t FFXSegment::getBrightness ( )

◆ getBufferSize()

uint16_t FFXSegment::getBufferSize ( )
inline

◆ getController()

FFXController* FFXSegment::getController ( )
inline

◆ getCurrentBrightness()

uint8_t FFXSegment::getCurrentBrightness ( )

◆ getCurrentOpacity()

uint8_t FFXSegment::getCurrentOpacity ( )
inline

◆ getEnd()

uint16_t FFXSegment::getEnd ( )
inline

◆ getFrameProvider()

FFXFrameProvider* FFXSegment::getFrameProvider ( )
inline

◆ getFX()

FFXBase* FFXSegment::getFX ( )
inline

◆ getLength()

uint16_t FFXSegment::getLength ( )
inline

◆ getOpacity()

uint8_t FFXSegment::getOpacity ( )
inline

◆ getOpacityObj()

FFXAFXFader* FFXSegment::getOpacityObj ( )
inline

◆ getOverlay()

FFXOverlay* FFXSegment::getOverlay ( )
inline

◆ getStart()

uint16_t FFXSegment::getStart ( )
inline

◆ getTag()

String FFXSegment::getTag ( )
inline

◆ hasDimmer()

bool FFXSegment::hasDimmer ( )
inline

◆ isPrimary()

bool FFXSegment::isPrimary ( )

◆ isStateChanged()

boolean FFXSegment::isStateChanged ( )
inline

◆ isUpdated()

bool FFXSegment::isUpdated ( )

◆ isVisible()

bool FFXSegment::isVisible ( )

◆ onNotify()

void FFXSegment::onNotify ( String  source,
String  attribute,
String  value 
)
overridevirtual

Implements FFXStateObserver.

◆ removeDimmer()

void FFXSegment::removeDimmer ( )

◆ removeOverlay()

void FFXSegment::removeOverlay ( )

◆ resetStateChanged()

void FFXSegment::resetStateChanged ( )
inline

◆ sameAs()

boolean FFXSegment::sameAs ( FFXSegment target)
inline

◆ setBrightness()

void FFXSegment::setBrightness ( uint8_t  newBrightness)

◆ setBrightnessInterval()

void FFXSegment::setBrightnessInterval ( unsigned long  newInterval)
inline

◆ setFX()

void FFXSegment::setFX ( FFXBase newFX)

◆ setOpacity()

void FFXSegment::setOpacity ( uint8_t  level)

◆ setOpacityInterval()

void FFXSegment::setOpacityInterval ( unsigned long  newInterval)
inline

◆ setOverlay()

void FFXSegment::setOverlay ( FFXOverlay newOvl)

◆ setTag()

void FFXSegment::setTag ( String  newTag)
inline

◆ updateFrame()

void FFXSegment::updateFrame ( CRGB *  frameBuffer)

◆ updateOverlay()

void FFXSegment::updateOverlay ( CRGB *  frameBuffer)