#[repr(C)]pub struct Rect_<T> {
pub x: T,
pub y: T,
pub width: T,
pub height: T,
}
Expand description
Fields§
§x: T
§y: T
§width: T
§height: T
Implementations§
source§impl<T> Rect_<T>
impl<T> Rect_<T>
pub const fn new(x: T, y: T, width: T, height: T) -> Self
pub fn from_point_size(pt: Point_<T>, sz: Size_<T>) -> Self
pub fn from_points(pt1: Point_<T>, pt2: Point_<T>) -> Self
pub const fn tl(&self) -> Point_<T>where
T: Copy,
pub fn br(&self) -> Point_<T>
pub const fn size(&self) -> Size_<T>where
T: Copy,
pub fn area(&self) -> T
pub fn empty(&self) -> boolwhere
T: PartialOrd + Zero,
pub fn contains(&self, pt: Point_<T>) -> bool
Trait Implementations§
source§impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
source§fn add_assign(&mut self, rhs: Point_<P>)
fn add_assign(&mut self, rhs: Point_<P>)
Performs the
+=
operation. Read moresource§impl<S, R: AddAssign<S>> AddAssign<Size_<S>> for Rect_<R>
impl<S, R: AddAssign<S>> AddAssign<Size_<S>> for Rect_<R>
source§fn add_assign(&mut self, rhs: Size_<S>)
fn add_assign(&mut self, rhs: Size_<S>)
Performs the
+=
operation. Read moresource§impl<T: PartialOrd + NumOps + Zero + Copy> BitAndAssign for Rect_<T>where
Self: Default,
impl<T: PartialOrd + NumOps + Zero + Copy> BitAndAssign for Rect_<T>where
Self: Default,
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<T: PartialOrd + NumOps + Zero + Copy> BitOrAssign for Rect_<T>
impl<T: PartialOrd + NumOps + Zero + Copy> BitOrAssign for Rect_<T>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<T: DataType> DataType for Rect_<T>
impl<T: DataType> DataType for Rect_<T>
source§fn opencv_depth() -> i32
fn opencv_depth() -> i32
The shape of bytes occupied by the single layer/channel of the element. E.g. for an 8-bit BGR
image it’s
CV_8U
because a single channel for a pixel is unsigned 8 bits. You should use one
of the depth constants for this like CV_8U
, CV_8S
, CV_32F
, etc.source§fn opencv_channels() -> i32
fn opencv_channels() -> i32
Amount of layers/channels per element. E.g. for an 8-bit BGR image it’s 3 because one pixel
consists of 3 channels: B, G and R.
source§fn opencv_type() -> i32
fn opencv_type() -> i32
OpenCV value for this type as produced by
CV_MAKETYPE()
functionsource§impl<T> From<(T, T, T, T)> for Rect_<T>
impl<T> From<(T, T, T, T)> for Rect_<T>
source§fn from(s: (T, T, T, T)) -> Self
fn from(s: (T, T, T, T)) -> Self
Converts to this type from the input type.
source§impl<T: PartialOrd> PartialOrd for Rect_<T>
impl<T: PartialOrd> PartialOrd for Rect_<T>
source§impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
source§fn sub_assign(&mut self, rhs: Point_<P>)
fn sub_assign(&mut self, rhs: Point_<P>)
Performs the
-=
operation. Read moresource§impl<S, R: SubAssign<S>> SubAssign<Size_<S>> for Rect_<R>
impl<S, R: SubAssign<S>> SubAssign<Size_<S>> for Rect_<R>
source§fn sub_assign(&mut self, rhs: Size_<S>)
fn sub_assign(&mut self, rhs: Size_<S>)
Performs the
-=
operation. Read moreimpl<T: Copy> Copy for Rect_<T>
impl<T: Eq> Eq for Rect_<T>
impl<T> StructuralPartialEq for Rect_<T>
Auto Trait Implementations§
impl<T> Freeze for Rect_<T>where
T: Freeze,
impl<T> RefUnwindSafe for Rect_<T>where
T: RefUnwindSafe,
impl<T> Send for Rect_<T>where
T: Send,
impl<T> Sync for Rect_<T>where
T: Sync,
impl<T> Unpin for Rect_<T>where
T: Unpin,
impl<T> UnwindSafe for Rect_<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)