Struct rasterize::Path [−][src]
pub struct Path { /* fields omitted */ }
Collection of the SubPath treated as a signle unit
Implementations
impl Path
[src]
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]
&self,
tr: Transform,
flatness: Scalar,
close: bool
) -> impl Iterator<Item = Line> + '_
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]
&self,
rasterizer: R,
tr: Transform,
fill_rule: FillRule,
paint: P,
img: I
) -> I where
R: Rasterizer,
P: Paint,
I: ImageMut<Pixel = LinColor>,
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]
&self,
rasterizer: R,
tr: Transform,
fill_rule: FillRule,
img: I
) -> I where
R: Rasterizer,
I: ImageMut<Pixel = Scalar>,
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 Extend<SubPath> for Path
[src]
impl Extend<SubPath> for Path
[src]fn extend<T: IntoIterator<Item = SubPath>>(&mut self, iter: T)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl IntoIterator for Path
[src]
impl IntoIterator for Path
[src]impl<'a> IntoIterator for &'a Path
[src]
impl<'a> IntoIterator for &'a Path
[src]impl StructuralPartialEq for Path
[src]
impl StructuralPartialEq for Path
[src]Auto Trait Implementations
impl RefUnwindSafe for Path
impl RefUnwindSafe for Path
impl UnwindSafe for Path
impl UnwindSafe for Path