pub trait Canvas {
    fn new(desc: CanvasDescriptor) -> Result<Self, DrawError>
    where
        Self: Sized
; fn draw_shape(&mut self, desc: ShapeDescriptor<'_>) -> Result<(), DrawError>; fn draw_line(&mut self, desc: LineDescriptor<'_>) -> Result<(), DrawError>; fn draw_curve(&mut self, desc: CurveDescriptor<'_>) -> Result<(), DrawError>; fn fill_region(&mut self, desc: FillDescriptor) -> Result<(), DrawError>; fn draw_text(&mut self, desc: TextDescriptor) -> Result<(), DrawError>; fn text_size(&mut self, desc: TextDescriptor) -> Result<Size, DrawError>; fn save_file<P: AsRef<Path>>(
        &mut self,
        desc: SaveFileDescriptor<P>
    ) -> Result<(), DrawError>; fn size(&self) -> Result<Size, DrawError>; }
Expand description

Represents a structure used for drawing.

Required Methods

The main constructor.

Draws a shape described by a ShapeDescriptor.

Draws a line described by a LineDescriptor.

Draws a curve described by a CurveDescriptor.

Draws color in a closed, arbitrary region described by a FillDescriptor.

Draws text described by a TextDescriptor.

Returns a Size representing the extent of the text described by a TextDescriptor.

Save the image to a file.

Get canvas size.

Implementors