FastLED 3.9.15
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 107 of file frame.cpp.hpp.

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

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

+ Here is the call graph for this function: