Struct imageproc::rect::Rect [] [src]

pub struct Rect { /* fields omitted */ }

A rectangular region of non-zero width and height.

Examples

use imageproc::rect::Rect;
use imageproc::rect::Region;

// Construct a rectangle with top-left corner at (4, 5), width 6 and height 7.
let rect = Rect::at(4, 5).of_size(6, 7);

// Contains top-left point:
assert_eq!(rect.left(), 4);
assert_eq!(rect.top(), 5);
assert!(rect.contains(rect.left(), rect.top()));

// Contains bottom-right point, at (left + width - 1, top + height - 1):
assert_eq!(rect.right(), 9);
assert_eq!(rect.bottom(), 11);
assert!(rect.contains(rect.right(), rect.bottom()));

Methods

impl Rect
[src]

Reduces possibility of confusing coordinates and dimensions when specifying rects.

Smallest y-coordinate reached by rect.

Smallest x-coordinate reached by rect.

Greatest y-coordinate reached by rect.

Greatest x-coordinate reached by rect.

Width of rect.

Height of rect.

Returns the intersection of self and other, or none if they are are disjoint.

Trait Implementations

impl Copy for Rect
[src]

impl Clone for Rect
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Rect
[src]

Formats the value using the given formatter.

impl PartialEq for Rect
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Rect
[src]

impl Region<i32> for Rect
[src]

Whether this region contains the given point.

impl Region<f32> for Rect
[src]

Whether this region contains the given point.