Struct andrew::Canvas[][src]

pub struct Canvas<'a> {
    pub buffer: &'a mut [u8],
    pub width: usize,
    pub height: usize,
    pub stride: usize,
    pub pixel_size: usize,
}

The canvas object acts as a wrapper around a buffer, providing information and functions for drawing

Fields

A buffer for the canvas to draw to

The width in pixels of the canvas

The height in pixels of the canvas

The number of bytes between each line of pixels on the canvas

The number of bytes contained in each pixel

Methods

impl<'a> Canvas<'a>
[src]

Creates a new canvas object

Draws an object that implements the Drawable trait to the buffer

Draws a pixel at the x and y coordinate

Clears the entire canvas buffer by zeroing it

Auto Trait Implementations

impl<'a> Send for Canvas<'a>

impl<'a> Sync for Canvas<'a>