pub struct SquarePixelGrid { /* private fields */ }
Expand description
Wraps a Canvas
and exposes a grid of square
“pixels”. The size of the grid (2 * height, width)
of the dimensions of the
wrapped canvas. This is implemented using Unicode’s upper half block
character.
Implementations§
Source§impl SquarePixelGrid
impl SquarePixelGrid
pub fn new(size: Size) -> Self
pub fn from_available(size: Size) -> Self
Sourcepub fn size(&self) -> Size
pub fn size(&self) -> Size
Returns the size of this square pixel grid. The grid has the same width as the wrapped canvas and twice the height.
pub fn draw(&mut self, position: Position, colour: Colour)
pub fn into_canvas(self) -> Canvas
Auto Trait Implementations§
impl Freeze for SquarePixelGrid
impl RefUnwindSafe for SquarePixelGrid
impl Send for SquarePixelGrid
impl Sync for SquarePixelGrid
impl Unpin for SquarePixelGrid
impl UnwindSafe for SquarePixelGrid
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