Skip to main content

PALETTE_INDEX

Constant PALETTE_INDEX 

Source
const PALETTE_INDEX: LocalKey<RefCell<Box<[u16]>>>;
Expand description

Palette index per global id, reused across encodes on this thread. It takes 128 KiB on each thread that encodes a section, allocated on first use.

Only the slots of the palette being encoded hold an index; every other slot holds EMPTY_SLOT, so a value missing from its palette is detected instead of being encoded with an index left over from an earlier palette.