pub struct BitImage(/* private fields */);
Expand description
A 5×5 image supporting only two levels of brightness (on and off).
Uses 5 bytes of storage.
For display, each pixel is treated as having brightness either 0 or MAX_BRIGHTNESS.
Implementations§
Source§impl BitImage
impl BitImage
Sourcepub const fn new(im: &[[u8; 5]; 5]) -> BitImage
pub const fn new(im: &[[u8; 5]; 5]) -> BitImage
Constructs a BitImage from an array of brightnesses.
The data should be an array of 5 rows (top first), each of which is an array of 5 values (left first). Each value should be either 0 or 1.
§Example
const HEART: BitImage = BitImage::new(&[
[0, 1, 0, 1, 0],
[1, 0, 1, 0, 1],
[1, 0, 0, 0, 1],
[0, 1, 0, 1, 0],
[0, 0, 1, 0, 0],
]);
Trait Implementations§
impl Copy for BitImage
Auto Trait Implementations§
impl Freeze for BitImage
impl RefUnwindSafe for BitImage
impl Send for BitImage
impl Sync for BitImage
impl Unpin for BitImage
impl UnwindSafe for BitImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more