FastLED 3.10.8
Loading...
Searching...
No Matches

◆ toScreenMap()

ScreenMap fl::XYMap::toScreenMap ( ) const

Definition at line 13 of file xymap.cpp.hpp.

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 // Store a shared_ptr to this XYMap so it can be used for encoding
24 out.setSourceXYMap(fl::make_shared<XYMap>(*this));
25 return out;
26}
u16 mapToIndex(const u16 &x, const u16 &y) const FL_NO_EXCEPT
u16 width
Definition xymap.h:128
u16 height
Definition xymap.h:129
fl::UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
vec2< float > vec2f
Definition geometry.h:333

References fl::FL_NO_EXCEPT, height, length(), fl::adl_barrier::make_shared(), mapToIndex(), fl::ScreenMap::set(), fl::ScreenMap::setSourceXYMap(), and width.

Referenced by operator=().

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