Expand description
Sprite processing and serving for map tile rendering.
Generates spritesheets from SVG files with support for high-DPI (@2x) and SDF (Signed Distance Field) sprites for dynamic styling.
§Usage
use martin_core::sprites::SpriteSources;
use std::path::PathBuf;
let mut sources = SpriteSources::default();
sources.add_source("icons".to_string(), PathBuf::from("/path/to/svg/directory"));
let spritesheet = sources.get_sprites("icons@2x", false).await.unwrap();Structs§
- Catalog
Sprite Entry - Sprite source metadata.
- Sprite
Cache - Sprite cache for storing generated sprite sheets.
- Sprite
Source - Sprite source directory.
- Sprite
Sources - Thread-safe sprite source manager for serving sprites as
.pngor.json. - Spritesheet
Enums§
- Sprite
Error - Errors that can occur during sprite processing.
Constants§
- NO_
SPRITE_ CACHE - Constant representing no sprite cache configuration.
Functions§
- get_
spritesheet - Generates spritesheet from sprite sources.
Type Aliases§
- OptSprite
Cache - Optional wrapper for
SpriteCache. - Sprite
Catalog - Catalog mapping sprite names to metadata (e.g., “icons” ->
CatalogSpriteEntry).