Struct 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) -> T
where T: Mul<Output = T>,

Source

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

Source

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

Cast Size to the other coord type

Trait Implementations§

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

Source§

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 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§

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>,

Source§

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>,

Source§

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

Source§

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

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

Source§

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 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> StructuralPartialEq for Size_<T>

Auto Trait Implementations§

§

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

§

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 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.