Expand description
AlphaMask operations — boolean ops, SDF rasterization, feathering.
AlphaMask is a TileStore<AlphaF32> (single-channel f32 per pixel).
It’s used for selections, layer masks, and future mask-like concepts.
The storage, COW, and transaction/memento infrastructure are inherited
from the generic TileStore<F> in tile.rs.
Shape rasterization uses the shared SDF functions from sdf.rs. Selection
tools provide an SDF closure to rasterize(), which evaluates it at each
pixel center and writes coverage values into tiles.
Structs§
- Rasterized
Mask - Result of rasterizing an SDF shape to a flat R8 buffer. Contains only the tight bounding region, not the full canvas.
Functions§
- contour_
polylines_ r8 - Same as
contour_segments_r8but returns chained polylines (one per connected contour) instead of a flat list of independent segments. Each innerVecis a sequence of points forming a polyline: points[p0, p1, ..., pN]describeNconnected segments. Closed contours havep0 == pN(within float tolerance). - contour_
segments_ r8 - Extract contour segments from a flat R8 buffer using marching squares.
- pixel_
bounds_ r8 - Compute tight pixel bounding box from a flat R8 buffer.
Returns
[x, y, w, h]or None if all pixels are zero. - rasterize_
polygon_ r8 - Rasterize a polygon into a tight-bounds R8 buffer using scanline fill.
- rasterize_
sdf_ r8 - Rasterize an SDF shape into a tight-bounds R8 buffer.