mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-08 19:42:12 +00:00
pcraft_layer_rgba(bytes, layer, &Limits) decodes one layer of a .pcraft bundle over the canvas: a raster layer's surface, or the rendered copy saved with a text, shape or smart object layer, as RGBA at the layer's 8, 16 or 32-bit sample type, with the layer mask as its own plane. Grayscale repeats the gray value, missing tiles hold the default pixel, and tiles outside the canvas are not read. Other color modes give Unsupported; groups, adjustment and fill layers give None. Tiles are read with craft-pcraft-format's TileRef and tile paths, decoded with ruzstd and checked against their BLAKE3 hash, as PhotoCraft reads them. The decoded layer and mask count against max_entry and max_total before they are allocated; a frame is decoded only up to its tile's size, and a frame larger than the tile plus an eighth and 4 KiB, or one that declares a window over 8 MiB, is refused. The feature adds ruzstd and blake3, both pure Rust. The doc workflow runs clippy and the tests with --all-features. Part of #59.