[][src]Struct cv::Rect

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

The Rect defines a rectangle in integer.

Fields

x: i32

x coordinate of the left-top corner

y: i32

y coordinate of the left-top corner

width: i32

width of this rectangle

height: i32

height of this rectangle

Methods

impl Rect[src]

pub fn new(x: i32, y: i32, width: i32, height: i32) -> 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 PartialEq<Rect> for Rect[src]

impl Default for Rect[src]

impl Clone for Rect[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

Auto Trait Implementations

impl Send for Rect

impl Sync for Rect

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.