[][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 Mask 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_mask(&mut self) -> &mut Self
[src]

Clear the mask.

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<'a, T>(&mut self, ops: T, rule: FillRule) -> &mut Mask where
    T: IntoIterator<Item = &'a PathOp>, 
[src]

Fill path onto the mask.

  • ops PathOp iterator.
  • rule Fill rule.

pub fn stroke<'a, T>(&mut self, ops: T) -> &mut Mask where
    T: IntoIterator<Item = &'a PathOp>, 
[src]

Stroke path onto the mask.

  • ops PathOp iterator.

pub fn mask(&mut self) -> &mut Mask
[src]

Get the mask.

Auto Trait Implementations

impl Send for Plotter

impl Sync for Plotter

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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