Struct rasterize::Path[][src]

pub struct Path { /* fields omitted */ }

Collection of the SubPath treated as a signle unit

Implementations

impl Path[src]

pub fn new(subpaths: Vec<SubPath>) -> Self[src]

Create path from the list of subpaths

pub fn empty() -> Self[src]

Create empty path

pub fn is_empty(&self) -> bool[src]

pub fn subpaths(&self) -> &[SubPath][src]

pub fn builder() -> PathBuilder[src]

Convenience method to create PathBuilder

pub fn into_builder(self) -> PathBuilder[src]

pub fn transform(&mut self, tr: Transform)[src]

Apply transformation to the path in place

pub fn segments_count(&self) -> usize[src]

pub fn stroke(&self, style: StrokeStyle) -> Path[src]

Stroke path

Stroked path is the path constructed from original by offsetting by distance/2 and joinging it with the path offsetted by -distance/2.

pub fn flatten(
    &self,
    tr: Transform,
    flatness: Scalar,
    close: bool
) -> impl Iterator<Item = Line> + '_
[src]

Convert path to an iterator over line segments

pub fn bbox(&self, tr: Transform) -> Option<BBox>[src]

Bounding box of the path after provided transformation is applied.

pub fn size(&self, tr: Transform) -> Option<(Size, Transform, Point)>[src]

Calclulate size of the image required to render the path

Returns:

  • Size of the image
  • Transformation required
  • Position of lowest x and y point of the image

pub fn reverse(&self) -> Self[src]

Rreverse order and direction of all segments

pub fn fill<R, P, I>(
    &self,
    rasterizer: R,
    tr: Transform,
    fill_rule: FillRule,
    paint: P,
    img: I
) -> I where
    R: Rasterizer,
    P: Paint,
    I: ImageMut<Pixel = LinColor>, 
[src]

Fill path with the provided paint

pub fn mask<R, I>(
    &self,
    rasterizer: R,
    tr: Transform,
    fill_rule: FillRule,
    img: I
) -> I where
    R: Rasterizer,
    I: ImageMut<Pixel = Scalar>, 
[src]

Rasterize mast for the path in into a provided image.

Everything that is outside of the image will be cropped. Image is assumed to contain zeros.

pub fn to_svg_path(&self) -> String[src]

Convert path to SVG path representation

pub fn write_svg_path(&self, out: impl Write) -> Result<()>[src]

Save path in SVG path format.

pub fn read_svg_path(input: impl Read) -> Result<Self>[src]

Load path from SVG path representation

Trait Implementations

impl Clone for Path[src]

impl Debug for Path[src]

impl Default for Path[src]

impl Extend<SubPath> for Path[src]

impl FromStr for Path[src]

type Err = SvgPathParserError

The associated error which can be returned from parsing.

impl IntoIterator for Path[src]

type Item = SubPath

The type of the elements being iterated over.

type IntoIter = <Vec<SubPath> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl<'a> IntoIterator for &'a Path[src]

type Item = &'a SubPath

The type of the elements being iterated over.

type IntoIter = <&'a Vec<SubPath> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl PartialEq<Path> for Path[src]

impl StructuralPartialEq for Path[src]

Auto Trait Implementations

impl RefUnwindSafe for Path

impl Send for Path

impl Sync for Path

impl Unpin for Path

impl UnwindSafe for Path

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.