30 return tls_raster.
access();
38 u32
id = ++sUniqueName;
81 for (
int i = 0; i <
steps; ++i) {
82 float alpha = fl::map_range<int, float>(i, 0,
steps - 1, from, to);
84 if (optional_alpha_gen) {
86 u8 a8 = (*optional_alpha_gen)(alpha);
100 tx.set_scale_x((width - 1.0f) * 0.5f);
103 tx.set_offset_x(width * 0.5f);
112 tx.set_scale_y((height - 1.0f) * 0.5f);
113 tx.set_offset_y(height * 0.5f);
171 out->setDrawBounds(width, height);
183 out->setDrawBounds(width, height);
190 out->setDrawBounds(width, height);
204 if (width > 0 && height > 0) {
205 out->setDrawBounds(width, height);
214 if (width > 0 && height > 0) {
215 out->setDrawBounds(width, height);
224 if (width > 0 && height > 0) {
225 out->setDrawBounds(width, height);
234 if (width > 0 && height > 0) {
235 out->setDrawBounds(width, height);
247 if (!drawbounds.
empty()) {
248 path->setDrawBounds(drawbounds);
255 if (path->hasDrawBounds(&bounds)) {
256 if (!bounds.
mMin.is_zero()) {
259 "Bounds with an origin other than 0,0 is not supported yet");
261 auto w = bounds.
width();
263 out->setDrawBounds(w, h);
292 return MAX(1, 200 * diff);
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 >())
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)
UISlider steps("Steps", 100.0f, 1.0f, 200.0f, 1.0f)
XYRaster raster(WIDTH, HEIGHT)
XYRasterU8Sparse & get_tls_raster()
fl::string unique_missing_name(const char *prefix)
XYRasterU8Sparse XYRaster
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)
ThreadLocalFake< T > ThreadLocal
shared_ptr< T > make_shared(Args &&... args)
Representation of an RGB pixel (Red, Green, Blue)