Struct aseprite_loader::loader::AsepriteFile

source ·
pub struct AsepriteFile<'a> { /* private fields */ }
Expand description

This can be used to load an Aseprite file.

Implementations§

source§

impl AsepriteFile<'_>

source

pub fn load(data: &[u8]) -> Result<AsepriteFile<'_>, LoadSpriteError>

Load a aseprite file from a byte slice

source

pub fn size(&self) -> (u16, u16)

Get size of the sprite (width, height)

source

pub fn tags(&self) -> &[Tag]

Get tag names

source

pub fn layers(&self) -> &[Layer]

Get layer names

source

pub fn frames(&self) -> &[Frame]

Get the image indices for a given tag and layer

source

pub fn image_count(&self) -> usize

Get image count

source

pub fn combined_frame_image( &self, frame_index: usize, target: &mut [u8] ) -> Result<u64, LoadImageError>

Get image loader for a given frame index This will combine all layers into a single image returns a hash describing the image, since cels can be reused in multiple frames

source

pub fn load_image( &self, index: usize, target: &mut [u8] ) -> Result<(), LoadImageError>

Get image loader for a given image index

source

pub fn slices(&self) -> &[SliceChunk<'_>]

Trait Implementations§

source§

impl<'a> Debug for AsepriteFile<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AsepriteFile<'a>

§

impl<'a> RefUnwindSafe for AsepriteFile<'a>

§

impl<'a> Send for AsepriteFile<'a>

§

impl<'a> Sync for AsepriteFile<'a>

§

impl<'a> Unpin for AsepriteFile<'a>

§

impl<'a> UnwindSafe for AsepriteFile<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.