opencv::core

Struct Rect_

source
#[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>

source

pub const fn new(x: T, y: T, width: T, height: T) -> Self

source

pub fn from_point_size(pt: Point_<T>, sz: Size_<T>) -> Self

source

pub fn from_points(pt1: Point_<T>, pt2: Point_<T>) -> Self
where T: PartialOrd + Sub<Output = T> + Copy,

source

pub const fn tl(&self) -> Point_<T>
where T: Copy,

source

pub fn br(&self) -> Point_<T>
where T: Add<Output = T> + Copy,

source

pub const fn size(&self) -> Size_<T>
where T: Copy,

source

pub fn area(&self) -> T
where T: Mul<Output = T> + Copy,

source

pub fn empty(&self) -> bool
where T: PartialOrd + Zero,

source

pub fn contains(&self, pt: Point_<T>) -> bool
where T: PartialOrd + Add<Output = T> + Copy,

source

pub fn to<D: NumCast>(&self) -> Option<Rect_<D>>
where T: ToPrimitive + Copy,

Cast Rect to the other coord and size type

Trait Implementations§

source§

impl<P, R> Add<Point_<P>> for Rect_<R>
where Self: AddAssign<Point_<P>>,

source§

type Output = Rect_<R>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Point_<P>) -> Self::Output

Performs the + operation. Read more
source§

impl<S, R> Add<Size_<S>> for Rect_<R>
where Self: AddAssign<Size_<S>>,

source§

type Output = Rect_<R>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Size_<S>) -> Self::Output

Performs the + operation. Read more
source§

impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>

source§

fn add_assign(&mut self, rhs: Point_<P>)

Performs the += operation. Read more
source§

impl<S, R: AddAssign<S>> AddAssign<Size_<S>> for Rect_<R>

source§

fn add_assign(&mut self, rhs: Size_<S>)

Performs the += operation. Read more
source§

impl<T> BitAnd for Rect_<T>
where Rect_<T>: BitAndAssign,

source§

type Output = Rect_<T>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<T: PartialOrd + NumOps + Zero + Copy> BitAndAssign for Rect_<T>
where Self: Default,

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl<T> BitOr for Rect_<T>
where Rect_<T>: BitOrAssign,

source§

type Output = Rect_<T>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<T: PartialOrd + NumOps + Zero + Copy> BitOrAssign for Rect_<T>

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl<T: Clone> Clone for Rect_<T>

source§

fn clone(&self) -> Rect_<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: DataType> DataType for Rect_<T>

source§

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

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

OpenCV value for this type as produced by CV_MAKETYPE() function
source§

impl<T: Debug> Debug for Rect_<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default> Default for Rect_<T>

source§

fn default() -> Rect_<T>

Returns the “default value” for a type. Read more
source§

impl<T: PartialOrd + Sub<Output = T> + Copy> From<(Point_<T>, Point_<T>)> for Rect_<T>

source§

fn from(s: (Point_<T>, Point_<T>)) -> Self

Converts to this type from the input type.
source§

impl<T> From<(Point_<T>, Size_<T>)> for Rect_<T>

source§

fn from(s: (Point_<T>, Size_<T>)) -> Self

Converts to this type from the input type.
source§

impl<T> From<(T, T, T, T)> for Rect_<T>

source§

fn from(s: (T, T, T, T)) -> Self

Converts to this type from the input type.
source§

impl<T: PartialEq> PartialEq for Rect_<T>

source§

fn eq(&self, other: &Rect_<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd> PartialOrd for Rect_<T>

source§

fn partial_cmp(&self, other: &Rect_<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<P, R> Sub<Point_<P>> for Rect_<R>
where Self: SubAssign<Point_<P>>,

source§

type Output = Rect_<R>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Point_<P>) -> Self::Output

Performs the - operation. Read more
source§

impl<S, R> Sub<Size_<S>> for Rect_<R>
where Self: SubAssign<Size_<S>>,

source§

type Output = Rect_<R>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Size_<S>) -> Self::Output

Performs the - operation. Read more
source§

impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>

source§

fn sub_assign(&mut self, rhs: Point_<P>)

Performs the -= operation. Read more
source§

impl<S, R: SubAssign<S>> SubAssign<Size_<S>> for Rect_<R>

source§

fn sub_assign(&mut self, rhs: Size_<S>)

Performs the -= operation. Read more
source§

impl<T: Copy> Copy for Rect_<T>

source§

impl<T: Eq> Eq for Rect_<T>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.