15 mRgb.resize(pixels_count);
16 if (pixels_count > 0) {
40 if (!other.
mRgb.empty()) {
41 fl::memcpy(mRgb.data(), other.mRgb.data(), mPixelsCount * sizeof(CRGB));
71 for (u16 h = 0; h <
height; ++h) {
72 for (u16 w = 0; w <
width; ++w) {
73 fl::u32 in_idx =
xyMap(w, h);
74 fl::u32 out_idx = count++;
77 "Frame::drawXY: in index out of range: " << in_idx);
82 "Frame::drawXY: out index out of range: " << out_idx);
109 if (frame1.
size() != frame2.
size()) {
113 const CRGB *rgbFirst = frame1.
rgb().data();
114 const CRGB *rgbSecond = frame2.
rgb().data();
116 if (frame1.
mRgb.empty() || frame2.
mRgb.empty()) {
121 for (
size_t i = 0; i < frame2.
size(); ++i) {
122 pixels[i] =
CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
130 FL_DBG(
"Frames must have the same size");
140 return !
mRgb.empty();
149 fl::u8* pixel = &pixels[i * 3];
150 rgbData[i] =
CRGB(pixel[0], pixel[1], pixel[2]);
159 rgbData[i] =
CRGB(r, g, b);
165 fl::u8* pixel = &pixels[i * 4];
166 rgbData[i] =
CRGB(pixel[0], pixel[1], pixel[2]);
fl::vector_psram< CRGB > mRgb
void convertPixelsToRgb(fl::u8 *pixels, PixelFormat format)
void drawXY(fl::span< CRGB > leds, const XYMap &xyMap, DrawMode draw_mode=DrawMode::DRAW_MODE_OVERWRITE) const
void draw(fl::span< CRGB > leds, DrawMode draw_mode=DrawMode::DRAW_MODE_OVERWRITE) const
void interpolate(const Frame &frame1, const Frame &frame2, u8 amountOfFrame2)
const size_t mPixelsCount
Frame(int pixels_per_frame)
Centralized logging categories for FastLED hardware interfaces and subsystems.
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
void rgb565ToRgb888(fl::u16 rgb565, fl::u8 &r, fl::u8 &g, fl::u8 &b)
@ DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS
To bit_cast(const From &from) FL_NOEXCEPT
fl::string format(const char *fmt)
Format with no arguments.
Base definition for an LED controller.
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NOEXCEPT
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower) FL_NOEXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)