pub struct Bitmap { /* private fields */ }Expand description
A one-bit-per-pixel image, least-significant bit first, each row padded to a word boundary so a shift never crosses a row. Ward flattens it instead.
Implementations§
Source§impl Bitmap
impl Bitmap
pub fn zeros(width: usize, height: usize) -> Self
pub fn width(&self) -> usize
pub fn height(&self) -> usize
Sourcepub fn get(&self, x: usize, y: usize) -> bool
pub fn get(&self, x: usize, y: usize) -> bool
Panics unless the coordinate is inside the bitmap.
Sourcepub fn set(&mut self, x: usize, y: usize, value: bool)
pub fn set(&mut self, x: usize, y: usize, value: bool)
Panics unless the coordinate is inside the bitmap.
Sourcepub fn count_ones(&self) -> u64
pub fn count_ones(&self) -> u64
Ward’s BitmapTotal. Padding is held clear, so whole words can count.
Sourcepub fn words_per_row(&self) -> usize
pub fn words_per_row(&self) -> usize
How many words each row occupies, padding included.
pub fn row(&self, y: usize) -> &[u64]
Trait Implementations§
impl Eq for Bitmap
impl StructuralPartialEq for Bitmap
Auto Trait Implementations§
impl Freeze for Bitmap
impl RefUnwindSafe for Bitmap
impl Send for Bitmap
impl Sync for Bitmap
impl Unpin for Bitmap
impl UnsafeUnpin for Bitmap
impl UnwindSafe for Bitmap
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