#[non_exhaustive]pub struct RegularGridParams {
pub pipeline: SquareGridParams,
pub canonicalize_top_left: bool,
pub prune_disconnected: bool,
}Expand description
Tuning knobs for RegularGridDetector.
#[non_exhaustive]: new knobs may land in future releases. Build
fully-specified instances with RegularGridParams::new or start
from RegularGridParams::default and override fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pipeline: SquareGridParamsCore seed → grow → extend → fill → validate tuning. The internal regular-grid policy fills in the pattern hooks; this struct carries the geometric knobs only.
The boundary-extension strategy lives on
SquareGridParams::extension (an ExtensionStrategy) — it is
the single source of truth and is honoured directly. Use
Self::with_extension to override it builder-style.
canonicalize_top_left: boolWhen true, detect_regular_grid canonicalises the labelled
grid to a visual top-left origin (+i → right, +j → down in
pixel space) before returning. When false, the grid keeps the
orientation BFS-grow produced (still rebased to (0, 0)).
prune_disconnected: boolWhen true, detect_regular_grid drops corners not
4-connected to the largest labelled component. Off-grid spurious
points and bridged sub-grids both manifest as extra components;
pruning is a pattern-agnostic precision guard.
Implementations§
Source§impl RegularGridParams
impl RegularGridParams
Sourcepub fn new(pipeline: SquareGridParams) -> Self
pub fn new(pipeline: SquareGridParams) -> Self
Construct params from a SquareGridParams, defaulting the
canonicalize_top_left and prune_disconnected toggles to their
Default values (true for both).
The struct is #[non_exhaustive], so this named constructor (or
RegularGridParams::default) is the supported way to build one
outside the crate. Layer the with_* builders on top to override
individual fields. The boundary-extension strategy is configured
via SquareGridParams::extension inside pipeline, or
builder-style with Self::with_extension.
Sourcepub fn with_extension(self, extension: ExtensionStrategy) -> Self
pub fn with_extension(self, extension: ExtensionStrategy) -> Self
Override the boundary-extension strategy. Builder-style setter
that writes SquareGridParams::extension inside pipeline —
the single source of truth for the extension stage.
Sourcepub fn with_canonicalize_top_left(self, on: bool) -> Self
pub fn with_canonicalize_top_left(self, on: bool) -> Self
Override the top-left canonicalisation toggle. Builder-style
setter; see Self::with_extension.
Sourcepub fn with_prune_disconnected(self, on: bool) -> Self
pub fn with_prune_disconnected(self, on: bool) -> Self
Override the connectivity-pruning toggle. Builder-style setter;
see Self::with_extension.
Trait Implementations§
Source§impl Clone for RegularGridParams
impl Clone for RegularGridParams
Source§fn clone(&self) -> RegularGridParams
fn clone(&self) -> RegularGridParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegularGridParams
impl Debug for RegularGridParams
Auto Trait Implementations§
impl Freeze for RegularGridParams
impl RefUnwindSafe for RegularGridParams
impl Send for RegularGridParams
impl Sync for RegularGridParams
impl Unpin for RegularGridParams
impl UnsafeUnpin for RegularGridParams
impl UnwindSafe for RegularGridParams
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
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.