spng 0.1.0-alpha+2

Rust bindings to libspng
docs.rs failed to build spng-0.1.0-alpha+2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: spng-0.2.0-alpha.2

PNG image decoding

Rust bindings to libspng.


# static TEST_PNG: &[u8] = include_bytes!("../tests/test-001.png");
let cursor = std::io::Cursor::new(TEST_PNG);
let decoder = spng::Decoder::new(cursor);
let (out_info, mut reader) = decoder.read_info()?;
let output_buffer_size = reader.output_buffer_size();
assert_eq!(300, out_info.width);
assert_eq!(300, out_info.height);
assert_eq!(8, out_info.bit_depth);
assert_eq!(4, out_info.color_type.samples());
assert_eq!(out_info.buffer_size, output_buffer_size);
let mut out = vec![0; output_buffer_size];
reader.next_frame(&mut out)?;
# Ok::<(), Box<dyn std::error::Error>>(())