Expand description
Generate MapLibre-compatible sprite assets from Rust.
render_icon returns RGBA pixels for one SVG, while
build_sprite_sheet produces a PNG sprite sheet and index. The default
cli feature also builds the spritore command-line interface; disable
default features when only the library API is needed. The command accepts a
directory of SVG files and writes the PNG and JSON files used by a MapLibre
style.
Structs§
- Build
Options - Options controlling sprite sheet construction.
- Rendered
Icon - A rasterized icon with straight-alpha RGBA pixels.
- Sprite
Index Entry - A MapLibre sprite index entry.
- Sprite
Sheet - A PNG sprite sheet and its MapLibre index.
Enums§
- Error
- An error produced while rendering an icon or building a sprite sheet.
Functions§
- build_
sprite_ sheet - Builds a MapLibre PNG sprite sheet from rasterized icons.
- index_
to_ json - Serializes a MapLibre sprite index as pretty JSON.
- render_
icon - Rasterizes one SVG icon at the requested pixel ratio.