Struct embedded_graphics::image::Image8BPP [−][src]
pub struct Image8BPP<'a> {
pub offset: Coord,
// some fields omitted
}8 bit per pixel image
Fields
offset: Coord
Top left corner offset from display origin (0,0)
Trait Implementations
impl<'a> Debug for Image8BPP<'a>[src]
impl<'a> Debug for Image8BPP<'a>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a> Image<'a> for Image8BPP<'a>[src]
impl<'a> Image<'a> for Image8BPP<'a>fn new(imagedata: &'a [u8], width: u32, height: u32) -> Self[src]
fn new(imagedata: &'a [u8], width: u32, height: u32) -> SelfCreate a new 8BPP image with given data, width and height. Data length must equal
width * height
impl<'a> IntoIterator for &'a Image8BPP<'a>[src]
impl<'a> IntoIterator for &'a Image8BPP<'a>type Item = Pixel
The type of the elements being iterated over.
type IntoIter = Image8BPPIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl<'a> Drawable for Image8BPP<'a>[src]
impl<'a> Drawable for Image8BPP<'a>impl<'a> Transform for Image8BPP<'a>[src]
impl<'a> Transform for Image8BPP<'a>fn translate(&self, by: Coord) -> Self[src]
fn translate(&self, by: Coord) -> SelfTranslate 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::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));
fn translate_mut(&mut self, by: Coord) -> &mut Self[src]
fn translate_mut(&mut self, by: Coord) -> &mut SelfTranslate the image from its current position to a new position by (x, y) pixels.
// 1px x 1px test image let mut image = Image8BPP::new(&[ 0xff ], 1, 1); image.translate_mut(Coord::new(25, 30)); assert_eq!(image.offset, Coord::new(25, 30));