Skip to main content

GraphicsArea

Trait GraphicsArea 

Source
pub trait GraphicsArea {
    // Required methods
    fn nrows(&self) -> usize;
    fn ncols(&self) -> usize;
    fn render_row(&self, row: usize, out: &mut RowBuffer);

    // Provided methods
    fn blank_char(&self) -> char { ... }
    fn prepare_render(&mut self) { ... }
    fn finish_render(&mut self) { ... }
}
Expand description

Anything that can be rendered row by row into a Plot.

All Canvas types implement this trait automatically via a blanket impl that delegates to Canvas::glyph_at and Canvas::color_at.

Required Methods§

Source

fn nrows(&self) -> usize

The number of character rows in the graphics area.

Source

fn ncols(&self) -> usize

The number of character columns in the graphics area.

Source

fn render_row(&self, row: usize, out: &mut RowBuffer)

Fills out with the cells for the given row index.

Provided Methods§

Source

fn blank_char(&self) -> char

The blank character used to fill empty cells (default: space).

Source

fn prepare_render(&mut self)

Called before rendering begins. Override for pre-render setup.

Source

fn finish_render(&mut self)

Called after rendering completes. Override for post-render cleanup.

Implementors§