[][src]Struct embedded_graphics::image::Image1BPP

pub struct Image1BPP<'a, C> {
    pub offset: Coord,
    // some fields omitted
}

1 bit per pixel image

Each byte of input data defines the on/off state of 8 horizontal pixels to be displayed on the screen.

You can convert an image to 1BPP for inclusion with include_bytes!() using the following Imagemagick command:

convert image.png -depth 1 gray:"image.raw"

Fields

offset: Coord

Image offset in pixels from screen origin (0,0)

Trait Implementations

impl<'a, C> Drawable for Image1BPP<'a, C>[src]

impl<'a, C> Dimensions for Image1BPP<'a, C> where
    C: PixelColor
[src]

impl<'a, C> Image<'a> for Image1BPP<'a, C> where
    C: PixelColor
[src]

impl<'a, C> Transform for Image1BPP<'a, C>[src]

fn translate(&self, by: Coord) -> Self[src]

Translate the image from its current position to a new position by (x, y) pixels, returning a new Image1BPP. For a mutating transform, see translate_mut.

// 8px x 1px test image
let image: Image1BPP<PixelColorU8> = Image1BPP::new(&[ 0xff ], 8, 1);
let moved = image.translate(Coord::new(25, 30));

assert_eq!(image.offset, Coord::new(0, 0));
assert_eq!(moved.offset, Coord::new(25, 30));

fn translate_mut(&mut self, by: Coord) -> &mut Self[src]

Translate the image from its current position to a new position by (x, y) pixels.

let mut image: Image1BPP<PixelColorU8> = Image1BPP::new(&[ 0xff ], 8, 1);
image.translate_mut(Coord::new(25, 30));

assert_eq!(image.offset, Coord::new(25, 30));

impl<'a, C: Debug> Debug for Image1BPP<'a, C>[src]

impl<'a, C> IntoIterator for &'a Image1BPP<'a, C> where
    C: PixelColor
[src]

type Item = Pixel<C>

The type of the elements being iterated over.

type IntoIter = Image1BPPIterator<'a, C>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<'a, C> Send for Image1BPP<'a, C> where
    C: Send

impl<'a, C> Sync for Image1BPP<'a, C> where
    C: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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>, 
[src]

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

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

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