[−][src]Struct footile::Plotter
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]
T: IntoIterator<Item = &'a PathOp>,
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]
T: IntoIterator<Item = &'a PathOp>,
Stroke path onto the mask.
ops
PathOp iterator.
pub fn mask(&mut self) -> &mut Mask
[src]
Get the mask.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,