pub struct Raster { /* private fields */ }Expand description
A full 32-row frame, in row-major order, containing only 0 (white) or 1 (black).
Implementations§
Source§impl Raster
impl Raster
pub fn new(width: usize, pixels: Vec<u8>) -> Result<Self, Error>
pub fn width(&self) -> usize
pub fn pixels(&self) -> &[u8] ⓘ
Sourcepub fn get(&self, x: usize, y: usize) -> bool
pub fn get(&self, x: usize, y: usize) -> bool
Out-of-frame coordinates are white, including overflowing coordinates.
pub fn pack_columns(&self) -> Vec<u8> ⓘ
pub fn from_packed_columns(width: usize, packed: &[u8]) -> Result<Self, Error>
Trait Implementations§
impl Eq for Raster
impl StructuralPartialEq for Raster
Auto Trait Implementations§
impl Freeze for Raster
impl RefUnwindSafe for Raster
impl Send for Raster
impl Sync for Raster
impl Unpin for Raster
impl UnsafeUnpin for Raster
impl UnwindSafe for Raster
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