Skip to main content

Module sprite_cache

Module sprite_cache 

Source
Expand description

Decoded sprite cache: PNG decoding, tile extraction, and runtime lookup.

The SpriteCache is built from TilesetOptions and provides O(1) lookup of decoded RGBA8 sprites by codepoint.

Structs§

Sprite
A decoded, ready-to-blit sprite.
SpriteCache
Cache of decoded sprites, keyed by Unicode codepoint.

Functions§

source_over
Blends src over dst using the Porter-Duff SRC_OVER operator for straight-alpha pixels: out = src + dst * (1 - src.a) for each channel, including alpha.