FastLED 3.9.15
Loading...
Searching...
No Matches

◆ draw()

void fl::Animartrix::draw ( DrawContext context)
overridevirtual
Parameters
nowThe current time in milliseconds. Fx writers are encouraged to use this instead of millis() directly as this will more deterministic behavior.

Implements fl::Fx.

Definition at line 268 of file animartrix.hpp.

268 {
269 this->leds = ctx.leds;
270 AnimartrixLoop(*this, ctx.now);
271 if (color_order != RGB) {
272 for (int i = 0; i < mXyMap.getTotal(); ++i) {
273 CRGB &pixel = ctx.leds[i];
274 const uint8_t b0_index = RGB_BYTE0(color_order);
275 const uint8_t b1_index = RGB_BYTE1(color_order);
276 const uint8_t b2_index = RGB_BYTE2(color_order);
277 pixel = CRGB(pixel.raw[b0_index], pixel.raw[b1_index],
278 pixel.raw[b2_index]);
279 }
280
281 }
282 this->leds = nullptr;
283}
friend void AnimartrixLoop(Animartrix &self, uint32_t now)
XYMap mXyMap
Definition fx2d.h:31
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:15
#define RGB_BYTE2(RO)
Gets the color channel for byte 2.
#define RGB_BYTE1(RO)
Gets the color channel for byte 1.
#define RGB_BYTE0(RO)
Gets the color channel for byte 0.

References AnimartrixLoop, color_order, fl::_DrawContext::leds, leds, fl::Fx2d::mXyMap, fl::_DrawContext::now, RGB, RGB_BYTE0, RGB_BYTE1, and RGB_BYTE2.

+ Here is the call graph for this function: