[−][src]Struct plotters_canvas::CanvasBackend
The backend that is drawing on the HTML canvas TODO: Support double buffering
Implementations
impl CanvasBackend
[src]
pub fn new(elem_id: &str) -> Option<Self>
[src]
Create a new drawing backend backed with an HTML5 canvas object with given Id
elem_id
The element id for the canvas- Return either some drawing backend has been created, or none in error case
pub fn with_canvas_object(canvas: HtmlCanvasElement) -> Option<Self>
[src]
Create a new drawing backend backend with a HTML5 canvas object passed in
canvas
The object we want to use as backend- Return either the drawing backend or None for error
Trait Implementations
impl DrawingBackend for CanvasBackend
[src]
type ErrorType = CanvasError
The error type reported by the backend
fn get_size(&self) -> (u32, u32)
[src]
fn ensure_prepared(&mut self) -> Result<(), DrawingErrorKind<CanvasError>>
[src]
fn present(&mut self) -> Result<(), DrawingErrorKind<CanvasError>>
[src]
fn draw_pixel(
&mut self,
point: BackendCoord,
style: BackendColor
) -> Result<(), DrawingErrorKind<CanvasError>>
[src]
&mut self,
point: BackendCoord,
style: BackendColor
) -> Result<(), DrawingErrorKind<CanvasError>>
fn draw_line<S: BackendStyle>(
&mut self,
from: BackendCoord,
to: BackendCoord,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
from: BackendCoord,
to: BackendCoord,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn draw_rect<S: BackendStyle>(
&mut self,
upper_left: BackendCoord,
bottom_right: BackendCoord,
style: &S,
fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
upper_left: BackendCoord,
bottom_right: BackendCoord,
style: &S,
fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn draw_path<S: BackendStyle, I: IntoIterator<Item = BackendCoord>>(
&mut self,
path: I,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
path: I,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn fill_polygon<S: BackendStyle, I: IntoIterator<Item = BackendCoord>>(
&mut self,
path: I,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
path: I,
style: &S
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn draw_circle<S: BackendStyle>(
&mut self,
center: BackendCoord,
radius: u32,
style: &S,
fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
center: BackendCoord,
radius: u32,
style: &S,
fill: bool
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn draw_text<S: BackendTextStyle>(
&mut self,
text: &str,
style: &S,
pos: BackendCoord
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
text: &str,
style: &S,
pos: BackendCoord
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
fn estimate_text_size<TStyle>(
&self,
text: &str,
style: &TStyle
) -> Result<(u32, u32), DrawingErrorKind<Self::ErrorType>> where
TStyle: BackendTextStyle,
[src]
&self,
text: &str,
style: &TStyle
) -> Result<(u32, u32), DrawingErrorKind<Self::ErrorType>> where
TStyle: BackendTextStyle,
fn blit_bitmap(
&mut self,
pos: (i32, i32),
(u32, u32),
src: &'a [u8]
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
[src]
&mut self,
pos: (i32, i32),
(u32, u32),
src: &'a [u8]
) -> Result<(), DrawingErrorKind<Self::ErrorType>>
Auto Trait Implementations
impl RefUnwindSafe for CanvasBackend
impl !Send for CanvasBackend
impl !Sync for CanvasBackend
impl Unpin for CanvasBackend
impl UnwindSafe for CanvasBackend
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,