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