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

◆ toScreenMap()

ScreenMap fl::XYMap::toScreenMap ( ) const

Definition at line 15 of file xymap.cpp.

15 {
16 const uint16_t length = width * height;
17 ScreenMap out(length);
18 for (uint16_t w = 0; w < width; w++) {
19 for (uint16_t h = 0; h < height; h++) {
20 uint16_t index = mapToIndex(w, h);
21 vec2f p = {static_cast<float>(w), static_cast<float>(h)};
22 out.set(index, p);
23 }
24 }
25 return out;
26}
uint16_t width
Definition xymap.h:121
uint16_t height
Definition xymap.h:122
uint16_t mapToIndex(const uint16_t &x, const uint16_t &y) const
Definition xymap.cpp:97
vec2< float > vec2f
Definition geometry.h:151
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:30