[−][src]Struct footile::Plotter
Plotter for 2D vector paths.
This is a software vector rasterizer featuring anti-aliasing. The plotter contains a raster, which is drawn by fill and stroke calls.
Example
use footile::{Path2D, Plotter}; use pix::rgb::Rgba8p; use pix::Raster; let path = Path2D::default() .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() .finish(); let mut p = Plotter::new(Raster::with_clear(100, 100)); p.stroke(&path, Rgba8p::new(255, 128, 0, 255));
Implementations
impl<P> Plotter<P> where
P: Pixel<Chan = Ch8, Alpha = Premultiplied, Gamma = Linear>,
[src]
P: Pixel<Chan = Ch8, Alpha = Premultiplied, Gamma = Linear>,
pub fn new(raster: Raster<P>) -> Self
[src]
Create a new plotter.
raster
Raster to draw.
pub fn width(&self) -> u32
[src]
Get width in pixels.
pub fn height(&self) -> u32
[src]
Get height in pixels.
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, rule: FillRule, ops: T, clr: P) -> &mut Raster<P> where
T: IntoIterator,
T::Item: Borrow<PathOp>,
[src]
T: IntoIterator,
T::Item: Borrow<PathOp>,
Fill path onto the raster.
rule
Fill rule.ops
PathOp iterator.clr
Color to fill.
pub fn stroke<T>(&mut self, ops: T, clr: P) -> &mut Raster<P> where
T: IntoIterator,
T::Item: Borrow<PathOp>,
[src]
T: IntoIterator,
T::Item: Borrow<PathOp>,
Stroke path onto the raster.
ops
PathOp iterator.clr
Color to stroke.
pub fn raster(self) -> Raster<P>
[src]
Get the raster.
Auto Trait Implementations
impl<P> RefUnwindSafe for Plotter<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for Plotter<P> where
P: Send,
P: Send,
impl<P> Sync for Plotter<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Plotter<P>
impl<P> UnwindSafe for Plotter<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,