FastLED 3.10.8
Loading...
Searching...
No Matches

◆ interpolate() [2/2]

void fl::Frame::interpolate ( const Frame & frame1,
const Frame & frame2,
u8 amountofFrame2,
fl::span< CRGB > pixels )
static

Definition at line 105 of file frame.cpp.hpp.

106 {
107 if (frame1.size() != frame2.size()) {
108 return; // Frames must have the same size
109 }
110
111 const CRGB *rgbFirst = frame1.rgb().data();
112 const CRGB *rgbSecond = frame2.rgb().data();
113
114 if (frame1.mRgb.empty() || frame2.mRgb.empty()) {
115 // Error, why are we getting null pointers?
116 return;
117 }
118
119 for (size_t i = 0; i < frame2.size(); ++i) {
120 pixels[i] = CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
121 }
122 // We will eventually do something with alpha.
123}
fl::CRGB CRGB
Definition video.h:18
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NO_EXCEPT
Definition crgb.cpp.hpp:55

References Frame(), fl::CRGB::blend(), and fl::FL_NO_EXCEPT.

+ Here is the call graph for this function: