Struct rasterize::Line[][src]

pub struct Line(pub [Point; 2]);

Line segment curve

Implementations

impl Line[src]

pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Self[src]

pub fn length(&self) -> Scalar[src]

Length of the line

pub fn points(&self) -> [Point; 2][src]

Start and end points of the line

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

pub fn intersect(&self, other: Line) -> Option<(Scalar, Scalar)>[src]

Find intersection of two lines

Returns pair of t parameters for this line and the other line. Found by solving self.at(t0) == other.at(t1). Actual intersection of line segments can be found by making sure that 0.0 <= t0 <= 1.0 && 0.0 <= t1 <= 1.0

pub fn intersect_point(&self, other: Line) -> Option<Point>[src]

Find intersection point between two line segments

pub fn direction(&self) -> Point[src]

Direction vector associated with the line segment

Trait Implementations

impl Clone for Line[src]

impl Copy for Line[src]

impl Curve for Line[src]

impl Debug for Line[src]

impl Display for Line[src]

impl From<Line> for Segment[src]

impl FromStr for Line[src]

type Err = SvgPathParserError

The associated error which can be returned from parsing.

impl PartialEq<Line> for Line[src]

impl StructuralPartialEq for Line[src]

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

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.