Defines a 2D rectangle with top-left corner coordinates and width/height in pixels. More...
Functions | |
Rect (size_t x_=0, size_t y_=0, size_t w_=0, size_t h_=0) | |
size_t | area () |
Returns the area of the rectangle. More... | |
bool | operator== (const Rect &that) const |
Tests if the given Rect has the same properties. More... | |
bool | operator!= (const Rect &that) const |
Tests if the given Rect has different properties. More... | |
bool | isEmpty () const |
Tests if the given Rect is empty (width or/and height is null) More... | |
bool | contains (const Rect &target, bool proper=false) const |
Tests if this Rect contains the <target> Rect. More... | |
bool | isContained (const Rect &target, bool proper=false) const |
Tests if this Rect is contained inside the given <target> Rect. More... | |
bool | isContained (const Resolution &resolution, bool proper=false) const |
Overloaded function. Tests if this Rect is contained inside a given Resolution. It tests if the current rect is contained inside a Rect defined by Rect(O,0,resolution.width,resolution.height). More... | |
Attributes | |
size_t | x |
size_t | y |
size_t | width |
size_t | height |
Defines a 2D rectangle with top-left corner coordinates and width/height in pixels.
|
inline |
|
inline |
Returns the area of the rectangle.
|
inline |
Tests if the given Rect has the same properties.
|
inline |
Tests if the given Rect has different properties.
|
inline |
Tests if the given Rect is empty (width or/and height is null)
|
inline |
|
inline |
|
inline |
Overloaded function. Tests if this Rect is contained inside a given Resolution. It tests if the current rect is contained inside a Rect defined by Rect(O,0,resolution.width,resolution.height).
size_t x |
x coordinates of top-left corner.
Referenced by Rect::contains(), Rect::isContained(), Rect::operator!=(), and Rect::operator==().
size_t y |
y coordinates of top-left corner.
Referenced by Rect::contains(), Rect::isContained(), Rect::operator!=(), and Rect::operator==().
size_t width |
width of the rectangle in pixels.
Referenced by Rect::contains(), Rect::isContained(), Rect::operator!=(), and Rect::operator==().
size_t height |
height of the rectangle in pixels.
Referenced by Rect::contains(), Rect::isContained(), Rect::operator!=(), and Rect::operator==().