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

◆ toScreenMap()

ScreenMap fl::XYMap::toScreenMap ( ) const

Definition at line 13 of file xymap.cpp.

13 {
14 const u16 length = width * height;
15 ScreenMap out(length);
16 for (u16 w = 0; w < width; w++) {
17 for (u16 h = 0; h < height; h++) {
18 u16 index = mapToIndex(w, h);
19 vec2f p = {static_cast<float>(w), static_cast<float>(h)};
20 out.set(index, p);
21 }
22 }
23 return out;
24}
u16 width
Definition xymap.h:127
u16 mapToIndex(const u16 &x, const u16 &y) const
Definition xymap.cpp:95
u16 height
Definition xymap.h:128
UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)
vec2< float > vec2f
Definition geometry.h:333

References height, length(), mapToIndex(), fl::ScreenMap::set(), and width.

Referenced by CLEDController::setScreenMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: