20 memset(
mRgb.get(), 0, pixels_count *
sizeof(
CRGB));
47 const uint16_t width =
xyMap.getWidth();
48 const uint16_t height =
xyMap.getHeight();
50 for (uint16_t h = 0; h < height; ++h) {
51 for (uint16_t w = 0; w < width; ++w) {
52 uint32_t in_idx =
xyMap(w, h);
53 uint32_t out_idx = count++;
55 FASTLED_WARN(
"Frame::drawXY: in index out of range: " << in_idx);
59 FASTLED_WARN(
"Frame::drawXY: out index out of range: " << out_idx);
79 uint8_t amountofFrame2,
CRGB *pixels) {
80 if (frame1.
size() != frame2.
size()) {
84 const CRGB *rgbFirst = frame1.
rgb();
85 const CRGB *rgbSecond = frame2.
rgb();
87 if (!rgbFirst || !rgbSecond) {
92 for (
size_t i = 0; i < frame2.
size(); ++i) {
93 pixels[i] =
CRGB::blend(rgbFirst[i], rgbSecond[i], amountofFrame2);
99 uint8_t amountOfFrame2) {
XYMap xyMap(HEIGHT, WIDTH, SERPENTINE)
void draw(CRGB *leds, DrawMode draw_mode=DRAW_MODE_OVERWRITE) const
fl::scoped_array< 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.
@ DRAW_MODE_BLEND_BY_BLACK
void LargeBlockDeallocate(void *ptr)
void * LargeBlockAllocate(size_t size, bool zero)
Implements a simple red square effect for 2D LED grids.
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)