Enum rasterize::Segment[][src]

pub enum Segment {
    Line(Line),
    Quad(Quad),
    Cubic(Cubic),
}

Segment is an enum of either Line, Quad or Cubic

Variants

Line(Line)
Quad(Quad)
Cubic(Cubic)

Implementations

impl Segment[src]

pub fn ends(&self) -> (Line, Line)[src]

pub fn intersect(
    self,
    other: impl Into<Segment>,
    tolerance: Scalar
) -> Vec<Point>
[src]

Find intersection between two segments

This might not be the fastest method possible but works for any two curves. Divide cuves as long as there is intersection between bounding boxes, if the intersection is smaller then tolerance we can treat it as an intersection point.

pub fn to_line(&self) -> Option<Line>[src]

Convert to line if it is a line variant of the segment

pub fn to_quad(&self) -> Option<Quad>[src]

Convert to quad if it is a quad variant of the segment

pub fn to_cubic(&self) -> Option<Cubic>[src]

Convert to cubic if it is a cubic variant of the segment

pub fn line_join(
    self,
    other: Segment,
    stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
[src]

Produce iterator over segments that join to segments with the specified method.

pub fn line_cap(
    self,
    other: Segment,
    stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
[src]

Produce and iterator over segments that adds caps between two segments

Trait Implementations

impl Clone for Segment[src]

impl Copy for Segment[src]

impl Curve for Segment[src]

impl Debug for Segment[src]

impl Display for Segment[src]

impl From<Cubic> for Segment[src]

impl From<Line> for Segment[src]

impl From<Quad> for Segment[src]

impl FromStr for Segment[src]

type Err = SvgPathParserError

The associated error which can be returned from parsing.

impl PartialEq<Segment> for Segment[src]

impl StructuralPartialEq for Segment[src]

Auto Trait Implementations

impl RefUnwindSafe for Segment

impl Send for Segment

impl Sync for Segment

impl Unpin for Segment

impl UnwindSafe for Segment

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> ToString for T where
    T: Display + ?Sized
[src]

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.