17 mRgb.resize(pixels_count);
43 const uint16_t width =
xyMap.getWidth();
44 const uint16_t height =
xyMap.getHeight();
46 for (uint16_t h = 0; h < height; ++h) {
47 for (uint16_t w = 0; w < width; ++w) {
48 fl::u32 in_idx =
xyMap(w, h);
49 fl::u32 out_idx = count++;
52 "Frame::drawXY: in index out of range: " << in_idx);
57 "Frame::drawXY: out index out of range: " << out_idx);
78 uint8_t amountofFrame2,
CRGB *pixels) {
79 if (frame1.
size() != frame2.
size()) {
83 const CRGB *rgbFirst = frame1.
rgb();
84 const CRGB *rgbSecond = frame2.
rgb();
86 if (frame1.
mRgb.empty() || frame2.
mRgb.empty()) {
91 for (
size_t i = 0; i < frame2.
size(); ++i) {
92 pixels[i] =
CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
98 uint8_t amountOfFrame2) {
void draw(CRGB *leds, DrawMode draw_mode=DRAW_MODE_OVERWRITE) const
fl::vector< CRGB, fl::allocator_psram< CRGB > > mRgb
void interpolate(const Frame &frame1, const Frame &frame2, uint8_t amountOfFrame2)
const size_t mPixelsCount
Frame(int pixels_per_frame)
void drawXY(CRGB *leds, const XYMap &xyMap, DrawMode draw_mode=DRAW_MODE_OVERWRITE) const
Defines the red, green, and blue (RGB) pixel struct.
Implements the FastLED namespace macros.
void * memfill(void *ptr, int value, fl::size num)
@ DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower)
Representation of an RGB pixel (Red, Green, Blue)