[][src]Struct bmp_monochrome::Bmp

pub struct Bmp { /* fields omitted */ }

The Bmp struct contains the data as a vector of boolean, each representing a pixel. In data the first element is the upper-left pixel, then proceed in the row. Last element of data is the lower-right pixel. Note in the serialized format the first element is the lower-left pixel see https://en.wikipedia.org/wiki/BMP_file_format

Implementations

impl Bmp[src]

pub fn read<T: Read>(from: T) -> Result<Self, BmpError>[src]

Read the monochrome bitmap from a Read type, such a File

impl Bmp[src]

pub fn write<T: Write>(&self, to: T) -> Result<(), BmpError>[src]

Write the monochrome bitmap to a Write type, such a File

impl Bmp[src]

pub fn new(data: Vec<bool>, width: usize) -> Result<Bmp, BmpError>[src]

Creates a new DataMatrix, failing if data is empty or its length not a multiple of width

pub fn mul(&self, mul: usize) -> Bmp[src]

multiply by mul every pixel

pub fn add_whitespace(&self, white_space: usize) -> Bmp[src]

add white_space pixels around

Trait Implementations

impl Clone for Bmp[src]

impl Debug for Bmp[src]

impl Eq for Bmp[src]

impl PartialEq<Bmp> for Bmp[src]

impl StructuralEq for Bmp[src]

impl StructuralPartialEq for Bmp[src]

Auto Trait Implementations

impl RefUnwindSafe for Bmp

impl Send for Bmp

impl Sync for Bmp

impl Unpin for Bmp

impl UnwindSafe for Bmp

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.