pub struct MaskPipeline { /* private fields */ }Expand description
An ordered mask processing pipeline.
Implementations§
Source§impl MaskPipeline
impl MaskPipeline
Sourcepub fn operations(&self) -> &[MaskOperation]
pub fn operations(&self) -> &[MaskOperation]
Return the ordered operations in this pipeline.
Sourcepub fn threshold_with(self, value: u8) -> Self
pub fn threshold_with(self, value: u8) -> Self
Add a threshold operation with a custom value.
Sourcepub fn dilate_with(self, radius: f32) -> Self
pub fn dilate_with(self, radius: f32) -> Self
Add a dilation operation with a custom radius.
A radius of zero leaves the mask unchanged.
§Panics
Panics if radius is negative or NaN.
Sourcepub fn erode_with(self, radius: f32) -> Self
pub fn erode_with(self, radius: f32) -> Self
Add an erosion operation with the default boundary behavior.
A radius of zero leaves the mask unchanged.
§Panics
Panics if radius is negative or NaN.
Sourcepub fn erode_with_border_mode(
self,
radius: f32,
border_mode: ErosionBorderMode,
) -> Self
pub fn erode_with_border_mode( self, radius: f32, border_mode: ErosionBorderMode, ) -> Self
Add an erosion operation with a custom radius and boundary behavior.
A radius of zero leaves the mask unchanged.
§Panics
Panics if radius is negative or NaN.
Sourcepub fn fill_holes_with(self, threshold: u8) -> Self
pub fn fill_holes_with(self, threshold: u8) -> Self
Add a hole-filling operation with a custom threshold.
Sourcepub fn keep_largest_component(self) -> Self
pub fn keep_largest_component(self) -> Self
Keep only the largest connected foreground component.
Sourcepub fn keep_n_largest_components(self, count: usize) -> Self
pub fn keep_n_largest_components(self, count: usize) -> Self
Keep the largest count connected foreground components.
Sourcepub fn drop_components_below_area(self, min_area: f32) -> Self
pub fn drop_components_below_area(self, min_area: f32) -> Self
Drop connected foreground components below min_area pixels.
§Panics
Panics if min_area is negative or NaN.
Trait Implementations§
Source§impl Clone for MaskPipeline
impl Clone for MaskPipeline
Source§impl Debug for MaskPipeline
impl Debug for MaskPipeline
Source§impl Default for MaskPipeline
impl Default for MaskPipeline
Source§impl PartialEq for MaskPipeline
impl PartialEq for MaskPipeline
impl StructuralPartialEq for MaskPipeline
Auto Trait Implementations§
impl Freeze for MaskPipeline
impl RefUnwindSafe for MaskPipeline
impl Send for MaskPipeline
impl Sync for MaskPipeline
impl Unpin for MaskPipeline
impl UnsafeUnpin for MaskPipeline
impl UnwindSafe for MaskPipeline
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.