FastLED 3.9.7
Loading...
Searching...
No Matches
cled_controller.cpp
Go to the documentation of this file.
1
3
4#define FASTLED_INTERNAL
5#include "FastLED.h"
6
7#include "cled_controller.h"
8
10
11CLEDController::~CLEDController() = default;
12
14CLEDController::CLEDController() : m_Data(NULL), m_ColorCorrection(UncorrectedColor), m_ColorTemperature(UncorrectedTemperature), m_DitherMode(BINARY_DITHER), m_nLeds(0) {
15 m_pNext = NULL;
16 if(m_pHead==NULL) { m_pHead = this; }
17 if(m_pTail != NULL) { m_pTail->m_pNext = this; }
18 m_pTail = this;
19}
20
21
22
24 if(m_Data) {
25 nLeds = (nLeds < 0) ? m_nLeds : nLeds;
26 nLeds = (nLeds > m_nLeds) ? m_nLeds : nLeds;
27 memset((void*)m_Data, 0, sizeof(struct CRGB) * nLeds);
28 }
29
30}
31
32ColorAdjustment CLEDController::getAdjustmentData(uint8_t brightness) {
33 // *premixed = getAdjustment(brightness);
34 // if (color_correction) {
35 // *color_correction = getAdjustment(255);
36 // }
37 #if FASTLED_HD_COLOR_MIXING
38 ColorAdjustment out = {this->getAdjustment(brightness), this->getAdjustment(255), brightness};
39 #else
40 ColorAdjustment out = {getAdjustment(brightness)};
41 #endif
42 return out;
43}
44
45
47
48
central include file for FastLED, defines the CFastLED class/object
CRGB * m_Data
pointer to the LED data used by this controller
CLEDController()
Create an led controller object, add it to the chain of controllers.
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 clearLedDataInternal(int nLeds=-1)
Zero out the LED data managed by this controller.
CRGB getAdjustment(uint8_t scale)
Get the combined brightness/color adjustment for this controller.
static CLEDController * m_pHead
pointer to the first LED controller in the linked list
base definitions used by led controllers for writing out led data
#define BINARY_DITHER
Enable dithering using binary dithering (only option)
Definition dither_mode.h:13
@ UncorrectedTemperature
Uncorrected temperature (0xFFFFFF)
Definition color.h:94
@ UncorrectedColor
Uncorrected color (0xFFFFFF)
Definition color.h:28
#define FASTLED_NAMESPACE_END
End of the FastLED namespace.
Definition namespace.h:16
#define FASTLED_NAMESPACE_BEGIN
Start of the FastLED namespace.
Definition namespace.h:14
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54