FastLED 3.9.15
Loading...
Searching...
No Matches

◆ drawXY()

void fl::Frame::drawXY ( CRGB * leds,
const XYMap & xyMap,
DrawMode draw_mode = DRAW_MODE_OVERWRITE ) const

Definition at line 43 of file frame.cpp.

43 {
44 const uint16_t width = xyMap.getWidth();
45 const uint16_t height = xyMap.getHeight();
46 uint32_t count = 0;
47 for (uint16_t h = 0; h < height; ++h) {
48 for (uint16_t w = 0; w < width; ++w) {
49 uint32_t in_idx = xyMap(w, h);
50 uint32_t out_idx = count++;
51 if (in_idx >= mPixelsCount) {
53 "Frame::drawXY: in index out of range: " << in_idx);
54 continue;
55 }
56 if (out_idx >= mPixelsCount) {
58 "Frame::drawXY: out index out of range: " << out_idx);
59 continue;
60 }
61 switch (draw_mode) {
63 leds[out_idx] = mRgb[in_idx];
64 break;
65 }
67 leds[out_idx] =
68 CRGB::blendAlphaMaxChannel(mRgb[in_idx], leds[in_idx]);
69 break;
70 }
71 }
72 }
73 }
74}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
fl::vector< CRGB, fl::allocator_psram< CRGB > > mRgb
Definition frame.h:45
const size_t mPixelsCount
Definition frame.h:44
uint16_t getWidth() const
Definition xymap.cpp:124
uint16_t getHeight() const
Definition xymap.cpp:126
XYMap xyMap
Definition gfx.cpp:8
@ DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS
Definition draw_mode.h:5
@ DRAW_MODE_OVERWRITE
Definition draw_mode.h:5
static CRGB blendAlphaMaxChannel(const CRGB &upper, const CRGB &lower)
Definition crgb.cpp:59
#define FASTLED_WARN
Definition warn.h:7

References CRGB::blendAlphaMaxChannel(), fl::DRAW_MODE_BLEND_BY_MAX_BRIGHTNESS, fl::DRAW_MODE_OVERWRITE, FASTLED_WARN, leds, mPixelsCount, mRgb, and xyMap.

+ Here is the call graph for this function: