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<'_>
impl AsepriteFile<'_>
sourcepub fn load(data: &[u8]) -> Result<AsepriteFile<'_>, LoadSpriteError>
pub fn load(data: &[u8]) -> Result<AsepriteFile<'_>, LoadSpriteError>
Load a aseprite file from a byte slice
Get tag names
sourcepub fn image_count(&self) -> usize
pub fn image_count(&self) -> usize
Get image count
sourcepub fn combined_frame_image(
&self,
frame_index: usize,
target: &mut [u8]
) -> Result<u64, LoadImageError>
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
sourcepub fn load_image(
&self,
index: usize,
target: &mut [u8]
) -> Result<(), LoadImageError>
pub fn load_image( &self, index: usize, target: &mut [u8] ) -> Result<(), LoadImageError>
Get image loader for a given image index
pub fn slices(&self) -> &[SliceChunk<'_>]
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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