[][src]Struct tinybmp::Bmp

pub struct Bmp<'a> {
    pub header: Header,
    // some fields omitted

A BMP-format bitmap


header: Header

Image header


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> Debug for Bmp<'a>[src]

impl<'a> PartialEq<Bmp<'a>> for Bmp<'a>[src]

impl<'a> Clone for Bmp<'a>[src]

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'a> Send for Bmp<'a>

impl<'a> Sync for Bmp<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized