Struct IntRect#

Struct Documentation#

struct IntRect#

A rectangle (with integer coordinates).

Public Functions

inline void Invalidate()#

Invalidates this object.

inline bool IsValid() const#

Returns a boolean indicating whether this rectangle contains valid information.

inline bool IsNonEmpty() const#

Returns a boolean indicating whether this rectangle is valid and non-empty.

inline bool IntersectsWith(const IntRect &r) const#

Determine whether this rectangle intersects with the specified one.

Parameters:

r – The other rectangle.

Returns:

True if the two rectangles intersect, false otherwise.

inline IntRect Intersect(const IntRect &r) const#

Calculate the intersection with the specified rectangle.

Parameters:

r – The rectangle for which the intersection is to be calculated.

Returns:

A rectangle which is the intersection of the two rectangles. If the two rectangles do not intersect, an empty rectangle is returned (width=height=0).

Public Members

int x#

The x-coordinate of the upper-left point of the rectangle.

int y#

The y-coordinate of the upper-left point of the rectangle.

int w#

The width of the rectangle.

int h#

The height of the rectangle.

Public Static Functions

static inline IntRect Intersect(const IntRect &a, const IntRect &b)#

Calculate the intersection of the two specified rectangle.

Parameters:
  • a – The first rectangle.

  • b – The second rectangle.

Returns:

A rectangle which is the intersection of the two rectangles. If the two rectangles do not intersect, an empty rectangle is returned (width=height=0).