MCPcopy Create free account
hub / github.com/FastLED/FastLED / interpolate

Method interpolate

src/fl/fx/frame.cpp.hpp:107–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void Frame::interpolate(const Frame &frame1, const Frame &frame2,
108 u8 amountofFrame2, fl::span<CRGB> pixels) {
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}
126
127void Frame::interpolate(const Frame &frame1, const Frame &frame2,
128 u8 amountOfFrame2) {

Callers

nothing calls this directly

Calls 6

rgbClass · 0.85
blendFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45
rgbMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected