#[non_exhaustive]pub enum GridCanvas {
Ascii(AsciiCanvas),
Block(BlockCanvas),
Braille(BrailleCanvas),
Density(DensityCanvas),
Dot(DotCanvas),
}Expand description
A runtime-selected canvas backend for line, scatter, and density plots.
Wraps all five canvas types behind a single enum so that plots can select
the canvas at runtime via CanvasType.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
Source§impl Canvas for GridCanvas
impl Canvas for GridCanvas
Source§fn pixel(&mut self, x: usize, y: usize, color: CanvasColor)
fn pixel(&mut self, x: usize, y: usize, color: CanvasColor)
Sets a single pixel at the given pixel coordinates.
Source§fn glyph_at(&self, col: usize, row: usize) -> char
fn glyph_at(&self, col: usize, row: usize) -> char
Returns the Unicode glyph for the character cell at
(col, row).Source§fn color_at(&self, col: usize, row: usize) -> CanvasColor
fn color_at(&self, col: usize, row: usize) -> CanvasColor
Returns the composited color for the character cell at
(col, row).Source§fn char_width(&self) -> usize
fn char_width(&self) -> usize
The number of character columns in this canvas.
Source§fn char_height(&self) -> usize
fn char_height(&self) -> usize
The number of character rows in this canvas.
Source§fn pixel_width(&self) -> usize
fn pixel_width(&self) -> usize
The total pixel width (character columns times pixels per character).
Source§fn pixel_height(&self) -> usize
fn pixel_height(&self) -> usize
The total pixel height (character rows times pixels per character).
Source§fn transform(&self) -> &Transform2D
fn transform(&self) -> &Transform2D
Returns a reference to this canvas’s coordinate transform.
Source§fn transform_mut(&mut self) -> &mut Transform2D
fn transform_mut(&mut self) -> &mut Transform2D
Returns a mutable reference to this canvas’s coordinate transform.
Source§fn point(&mut self, x: f64, y: f64, color: CanvasColor)
fn point(&mut self, x: f64, y: f64, color: CanvasColor)
Plots a single data-space point, transforming it to pixel coordinates.
Source§fn points(&mut self, xs: &[f64], ys: &[f64], color: CanvasColor)
fn points(&mut self, xs: &[f64], ys: &[f64], color: CanvasColor)
Plots multiple data-space points. Silently ignores mismatched lengths.
Source§fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, color: CanvasColor)
fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, color: CanvasColor)
Draws a line between two data-space points using DDA rasterization.
Source§impl Clone for GridCanvas
impl Clone for GridCanvas
Source§fn clone(&self) -> GridCanvas
fn clone(&self) -> GridCanvas
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridCanvas
impl Debug for GridCanvas
Source§impl PartialEq for GridCanvas
impl PartialEq for GridCanvas
impl StructuralPartialEq for GridCanvas
Auto Trait Implementations§
impl Freeze for GridCanvas
impl RefUnwindSafe for GridCanvas
impl Send for GridCanvas
impl Sync for GridCanvas
impl Unpin for GridCanvas
impl UnsafeUnpin for GridCanvas
impl UnwindSafe for GridCanvas
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C> GraphicsArea for Cwhere
C: Canvas,
impl<C> GraphicsArea for Cwhere
C: Canvas,
Source§fn render_row(&self, row: usize, out: &mut Vec<RowCell>)
fn render_row(&self, row: usize, out: &mut Vec<RowCell>)
Fills
out with the cells for the given row index.Source§fn blank_char(&self) -> char
fn blank_char(&self) -> char
The blank character used to fill empty cells (default: space).
Source§fn prepare_render(&mut self)
fn prepare_render(&mut self)
Called before rendering begins. Override for pre-render setup.
Source§fn finish_render(&mut self)
fn finish_render(&mut self)
Called after rendering completes. Override for post-render cleanup.