[−][src]Struct usvg::PathData
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]
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x: f64,
y: f64
)
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]
&mut self,
rx: f64,
ry: f64,
x_axis_rotation: f64,
large_arc: bool,
sweep: bool,
x: f64,
y: f64
)
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]
&self,
ts: Transform,
stroke: Option<&Stroke>
) -> Option<Rect>
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.
fn deref(&self) -> &Self::Target
[src]
impl DerefMut for PathData
[src]
Auto Trait Implementations
impl RefUnwindSafe for PathData
impl Send for PathData
impl Sync for PathData
impl Unpin for PathData
impl UnwindSafe for PathData
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,