[][src]Trait plotters::drawing::backend::DrawingBackend

pub trait DrawingBackend {
type ErrorType: Error;
    fn get_size(&self) -> (u32, u32);
fn open(&mut self) -> Result<(), DrawingErrorKind<Self::ErrorType>>;
fn close(&mut self) -> Result<(), DrawingErrorKind<Self::ErrorType>>;
fn draw_pixel<C: Color>(
        &mut self,
        point: BackendCoord,
        color: &C
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>>; fn draw_line<C: Color>(
        &mut self,
        from: BackendCoord,
        to: BackendCoord,
        color: &C
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> { ... }
fn draw_rect<C: Color>(
        &mut self,
        upper_left: BackendCoord,
        bottom_right: BackendCoord,
        color: &C,
        fill: bool
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> { ... }
fn draw_path<C: Color, I: IntoIterator<Item = BackendCoord>>(
        &mut self,
        path: I,
        color: &C
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> { ... }
fn draw_circle<C: Color>(
        &mut self,
        center: BackendCoord,
        radius: u32,
        color: &C,
        fill: bool
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> { ... }
fn draw_text<'a, C: Color>(
        &mut self,
        text: &str,
        font: &FontDesc<'a>,
        pos: BackendCoord,
        color: &C
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> { ... } }

The drawing context

Associated Types

type ErrorType: Error

The error reported by the backend

Loading content...

Required methods

fn get_size(&self) -> (u32, u32)

Dimension

fn open(&mut self) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Start drawing

fn close(&mut self) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Stop drawing

fn draw_pixel<C: Color>(
    &mut self,
    point: BackendCoord,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a pixel

Loading content...

Provided methods

fn draw_line<C: Color>(
    &mut self,
    from: BackendCoord,
    to: BackendCoord,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a line

fn draw_rect<C: Color>(
    &mut self,
    upper_left: BackendCoord,
    bottom_right: BackendCoord,
    color: &C,
    fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a rectangle

fn draw_path<C: Color, I: IntoIterator<Item = BackendCoord>>(
    &mut self,
    path: I,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a path

fn draw_circle<C: Color>(
    &mut self,
    center: BackendCoord,
    radius: u32,
    color: &C,
    fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a circle

fn draw_text<'a, C: Color>(
    &mut self,
    text: &str,
    font: &FontDesc<'a>,
    pos: BackendCoord,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Draw a text

Loading content...

Implementors

impl<'a> DrawingBackend for BitMapBackend<'a>[src]

type ErrorType = ImageError

fn draw_line<C: Color>(
    &mut self,
    from: BackendCoord,
    to: BackendCoord,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]

fn draw_rect<C: Color>(
    &mut self,
    upper_left: BackendCoord,
    bottom_right: BackendCoord,
    color: &C,
    fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]

fn draw_path<C: Color, I: IntoIterator<Item = BackendCoord>>(
    &mut self,
    path: I,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]

fn draw_circle<C: Color>(
    &mut self,
    center: BackendCoord,
    radius: u32,
    color: &C,
    fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]

fn draw_text<'a, C: Color>(
    &mut self,
    text: &str,
    font: &FontDesc<'a>,
    pos: BackendCoord,
    color: &C
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]

impl<'a> DrawingBackend for SVGBackend<'a>[src]

type ErrorType = Error

Loading content...