![]() |
FastFX
1.1.0
LED Strip Animation and Effects Framework for Arduino
|
#include <FFXSegment.h>
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 |
FFXBase * | getFX () |
void | setFX (FFXBase *newFX) |
FFXOverlay * | getOverlay () |
void | setOverlay (FFXOverlay *newOvl) |
void | removeOverlay () |
FFXController * | getController () |
bool | isPrimary () |
uint16_t | getStart () |
uint16_t | getEnd () |
uint16_t | getLength () |
uint16_t | getBufferSize () |
FFXFrameProvider * | getFrameProvider () |
bool | isVisible () |
void | setOpacity (uint8_t level) |
uint8_t | getOpacity () |
uint8_t | getCurrentOpacity () |
FFXAFXFader * | getOpacityObj () |
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) |
FFXAFDimmer * | getActiveDimmer () |
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) |
![]() | |
FFXStateObserver () | |
virtual | ~FFXStateObserver () |
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.
FFXSegment::FFXSegment | ( | String | initTag, |
uint16_t | initStartIdx, | ||
uint16_t | initEndIdx, | ||
FFXBase * | initEffect, | ||
CRGB * | initFrame, | ||
FFXController * | parentController | ||
) |
|
virtual |
|
inline |
FFXAFDimmer * FFXSegment::getActiveDimmer | ( | ) |
uint8_t FFXSegment::getBrightness | ( | ) |
|
inline |
|
inline |
uint8_t FFXSegment::getCurrentBrightness | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool FFXSegment::isPrimary | ( | ) |
|
inline |
bool FFXSegment::isUpdated | ( | ) |
bool FFXSegment::isVisible | ( | ) |
|
overridevirtual |
Implements FFXStateObserver.
void FFXSegment::removeDimmer | ( | ) |
void FFXSegment::removeOverlay | ( | ) |
|
inline |
|
inline |
void FFXSegment::setBrightness | ( | uint8_t | newBrightness | ) |
|
inline |
void FFXSegment::setFX | ( | FFXBase * | newFX | ) |
void FFXSegment::setOpacity | ( | uint8_t | level | ) |
|
inline |
void FFXSegment::setOverlay | ( | FFXOverlay * | newOvl | ) |
|
inline |
void FFXSegment::updateFrame | ( | CRGB * | frameBuffer | ) |
void FFXSegment::updateOverlay | ( | CRGB * | frameBuffer | ) |