Struct embedded_graphics::image::Image1BPP
source · pub struct Image1BPP<'a, C> {
pub offset: Coord,
/* private fields */
}
Expand description
1 bit per pixel image
Fields
offset: Coord
Image offset in pixels from screen origin (0,0)
Trait Implementations
sourceimpl<'a, C> Image<'a> for Image1BPP<'a, C>where
C: PixelColor,
impl<'a, C> Image<'a> for Image1BPP<'a, C>where
C: PixelColor,
sourceimpl<'a, C> IntoIterator for &'a Image1BPP<'a, C>where
C: PixelColor,
impl<'a, C> IntoIterator for &'a Image1BPP<'a, C>where
C: PixelColor,
sourceimpl<'a, C> Transform for Image1BPP<'a, C>
impl<'a, C> Transform for Image1BPP<'a, C>
sourcefn translate(&self, by: Coord) -> Self
fn translate(&self, by: Coord) -> Self
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));
sourcefn translate_mut(&mut self, by: Coord) -> &mut Self
fn translate_mut(&mut self, by: Coord) -> &mut Self
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> Drawable for Image1BPP<'a, C>
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for Image1BPP<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Image1BPP<'a, C>where
C: Send,
impl<'a, C> Sync for Image1BPP<'a, C>where
C: Sync,
impl<'a, C> Unpin for Image1BPP<'a, C>where
C: Unpin,
impl<'a, C> UnwindSafe for Image1BPP<'a, C>where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more