FastLED 3.9.15
Loading...
Searching...
No Matches

◆ rasterize()

void fl::XYPathRenderer::rasterize ( float from,
float to,
int steps,
XYRasterU8Sparse & raster,
fl::function< u8(float)> * optional_alpha_gen = nullptr )

Definition at line 79 of file xypath.cpp.hpp.

81 {
82 for (int i = 0; i < steps; ++i) {
83 float alpha = fl::map_range<int, float>(i, 0, steps - 1, from, to);
84 Tile2x2_u8 tile = at_subpixel(alpha);
85 if (optional_alpha_gen) {
86 // Scale the tile based on the alpha value.
87 u8 a8 = (*optional_alpha_gen)(alpha);
88 tile.scale(a8);
89 }
90 raster.rasterize(tile);
91 }
92}
Tile2x2_u8 at_subpixel(float alpha)
void rasterize(const vec2< u16 > &pt, u8 value)
fl::UISlider steps("Steps", 100.0f, 1.0f, 200.0f, 1.0f)
fl::XYRaster raster(WIDTH, HEIGHT)
unsigned char u8
Definition stdint.h:131
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max) FL_NOEXCEPT
Definition math.h:174

References at_subpixel(), fl::map_range(), raster(), fl::Tile2x2_u8::scale(), and steps().

Referenced by ~XYPathRenderer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: