[−][src]Struct tinybmp::Bmp
A BMP-format bitmap
Fields
header: Header
Image header
Methods
impl<'a> Bmp<'a>
[src]
pub fn from_slice(bytes: &'a [u8]) -> Result<Self, ()>
[src]
Create a bitmap object from a byte array
This method keeps a slice of the original input and does not dynamically allocate memory. The input data must live for as long as this BMP instance does.
pub fn image_data(&'a self) -> &'a [u8]
[src]
Get a reference to the range of bytes that represents the pixel data in the image
pub fn width(&self) -> u32
[src]
Get the image width in pixels
pub fn height(&self) -> u32
[src]
Get the image height in pixels
pub fn dimensions(&self) -> (u32, u32)
[src]
Get image dimensions as (width, height)
in pixels
pub fn bpp(&self) -> u32
[src]
Get the BPP (bits per pixel) for this image
Trait Implementations
impl<'a> PartialEq<Bmp<'a>> for Bmp<'a>
[src]
impl<'a> Debug for Bmp<'a>
[src]
impl<'a> Clone for Bmp<'a>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,