13#include "fl/force_inline.h"
17#include "fl/engine_events.h"
18#include "fl/screenmap.h"
19#include "fl/virtual_if_not_avr.h"
43 bool m_enabled =
true;
53 virtual void showColor(
const CRGB & data,
int nLeds, uint8_t brightness) = 0;
59 virtual void show(
const struct CRGB *data,
int nLeds, uint8_t brightness) = 0;
63 Rgbw mRgbMode = RgbwInvalid::value();
71 void setEnabled(
bool enabled) { m_enabled = enabled; }
74 #if defined(FASTLED_TESTING)
91 Rgbw getRgbw()
const {
return mRgbMode; }
106 VIRTUAL_IF_NOT_AVR
void showLeds(uint8_t brightness) {
107 void* data = beginShowLeds();
123 show(data, nLeds,brightness);
205 fl::EngineEvents::onCanvasUiSet(
this, screenmap);
210 fl::EngineEvents::onCanvasUiSet(
this, map);
215 return setScreenMap(fl::XYMap::constructRectangularGrid(width, height));
222 virtual void* beginShowLeds() {
236 void* out =
reinterpret_cast<void*
>(d);
239 virtual void endShowLeds(
void* data) {
243 uintptr_t d =
reinterpret_cast<uintptr_t
>(data);
central include file for FastLED, defines the CFastLED class/object
High level controller interface for FastLED.
Base definition for an LED controller.
CLEDController & setTemperature(ColorTemperature temperature)
Set the color temperature, aka white point, for this controller.
CRGB getCorrection()
Get the correction value used by this controller.
CLEDController * next()
Get the next controller in the linked list after this one.
CLEDController & setDither(uint8_t ditherMode=BINARY_DITHER)
Set the dithering mode for this controller to use.
virtual int lanes()
How many Lanes does this controller manage?
virtual uint16_t getMaxRefreshRate() const
Gets the maximum possible refresh rate of the strip.
CRGB * m_Data
pointer to the LED data used by this controller
CRGB & operator[](int x)
Reference to the n'th LED managed by the controller.
CRGB m_ColorCorrection
CRGB object representing the color correction to apply to the strip on show()
virtual int size()
How many LEDs does this controller manage?
uint8_t getDither()
Get the dithering option currently set for this controller.
CLEDController & setLeds(CRGB *data, int nLeds)
Set the default array of LEDs to be used by this controller.
VIRTUAL_IF_NOT_AVR void clearLeds(int nLeds=-1)
Clear out/zero out the given number of LEDs.
CLEDController & setCorrection(CRGB correction)
The color corrction to use for this controller, expressed as a CRGB object.
static CLEDController * head()
Get the first LED controller in the linked list of controllers.
CLEDController()
Create an led controller object, add it to the chain of controllers.
EDitherMode m_DitherMode
the current dither mode of the controller
CLEDController & setTemperature(CRGB temperature)
Set the color temperature, aka white point, for this controller.
CRGB * leds()
Pointer to the CRGB array for this controller.
CLEDController * m_pNext
pointer to the next LED controller in the linked list
int m_nLeds
the number of LEDs in the LED data array
static CLEDController * m_pTail
pointer to the last LED controller in the linked list
void showInternal(const struct CRGB *data, int nLeds, uint8_t brightness)
void showColorInternal(const struct CRGB &data, int nLeds, uint8_t brightness)
void showLedsInternal(uint8_t brightness)
Write the data to the LEDs managed by this controller.
void clearLedDataInternal(int nLeds=-1)
Zero out the LED data managed by this controller.
CLEDController & setCorrection(LEDColorCorrection correction)
The color corrction to use for this controller, expressed as a CRGB object.
CRGB m_ColorTemperature
CRGB object representing the color temperature to apply to the strip on show()
void showColorInternal(const struct CRGB &data, uint8_t brightness)
virtual void showColor(const CRGB &data, int nLeds, uint8_t brightness)=0
Set all the LEDs to a given color.
CRGB getAdjustment(uint8_t scale)
Get the combined brightness/color adjustment for this controller.
virtual void init()=0
Initialize the LED controller.
static CLEDController * m_pHead
pointer to the first LED controller in the linked list
virtual void show(const struct CRGB *data, int nLeds, uint8_t brightness)=0
Write the passed in RGB data out to the LEDs managed by this controller.
CRGB getTemperature()
Get the color temperature, aka whipe point, for this controller.
Declares dithering options and types.
uint8_t EDitherMode
The dither setting, either DISABLE_DITHER or BINARY_DITHER.
#define BINARY_DITHER
Enable dithering using binary dithering (only option)
ColorTemperature
Color temperature values.
LEDColorCorrection
Color correction starting points.
Determines which platform system definitions to include.
#define FASTLED_NAMESPACE_END
End of the FastLED namespace.
#define FASTLED_NAMESPACE_BEGIN
Start of the FastLED namespace.
Low level pixel data writing class.
Non-templated low level pixel data writing class.
Includes defintions for RGB and HSV pixels.
Contains definitions for color correction and temperature.
Representation of an RGB pixel (Red, Green, Blue)
static CRGB computeAdjustment(uint8_t scale, const CRGB &colorCorrection, const CRGB &colorTemperature)
Calculates the combined color adjustment to the LEDs at a given scale, color correction,...