pub struct Cel<'a> { /* private fields */ }
Expand description
A reference to a single Cel. A cel contains the image data at a specific layer and frame. In the timeline view these are the dots.
You can get a cel
by going either via frame then layer or vice versa.
Implementations§
source§impl<'a> Cel<'a>
impl<'a> Cel<'a>
sourcepub fn image(&self) -> RgbaImage
pub fn image(&self) -> RgbaImage
This cel as an image. Result has the same dimensions as the AsepriteFile. If the cel is empty, all image pixels will be transparent.
sourcepub fn top_left(&self) -> (i32, i32)
pub fn top_left(&self) -> (i32, i32)
Top-left corner of the non-empty rectangular area of the cel.
In other words, the first component is the smallest x coordinate of a non-empty pixel. And the second is the same for y.
These may be negative or outside of the visible area. This can happen if you drag a layer around.
sourcepub fn is_tilemap(&self) -> bool
pub fn is_tilemap(&self) -> bool
Does this cel include a tilemap.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Cel<'a>
impl<'a> RefUnwindSafe for Cel<'a>
impl<'a> Send for Cel<'a>
impl<'a> Sync for Cel<'a>
impl<'a> Unpin for Cel<'a>
impl<'a> UnwindSafe for Cel<'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