implements PLN-0087

This commit is contained in:
2026-07-14 16:25:52 +01:00
parent 013ca4355c
commit 340442d374
5 changed files with 31 additions and 14 deletions
@@ -121,6 +121,11 @@ Rules:
- glyph-bank palette payloads must expose canonical `rgba8888` color values in runtime RGBA channel order;
- ARGB values produced by host image APIs are import-side implementation details, not canonical declaration or projection fields;
- `convertedRgb565` is not part of the normal palette contract;
- glyph-bank `palette_count` is an effective runtime metadata field and means
the number of serialized and resident RGBA8888 palettes for the bank;
- glyph-bank `palette_count` must be in the inclusive range `1..=64`;
- `palette_authored`, when present, is informative tooling metadata only and
must not be treated as runtime-effective metadata;
- the packer must sort such entries by numeric `index`, not by physical array position;
- duplicate or malformed indices are structural errors;
- missing or malformed `palette` payloads are structural errors;
@@ -147,7 +147,8 @@ Offset ambiguity guardrail:
## Format-Specific Baseline: `GLYPH/indexed_v1`
The first-wave producer contract for `GLYPH/indexed_v1` is fixed and runtime-aligned.
The producer contract for `GLYPH/indexed_v1` is runtime-aligned and uses a
variable RGBA8888 palette block.
### Tile Selection and Identity
@@ -178,7 +179,7 @@ Rules:
- the serialized payload for `GLYPH/indexed_v1` is:
1. one packed `u4` pixel plane for the full emitted sheet;
2. one palette block of `64 * 16 * 4 = 4096` bytes;
2. one palette block of `palette_count * 16 * 4` bytes;
- packed pixel bytes must be emitted by the packer, not inferred later by the runtime;
- the palette block is serialized as RGBA8888 values in runtime RGBA channel order;
- each palette entry is emitted as four bytes in `R`, `G`, `B`, `A` order;
@@ -196,10 +197,15 @@ Rules:
- `width`
- `height`
- `palette_count`
- tile-bank v1 requires `palette_count = 64`;
- tile-bank v1 requires `palette_count` in the inclusive range `1..=64`;
- `palette_count` is the number of serialized palettes and resident runtime
palettes for the bank;
- tile-bank v1 size formulas are:
- `size = ceil(width * height / 2) + 4096`
- `decoded_size = (width * height) + 4096`
- `size = ceil(width * height / 2) + palette_count * 16 * 4`
- `decoded_size = (width * height) + palette_count * 16 * 4`
- fixed 64-palette padding is not a compatibility mode unless
`palette_count = 64` and the payload directly satisfies the v1 contract;
- `GLYPH/indexed_v2` must not be introduced for this palette-count correction.
### Palette Contract
@@ -209,7 +215,8 @@ Rules:
- each palette declaration uses the shape `{ "index": <int>, "palette": { ... } }`;
- each palette payload uses canonical `rgba8888` entries interpreted as `0xRRGGBBAA`;
- palette ordering is ascending numeric `index`, never raw array position;
- palette ids in the emitted glyph bank are the normalized declared palette indices;
- palette ids in the emitted glyph bank are direct declared palette indices;
- v1 has no sparse-to-dense palette remapping metadata;
- palette index `0` is ordinary and may carry any RGBA8888 value;
- glyph palettes have 16 usable entries;
- transparency and partial transparency are encoded only by RGBA alpha;