17 static void loadAndScaleRGBW(
void* pixel_controller,
Rgbw rgbw, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* b3_out) {
18 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
19 pc->loadAndScaleRGBW(rgbw, b0_out, b1_out, b2_out, b3_out);
22 static void loadAndScaleRGB(
void* pixel_controller, uint8_t* r_out, uint8_t* g_out, uint8_t* b_out) {
23 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
24 pc->loadAndScaleRGB(r_out, g_out, b_out);
27 static void loadAndScale_APA102_HD(
void* pixel_controller, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* brightness_out) {
28 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
29 pc->loadAndScale_APA102_HD(b0_out, b1_out, b2_out, brightness_out);
32 static void stepDithering(
void* pixel_controller) {
33 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
37 static void advanceData(
void* pixel_controller) {
38 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
42 static int size(
void* pixel_controller) {
43 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
46 static bool has(
void* pixel_controller,
int n) {
47 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
52 #if FASTLED_HD_COLOR_MIXING
53 static void getHdScale(
void* pixel_controller, uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness) {
54 PixelControllerT* pc =
static_cast<PixelControllerT*
>(pixel_controller);
55 pc->getHdScale(c0, c1, c2, brightness);
60typedef void (*loadAndScaleRGBWFunction)(
void* pixel_controller,
Rgbw rgbw, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* b3_out);
61typedef void (*loadAndScaleRGBFunction)(
void* pixel_controller, uint8_t* r_out, uint8_t* g_out, uint8_t* b_out);
62typedef void (*loadAndScale_APA102_HDFunction)(
void* pixel_controller, uint8_t* b0_out, uint8_t* b1_out, uint8_t* b2_out, uint8_t* brightness_out);
68typedef void (*getHdScaleFunction)(
void* pixel_controller, uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness);
76 template<
typename PixelControllerT>
78 : mPixelController(pc), mRgbw(rgbw) {
104 mLoadAndScaleRGBW = &Vtable::loadAndScaleRGBW;
105 mLoadAndScaleRGB = &Vtable::loadAndScaleRGB;
106 mLoadAndScale_APA102_HD = &Vtable::loadAndScale_APA102_HD;
107 mStepDithering = &Vtable::stepDithering;
108 mAdvanceData = &Vtable::advanceData;
109 mSize = &Vtable::size;
111 #if FASTLED_HD_COLOR_MIXING
112 mGetHdScale = &Vtable::getHdScale;
116 bool has(
int n) {
return mHas(mPixelController, n); }
117 void loadAndScaleRGBW(uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *w_out) {
118 mLoadAndScaleRGBW(mPixelController, mRgbw, b0_out, b1_out, b2_out, w_out);
120 void loadAndScaleRGB(uint8_t *r_out, uint8_t *g_out, uint8_t *b_out) {
121 mLoadAndScaleRGB(mPixelController, r_out, g_out, b_out);
123 void loadAndScale_APA102_HD(uint8_t *b0_out, uint8_t *b1_out, uint8_t *b2_out, uint8_t *brightness_out) {
124 mLoadAndScale_APA102_HD(mPixelController, b0_out, b1_out, b2_out, brightness_out);
126 void stepDithering() { mStepDithering(mPixelController); }
127 void advanceData() { mAdvanceData(mPixelController); }
128 int size() {
return mSize(mPixelController); }
130 void set_rgbw(
Rgbw rgbw) { mRgbw = rgbw; }
131 Rgbw get_rgbw()
const {
return mRgbw; }
133 #if FASTLED_HD_COLOR_MIXING
134 void getHdScale(uint8_t* c0, uint8_t* c1, uint8_t* c2, uint8_t* brightness) {
135 mGetHdScale(mPixelController, c0, c1, c2, brightness);
141 void* mPixelController =
nullptr;
143 loadAndScaleRGBWFunction mLoadAndScaleRGBW =
nullptr;
144 loadAndScaleRGBFunction mLoadAndScaleRGB =
nullptr;
145 loadAndScale_APA102_HDFunction mLoadAndScale_APA102_HD =
nullptr;
146 stepDitheringFunction mStepDithering =
nullptr;
147 advanceDataFunction mAdvanceData =
nullptr;
148 sizeFunction mSize =
nullptr;
149 hasFunction mHas =
nullptr;
150 #if FASTLED_HD_COLOR_MIXING
151 getHdScaleFunction mGetHdScale =
nullptr;