pub type PathI32 = Path<PointI32>;Expand description
Path of 2D PointI32
Aliased Type§
pub struct PathI32 {
pub path: Vec<Point2<i32>>,
}Fields§
§path: Vec<Point2<i32>>T can be PointI32/PointF64, etc. (see src/point.rs).
Implementations§
Source§impl PathI32
impl PathI32
Sourcepub fn smooth(
&self,
corner_threshold: f64,
outset_ratio: f64,
segment_length: f64,
max_iterations: usize,
) -> PathF64
pub fn smooth( &self, corner_threshold: f64, outset_ratio: f64, segment_length: f64, max_iterations: usize, ) -> PathF64
Returns a copy of self after Path Smoothing, preserving corners.
corner_threshold is specified in radians.
outset_ratio is a real number >= 1.0.
segment_length is specified in pixels (length unit in path coordinate system).
Source§impl PathI32
impl PathI32
Sourcepub fn simplify(&self, clockwise: bool) -> Self
pub fn simplify(&self, clockwise: bool) -> Self
Returns a copy of self after Path Simplification:
First remove staircases then simplify by limiting penalties.
Sourcepub fn image_to_path(
image: &BinaryImage,
clockwise: bool,
mode: PathSimplifyMode,
) -> PathI32
pub fn image_to_path( image: &BinaryImage, clockwise: bool, mode: PathSimplifyMode, ) -> PathI32
Converts outline of pixel cluster to path with Path Walker. Takes a bool representing the clockwiseness of traversal (useful in svg representation to represent holes). Takes an enum PathSimplifyMode which indicates the required operation:
- Polygon - Walk path and simplify it
- Otherwise - Walk path only
Sourcepub fn to_path_f64(&self) -> PathF64
pub fn to_path_f64(&self) -> PathF64
Returns a copy of self converted to PathF64