pub struct Image { /* private fields */ }
Expand description
Image stored as palette indices (0..256) in row-major order
Implementations§
Source§impl Image
impl Image
Sourcepub fn from_pixels(width: u32, pixels: Box<[u8]>) -> Self
pub fn from_pixels(width: u32, pixels: Box<[u8]>) -> Self
Create an image from a width and list of pixels. Height is calculated from number of pixels and width, or 0 if pixels are empty.
§Panics
Panics if pixel count does not fit within a u32
, pixels cannot fit
within an integer number of row, or there are a non-zero number of
pixels and width is 0.
pub fn width(&self) -> u32
pub fn height(&self) -> u32
Trait Implementations§
impl Eq for Image
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
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