Struct footile::Plotter
[−]
[src]
pub struct Plotter { /* fields omitted */ }
Plotter for rasterizing vector paths.
Paths are made from lines and splines (quadratic or cubic).
Example
use footile::PlotterBuilder; let mut p = PlotterBuilder::new().build(); p.pen_width(3f32, false) .move_to(50f32, 34f32) .cubic_to(4f32, 16f32, 16f32, 28f32, 0f32, 32f32) .cubic_to(-16f32, -4f32, -4f32, -16f32, 0f32, -32f32) .close() .stroke();
Methods
impl Plotter
[src]
fn width(&self) -> u32
[src]
Get width in pixels.
fn height(&self) -> u32
[src]
Get height in pixels.
fn reset(&mut self) -> &mut Self
[src]
Reset path and lift pen.
fn clear(&mut self) -> &mut Self
[src]
Clear the mask.
fn close(&mut self) -> &mut Self
[src]
Close current sub-path and lift the pen.
fn pen_width(&mut self, width: f32, pixels: bool) -> &mut Self
[src]
Set pen stroke width.
All subsequent path points will be affected, until the stroke width is changed again.
width
Pen stroke width.pixels
Use pixel units (true), or user units (false).
fn join_style(&mut self, js: JoinStyle) -> &mut Self
[src]
Set stroke join style.
js
Join style.
fn move_to(&mut self, bx: f32, by: f32) -> &mut Self
[src]
Move pen to a point and lower it.
bx
X-position of point.by
Y-position of point.
fn line_to(&mut self, bx: f32, by: f32) -> &mut Self
[src]
Add a line from pen to a point.
If pen is lifted, nothing is added.
bx
X-position of end point.by
Y-position of end point.
fn quad_to(&mut self, bx: f32, by: f32, cx: f32, cy: f32) -> &mut Self
[src]
Add a quadratic bézier spline.
The points are A (current pen position), B (control point), and C (spline end point).
If pen is lifted, nothing is added.
bx
X-position of control point.by
Y-position of control point.cx
X-position of end point.cy
Y-position of end point.
fn cubic_to(
&mut self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32
) -> &mut Self
[src]
&mut self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32
) -> &mut Self
Add a cubic bézier spline.
The points are A (current pen position), B (first control point), C (second control point) and D (spline end point).
If pen is lifted, nothing is added.
bx
X-position of first control point.by
Y-position of first control point.cx
X-position of second control point.cy
Y-position of second control point.dx
X-position of end point.dy
Y-position of end point.
fn fill(&mut self, rule: FillRule) -> &mut Self
[src]
Fill path onto the mask. The path is not affected.
rule
Fill rule.
fn stroke(&mut self) -> &mut Self
[src]
Stroke path onto the mask. The path is not affected.
fn mask(&self) -> &Mask
[src]
Get the mask.