Struct cv::core::Rect[][src]

#[repr(C)]pub struct Rect {
    pub x: c_int,
    pub y: c_int,
    pub width: c_int,
    pub height: c_int,
}

The Rect defines a rectangle in integer.

Fields

x: c_int

x coordinate of the left-top corner

y: c_int

y coordinate of the left-top corner

width: c_int

width of this rectangle

height: c_int

height of this rectangle

Implementations

impl Rect[src]

pub fn new(x: c_int, y: c_int, width: c_int, height: c_int) -> Self[src]

Creates a new Rect with (x, y, width, height) parameters.

pub fn scale(&self, ratio: f32) -> Rect[src]

Scales the rectangle by the specified ratio.

pub fn normalize_to_mat(&self, mat: &Mat) -> Rect2f[src]

Normalize the rectangle according to the image (if the rectangle is inside the image, then the result should be all within (0, 1).

Trait Implementations

impl Clone for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

impl Default for Rect[src]

impl Eq for Rect[src]

impl PartialEq<Rect> for Rect[src]

impl StructuralEq for Rect[src]

impl StructuralPartialEq for Rect[src]

Auto Trait Implementations

impl RefUnwindSafe for Rect

impl Send for Rect

impl Sync for Rect

impl Unpin for Rect

impl UnwindSafe for Rect

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.