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

◆ make_path()

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

Definition at line 13 of file xypaths.cpp.

13 {
14 // make a triangle.
17 points.push_back(vec2f(0.0f, 0.0f));
18 points.push_back(vec2f(width / 3, height / 2));
19 points.push_back(vec2f(width - 3, height - 1));
20 points.push_back(vec2f(0.0f, height - 1));
21 points.push_back(vec2f(0.0f, 0.0f));
22 for (auto &p : points) {
23 p.x = map_range<float, float>(p.x, 0.0f, width - 1, -1.0f, 1.0f);
24 p.y = map_range<float, float>(p.y, 0.0f, height - 1, -1.0f, 1.0f);
25 params->addPoint(p);
26 }
27 return params;
28 }
void push_back(const T &value)
Definition vector.h:919
Definition ptr.h:118
InlinedVector< T, INLINED_SIZE > vector_inlined
Definition vector.h:1034
vec2< float > vec2f
Definition geometry.h:151
Ptr< T > NewPtr(Args... args)
Definition ptr.h:451
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max)
Definition map_range.h:26
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:30

References fl::map_range(), fl::NewPtr(), p, and fl::InlinedVector< T, INLINED_SIZE >::push_back().

Referenced by CreateXYPaths().

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