Struct visioncortex::bound::BoundingRect
source · [−]Expand description
The rectangle that bounds an object
Fields
left: i32
top: i32
right: i32
bottom: i32
Implementations
Calculates the squared distance betweeen the center of two BoundingRect
s.
Tolerance means:
1. Extend each boundary on both sides by tolerance
units along its direction.
2. true
is returned iff p
lies on either one of the extended boundaries.
A point p
lying on boundary “strictly” means this function returns true with p
and tolerance
set as 0.
pub fn have_point_on_boundary_or_inside(
&self,
p: PointI32,
boundary_tolerance: usize
) -> bool
pub fn have_point_on_boundary_or_inside(
&self,
p: PointI32,
boundary_tolerance: usize
) -> bool
For definition of boundary_tolerance
, see BoundingRect::have_point_on_boundary().
Given a point on the boundary, return the closest point inside the bounding rect. The behavior is undefined unless ‘p’ is a point on boundary (strictly) and the area of this rect is larger than 1.
Given a point on the boundary, return the closest point outside the bounding rect. Note that if ‘p’ is a corner, there are three closest points, but the diagonal one is always returned. The behavior is undefined unless ‘p’ is a point on boundary (strictly).
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for BoundingRect
impl Send for BoundingRect
impl Sync for BoundingRect
impl Unpin for BoundingRect
impl UnwindSafe for BoundingRect
Blanket Implementations
Mutably borrows from an owned value. Read more