feat(libScePngEnc): implement PNG encoding #227
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/227"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-01T17:14:56Z.
What
Implements the four
libScePngEncexports on top of the shared PNG encoder incore/Decoder/Png(#175).scePngEncQueryMemorySize/scePngEncCreatevalidate the create parameters and place a small tagged context in the caller's memory;scePngEncDeleteinvalidates it.scePngEncEncodereads R8G8B8A8 or B8G8R8A8 rows with the given pitch, writes an RGB or RGBA PNG, and returns its size (also inPngEncOutputInfo). A too small output buffer returnsDATA_OVERFLOWwith an empty output info.Decoder::Png::Encodegets optionalEncodeOptions(compression level, filter) socompression_levelandfilter_typeare honoured. stb keeps both in globals, so they are set under a mutex. Existing callers are unchanged.SceTypes.hpp, with size checks.Signatures, struct layout, error codes (
0x8069010x) and validation follow both KytyPS5 and shadPS4, which agree. Where they differ:max_filter_numberup to 5 as in shadPS4; pitch is honoured for RGBA too (shadPS4 ignores it there).Gap, listed in
TechnicalDebt.md: stb cannot restrict adaptive filtering to a subset of filters, so afilter_typemask other than "all" uses its first filter.Tested
Linux (CachyOS, GCC): new
guest_png_enctest (core/libs/tests/GuestPngEnc.cpp) encodes a padded-pitch image in all four pixel format / color space combinations and decodes it back withDecoder::Png, checking every pixel; it also covers every error path and the output overflow. It fails on each of four injected bugs (BGR swap removed, pitch ignored, overflow not detected, compression level unchecked).decoder_pngtest extended for the new options. Full suite passes. Windows only through CI. No title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-01T17:15:24Z.
Progress report (
01eaae0→58f90ee)📈 System libraries: 80.9% (+0.14%, +4 implemented functions)
✅ 4 implemented
scePngEncCreatescePngEncDeletescePngEncEncodescePngEncQueryMemorySize