pub struct CanvasSize {
pub width: u32,
pub height: u32,
}Expand description
Pixel dimensions of a full animation canvas.
Fields§
§width: u32Canvas width in pixels.
height: u32Canvas height in pixels.
Implementations§
Source§impl CanvasSize
impl CanvasSize
Sourcepub fn pixel_count(self) -> Option<u64>
pub fn pixel_count(self) -> Option<u64>
Returns width * height, or None if the multiplication overflows.
Sourcepub fn rgba_bytes(self) -> Option<usize>
pub fn rgba_bytes(self) -> Option<usize>
Returns the tightly packed RGBA8 buffer size, or None on overflow.
Trait Implementations§
Source§impl Clone for CanvasSize
impl Clone for CanvasSize
Source§fn clone(&self) -> CanvasSize
fn clone(&self) -> CanvasSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CanvasSize
Source§impl Debug for CanvasSize
impl Debug for CanvasSize
impl Eq for CanvasSize
Source§impl PartialEq for CanvasSize
impl PartialEq for CanvasSize
impl StructuralPartialEq for CanvasSize
Auto Trait Implementations§
impl Freeze for CanvasSize
impl RefUnwindSafe for CanvasSize
impl Send for CanvasSize
impl Sync for CanvasSize
impl Unpin for CanvasSize
impl UnsafeUnpin for CanvasSize
impl UnwindSafe for CanvasSize
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