FastLED 3.9.15
Loading...
Searching...
No Matches
cpixel_ledcontroller.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "led_sysdefs.h"
7#include "pixeltypes.h"
8#include "color.h"
9#include "eorder.h"
10
12#include "fl/stl/int.h"
13#include "pixel_controller.h"
14#include "cled_controller.h"
15
16
17
22template<EOrder RGB_ORDER, int LANES=1, fl::u32 MASK=0xFFFFFFFF> class CPixelLEDController : public CLEDController {
23protected:
28
33 virtual void showColor(const CRGB& data, int nLeds, fl::u8 brightness) override {
34 // CRGB premixed, color_correction;
35 // getAdjustmentData(brightness, &premixed, &color_correction);
36 // ColorAdjustment color_adjustment = {premixed, color_correction, brightness};
38 PixelController<RGB_ORDER, LANES, MASK> pixels(data, nLeds, color_adjustment, getDither());
39 showPixels(pixels);
40 }
41
46 virtual void show(const CRGB *data, int nLeds, fl::u8 brightness) override {
48 PixelController<RGB_ORDER, LANES, MASK> pixels(data, nLeds < 0 ? -nLeds : nLeds, color_adjustment, getDither());
49 if(nLeds < 0) {
50 // nLeds < 0 implies that we want to show them in reverse
51 pixels.mAdvance = -pixels.mAdvance;
52 }
53 showPixels(pixels);
54 }
55
56public:
58 static const int LANES_VALUE = LANES;
59 static const fl::u32 MASK_VALUE = MASK;
61
65
68 int lanes() override { return LANES; }
69};
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
#define RGB_ORDER
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels)=0
Send the LED data to the strip.
int lanes() override
Get the number of lanes of the Controller.
static const fl::u32 MASK_VALUE
The mask for the lanes for this controller.
static const EOrder RGB_ORDER_VALUE
The RGB ordering for this controller.
static const int LANES_VALUE
The number of lanes for this controller.
virtual void show(const CRGB *data, int nLeds, fl::u8 brightness) override
Write the passed in RGB data out to the LEDs managed by this controller.
CPixelLEDController(RegistrationMode mode)
Protected constructor with registration mode.
virtual void showColor(const CRGB &data, int nLeds, fl::u8 brightness) override
Set all the LEDs on the controller to a given color.
fl::u8 getDither() FL_NOEXCEPT
Get the dithering option currently set for this controller.
RegistrationMode
Registration mode for constructor.
CLEDController(RegistrationMode mode) FL_NOEXCEPT
Protected constructor with registration mode.
ColorAdjustment getAdjustmentData(fl::u8 brightness) FL_NOEXCEPT
base definitions used by led controllers for writing out led data
fl::EOrder EOrder
Definition eorder.h:12
Defines color channel ordering enumerations.
fl::CRGB CRGB
Definition crgb.h:25
Determines which platform system definitions to include.
unsigned char u8
Definition stdint.h:131
Low level pixel data writing class.
Includes defintions for RGB and HSV pixels.
Contains definitions for color correction and temperature.
Color adjustment structure for pixel output.
fl::i8 mAdvance
how many bytes to advance the pointer by each time. For CRGB this is 3.
Pixel controller class.