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 46 of file frame.cpp.

46 {
47 const uint16_t width = xyMap.getWidth();
48 const uint16_t height = xyMap.getHeight();
49 uint32_t count = 0;
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++;
54 if (in_idx >= mPixelsCount) {
56 "Frame::drawXY: in index out of range: " << in_idx);
57 continue;
58 }
59 if (out_idx >= mPixelsCount) {
61 "Frame::drawXY: out index out of range: " << out_idx);
62 continue;
63 }
64 switch (draw_mode) {
66 leds[out_idx] = mRgb[in_idx];
67 break;
68 }
70 leds[out_idx] =
71 CRGB::blendAlphaMaxChannel(mRgb[in_idx], leds[in_idx]);
72 break;
73 }
74 }
75 }
76 }
77}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
XYMap xyMap(WIDTH, HEIGHT, false)
fl::scoped_array< CRGB > mRgb
Definition frame.h:44
const size_t mPixelsCount
Definition frame.h:43
uint16_t getWidth() const
Definition xymap.cpp:124
uint16_t getHeight() const
Definition xymap.cpp:126
@ 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: