[][src]Struct footile::Plotter

pub struct Plotter { /* fields omitted */ }

Plotter for 2D vector paths.

This is a software vector rasterizer featuring anti-aliasing. Paths can be created using PathBuilder. The plotter contains a matte of the current plot, which is affected by fill and stroke calls.

Example

use footile::{PathBuilder, Plotter};
let path = PathBuilder::new().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().build();
let mut p = Plotter::new(100, 100);
p.stroke(&path);

Methods

impl Plotter[src]

pub fn new(width: u32, height: u32) -> Plotter[src]

Create a new plotter.

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

pub fn width(&self) -> u32[src]

Get width in pixels.

pub fn height(&self) -> u32[src]

Get height in pixels.

pub fn clear_matte(&mut self) -> &mut Self[src]

Clear the matte.

pub fn set_tolerance(&mut self, t: f32) -> &mut Self[src]

Set tolerance threshold for curve decomposition.

pub fn set_transform(&mut self, t: Transform) -> &mut Self[src]

Set the transform.

pub fn set_join(&mut self, js: JoinStyle) -> &mut Self[src]

Set stroke join style.

  • js Join style.

pub fn fill<T>(&mut self, ops: T, rule: FillRule) -> &mut Raster<Matte8> where
    T: IntoIterator,
    T::Item: Borrow<PathOp>, 
[src]

Fill path onto the matte.

  • ops PathOp iterator.
  • rule Fill rule.

pub fn stroke<T>(&mut self, ops: T) -> &mut Raster<Matte8> where
    T: IntoIterator,
    T::Item: Borrow<PathOp>, 
[src]

Stroke path onto the matte.

  • ops PathOp iterator.

pub fn matte(&mut self) -> &mut Raster<Matte8>[src]

Get the matte.

Auto Trait Implementations

impl RefUnwindSafe for Plotter

impl Send for Plotter

impl Sync for Plotter

impl Unpin for Plotter

impl UnwindSafe for Plotter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.