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

◆ make_path()

fl::shared_ptr< fl::CatmullRomParams > anonymous_namespace{xypaths.cpp}::make_path ( int width,
int height )

Definition at line 11 of file xypaths.cpp.

11 {
12 // make a triangle.
15 points.push_back(fl::vec2f(0.0f, 0.0f));
16 points.push_back(fl::vec2f(width / 3, height / 2));
17 points.push_back(fl::vec2f(width - 3, height - 1));
18 points.push_back(fl::vec2f(0.0f, height - 1));
19 points.push_back(fl::vec2f(0.0f, 0.0f));
20 for (auto &p : points) {
21 p.x = fl::map_range<float, float>(p.x, 0.0f, width - 1, -1.0f, 1.0f);
22 p.y = fl::map_range<float, float>(p.y, 0.0f, height - 1, -1.0f, 1.0f);
23 params->addPoint(p);
24 }
25 return params;
26 }
void push_back(const T &value) FL_NOEXCEPT
Definition vector.h:624
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max) FL_NOEXCEPT
Definition math.h:174
vec2< float > vec2f
Definition geometry.h:333
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414
VectorN< T, INLINED_SIZE > vector_inlined
Definition vector.h:1133

References fl::make_shared(), fl::map_range(), and fl::vector< T >::push_back().

Referenced by CreateXYPaths().

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