Fix 16-bit binary PBM sample byte order
Merged
JI
2mo ago+300+300+012345678901234567890123456789-14-14-01234567890123456789
Prerequisites
- I have written a descriptive pull-request title
- I have verified that there are no overlapping pull-requests open
- I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
- I have provided test coverage for my change (where applicable)
Description
The binary PGM and PPM formats store 16-bit samples most significant byte first. The decoder and encoder read and wrote them in native little-endian order, so every wide sample was byte swapped. This corrects the swizzled colors reported for 16-bit PPM images.
- Reverse the sample byte order in BinaryDecoder and BinaryEncoder.
- Fix integer division in the max pixel value upscale factor.
- Add exact-value, reference-decoder, upscale, and round-trip tests.
- Add a 16-bit PPM test image and its Magick-anchored reference PNG.
- Document the binary decoder and encoder in full.