Expand description
crate for decoding/encoding the portable anymap format.
§a quick guide to the various functions for everyday use
decode()
: your go-to for all PNM image decoding. If you have a specific format you need to support, use its module directly. Note that this function reads both plain and raw formats.encode()
: this function is a little tricky. It supports the “older” PNM formats, and, due to their age they do not support the alpha channels existence. If possible, usepam::encode
instead.encode_plain
: ThePAM
format doesnt actually support read-age-by-humans, so this is still useful at times. Outputs data in decimal digits.
§functions in action
let data = include_bytes!("../tdata/fimg-rainbowR.ppm");
let out = pnm::decode(data).unwrap();
assert_eq!(pnm::encode(out), data);
Modules§
- decode
- decoding utilities
- pam
- Portable Arbitrary Format RGB (no alpha) image encoding and decoding.
- pbm
- Portable BitMap Format black and white image encoding and decoding.
- pgm
- Portable GreyMap Format grey image encoding and decoding.
- ppm
- Portable PixMap Format RGB (no alpha) image encoding and decoding.