|
FastLED 3.10.8
|
Fx2dTo1d samples a 2D effect into a 1D LED strip using a ScreenMap.
This class wraps any Fx2d effect and samples it into a 1D LED strip based on a ScreenMap that defines the coordinate mapping. This is useful for creating effects like sampling a circle from a rectangular grid, or any other arbitrary path through 2D space.
Example usage:
Definition at line 37 of file fx2d_to_1d.h.
#include <fx2d_to_1d.h>
Inheritance diagram for fl::Fx2dTo1d:
Collaboration diagram for fl::Fx2dTo1d:Public Types | |
| enum | InterpolationMode { NEAREST = int(SampleMode::SAMPLE_NEAREST) , BILINEAR = int(SampleMode::SAMPLE_BILINEAR) } |
| Interpolation mode for sampling the 2D grid. More... | |
Public Types inherited from fl::Fx | |
| using | DrawContext = ::fl::DrawContext |
Public Member Functions | |
| Fx2dTo1d (u16 numLeds, Fx2dPtr fx2d, const ScreenMap &screenMap, InterpolationMode mode=BILINEAR) FL_NO_EXCEPT | |
| Construct a 2D-to-1D sampling effect. | |
| void | draw (DrawContext context) FL_NO_EXCEPT override |
| fl::string | fxName () const FL_NO_EXCEPT override |
| Fx2dPtr | getFx2d () const FL_NO_EXCEPT |
| Get the underlying 2D effect. | |
| bool | hasFixedFrameRate (float *fps) const FL_NO_EXCEPT override |
| void | pause (u32 now) FL_NO_EXCEPT override |
| void | resume (u32 now) FL_NO_EXCEPT override |
| void | setFx2d (Fx2dPtr fx2d) FL_NO_EXCEPT |
| Replace the underlying 2D effect. | |
| void | setInterpolationMode (InterpolationMode mode) FL_NO_EXCEPT |
| Set the interpolation mode. | |
| void | setScreenMap (const ScreenMap &screenMap) FL_NO_EXCEPT |
| Set the screen map for coordinate mapping. | |
Public Member Functions inherited from fl::Fx1d | |
| Fx1d (u16 numLeds) FL_NO_EXCEPT | |
| void | setXmap (const XMap &xMap) FL_NO_EXCEPT |
| u16 | xyMap (u16 x) const FL_NO_EXCEPT |
Public Member Functions inherited from fl::Fx | |
| Fx (u16 numLeds) FL_NO_EXCEPT | |
| u16 | getNumLeds () const FL_NO_EXCEPT |
| virtual void | pause (fl::u32 now) FL_NO_EXCEPT |
| virtual void | resume (fl::u32 now) FL_NO_EXCEPT |
Private Attributes | |
| Fx2dPtr | mFx2d |
| fl::unique_ptr< CRGB[]> | mGrid |
| InterpolationMode | mInterpolationMode |
| ScreenMap | mScreenMap |
Additional Inherited Members | |
Protected Member Functions inherited from fl::Fx | |
| virtual | ~Fx () FL_NO_EXCEPT |
Protected Attributes inherited from fl::Fx1d | |
| XMap | mXMap |
Protected Attributes inherited from fl::Fx | |
| u16 | mNumLeds |