- PackBits scans each row once; RLE planes encode their rows on worker
threads on native targets (rayon), keeping the exact packet boundaries
and the fallback when RLE does not pay.
- ZIP output grows in bounded blocks and is compacted to its encoded size,
instead of reserving the raw size; native threads reuse a finished
encoder's working buffers.
- 16/32-bit prediction works on owned buffers in one pass.
- Filter-effects planes and pattern blocks encode from borrowed rows and
owned buffers without the intermediate copies.
The encoded bytes are unchanged.
Ported from storytold/photocraft#7797 (its crates/psd part), at
a1ee8355a4651d379286cd13f92dabe4344e295f.
Co-authored-by: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com>
PhotoCraft's `photocraft-psd` crate (crates/psd at storytold/photocraft
63b641b55e54bf8f5c83efd977fdb16a2c255431) as `craft-psd`: the lossless
PSD/PSB model, reader, writer and builder, descriptors, the Photoshop
resource files that share its primitives (.abr, .asl, .aco, .act, .ase,
.grd, .pat, .atn, .csh, .shc) and the Photoshop blocks of a layered TIFF.
The crate had no dependency on any other PhotoCraft crate.
Code is unchanged apart from the crate name, craft-libs' rustfmt width,
comments that named other PhotoCraft crates, issue references (now
`photocraft#N`), and the corpus tests' directory (`CRAFT_PSD_CORPUS` or
`corpus/` at the workspace root). Tests, proptests, fuzz targets and
fixtures move with it.
Part of #778, #786.