Skip to main content

Crate spritore_core

Crate spritore_core 

Source
Expand description

Rasterize SVG icons and build MapLibre-compatible sprite assets.

Use render_icon to produce RGBA pixels for one icon, or combine rendered icons with build_sprite_sheet and serialize its index with index_to_json. The API accepts SVG text and returns in-memory image and index data, so applications can choose how to read and store their assets.

Structs§

BuildOptions
Options controlling sprite sheet construction.
RenderedIcon
A rasterized icon with straight-alpha RGBA pixels.
SpriteIndexEntry
A MapLibre sprite index entry.
SpriteSheet
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.