## **Overview**
**Related Modules:**
[Graphic](Graphic.md)
**Description:**
Defines a rectangle, including the position data of the four boundaries of the rectangle, and provides functions for rectangle inclusion, intersection, and aggregation.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Public Member Functions
Rect () | A constructor used to create a Rect instance. |
~Rect () | A destructor used to delete the Rect instance. |
Rect (int16_t left, int16_t top, int16_t right, int16_t bottom) | A constructor used to create a Rect instance based on the coordinates of the four boundaries. |
A constructor used to create a Rect instance by copying another rectangle. | |
A constructor used to create a Rect instance by copying another rectangle. | |
SetRect (int16_t left, int16_t top, int16_t right, int16_t bottom) | Sets the coordinates of the four boundaries of a rectangle. |
GetWidth () const | |
GetHeight () const | |
GetX () const | Obtains the left boundary coordinate of the rectangle. |
GetY () const | Obtains the top boundary coordinate of the rectangle. |
GetLeft () const | Obtains the left boundary coordinate of the rectangle. |
GetTop () const | Obtains the top boundary coordinate of the rectangle. |
GetRight () const | Obtains the right boundary coordinate of the rectangle. |
GetBottom () const | Obtains the bottom boundary coordinate of the rectangle. |
SetX (int16_t x) | Changes the left boundary coordinate of the rectangle without changing the rectangle width. |
SetY (int16_t y) | Changes the top boundary coordinate of the rectangle without changing the rectangle height. |
SetPosition (int16_t x, int16_t y) | Changes the coordinates of the left and top boundaries of the rectangle without changing the rectangle width and height. |
SetWidth (int16_t width) | Changes the width of the rectangle without changing the coordinate of the left boundary. |
SetHeight (int16_t height) | Changes the height of the rectangle without changing the coordinate of the top boundary. |
SetLeft (int16_t left) | Sets the coordinate of the left boundary of a rectangle. |
SetTop (int16_t top) | Sets the coordinate of the top boundary of a rectangle. |
SetRight (int16_t right) | Sets the coordinate of the right boundary of a rectangle. |
SetBottom (int16_t bottom) | Sets the coordinate of the bottom boundary of a rectangle. |
Resize (int16_t width, int16_t height) | Sets the width and height of a rectangle. |
GetSize () const | Obtains the area of a rectangle. |
Intersect (const Rect &rect1, const Rect &rect2) | Checks whether two rectangles intersect. |
Join (const Rect &rect1, const Rect &rect2) | Obtains the minimum rectangle that contains another two rectangles. |
IsContains (const Vector2< int16_t > &point) const | Checks whether the rectangle contains a coordinate point. |
IsContains (const Point &point) const | Checks whether the rectangle contains a coordinate point. |
IsExtends (const Rect &other) const | Checks whether the rectangle is adjacent to another rectangle horizontally or vertically. |
IsIntersect (const Rect &other) const | Checks whether the rectangle intersects with another rectangle. |
IsContains (const Rect &other) const | Checks whether the rectangle contains another rectangle. |
operator new (size_t size) | |
operator delete (void *p) | Overrides the delete function. |