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 277 of file animartrix.hpp.

277 {
278 this->leds = ctx.leds;
279 AnimartrixLoop(*this, ctx.now);
280 if (color_order != RGB) {
281 for (int i = 0; i < mXyMap.getTotal(); ++i) {
282 CRGB &pixel = ctx.leds[i];
283 const uint8_t b0_index = RGB_BYTE0(color_order);
284 const uint8_t b1_index = RGB_BYTE1(color_order);
285 const uint8_t b2_index = RGB_BYTE2(color_order);
286 pixel = CRGB(pixel.raw[b0_index], pixel.raw[b1_index],
287 pixel.raw[b2_index]);
288 }
289
290 }
291 this->leds = nullptr;
292}
friend void AnimartrixLoop(Animartrix &self, fl::u32 now)
XYMap mXyMap
Definition fx2d.h:31
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:14
#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, fl::RGB, RGB_BYTE0, RGB_BYTE1, and RGB_BYTE2.

+ Here is the call graph for this function: