diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-06-07 10:05:09 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-06-07 10:05:09 +0400 |
commit | 14a228f960e7b28653bb13ccf65fa2ca31663157 (patch) | |
tree | 3e7f0ad70b9fcb767ce2a45dc060898016a36670 /controller.h | |
parent | a4323c3d94faafbfa2bfc0d8ec26f40769132e0a (diff) | |
parent | 4ac475b57b12cbb2f5eb48d376e250caeaac28f0 (diff) |
Merge from FastLED2.1
Diffstat (limited to 'controller.h')
-rw-r--r-- | controller.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/controller.h b/controller.h index b9912291..1dbc5751 100644 --- a/controller.h +++ b/controller.h @@ -32,7 +32,7 @@ typedef uint8_t EDitherMode; class CLEDController { protected: friend class CFastLED; - const CRGB *m_Data; + CRGB *m_Data; CLEDController *m_pNext; CRGB m_ColorCorrection; CRGB m_ColorTemperature; @@ -96,7 +96,7 @@ public: } #endif - CLEDController & setLeds(const CRGB *data, int nLeds) { + CLEDController & setLeds(CRGB *data, int nLeds) { m_Data = data; m_nLeds = nLeds; return *this; @@ -108,6 +108,15 @@ public: } } + // How many leds does this controller manage? + int size() { return m_nLeds; } + + // Pointer to the CRGB array for this controller + CRGB* leds() { return m_Data; } + + // Reference to the n'th item in the controller + CRGB &operator[](int x) { return m_Data[x]; } + inline CLEDController & setDither(uint8_t ditherMode = BINARY_DITHER) { m_DitherMode = ditherMode; return *this; } inline uint8_t getDither() { return m_DitherMode; } |