implements PLN-0081

This commit is contained in:
2026-05-23 22:17:34 +01:00
parent e044fc15fc
commit ad2bfeb66f
5 changed files with 44 additions and 16 deletions
@@ -118,6 +118,9 @@ Rules:
- collections such as `output.pipeline.palettes` may remain JSON arrays for authoring ergonomics;
- when a collection member has runtime- or packing-relevant identity, each entry must carry an explicit `index`;
- `output.pipeline.palettes` entries must use the shape `{ "index": <int>, "palette": { ... } }`;
- 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;
- 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;
@@ -133,8 +136,7 @@ Example:
{
"index": 0,
"palette": {
"originalArgb8888": [4294901760, 4278255360],
"convertedRgb565": [63488, 2016]
"rgba8888": [4294901760, 16711935]
}
}
]
@@ -143,6 +145,19 @@ Example:
}
```
For glyph-bank palettes, each `rgba8888` integer is interpreted as
`0xRRGGBBAA`.
Rules:
- palette index `0` is an ordinary palette slot;
- glyph palettes expose 16 usable colors;
- transparency and partial transparency are represented only by the alpha byte
in the RGBA8888 palette value;
- alpha values from `0` through `255` are valid;
- magenta color-key behavior is not supported as a normal declaration,
projection, or publication rule.
## Metadata Source Segmentation and Runtime Sink
`asset.json` may keep metadata segmented by concern during authoring.
@@ -178,10 +178,10 @@ 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 * 2 = 2048` bytes;
2. one palette block of `64 * 16 * 4 = 4096` bytes;
- packed pixel bytes must be emitted by the packer, not inferred later by the runtime;
- the palette block is serialized as `RGB565` `u16` values;
- palette bytes must be emitted in little-endian order;
- 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;
- payload interpretation must not depend on incidental per-artifact boundaries.
### Runtime Entry Derivation
@@ -198,8 +198,8 @@ Rules:
- `palette_count`
- tile-bank v1 requires `palette_count = 64`;
- tile-bank v1 size formulas are:
- `size = ceil(width * height / 2) + 2048`
- `decoded_size = (width * height) + 2048`
- `size = ceil(width * height / 2) + 4096`
- `decoded_size = (width * height) + 4096`
### Palette Contract
@@ -207,8 +207,13 @@ Rules:
- bank palettes are declared under `output.pipeline.palettes`;
- 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 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;
- magenta color-key behavior is not part of the normal glyph-bank contract;
- any tile in the bank may be rendered with any palette in the bank at runtime;
- palette selection is a runtime draw concern, not a tile-payload embedding concern.
@@ -224,6 +224,10 @@ Rules:
- `output.format`
- `codec`
- `preload`
- Glyph-bank palette projections must use canonical `rgba8888` values when
palette data is shown.
- Studio-facing glyph palette views must not expose `convertedRgb565` as normal
runtime or tooling truth.
- Runtime-facing output information must not require raw JSON inspection.
### Inputs / Preview
@@ -328,6 +332,10 @@ Rules:
- `glyph_asset_id` is derived from the glyph asset selected for the layer;
- `parallax_factor_x` and `parallax_factor_y` are layer-owned editorial fields in Studio;
- `palette_id` has a layer-owned default and may be overridden per tile when the supported editorial surface provides an explicit override;
- `palette_id` remains an index into the referenced glyph palette and does not
imply a color format change in the scene request;
- referenced glyph palettes resolve to RGBA8888 entries, with palette index `0`
treated as an ordinary palette slot;
- layer `active` determines whether the layer participates in publication output;
- tile `active` determines whether the tile contributes an active tile record to the published request;
- canonical scene persistence must not depend on `TMX`, `TSX`, or any other external file format remaining present on disk.