implements PLN-0067

This commit is contained in:
2026-05-23 19:15:14 +01:00
parent 4d5818c244
commit 1256d33a72
7 changed files with 103 additions and 52 deletions
+12 -5
View File
@@ -114,7 +114,7 @@ For `BankType::GLYPH`, the v1 runtime-facing contract is:
- `codec = NONE`
- serialized pixels use packed `u4` palette indices
- serialized palettes use `RGB565` (`u16`, little-endian)
- serialized palettes use `RGBA8888` with canonical RGBA channel order
- `palette_count = 64`
- runtime materialization may expand pixel indices to one `u8` per pixel
@@ -152,18 +152,25 @@ Validation rules for `GLYPH` v1:
#### 4.1.2 Payload Layout
1. packed indexed pixels for the full sheet, using `ceil(width * height / 2)` bytes;
2. palette table, using `palette_count * 16 * 2` bytes.
2. palette table, using `palette_count * 16 * 4` bytes.
The tile-bank payload therefore separates serialized storage form from runtime memory form:
- serialized pixel plane: packed `4bpp`
- decoded pixel plane: expanded `u8` indices, one entry per pixel
- palette table: `64 * 16` colors in `RGB565`
- palette table: `64 * 16` colors in RGBA8888 channel order
For `GLYPH` v1:
- `size` must match `ceil(width * height / 2) + (palette_count * 16 * 2)`
- `decoded_size` must match `(width * height) + (palette_count * 16 * 2)`
- `size` must match `ceil(width * height / 2) + (palette_count * 16 * 4)`
- `decoded_size` must match `(width * height) + (palette_count * 16 * 4)`
RGB565 palette payloads are not compatible runtime input. Existing assets with
two-byte RGB565 palette entries must be regenerated or converted by tooling
before they are loaded by the runtime.
Palette indices are ordinary indices. Transparency is represented by the alpha
channel of the resolved RGBA8888 palette entry, not by reserving index `0`.
### 4.2 `SCENE` asset contract in v1