2#include "platforms/is_platform.h"
39 u32
id = ++sUniqueName;
82 for (
int i = 0; i <
steps; ++i) {
85 if (optional_alpha_gen) {
87 u8 a8 = (*optional_alpha_gen)(alpha);
101 tx.set_scale_x((
width - 1.0f) * 0.5f);
104 tx.set_offset_x(
width * 0.5f);
113 tx.set_scale_y((
height - 1.0f) * 0.5f);
114 tx.set_offset_y(
height * 0.5f);
248 if (!drawbounds.
empty()) {
249 path->setDrawBounds(drawbounds);
256 if (path->hasDrawBounds(&bounds)) {
257 if (!bounds.
mMin.is_zero()) {
260 "Bounds with an origin other than 0,0 is not supported yet");
262 auto w = bounds.
width();
264 out->setDrawBounds(w, h);
fl::UISlider scale("Scale", 4,.1, 4,.1)
static T & instance() FL_NOEXCEPT
static XYPathPtr NewCustomPath(const fl::function< vec2f(float)> &path, const rect< i16 > &drawbounds=rect< i16 >(), const TransformFloat &transform=TransformFloat(), const char *name=nullptr)
int calculateSteps(float from, float to)
static XYPathPtr NewPhyllotaxisPath(u16 width=0, u16 height=0, const fl::shared_ptr< PhyllotaxisParams > &args=fl::make_shared< PhyllotaxisParams >())
void drawColor(const CRGB &color, float from, float to, Leds *leds, int steps=-1)
static XYPathPtr NewHeartPath()
static XYPathPtr NewArchimedeanSpiralPath()
Tile2x2_u8 at_subpixel(float alpha)
void setScale(float scale)
static XYPathPtr NewPointPath(float x, float y)
bool hasDrawBounds() const
static XYPathPtr NewGielisCurvePath(u16 width=0, u16 height=0, const fl::shared_ptr< GielisCurveParams > ¶ms=fl::make_shared< GielisCurveParams >())
void drawGradient(const Gradient &gradient, float from, float to, Leds *leds, int steps=-1)
void setTransform(const TransformFloat &transform)
static XYPathPtr NewCatmullRomPath(u16 width=0, u16 height=0, const fl::shared_ptr< CatmullRomParams > ¶ms=fl::make_shared< CatmullRomParams >())
virtual ~XYPath() FL_NOEXCEPT
static XYPathPtr NewLinePath(float x0, float y0, float x1, float y1)
XYPathRendererPtr mPathRenderer
fl::function< u8(float)> AlphaFunction
static XYPathPtr NewRosePath(u16 width=0, u16 height=0, const fl::shared_ptr< RosePathParams > ¶ms=fl::make_shared< RosePathParams >())
XYPath(XYPathGeneratorPtr path, TransformFloat transform=TransformFloat())
void setDrawBounds(u16 width, u16 height)
void rasterize(float from, float to, int steps, XYRasterU8Sparse &raster, AlphaFunction *optional_alpha_gen=nullptr)
static XYPathPtr NewCirclePath()
TransformFloat & transform()
TransformFloat & transform()
vec2f compute(float alpha)
Tile2x2_u8 at_subpixel(float alpha)
TransformFloat mTransform
TransformFloat mGridTransform
vec2f compute_float(float alpha, const TransformFloat &tx)
void rasterize(float from, float to, int steps, XYRasterU8Sparse &raster, fl::function< u8(float)> *optional_alpha_gen=nullptr)
void onTransformFloatChanged()
void setScale(float scale)
void setDrawBounds(u16 width, u16 height)
fl::UISlider steps("Steps", 100.0f, 1.0f, 200.0f, 1.0f)
fl::XYRaster raster(WIDTH, HEIGHT)
XYRasterU8Sparse & get_tls_raster()
fl::string unique_missing_name(const char *prefix)
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
XYRasterU8Sparse XYRaster
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max) FL_NOEXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT
Base definition for an LED controller.
Representation of an 8-bit RGB pixel (Red, Green, Blue)
bool empty() const FL_NOEXCEPT
u16 width() const FL_NOEXCEPT
u16 height() const FL_NOEXCEPT