pub struct Bitmap<'a> { /* private fields */ }Expand description
A one-bit picture file, read without copying (Bitmap::parse).
Implementations§
Source§impl<'a> Bitmap<'a>
impl<'a> Bitmap<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self, &'static str>
pub fn parse(bytes: &'a [u8]) -> Result<Self, &'static str>
Reads the file bytes, or says in plain words what is wrong with it.
Sourcepub const fn plane_bytes(width: u16, height: u16) -> usize
pub const fn plane_bytes(width: u16, height: u16) -> usize
Bytes of one style (or of the mask) of a width × height picture.
Sourcepub const fn source_size(&self) -> (u16, u16)
pub const fn source_size(&self) -> (u16, u16)
The size of the PNG it was made from, in that PNG’s pixels.
Trait Implementations§
impl<'a> Copy for Bitmap<'a>
impl<'a> Eq for Bitmap<'a>
impl<'a> StructuralPartialEq for Bitmap<'a>
Auto Trait Implementations§
impl<'a> Freeze for Bitmap<'a>
impl<'a> RefUnwindSafe for Bitmap<'a>
impl<'a> Send for Bitmap<'a>
impl<'a> Sync for Bitmap<'a>
impl<'a> Unpin for Bitmap<'a>
impl<'a> UnsafeUnpin for Bitmap<'a>
impl<'a> UnwindSafe for Bitmap<'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