Struct opencv::core::Size_

source ·
#[repr(C)]
pub struct Size_<T> { pub width: T, pub height: T, }
Expand description

Fields§

§width: T§height: T

Implementations§

source§

impl<T> Size_<T>

source

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

source

pub fn from_point(pt: Point_<T>) -> Self

source

pub fn area(self) -> Twhere T: Mul<Output = T>,

source

pub fn empty(self) -> boolwhere T: PartialOrd + Zero,

source

pub fn to<D: NumCast>(self) -> Option<Size_<D>>where T: ToPrimitive,

Trait Implementations§

source§

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

§

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<T> Add<Size_<T>> for Size_<T>where Self: AddAssign,

§

type Output = Size_<T>

The resulting type after applying the + operator.
source§

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

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: AddAssign> AddAssign<Size_<T>> for Size_<T>

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl<T: Clone> Clone for Size_<T>

source§

fn clone(&self) -> Size_<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 Size_<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§

fn depth() -> i32

👎Deprecated: Use opencv_depth() instead. Removal in July 2023
source§

fn channels() -> i32

👎Deprecated: Use opencv_channels() instead. Removal in July 2023
source§

fn typ() -> i32

👎Deprecated: Use opencv_type() instead. Removal in July 2023
source§

impl<T: Debug> Debug for Size_<T>

source§

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

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

impl<T: Default> Default for Size_<T>

source§

fn default() -> Size_<T>

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

impl<T> Div<T> for Size_<T>where Self: DivAssign<T>,

§

type Output = Size_<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T: DivAssign + Copy> DivAssign<T> for Size_<T>

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

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

source§

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

Converts to this type from the input type.
source§

impl<T> From<Point_<T>> for Size_<T>

source§

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

Converts to this type from the input type.
source§

impl<T> From<Size_<T>> for Point_<T>

source§

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

Converts to this type from the input type.
source§

impl<T> Mul<T> for Size_<T>where Self: MulAssign<T>,

§

type Output = Size_<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T: MulAssign + Copy> MulAssign<T> for Size_<T>

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl<T: PartialEq> PartialEq<Size_<T>> for Size_<T>

source§

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

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

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

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

impl<T: PartialOrd> PartialOrd<Size_<T>> for Size_<T>

source§

fn partial_cmp(&self, other: &Size_<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

This method 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

This method 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

This method 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

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

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

§

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<T> Sub<Size_<T>> for Size_<T>where Self: SubAssign,

§

type Output = Size_<T>

The resulting type after applying the - operator.
source§

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

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: SubAssign> SubAssign<Size_<T>> for Size_<T>

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl<T: Copy> Copy for Size_<T>

source§

impl<T: Eq> Eq for Size_<T>

source§

impl<T> StructuralEq for Size_<T>

source§

impl<T> StructuralPartialEq for Size_<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Size_<T>where T: RefUnwindSafe,

§

impl<T> Send for Size_<T>where T: Send,

§

impl<T> Sync for Size_<T>where T: Sync,

§

impl<T> Unpin for Size_<T>where T: Unpin,

§

impl<T> UnwindSafe for Size_<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.