Struct embedded_graphics::image::Image8BPP[][src]

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

8 bit per pixel image

Fields

Top left corner offset from display origin (0,0)

Trait Implementations

impl<'a, C: Debug + PixelColor> Debug for Image8BPP<'a, C>
[src]

Formats the value using the given formatter. Read more

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

Create a new 8BPP image with given data, width and height. Data length must equal width * height

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a, C> Drawable for Image8BPP<'a, C> where
    C: PixelColor
[src]

impl<'a, C> Transform for Image8BPP<'a, C> where
    C: PixelColor
[src]

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


// 1px x 1px test image
let image: Image8BPP<PixelColorU8> = Image8BPP::new(&[ 0xff ], 1, 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));

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


// 1px x 1px test image
let mut image: Image8BPP<PixelColorU8> = Image8BPP::new(&[ 0xff ], 1, 1);
image.translate_mut(Coord::new(25, 30));

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

Auto Trait Implementations

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

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