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

◆ rasterize()

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

Definition at line 77 of file xypath.cpp.

79 {
80 for (int i = 0; i < steps; ++i) {
81 float alpha = fl::map_range<int, float>(i, 0, steps - 1, from, to);
82 Tile2x2_u8 tile = at_subpixel(alpha);
83 if (optional_alpha_gen) {
84 // Scale the tile based on the alpha value.
85 uint8_t a8 = (*optional_alpha_gen)(alpha);
86 tile.scale(a8);
87 }
88 raster.rasterize(tile);
89 }
90}
XYRaster raster(WIDTH, HEIGHT)
Tile2x2_u8 at_subpixel(float alpha)
UISlider steps("Steps", 100.0f, 1.0f, 200.0f, 1.0f)
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max)
Definition map_range.h:26

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

+ Here is the call graph for this function: