Type Alias visioncortex::PathI32

source ·
pub type PathI32 = Path<PointI32>;
Expand description

Path of 2D PointI32

Aliased Type§

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

source

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

source

pub fn simplify(&self, clockwise: bool) -> Self

Returns a copy of self after Path Simplification:

First remove staircases then simplify by limiting penalties.

source

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
source

pub fn to_path_f64(&self) -> PathF64

Returns a copy of self converted to PathF64