pub struct Plotter { /* private fields */ }
Expand description
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);
Implementations
sourceimpl Plotter
impl Plotter
sourcepub fn new(width: u32, height: u32) -> Plotter
pub fn new(width: u32, height: u32) -> Plotter
Create a new plotter.
width
Width in pixels.height
Height in pixels.
sourcepub fn clear_mask(&mut self) -> &mut Self
pub fn clear_mask(&mut self) -> &mut Self
Clear the mask.
sourcepub fn set_tolerance(&mut self, t: f32) -> &mut Self
pub fn set_tolerance(&mut self, t: f32) -> &mut Self
Set tolerance threshold for curve decomposition.
sourcepub fn set_transform(&mut self, t: Transform) -> &mut Self
pub fn set_transform(&mut self, t: Transform) -> &mut Self
Set the transform.
sourcepub fn fill<'a, T>(&mut self, ops: T, rule: FillRule) -> &mut Maskwhere
T: IntoIterator<Item = &'a PathOp>,
pub fn fill<'a, T>(&mut self, ops: T, rule: FillRule) -> &mut Maskwhere
T: IntoIterator<Item = &'a PathOp>,
Fill path onto the mask.
ops
PathOp iterator.rule
Fill rule.
sourcepub fn stroke<'a, T>(&mut self, ops: T) -> &mut Maskwhere
T: IntoIterator<Item = &'a PathOp>,
pub fn stroke<'a, T>(&mut self, ops: T) -> &mut Maskwhere
T: IntoIterator<Item = &'a PathOp>,
Stroke path onto the mask.
ops
PathOp iterator.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more