[−][src]Struct bmp_monochrome::Bmp
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,