[][src]Struct blit::aseprite_feature::AnimationBlitBuffer

pub struct AnimationBlitBuffer { /* fields omitted */ }

BlitBuffer with extra information and functions to animate a sheet.

Methods

impl AnimationBlitBuffer[src]

pub fn new(buffer: BlitBuffer, info: SpritesheetData) -> Self[src]

pub fn blit_frame(
    &self,
    dst: &mut [u32],
    dst_width: usize,
    offset: (i32, i32),
    frame: usize
) -> Result<(), Box<dyn Error>>
[src]

Draw one frame from the animation.

pub fn blit(
    &self,
    dst: &mut [u32],
    dst_width: usize,
    offset: (i32, i32),
    info: &Animation
) -> Result<(), Box<dyn Error>>
[src]

Draw the current frame using the animation info.

pub fn save<P>(&self, path: P) -> Result<(), Box<dyn Error>> where
    P: AsRef<Path>, 
[src]

Saves the buffer to a file at the path specified. A custom binary format is used for this.

pub fn open<P>(path: P) -> Result<Self, Box<dyn Error>> where
    P: AsRef<Path>, 
[src]

Create a new buffer from a file at the path specified. The file needs to be the custom binary format.

pub fn from_memory(buffer: &[u8]) -> Result<Self, Box<dyn Error>>[src]

Create a new buffer from a file at the path specified. The array needs to be the custom binary format.

Trait Implementations

impl Debug for AnimationBlitBuffer[src]

impl<'de> Deserialize<'de> for AnimationBlitBuffer[src]

impl Serialize for AnimationBlitBuffer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.