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

◆ interpolate() [2/2]

void fl::Frame::interpolate ( const Frame & frame1,
const Frame & frame2,
uint8_t amountofFrame2,
CRGB * pixels )
static

Definition at line 81 of file frame.cpp.

82 {
83 if (frame1.size() != frame2.size()) {
84 return; // Frames must have the same size
85 }
86
87 const CRGB *rgbFirst = frame1.rgb();
88 const CRGB *rgbSecond = frame2.rgb();
89
90 if (!rgbFirst || !rgbSecond) {
91 // Error, why are we getting null pointers?
92 return;
93 }
94
95 for (size_t i = 0; i < frame2.size(); ++i) {
96 pixels[i] = CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
97 }
98 // We will eventually do something with alpha.
99}
size_t size() const
Definition frame.h:31
CRGB * rgb()
Definition frame.h:29
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Definition crgb.cpp:54

References Frame(), CRGB::blend(), rgb(), and size().

+ Here is the call graph for this function: