Please check build logs and if you believe this is docs.rs' fault, report into this issue report.
PNG encoder and decoder
This crate contains a PNG decoder. It supports reading of single lines or whole frames.
The most important types for decoding purposes are
Reader. They both wrap a
Decoder serves as a builder for
Decoder::read_info reads from the
Read until the
image data is reached.
Using the decoder
use std::fs::File; // The decoder is a build for reader and can be used to set various decoding options // via `Transformations`. The default output transformation is `TRANSFORM_EXPAND // | TRANSFORM_STRIP_ALPHA`. let decoder = png::Decoder::new(File::open("tests/pngsuite/basi0g01.png").unwrap()); let (info, mut reader) = decoder.read_info().unwrap(); // Allocate the output buffer. let mut buf = vec![0; info.buffer_size()]; // Read the next frame. Currently this function should only called once. // The default options reader.next_frame(&mut buf).unwrap();
Not available yet