[][src]Struct usvg::PathData

pub struct PathData(pub Vec<PathSegment>);

An SVG path data container.

All segments are in absolute coordinates.

Implementations

impl PathData[src]

pub fn new() -> Self[src]

Creates a new path.

pub fn with_capacity(capacity: usize) -> Self[src]

Creates a new path with a specified capacity.

pub fn from_rect(rect: Rect) -> Self[src]

Creates a path from a rect.

pub fn push_move_to(&mut self, x: f64, y: f64)[src]

Pushes a MoveTo segment to the path.

pub fn push_line_to(&mut self, x: f64, y: f64)[src]

Pushes a LineTo segment to the path.

pub fn push_curve_to(
    &mut self,
    x1: f64,
    y1: f64,
    x2: f64,
    y2: f64,
    x: f64,
    y: f64
)
[src]

Pushes a CurveTo segment to the path.

pub fn push_quad_to(&mut self, x1: f64, y1: f64, x: f64, y: f64)[src]

Pushes a QuadTo segment to the path.

Will be converted into cubic curve.

pub fn push_arc_to(
    &mut self,
    rx: f64,
    ry: f64,
    x_axis_rotation: f64,
    large_arc: bool,
    sweep: bool,
    x: f64,
    y: f64
)
[src]

Pushes an ArcTo segment to the path.

Arc will be converted into cubic curves.

pub fn push_close_path(&mut self)[src]

Pushes a ClosePath segment to the path.

pub fn push_rect(&mut self, rect: Rect)[src]

Pushes a rect to the path.

pub fn bbox(&self) -> Option<Rect>[src]

Calculates path's bounding box.

This operation is expensive.

pub fn bbox_with_transform(
    &self,
    ts: Transform,
    stroke: Option<&Stroke>
) -> Option<Rect>
[src]

Calculates path's bounding box with a specified transform.

This operation is expensive.

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

Checks that path has a bounding box.

This operation is expensive.

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

Calculates path's length.

Length from the first segment to the first MoveTo, ClosePath or slice end.

This operation is expensive.

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

Applies the transform to the path.

pub fn transform_from(&mut self, offset: usize, ts: Transform)[src]

Applies the transform to the path from the specified offset.

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

Returns an iterator over path subpaths.

Trait Implementations

impl Clone for PathData[src]

impl Debug for PathData[src]

impl Default for PathData[src]

impl Deref for PathData[src]

type Target = Vec<PathSegment>

The resulting type after dereferencing.

impl DerefMut for PathData[src]

Auto Trait Implementations

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.