pub struct AsepriteFile<'a> {
pub file: File<'a>,
pub layers: Vec<Layer>,
pub frames: Vec<Frame>,
pub tags: Vec<Tag>,
pub images: Vec<Image<'a>>,
}
Expand description
This can be used to load an Aseprite file.
Fields§
§file: File<'a>
§layers: Vec<Layer>
All layers in the file in order
frames: Vec<Frame>
All frames in the file in order
All tags in the file
images: Vec<Image<'a>>
All images in the 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