15 mRgb.resize(pixels_count);
16 if (pixels_count > 0) {
40 if (!other.mRgb.empty()) {
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++;
76 FL_WARN(
"Frame::drawXY: in index out of range: " << in_idx);
80 FL_WARN(
"Frame::drawXY: out index out of range: " << out_idx);
107 if (frame1.size() != frame2.size()) {
111 const CRGB *rgbFirst = frame1.rgb().data();
112 const CRGB *rgbSecond = frame2.rgb().data();
114 if (frame1.mRgb.empty() || frame2.mRgb.empty()) {
119 for (
size_t i = 0; i < frame2.size(); ++i) {
120 pixels[i] =
CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
127 if (frame1.size() != frame2.size() || frame1.size() !=
mPixelsCount) {
128 FL_DBG(
"Frames must have the same size");
138 return !
mRgb.empty();
147 fl::u8* pixel = &pixels[i * 3];
148 rgbData[i] =
CRGB(pixel[0], pixel[1], pixel[2]);
157 rgbData[i] =
CRGB(r,
g, b);
163 fl::u8* pixel = &pixels[i * 4];
164 rgbData[i] =
CRGB(pixel[0], pixel[1], pixel[2]);
Frame(int pixels_per_frame) FL_NO_EXCEPT
void interpolate(const Frame &frame1, const Frame &frame2, u8 amountOfFrame2) FL_NO_EXCEPT
bool isValid() const FL_NO_EXCEPT
fl::vector_psram< CRGB > mRgb
void convertPixelsToRgb(fl::u8 *pixels, PixelFormat format) FL_NO_EXCEPT
void drawXY(fl::span< CRGB > leds, const XYMap &xyMap, DrawMode draw_mode=DrawMode::DRAW_MODE_OVERWRITE) const FL_NO_EXCEPT
void clear() FL_NO_EXCEPT
const size_t mPixelsCount
void draw(fl::span< CRGB > leds, DrawMode draw_mode=DrawMode::DRAW_MODE_OVERWRITE) const FL_NO_EXCEPT
fl::span< CRGB > rgb() FL_NO_EXCEPT
Centralized logging categories for FastLED hardware interfaces and subsystems.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
fl::string format(const char *fmt) FL_NO_EXCEPT
Format with no arguments.
FASTLED_FORCE_INLINE void * memset(void *s, int c, size_t n) FL_NO_EXCEPT
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
void rgb565ToRgb888(fl::u16 rgb565, fl::u8 &r, fl::u8 &g, fl::u8 &b) FL_NO_EXCEPT
@ DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS
To bit_cast(const From &from) FL_NO_EXCEPT
Base definition for an LED controller.
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower) FL_NO_EXCEPT
static CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NO_EXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)