[][src]Struct tinybmp::Bmp

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

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

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

impl<'a> IntoIterator for &'a Bmp<'a>[src]

type Item = u32

The type of the elements being iterated over.

type IntoIter = BmpIterator<'a>

Which kind of iterator are we turning this into?

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

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

Auto Trait Implementations

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

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

impl<'a> Unpin for Bmp<'a>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.