|
constexpr | Rect (const RectRaw &r={}) |
| Wraps Rect. More...
|
|
constexpr | Rect (int x, int y, int w, int h) |
| Constructs from its fields. More...
|
|
constexpr | Rect (const PointRaw &corner, const PointRaw &size) |
| Construct from offset and size. More...
|
|
constexpr bool | operator== (const RectRaw &other) const |
| Compares with the underlying type.
|
|
constexpr bool | operator== (const Rect &other) const |
| Compares with the underlying type.
|
|
constexpr | operator bool () const |
|
constexpr int | GetX () const |
| Get left x coordinate. More...
|
|
constexpr Rect & | SetX (int newX) |
| Set the left x coordinate. More...
|
|
constexpr int | GetY () const |
| Get top y coordinate. More...
|
|
constexpr Rect & | SetY (int newY) |
| Set the top y coordinate. More...
|
|
constexpr int | GetW () const |
| Get width of the rect. More...
|
|
constexpr Rect & | SetW (int newW) |
| Set the width of the rect. More...
|
|
constexpr int | GetH () const |
| Get height of the rect. More...
|
|
constexpr Rect & | SetH (int newH) |
| Set the height of the rect. More...
|
|
constexpr int | GetX2 () const |
| Get X coordinate of the rect second corner. More...
|
|
constexpr Rect & | SetX2 (int x2) |
| Set X coordinate of the rect second corner. More...
|
|
constexpr int | GetY2 () const |
| Get Y coordinate of the rect second corner. More...
|
|
constexpr Rect & | SetY2 (int y2) |
| Set Y coordinate of the rect second corner. More...
|
|
constexpr Point | GetTopLeft () const |
| Get top left corner of the rect. More...
|
|
constexpr Point | GetTopRight () const |
| Get top right corner of the rect. More...
|
|
constexpr Point | GetBottomLeft () const |
| Get bottom left corner of the rect. More...
|
|
constexpr Point | GetBottomRight () const |
| Get bottom right corner of the rect. More...
|
|
constexpr Point | GetSize () const |
| Get size of the rect. More...
|
|
constexpr Point | GetCentroid () const |
| Get centroid of the rect. More...
|
|
bool | GetLineIntersection (PointRaw *p1, PointRaw *p2) const |
| Calculate the intersection of a rectangle and line segment. More...
|
|
bool | GetLineIntersection (int *X1, int *Y1, int *X2, int *Y2) const |
| Calculate the intersection of a rectangle and line segment. More...
|
|
constexpr | operator SDL_FRect () const |
| Convert an SDL_Rect to SDL_FRect. More...
|
|
constexpr | operator FRect () const |
|
constexpr bool | Empty () const |
| Determine whether a rectangle has no area. More...
|
|
constexpr bool | Equal (const RectRaw &other) const |
| Determine whether two rectangles are equal. More...
|
|
constexpr bool | Contains (const PointRaw &p) const |
| Check whether the rect contains given point. More...
|
|
constexpr bool | Contains (const RectRaw &other) const |
| Check whether the rect contains given point. More...
|
|
constexpr bool | HasIntersection (const RectRaw &other) const |
| Determine whether two rectangles intersect. More...
|
|
constexpr std::optional< Rect > | GetIntersection (const RectRaw &other) const |
| Calculate the intersection of two rectangles. More...
|
|
constexpr Rect | GetUnion (const RectRaw &other) const |
| Calculate the union of two rectangles. More...
|
|
constexpr Rect | GetExtension (unsigned int amount) const |
| Get a rect extended by specified amount of pixels. More...
|
|
constexpr Rect | GetExtension (unsigned int hAmount, unsigned int vAmount) const |
| Get a rect extended by specified amount of pixels. More...
|
|
constexpr Rect & | Extend (unsigned int amount) |
| Extend a rect by specified amount of pixels. More...
|
|
constexpr Rect & | Extend (unsigned int hAmount, unsigned int vAmount) |
| Extend a rect by specified amount of pixels. More...
|
|
constexpr Rect | operator+ (const Point &offset) const |
| Get rectangle moved by a given offset. More...
|
|
constexpr Rect | operator- (const Point &offset) const |
| Get rectangle moved by an opposite of given offset. More...
|
|
constexpr Rect & | operator+= (const Point &offset) |
| Move by then given offset. More...
|
|
constexpr Rect & | operator-= (const Point &offset) |
| Move by an opposite of the given offset. More...
|
|
|
static Rect | GetEnclosingPoints (SpanRef< const PointRaw > points, OptionalRef< const RectRaw > clip=std::nullopt) |
| Calculate a minimal rectangle enclosing a set of points. More...
|
|
static constexpr Rect | FromCenter (int cx, int cy, int w, int h) |
| Construct the rect from given center coordinates, width and height. More...
|
|
static constexpr Rect | FromCenter (Point center, Point size) |
| Construct the rect from given center coordinates and size. More...
|
|
static constexpr Rect | FromCorners (int x1, int y1, int x2, int y2) |
| Construct the rect from given corners coordinates. More...
|
|
static constexpr Rect | FromCorners (Point p1, Point p2) |
| Construct the rect from given centers coordinates. More...
|
|