Skip to main content

yaged/
lib.rs

1//! Gif encoder/decoder bases on [GIF89a specification](https://www.w3.org/Graphics/GIF/spec-gif89a.txt).
2//!
3//! #### Decoding
4//! ```
5//! use {std::fs::File, std::path::Path};
6//!
7//! // decodes a gif using ColorMap ColorOutput mode
8//! let file = &mut File::open(Path::new("./ascii-gif-example.gif")).unwrap();
9//! let color_map_gif = yaged::decoder::decode(file, yaged::decoder::ColorOutput::ColorMap).unwrap();
10//! color_map_gif.frames().iter().for_each(|frame| {
11//!  assert!(frame.rgba_raster_data().is_none())
12//! });
13//!
14//! // decodes a gif using RGBA ColorOutput mode
15//! let file = &mut File::open(Path::new("./ascii-gif-example.gif")).unwrap();
16//! let rgba_gif = yaged::decoder::decode(file, yaged::decoder::ColorOutput::RGBA).unwrap();
17//! // with this color output mode the rgba_raster_data() will be present in each frame
18//! rgba_gif.frames().iter().for_each(|frame| {
19//!  assert!(frame.rgba_raster_data().is_some())
20//! });
21//! ```
22
23pub mod decoder;
24pub mod types;