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

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

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

+ Here is the call graph for this function: