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 61 of file fx_compositor.h.

61 {
62 if (!mLayers[0]->getFx()) {
63 return;
64 }
65 mLayers[0]->draw(warpedTime);
66 uint8_t progress = mTransition.getProgress(now);
67 if (!progress) {
68 memcpy(finalBuffer, mLayers[0]->getSurface(), sizeof(CRGB) * mNumLeds);
69 return;
70 }
71 mLayers[1]->draw(warpedTime);
72 const CRGB* surface0 = mLayers[0]->getSurface();
73 const CRGB* surface1 = mLayers[1]->getSurface();
74
75 for (uint32_t i = 0; i < mNumLeds; i++) {
76 const CRGB& p0 = surface0[i];
77 const CRGB& p1 = surface1[i];
78 CRGB out = CRGB::blend(p0, p1, progress);
79 finalBuffer[i] = out;
80 }
81 if (progress == 255) {
83 }
84}
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:50

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

+ Here is the call graph for this function: