Struct visioncortex::color_clusters::Cluster
source · pub struct Cluster {
pub indices: Vec<u32>,
pub holes: Vec<u32>,
pub num_holes: u32,
pub depth: u32,
pub sum: ColorSum,
pub residue_sum: ColorSum,
pub rect: BoundingRect,
pub merged_into: ClusterIndex,
}
Fields§
§indices: Vec<u32>
§holes: Vec<u32>
§num_holes: u32
§depth: u32
§sum: ColorSum
§residue_sum: ColorSum
§rect: BoundingRect
§merged_into: ClusterIndex
Implementations§
source§impl Cluster
impl Cluster
pub fn new() -> Self
pub fn add(&mut self, i: u32, color: &Color, x: i32, y: i32)
pub fn area(&self) -> usize
pub fn iter(&self) -> impl Iterator<Item = &u32>
pub fn color(&self) -> Color
pub fn residue_color(&self) -> Color
pub fn perimeter(&self, parent: &ClustersView<'_>) -> u32
pub fn to_image(&self, parent: &ClustersView<'_>) -> BinaryImage
pub fn to_image_with_hole(&self, parent_width: u32, hole: bool) -> BinaryImage
pub fn render_to_binary_image( &self, parent: &ClustersView<'_>, image: &mut BinaryImage )
pub fn render_to_color_image( &self, parent: &ClustersView<'_>, image: &mut ColorImage )
pub fn render_to_color_image_with_color( &self, parent: &ClustersView<'_>, image: &mut ColorImage, color: &Color )
pub fn to_shape(&self, parent: &ClustersView<'_>) -> Shape
pub fn to_compound_path( &self, parent: &ClustersView<'_>, hole: bool, mode: PathSimplifyMode, corner_threshold: f64, length_threshold: f64, max_iterations: usize, splice_threshold: f64 ) -> CompoundPath
pub fn neighbours(&self, parent: &ClustersView<'_>) -> Vec<ClusterIndex>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cluster
impl RefUnwindSafe for Cluster
impl Send for Cluster
impl Sync for Cluster
impl Unpin for Cluster
impl UnwindSafe for Cluster
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more