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

42 {
43 const uint16_t width = xyMap.getWidth();
44 const uint16_t height = xyMap.getHeight();
45 fl::u32 count = 0;
46 for (uint16_t h = 0; h < height; ++h) {
47 for (uint16_t w = 0; w < width; ++w) {
48 fl::u32 in_idx = xyMap(w, h);
49 fl::u32 out_idx = count++;
50 if (in_idx >= mPixelsCount) {
52 "Frame::drawXY: in index out of range: " << in_idx);
53 continue;
54 }
55 if (out_idx >= mPixelsCount) {
57 "Frame::drawXY: out index out of range: " << out_idx);
58 continue;
59 }
60 switch (draw_mode) {
62 leds[out_idx] = mRgb[in_idx];
63 break;
64 }
66 leds[out_idx] =
67 CRGB::blendAlphaMaxChannel(mRgb[in_idx], leds[in_idx]);
68 break;
69 }
70 }
71 }
72 }
73}
CRGB leds[NUM_LEDS]
fl::XYMap xyMap
Definition ColorBoost.h:61
fl::vector< CRGB, fl::allocator_psram< CRGB > > mRgb
Definition frame.h:45
const size_t mPixelsCount
Definition frame.h:44
u16 getWidth() const
Definition xymap.cpp:122
u16 getHeight() const
Definition xymap.cpp:124
@ 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:60
#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: