mag-image-decoder

Crates.iomag-image-decoder
lib.rsmag-image-decoder
version0.1.0
sourcesrc
created_at2019-08-04 05:28:37.607865
updated_at2019-08-04 05:28:37.607865
descriptionMAG image decoder
homepage
repositoryhttps://bitbucket.org/yshryk/mag-image-decoder
max_upload_size
id154072
size28,227
yshryk (yshryk)

documentation

https://docs.rs/mag-image-decoder

README

MAG image decoder

MAG format is also known as MAKI02, Maki-chan Graphics.

Documentation

Supported Features

  • 16-color mode
  • 256-color mode
  • 200-line mode, non-square (rectangular) pixel aspect ratio

Decoding

Cargo.toml:

[dependencies]
mag-image-decoder = "0.1"

main.rs:

use std::fs::File;
use std::io::BufReader;
use mag_image_decoder::Decoder;

let file = File::open("SAMPLE.MAG").expect("failed to open file");
let decoder = Decoder::new(BufReader::new(file)).expect("failed to decode header");
let header = decoder.info();
println!("{:?}", header);
let img = decoder.decode().expect("failed to decode image");
img.save("SAMPLE.png").expect("failed to save image");

CLI Tool

% cargo build --release
% ./target/release/magdecode --help
% ./target/release/magdecode --outdir out *.MAG
% file out/SAMPLE.png
out/SAMPLE.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt