Skip to main content

Crate aseprite_loader

Crate aseprite_loader 

Source
Expand description

§Aseprite Loader

Latest Version CI Unsafe forbidden Rust 1.70+

This crate implements a zero-copy parser for aseprite files according to the Aseprite File Format (.ase/.aseprite) Specifications:

https://github.com/aseprite/aseprite/blob/main/docs/ase-file-specs.md

§Usage

use aseprite_loader::loader::{AsepriteFile, LayerSelection};

let data = std::fs::read("sprite.aseprite")?;
let file = AsepriteFile::load(&data)?;

let (width, height) = file.size();
let mut rgba = vec![0u8; usize::from(width) * usize::from(height) * 4];

file.render_frame(0, &mut rgba, &LayerSelection::Visible)?;

§License

Licensed under either of

at your option.

Modules§

binary
This module contains a parser for the .aseprite file specification in version 1.3 as described in the aseprite/aseprite repository on GitHub: https://github.com/aseprite/aseprite/blob/main/docs/ase-file-specs.md
loader
This module contains the actual loader API. This API is based on the binary-module of this crate and does provide a convenience API for accessing layers, frames, tags and fully blended images.