19 static void loadAndScaleRGBW(
void* pixel_controller,
Rgbw rgbw, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* b3_out) {
20 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
21 pc->loadAndScaleRGBW(rgbw, b0_out, b1_out, b2_out, b3_out);
24 static void loadAndScaleRGB(
void* pixel_controller, uint8_t* r_out, uint8_t* g_out, uint8_t* b_out) {
25 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
26 pc->loadAndScaleRGB(r_out, g_out, b_out);
29 static void loadAndScale_APA102_HD(
void* pixel_controller, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* brightness_out) {
30 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
31 pc->loadAndScale_APA102_HD(b0_out, b1_out, b2_out, brightness_out);
34 static void stepDithering(
void* pixel_controller) {
35 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
39 static void advanceData(
void* pixel_controller) {
40 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
44 static int size(
void* pixel_controller) {
45 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
48 static bool has(
void* pixel_controller,
int n) {
49 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
54 #if FASTLED_HD_COLOR_MIXING
55 static void getHdScale(
void* pixel_controller, uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness) {
56 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
57 pc->getHdScale(c0, c1, c2, brightness);
62typedef void (*loadAndScaleRGBWFunction)(
void* pixel_controller,
Rgbw rgbw, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* b3_out);
63typedef void (*loadAndScaleRGBFunction)(
void* pixel_controller, uint8_t* r_out, uint8_t* g_out, uint8_t* b_out);
64typedef void (*loadAndScale_APA102_HDFunction)(
void* pixel_controller, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* brightness_out);
70typedef void (*getHdScaleFunction)(
void* pixel_controller, uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness);
78 template<
typename PixelControllerT>
80 : mPixelController(pc), mRgbw(rgbw) {
106 mLoadAndScaleRGBW = &Vtable::loadAndScaleRGBW;
107 mLoadAndScaleRGB = &Vtable::loadAndScaleRGB;
108 mLoadAndScale_APA102_HD = &Vtable::loadAndScale_APA102_HD;
109 mStepDithering = &Vtable::stepDithering;
110 mAdvanceData = &Vtable::advanceData;
111 mSize = &Vtable::size;
113 #if FASTLED_HD_COLOR_MIXING
114 mGetHdScale = &Vtable::getHdScale;
118 bool has(
int n) {
return mHas(mPixelController, n); }
119 void loadAndScaleRGBW(uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *w_out) {
120 mLoadAndScaleRGBW(mPixelController, mRgbw, b0_out, b1_out, b2_out, w_out);
122 void loadAndScaleRGB(uint8_t *r_out, uint8_t *g_out, uint8_t *b_out) {
123 mLoadAndScaleRGB(mPixelController, r_out, g_out, b_out);
125 void loadAndScale_APA102_HD(uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *brightness_out) {
126 mLoadAndScale_APA102_HD(mPixelController, b0_out, b1_out, b2_out, brightness_out);
128 void stepDithering() { mStepDithering(mPixelController); }
129 void advanceData() { mAdvanceData(mPixelController); }
130 int size() {
return mSize(mPixelController); }
132 void set_rgbw(
Rgbw rgbw) { mRgbw = rgbw; }
133 Rgbw get_rgbw()
const {
return mRgbw; }
135 #if FASTLED_HD_COLOR_MIXING
136 void getHdScale(uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness) {
137 mGetHdScale(mPixelController, c0, c1, c2, brightness);
143 void* mPixelController =
nullptr;
145 loadAndScaleRGBWFunction mLoadAndScaleRGBW =
nullptr;
146 loadAndScaleRGBFunction mLoadAndScaleRGB =
nullptr;
147 loadAndScale_APA102_HDFunction mLoadAndScale_APA102_HD =
nullptr;
148 stepDitheringFunction mStepDithering =
nullptr;
149 advanceDataFunction mAdvanceData =
nullptr;
150 sizeFunction mSize =
nullptr;
151 hasFunction mHas =
nullptr;
152 #if FASTLED_HD_COLOR_MIXING
153 getHdScaleFunction mGetHdScale =
nullptr;