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

◆ draw()

void fl::FxCompositor::draw ( uint32_t now,
uint32_t warpedTime,
CRGB * finalBuffer )
inline

Definition at line 59 of file fx_compositor.h.

60 {
61 if (!mLayers[0]->getFx()) {
62 return;
63 }
64 mLayers[0]->draw(warpedTime);
65 uint8_t progress = mTransition.getProgress(now);
66 if (!progress) {
67 memcpy(finalBuffer, mLayers[0]->getSurface(), sizeof(CRGB) * mNumLeds);
68 return;
69 }
70 mLayers[1]->draw(warpedTime);
71 const CRGB *surface0 = mLayers[0]->getSurface();
72 const CRGB *surface1 = mLayers[1]->getSurface();
73
74 for (uint32_t i = 0; i < mNumLeds; i++) {
75 const CRGB &p0 = surface0[i];
76 const CRGB &p1 = surface1[i];
77 CRGB out = CRGB::blend(p0, p1, progress);
78 finalBuffer[i] = out;
79 }
80 if (progress == 255) {
82 }
83}
FxLayerPtr mLayers[2]
const uint32_t mNumLeds
void completeTransition()
Transition mTransition
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Definition crgb.cpp:54

References CRGB::blend(), completeTransition(), mLayers, mNumLeds, and mTransition.

+ Here is the call graph for this function: