FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ interpolate() [2/2]

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

Definition at line 78 of file frame.cpp.

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

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

+ Here is the call graph for this function: