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 244 of file xypath_impls.h.

#include <xypath_impls.h>

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

Public Member Functions

 CatmullRomPath (const Ptr< CatmullRomParams > &p=NewPtr< 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 Str name () const override
 
CatmullRomParamsparams ()
 
const CatmullRomParamsparams () const
 
size_t size () const
 Get the number of control points.
 
- Public Member Functions inherited from fl::XYPathGenerator
virtual bool hasDrawBounds (rect< int > *bounds)
 
- Public Member Functions inherited from fl::Referent
virtual int ref_count () const
 

Private Member Functions

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

Private Attributes

Ptr< CatmullRomParamsmParams
 

Additional Inherited Members

- Protected Member Functions inherited from fl::Referent
 Referent ()
 
 Referent (const Referent &)
 
 Referent (Referent &&)
 
virtual ~Referent ()
 
virtual void destroy () const
 
Referentoperator= (const Referent &)
 
Referentoperator= (Referent &&)
 
virtual void ref () const
 
virtual void unref () const
 

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