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 65 of file xypath.cpp.

67 {
68 for (int i = 0; i < steps; ++i) {
69 float alpha = fl::map_range<int, float>(i, 0, steps - 1, from, to);
70 Tile2x2_u8 tile = at_subpixel(alpha);
71 if (optional_alpha_gen) {
72 // Scale the tile based on the alpha value.
73 uint8_t a8 = (*optional_alpha_gen)(alpha);
74 tile.scale(a8);
75 }
76 raster.rasterize(tile);
77 }
78}
XYRaster raster(WIDTH, HEIGHT)
Tile2x2_u8 at_subpixel(float alpha)
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, and fl::Tile2x2_u8::scale().

+ Here is the call graph for this function: