FastLED 3.9.15
Loading...
Searching...
No Matches
fl::CatmullRomPath Class Reference

Detailed Description

Catmull–Rom spline through arbitrary points.

Simply add control points and compute(α) will smoothly interpolate through them.

Definition at line 245 of file xypath_impls.h.

#include <xypath_impls.h>

+ Inheritance diagram for fl::CatmullRomPath:
+ Collaboration diagram for fl::CatmullRomPath:

Public Member Functions

 CatmullRomPath (const fl::shared_ptr< CatmullRomParams > &p=fl::make_shared< CatmullRomParams >())
 
void addPoint (float x, float y)
 Add a point with separate x,y coordinates.
 
void addPoint (vec2f p)
 Add a point in [0,1]² to the path.
 
void clear ()
 Clear all control points.
 
vec2f compute (float alpha) override
 
const string name () const override
 
CatmullRomParamsparams ()
 
const CatmullRomParamsparams () const
 
fl::size size () const
 Get the number of control points.
 
- Public Member Functions inherited from fl::XYPathGenerator
virtual ~XYPathGenerator ()=default
 
virtual bool hasDrawBounds (rect< i16 > *bounds)
 

Private Member Functions

vec2f interpolate (const vec2f &p0, const vec2f &p1, const vec2f &p2, const vec2f &p3, float t) const
 

Private Attributes

fl::shared_ptr< CatmullRomParamsmParams
 

The documentation for this class was generated from the following files: