Struct footile::Plotter

source ·
pub struct Plotter { /* private fields */ }
Expand description

Plotter for 2D vector paths.

This is a software vector rasterizer featuring high quality anti-aliasing. Paths can be created using PathBuilder. The plotter contains a Mask of the current plot, which is affected by fill and stroke calls. Using the color_over method will cause a Raster to be created with the same height and width as the mask.

Example

use footile::{PathBuilder, Plotter};
let path = PathBuilder::new().pen_width(3f32)
                       .move_to(50f32, 34f32)
                       .cubic_to(4f32, 16f32, 16f32, 28f32, 0f32, 32f32)
                       .cubic_to(-16f32, -4f32, -4f32, -16f32, 0f32, -32f32)
                       .close().build();
let mut p = Plotter::new(100, 100);
p.stroke(&path);

Implementations

Create a new plotter.

  • width Width in pixels.
  • height Height in pixels.

Get width in pixels.

Get height in pixels.

Clear the mask.

Set tolerance threshold for curve decomposition.

Set the transform.

Set stroke join style.

  • js Join style.

Fill path onto the mask.

  • ops PathOp iterator.
  • rule Fill rule.

Stroke path onto the mask.

  • ops PathOp iterator.

Composite mask with a color onto raster, using “over”.

  • clr Color to composite.

Get the mask.

Get the raster.

Write the plot to a PNG (portable network graphics) file.

  • filename Name of file to write.

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.