pub struct Plotter<P> where
    P: Pixel<Chan = Ch8, Alpha = Premultiplied, Gamma = Linear>, 
{ /* private fields */ }
Expand description

Plotter for 2D vector paths.

This is a software vector rasterizer featuring anti-aliasing. The plotter contains a raster, which is drawn by fill and stroke calls.

Example

use footile::{Path2D, Plotter};
use pix::rgb::Rgba8p;
use pix::Raster;

let path = Path2D::default()
    .pen_width(3.0)
    .move_to(50.0, 34.0)
    .cubic_to(4.0, 16.0, 16.0, 28.0, 0.0, 32.0)
    .cubic_to(-16.0, -4.0, -4.0, -16.0, 0.0, -32.0)
    .close()
    .finish();
let mut p = Plotter::new(Raster::with_clear(100, 100));
p.stroke(&path, Rgba8p::new(255, 128, 0, 255));

Implementations

Create a new plotter.

  • raster Raster to draw.

Get width in pixels.

Get height in pixels.

Set tolerance threshold for curve decomposition.

Set the transform.

Set stroke join style.

  • js Join style.

Fill path onto the raster.

  • rule Fill rule.
  • ops PathOp iterator.
  • clr Color to fill.

Stroke path onto the raster.

  • ops PathOp iterator.
  • clr Color to stroke.

Get a reference to the raster.

Get a mutable reference to the raster.

Consume the plotter and get the raster.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.