Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Rect_t Struct Reference

Structure describing an integer precision 2D rectangle. More...

Public Member Functions

int32_t GetWidth (void) const noexcept
 Return the width of a rectangle.
 
int32_t GetHeight (void) const noexcept
 Return the height of a rectangle.
 
int32_t GetLeft (void) const noexcept
 Return the leftmost X value of a rectangle.
 
int32_t GetTop (void) const noexcept
 Return the topmost Y value of a rectangle.
 
int32_t GetRight (void) const noexcept
 Return the rightmost X value of a rectangle.
 
int32_t GetBottom (void) const noexcept
 Return the bottommost Y value of a rectangle.
 
void SetWidth (int32_t iWidth) noexcept
 Set the width of a rectangle.
 
void SetHeight (int32_t iHeight) noexcept
 Set the height of a rectangle.
 
void SetSize (int32_t iWidth, int32_t iHeight) noexcept
 Set the size of a rectangle.
 
void SetLeft (int32_t iLeft) noexcept
 Set the left most X coordinate of a rectangle.
 
void SetTop (int32_t iTop) noexcept
 Set the top most Y coordinate of a rectangle.
 
void SetRight (int32_t iRight) noexcept
 Set the right most X coordinate of a rectangle.
 
void SetBottom (int32_t iBottom) noexcept
 Set the bottom most Y coordinate of a rectangle.
 
void Set (int32_t iLeft, int32_t iTop, int32_t iRight, int32_t iBottom) noexcept
 Set all four coordinates of a rectangle.
 
void SetBySize (int32_t iLeft, int32_t iTop, int32_t iWidth, int32_t iHeight) noexcept
 Set all four coordinates of a rectangle using upper left corner and width and height.
 
void Clear (void) noexcept
 Set all four coordinates of a rectangle to zero.
 
void Offset (int32_t iX, int32_t iY) noexcept
 Adjust all four coordinates by a horizontal and vertical offset.
 
int32_t CenterX (void) const noexcept
 Find and return the center x position of a rect.
 
int32_t CenterY (void) const noexcept
 Find and return the center y position of a rect.
 
void GetCenter (int32_t *pX, int32_t *pY) const noexcept
 Find and return the center position of a rect.
 
void GetCenter (Point2D_t *pOutput) const noexcept
 Find and return the center position of a rect.
 
void MoveTo (int32_t iX, int32_t iY) noexcept
 Move a rectangle to a new location.
 
void MoveTo (const Point2D_t *pInput) noexcept
 Move a rectangle to a new location.
 
void MoveX (int32_t iX) noexcept
 Move a rectangle to a specific x coordinate.
 
void MoveY (int32_t iY) noexcept
 Move a rectangle to a specific y coordinate.
 
void MoveWithinRect (const Rect_t *pInput) noexcept
 Move a rect so that it is encompassed by a larger rect.
 
void CenterAroundX (int32_t iX) noexcept
 Move a rect around a center X.
 
void CenterAroundX (const Point2D_t *pInput) noexcept
 Move a rect around a center X.
 
void CenterAroundX (const Rect_t *pInput) noexcept
 Move a rect around a center X of an input rectangle.
 
void CenterAroundY (int32_t iY) noexcept
 Move a rect around a center Y.
 
void CenterAroundY (const Point2D_t *pInput) noexcept
 Move a rect around a center Y.
 
void CenterAroundY (const Rect_t *pInput) noexcept
 Move a rect around a center Y of an input rectangle.
 
void CenterAround (int32_t iX, int32_t iY) noexcept
 Move a rect around a center point.
 
void CenterAround (const Point2D_t *pInput) noexcept
 Move a rect around a center point.
 
void CenterAround (const Rect_t *pInput) noexcept
 Move a rect around a center point of another rectangle.
 
uint_t IsInside (int32_t iX, int32_t iY) const noexcept
 Return TRUE if the X and Y coordinates are inside of a rectangle.
 
uint_t IsInside (const Point2D_t *pPoint) const noexcept
 Return TRUE if the Point2D_t is inside of a rectangle.
 
uint_t IsInside (const Rect_t *pRect) const noexcept
 Return TRUE if the input rectangle is completely inside of the rectangle.
 
void Sort (void) noexcept
 Ensure that the rectangle is sorted.
 
void SetSorted (int32_t iLeft, int32_t iTop, int32_t iRight, int32_t iBottom) noexcept
 Set all four coordinates of a rectangle and ensure they are sorted.
 
uint_t IsEmpty (void) const noexcept
 Return TRUE if the rect is empty.
 
uint_t IsNotEmpty (void) const noexcept
 Return TRUE if the rect is not empty.
 
uint_t IsEqual (const Rect_t *pInput) const noexcept
 Return TRUE if the two rectangles are equal.
 
uint_t IsNotEqual (const Rect_t *pInput) const noexcept
 Return TRUE if the two rectangles are not equal.
 
uint_t operator== (const Rect_t &rInput) const noexcept
 Return TRUE if the two rectangles are equal.
 
uint_t operator!= (const Rect_t &rInput) const noexcept
 Return TRUE if the two rectangles are not equal.
 
void Inset (int32_t iX, int32_t iY) noexcept
 Shrink or expand a rect by a specific number of units.
 
uint_t IsIntersecting (const Rect_t *pInput) const noexcept
 Return TRUE if the two rectangles intersect.
 
uint_t Intersection (const Rect_t *pInput1, const Rect_t *pInput2) noexcept
 Create the intersection of two rectangles.
 
void Union (const Rect_t *pInput1, const Rect_t *pInput2) noexcept
 Generate the union between two rects.
 
void Add (const Point2D_t *pInput) noexcept
 Expand a rectangle to encompass a new point.
 
void Add (int32_t iX, int32_t iY) noexcept
 Expand a rectangle to encompass a new point.
 
void Clip (const Rect_t *pInput) noexcept
 Clip a rectangle to a bounds rectangle.
 
void Get (Rect *pOutput) const noexcept
 Convert a Rect_t into a MacOS Rect structure.
 
void Set (const Rect *pInput) noexcept
 Convert a MacOS Rect structure into a Rect_t.
 
void Get (CGRect *pOutput) const noexcept
 Convert a Rect_t into a MacOSX/iOS CGRect structure.
 
void Set (const CGRect *pInput) noexcept
 Convert a CGRect structure into a Rect_t.
 
void Get (_NSRect *pOutput) const noexcept
 Convert a Rect_t into a MacOS _NSRect structure.
 
void Set (const _NSRect *pInput) noexcept
 Convert a CGRect Rect structure into a Rect_t.
 
void Get (tagRECT *pOutput) const noexcept
 Convert a Rect_t into a Windows RECT structure.
 
void Set (const tagRECT *pInput) noexcept
 Convert a Windows RECT structure into a Rect_t.
 

Public Attributes

int32_t m_iLeft
 Leftmost x of rectangle.
 
int32_t m_iTop
 Topmost y of rectangle.
 
int32_t m_iRight
 Rightmost x of rectangle.
 
int32_t m_iBottom
 Bottommost y of rectangle.
 

Detailed Description

Structure describing an integer precision 2D rectangle.


Simple container structure that holds the upper left and lower right coordinates in integer precision.

See also
Burger::Vector4D_t or Burger::Point2D_t

Member Function Documentation

◆ Add() [1/2]

void Burger::Rect_t::Add ( const Point2D_t * pInput)
noexcept

Expand a rectangle to encompass a new point.


If a passed point is outside of the bounds of the current rect, expand the rectangle to contain the point.

If the rectangle is empty, initialize the rectangle to encompass only the point with a width and height of one.

Parameters
pInputPointer to a valid Point2D_t structure
See also
Add(int32_t,int32_t)

◆ Add() [2/2]

void Burger::Rect_t::Add ( int32_t iX,
int32_t iY )
noexcept

Expand a rectangle to encompass a new point.


If a passed point is outside of the bounds of the current rect, expand the rectangle to contain the point.

If the rectangle is empty, initialize the rectangle to encompass only the point with a width and height of one.

Parameters
iXX coordinate of the new point to add
iYY coordinate of the new point to add
See also
Add(const Point2D_t *)

◆ CenterAround() [1/3]

void Burger::Rect_t::CenterAround ( const Point2D_t * pInput)
noexcept

Move a rect around a center point.


Given a central location, move the rectangle so that point represents the new center of the rectangle.

Parameters
pInputCoordinates of the center point
See also
CenterAround(int32_t, int32_t)

◆ CenterAround() [2/3]

void Burger::Rect_t::CenterAround ( const Rect_t * pInput)
noexcept

Move a rect around a center point of another rectangle.


Using the central point of the input rectangle, move the current rectangle so that point represents the new center of the rectangle.

Parameters
pInputRectangle whose center will be the center of this rectangle.
See also
CenterAround(int32_t, int32_t)

◆ CenterAround() [3/3]

void Burger::Rect_t::CenterAround ( int32_t iX,
int32_t iY )
noexcept

Move a rect around a center point.


Given a central location, move the rectangle so that point represents the new center of the rectangle.

Parameters
iXX coordinate of the center point
iYY coordinate of the center point
See also
CenterAround(const Point2D_t*)

◆ CenterAroundX() [1/3]

void Burger::Rect_t::CenterAroundX ( const Point2D_t * pInput)
noexcept

Move a rect around a center X.


Given a central X coordinate, move the rectangle so that X coordinate represents the new X center of the rectangle. The top and bottom values are not modified.

Parameters
pInputPointer to a point to obtain the X center coordinate.
See also
CenterAroundX(const Rect_t*)

◆ CenterAroundX() [2/3]

void Burger::Rect_t::CenterAroundX ( const Rect_t * pInput)
noexcept

Move a rect around a center X of an input rectangle.


Given a rectangle, determine the central X coordinate, and then move the rectangle so that X coordinate represents the new X center of the rectangle. The top and bottom values are not modified.

Parameters
pInputPointer to a rectangle to obtain the center X.
See also
CenterAroundX(int32_t)

◆ CenterAroundX() [3/3]

void Burger::Rect_t::CenterAroundX ( int32_t iX)
noexcept

Move a rect around a center X.


Given a central X coordinate, move the rectangle so that X coordinate represents the new X center of the rectangle. The top and bottom values are not modified.

Parameters
iXX coordinate of the center point
See also
CenterAroundX(const Point2D_t*)

◆ CenterAroundY() [1/3]

void Burger::Rect_t::CenterAroundY ( const Point2D_t * pInput)
noexcept

Move a rect around a center Y.


Given a central Y coordinate, move the rectangle so that Y coordinate represents the new Y center of the rectangle. The left and right values are not modified.

Parameters
pInputPointer to a point to obtain the Y center coordinate.
See also
CenterAroundY(const Rect_t*)

◆ CenterAroundY() [2/3]

void Burger::Rect_t::CenterAroundY ( const Rect_t * pInput)
noexcept

Move a rect around a center Y of an input rectangle.


Given a rectangle, determine the central Y coordinate, and then move the rectangle so that Y coordinate represents the new Y center of the rectangle. The left and right values are not modified.

Parameters
pInputPointer to a rectangle to obtain the center Y.
See also
CenterAroundY(int32_t)

◆ CenterAroundY() [3/3]

void Burger::Rect_t::CenterAroundY ( int32_t iY)
noexcept

Move a rect around a center Y.


Given a central Y coordinate, move the rectangle so that Y coordinate represents the new Y center of the rectangle. The left and right values are not modified.

Parameters
iYY coordinate of the center point
See also
CenterAroundY(const Point2D_t*)

◆ CenterX()

int32_t Burger::Rect_t::CenterX ( void ) const
noexcept

Find and return the center x position of a rect.


Use this form instead of (left+right)>>1 since it prevents overflow errors

Returns
X value of the center of the rectangle.
See also
GetCenter(int32_t *, int32_t *) const or GetCenterY() const

◆ CenterY()

int32_t Burger::Rect_t::CenterY ( void ) const
noexcept

Find and return the center y position of a rect.


Use this form instead of (top+bottom)>>1 since it prevents overflow errors

Returns
Y value of the center of the rectangle.
See also
GetCenter(int32_t *, int32_t *) const or GetCenterX() const

◆ Clear()

void Burger::Rect_t::Clear ( void )
inlinenoexcept

Set all four coordinates of a rectangle to zero.


Initializes a Burger::Rect_t to an empty rectangle.

See also
SetSorted(), SetBySize() or Set(int32_t,int32_t,int32_t,int32_t)

◆ Clip()

void Burger::Rect_t::Clip ( const Rect_t * pInput)
noexcept

Clip a rectangle to a bounds rectangle.


Clip the rectangle to the boundaries set by the input rectangle. If this rectangle is outside of the boundaries, set it to an empty rectangle with all entries being set to zero.

Parameters
pInputPointer to a valid boundary rectangle
See also
Union(const Rect_t *,const Rect_t *)

◆ Get() [1/4]

void Burger::Rect_t::Get ( _NSRect * pOutput) const
noexcept

Convert a Rect_t into a MacOS _NSRect structure.


Converts the contents of a Rect_t into a MacOSX _NSRect structure.

Parameters
pOutputPointer to an uninitialized MacOSX _NSRect structure.
Note
This function is 32 bit MacOSX only. This is what NSRect maps to.

◆ Get() [2/4]

void Burger::Rect_t::Get ( CGRect * pOutput) const
noexcept

Convert a Rect_t into a MacOSX/iOS CGRect structure.


Converts the contents of a Rect_t into a MacOSX/iOS CGRect structure.

Parameters
pOutputPointer to an uninitialized MacOSX/iOS CGRect structure.
Note
This function is MacOSX or iOS only.

◆ Get() [3/4]

void Burger::Rect_t::Get ( Rect * pOutput) const
noexcept

Convert a Rect_t into a MacOS Rect structure.


Converts the contents of a Rect_t into a MacOS/Quicktime for Windows Rect structure. Since it's converting an int32_t into a short, data loss could occur if the values exceed 32767 or are less than -32768.

Parameters
pOutputPointer to an uninitialized MacOS Rect structure.
Note
This function is MacOS or Windows using Quicktime only.

◆ Get() [4/4]

void Burger::Rect_t::Get ( tagRECT * pOutput) const
noexcept

Convert a Rect_t into a Windows RECT structure.


Converts the contents of a Rect_t into a Windows RECT structure.

Parameters
pOutputPointer to an uninitialized Windows RECT structure.
Note
This function is Windows or Xbox 360 only.

◆ GetBottom()

int32_t Burger::Rect_t::GetBottom ( void ) const
inlinenoexcept

Return the bottommost Y value of a rectangle.


Return the bottom most value of the rectangle

Returns
Bottom Y of the rectangle
See also
GetTop() or SetBottom()
Note
On unsorted rectangles, this could be a smaller value than the top most value. Do not assume that this value is greater than or equal to the topmost Y coordinate.

◆ GetCenter() [1/2]

void Burger::Rect_t::GetCenter ( int32_t * pX,
int32_t * pY ) const
noexcept

Find and return the center position of a rect.


Use this form instead of (left+right)>>1 since it prevents overflow errors

Parameters
pXPointer to int32_t to receive the center X
pYPointer to int32_t to receive the center Y
See also
GetCenter(Point2D_t *), GetCenterX() const or GetCenterY() const

◆ GetCenter() [2/2]

void Burger::Rect_t::GetCenter ( Point2D_t * pOutput) const
noexcept

Find and return the center position of a rect.


Use this form instead of (left+right)>>1 since it prevents overflow errors

Parameters
pOutputPointer to Point2D_t to receive the center
See also
GetCenter(int32_t *, int32_t *)

◆ GetHeight()

int32_t Burger::Rect_t::GetHeight ( void ) const
inlinenoexcept

Return the height of a rectangle.


Subtract the bottom value from the top value and returns the difference in the form of the rectangle's height.

Returns
Height of the rectangle
See also
GetWidth() and SetHeight()

◆ GetLeft()

int32_t Burger::Rect_t::GetLeft ( void ) const
inlinenoexcept

Return the leftmost X value of a rectangle.


Return the left most value of the rectangle

Returns
Left X of the rectangle
See also
GetRight() or SetLeft()
Note
On unsorted rectangles, this could be a larger value than the rightmost value. Do not assume that this value is less than or equal to the rightmost X coordinate.

◆ GetRight()

int32_t Burger::Rect_t::GetRight ( void ) const
inlinenoexcept

Return the rightmost X value of a rectangle.


Return the right most value of the rectangle

Returns
Right X of the rectangle
See also
GetLeft() or SetRight()
Note
On unsorted rectangles, this could be a smaller value than the leftmost value. Do not assume that this value is greater than or equal to the leftmost X coordinate.

◆ GetTop()

int32_t Burger::Rect_t::GetTop ( void ) const
inlinenoexcept

Return the topmost Y value of a rectangle.


Return the top most value of the rectangle

Returns
Top Y of the rectangle
See also
GetBottom() or SetTop()
Note
On unsorted rectangles, this could be a larger value than the bottommost value. Do not assume that this value is less than or equal to the bottommost Y coordinate.

◆ GetWidth()

int32_t Burger::Rect_t::GetWidth ( void ) const
inlinenoexcept

Return the width of a rectangle.


Subtract the right value from the left value and returns the difference in the form of the rectangle's width.

Returns
Width of the rectangle
See also
GetHeight() and SetWidth()

◆ Inset()

void Burger::Rect_t::Inset ( int32_t iX,
int32_t iY )
noexcept

Shrink or expand a rect by a specific number of units.


If positive offsets are given, the rectangle is shrunk by the number of units. The rectangle is grown if the offsets are negative values. the coordinates are sorted after adjustment.

Parameters
iXNumber of units to shrink the rectangle horizontally
iYNumber of units to shrink the rectangle vertically
See also
Offset(int32_t,int32_t)

◆ Intersection()

uint_t Burger::Rect_t::Intersection ( const Rect_t * pInput1,
const Rect_t * pInput2 )
noexcept

Create the intersection of two rectangles.


Create the intersection of two rects and return TRUE if they truly intersect.

Parameters
pInput1Pointer to the first valid Rect_t structure
pInput2Pointer to the second valid Rect_t structure
Note
It is okay to pass the output rectangle as one of the input rectangles
See also
IsIntersecting(const Rect_t *) const or Union( const Rect_t *,const Rect_t *)

◆ IsEmpty()

uint_t Burger::Rect_t::IsEmpty ( void ) const
noexcept

Return TRUE if the rect is empty.


If either the horizontal or vertical coordinates are equal, this will be considered an empty rectangle.

See also
IsNotEmpty()

◆ IsEqual()

uint_t Burger::Rect_t::IsEqual ( const Rect_t * pInput) const
noexcept

Return TRUE if the two rectangles are equal.


If all four entries are the same, return TRUE, otherwise return FALSE.

Parameters
pInputPointer to a valid Rect_t to test against
See also
IsNotEqual(const Rect_t *) const or Rect_t::operator==( const Rect_t &) const

◆ IsInside() [1/3]

uint_t Burger::Rect_t::IsInside ( const Point2D_t * pPoint) const
noexcept

Return TRUE if the Point2D_t is inside of a rectangle.


Given an X and Y coordinate inside of a Point2D_t, determine if it is inside of a rect if so, then return TRUE, otherwise, return FALSE.

Determination of whether a point is inside is that the value must be greater than or equal to the minimum and less than the maximum. If the rectangle has a width or height of zero or less, then this function always returns FALSE

Parameters
pPointPointer to a valid Point2D_t structure.
See also
IsInside(int32_t,int32_t) const or IsInside(const Rect_t *pRect) const

◆ IsInside() [2/3]

uint_t Burger::Rect_t::IsInside ( const Rect_t * pInput) const
noexcept

Return TRUE if the input rectangle is completely inside of the rectangle.


Given an Rect_t, test it against the bounds of this rectangle and return TRUE if the input rectangle is completely enclosed by this rectangle.

Parameters
pInputPointer to a valid Rect_t to test against
See also
IsInside(int32_t,int32_t) const or IsInside(const Point2D_t *) const

◆ IsInside() [3/3]

uint_t Burger::Rect_t::IsInside ( int32_t iX,
int32_t iY ) const
noexcept

Return TRUE if the X and Y coordinates are inside of a rectangle.


Given an X and Y coordinate, determine if it is inside of a rect if so, then return TRUE, otherwise, return FALSE.

Determination of whether a point is inside is that the value must be greater than or equal to the minimum and less than the maximum. If the rectangle has a width or height of zero or less, then this function always returns FALSE

Parameters
iXX coordinate to test
iYY coordinate to test
See also
IsInside(const Point2D_t *) const or IsInside(const Rect_t *pRect) const

◆ IsIntersecting()

uint_t Burger::Rect_t::IsIntersecting ( const Rect_t * pInput) const
noexcept

Return TRUE if the two rectangles intersect.


Test the rectangle against this one and if they are intersecting, return TRUE. This function assumes the rectangles are sorted.

Parameters
pInputPointer to a valid Rect_t
See also
Intersection(const Rect_t *,const Rect_t *)

◆ IsNotEmpty()

uint_t Burger::Rect_t::IsNotEmpty ( void ) const
noexcept

Return TRUE if the rect is not empty.


If both the horizontal or vertical coordinates are not equal, this will be considered a valid rectangle.

See also
IsEmpty()

◆ IsNotEqual()

uint_t Burger::Rect_t::IsNotEqual ( const Rect_t * pInput) const
noexcept

Return TRUE if the two rectangles are not equal.


If all four entries are the same, return FALSE, otherwise return TRUE.

Parameters
pInputPointer to a valid Rect_t to test against
See also
IsEqual(const Rect_t *) const or Rect_t::operator!=( const Rect_t &) const

◆ MoveTo() [1/2]

void Burger::Rect_t::MoveTo ( const Point2D_t * pInput)
noexcept

Move a rectangle to a new location.


Given an x,y point, "move" the rectangle so that bottom right corner maintains the same offset (Width/Height) from the new origin point as the previous origin point

Parameters
pInputPointer to a valid Point2D_t structure.
See also
Offset(int32_t,int32_t), MoveTo(int32_t,int32_t), MoveX(int32_t) or MoveY(int32_t)

◆ MoveTo() [2/2]

void Burger::Rect_t::MoveTo ( int32_t iX,
int32_t iY )
noexcept

Move a rectangle to a new location.


Given an x,y point, "move" the rectangle so that bottom right corner maintains the same offset (Width/Height) from the new origin point as the previous origin point

Parameters
iXNew upper left X coordinate
iYNew upper top Y coordinate
See also
Offset(int32_t,int32_t), MoveTo(const Point2D_t *), MoveX(int32_t) or MoveY(int32_t)

◆ MoveWithinRect()

void Burger::Rect_t::MoveWithinRect ( const Rect_t * pInput)
noexcept

Move a rect so that it is encompassed by a larger rect.


Favor bounding to the top-leftmost edge in the case that the bounds rect cannot fit the rect in question.

Parameters
pInputPointer to a valid boundary rectangle
See also
MoveX(int32_t) or MoveY(int32_t)

◆ MoveX()

void Burger::Rect_t::MoveX ( int32_t iX)
noexcept

Move a rectangle to a specific x coordinate.


Parameters
iXNew upper left X coordinate
See also
MoveTo(int32_t,int32_t), Offset(int32_t,int32_t) or MoveY(int32_t)

◆ MoveY()

void Burger::Rect_t::MoveY ( int32_t iY)
noexcept

Move a rectangle to a specific y coordinate.


Parameters
iYNew upper top Y coordinate
See also
MoveTo(int32_t,int32_t), Offset(int32_t,int32_t) or MoveX(int32_t)

◆ Offset()

void Burger::Rect_t::Offset ( int32_t iX,
int32_t iY )
inlinenoexcept

Adjust all four coordinates by a horizontal and vertical offset.


Given a new X and Y offset value, adjust the location of the entire rectangle by the X and Y offsets. This is performed by addition of the offsets. No bounds checking is performed, so the rectangle could "wrap around"

Parameters
iXNumber of units to add to the left and right coordinates
iYNumber of units to add to the top and bottom coordinates
See also
MoveTo(int32_t,int32_t)

◆ operator!=()

uint_t Burger::Rect_t::operator!= ( const Rect_t & rInput) const
inlinenoexcept

Return TRUE if the two rectangles are not equal.


If all four entries are the same, return FALSE, otherwise return TRUE.

Parameters
rInputReference to a valid Rect_t to test against
See also
IsNotEqual(const Rect_t *) const or Rect_t::operator==( const Rect_t &) const

◆ operator==()

uint_t Burger::Rect_t::operator== ( const Rect_t & rInput) const
inlinenoexcept

Return TRUE if the two rectangles are equal.


If all four entries are the same, return TRUE, otherwise return FALSE.

Parameters
rInputReference to a valid Rect_t to test against
See also
IsEqual(const Rect_t *) const or Rect_t::operator!=( const Rect_t &) const

◆ Set() [1/5]

void Burger::Rect_t::Set ( const _NSRect * pInput)
noexcept

Convert a CGRect Rect structure into a Rect_t.


Converts the contents of a MacOSX CGRect structure into a Rect_t. Since it's converting a float or double into an int, data loss could occur.

Parameters
pInputPointer to a valid MacOSX _NSRect structure.
Note
This function is 32 bit MacOSX only. This is what NSRect maps to.

◆ Set() [2/5]

void Burger::Rect_t::Set ( const CGRect * pInput)
noexcept

Convert a CGRect structure into a Rect_t.


Converts the contents of a MacOSX/iOS CGRect structure into a Rect_t. Since it's converting a float or double into an int, data loss could occur.

Parameters
pInputPointer to a valid MacOSX/iOS CGRect structure.
Note
This function is MacOSX or iOS only.

◆ Set() [3/5]

void Burger::Rect_t::Set ( const Rect * pInput)
noexcept

Convert a MacOS Rect structure into a Rect_t.


Converts the contents of a MacOS/Quicktime for Windows Rect structure into a Rect_t. Since it's converting a short to an int, no data loss will occur.

Parameters
pInputPointer to a valid MacOS Rect structure.
Note
This function is MacOS or Windows using Quicktime only.

◆ Set() [4/5]

void Burger::Rect_t::Set ( const tagRECT * pInput)
noexcept

Convert a Windows RECT structure into a Rect_t.


Converts the contents of a Windows RECT structure into a Rect_t.

Parameters
pInputPointer to a valid Windows RECT structure.
Note
This function is Windows or Xbox 360 only.

◆ Set() [5/5]

void Burger::Rect_t::Set ( int32_t iLeft,
int32_t iTop,
int32_t iRight,
int32_t iBottom )
inlinenoexcept

Set all four coordinates of a rectangle.


Sets the left, top, right and bottom coordinates of the rectangle to specific values. No bounds checking is performed to prevent unsorted rectangles.

Parameters
iLeftRequested left most X coordinate of the rectangle.
iTopRequested top most Y coordinate of the rectangle.
iRightRequested right most X coordinate of the rectangle.
iBottomRequested bottom most Y coordinate of the rectangle.
See also
SetSorted() or SetBySize()

◆ SetBottom()

void Burger::Rect_t::SetBottom ( int32_t iBottom)
inlinenoexcept

Set the bottom most Y coordinate of a rectangle.


Set the bottom most Y coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
iBottomRequested bottom most Y coordinate of the rectangle.
See also
GetBottom() or SetTop()

◆ SetBySize()

void Burger::Rect_t::SetBySize ( int32_t iLeft,
int32_t iTop,
int32_t iWidth,
int32_t iHeight )
inlinenoexcept

Set all four coordinates of a rectangle using upper left corner and width and height.


Sets the left, top, right and bottom coordinates of the rectangle to using iLeft and iTop as the upper left anchor point and iWidth and iHeight to determine what the new bottom right coordinate should be. No bounds checking is performed to prevent unsorted rectangles, espectially in the cases of negative width or height.

Parameters
iLeftRequested left most X coordinate of the rectangle.
iTopRequested top most Y coordinate of the rectangle.
iWidthRequested width of the rectangle.
iHeightRequested height of the rectangle.
See also
SetSorted(),Clear() or Set(int32_t,int32_t,int32_t,int32_t)

◆ SetHeight()

void Burger::Rect_t::SetHeight ( int32_t iHeight)
inlinenoexcept

Set the height of a rectangle.


Set the bottom most Y coordinate so the rectangle will be the requested height. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
iHeightRequested height of the rectangle.
See also
GetHeight() or SetWidth()

◆ SetLeft()

void Burger::Rect_t::SetLeft ( int32_t iLeft)
inlinenoexcept

Set the left most X coordinate of a rectangle.


Set the left most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
iLeftRequested left most X coordinate of the rectangle.
See also
GetLeft() or SetRight()

◆ SetRight()

void Burger::Rect_t::SetRight ( int32_t iRight)
inlinenoexcept

Set the right most X coordinate of a rectangle.


Set the right most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
iRightRequested right most X coordinate of the rectangle.
See also
GetRight() or SetLeft()

◆ SetSize()

void Burger::Rect_t::SetSize ( int32_t iWidth,
int32_t iHeight )
inlinenoexcept

Set the size of a rectangle.


Set the right most X coordinate and the bottom most Y coordinate so the rectangle will be the requested width and height. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
iWidthRequested width of the rectangle.
iHeightRequested height of the rectangle.
See also
GetWidth(), GetHeight(), SetWidth() or SetHeight()

◆ SetSorted()

void Burger::Rect_t::SetSorted ( int32_t iLeft,
int32_t iTop,
int32_t iRight,
int32_t iBottom )
noexcept

Set all four coordinates of a rectangle and ensure they are sorted.


Sets the left, top, right and bottom coordinates of the rectangle to specific values. The Left and Right are sorted so that the Left side is less than or equal to the Right and the Top and Bottom sides are sorted as well.

Due to the sorting, there is a slight performance penalty to perform the tests. If it's known in advance that the coordinates are sorted, use Set(int32_t,int32_t,int32_t,int32_t) instead.

Parameters
iLeftFirst X coordinate of the rectangle.
iTopFirst Y coordinate of the rectangle.
iRightSecond X coordinate of the rectangle.
iBottomSecond Y coordinate of the rectangle.
See also
Set(int32_t,int32_t,int32_t,int32_t) or SetBySize(int32_t,int32_t,int32_t,int32_t)

◆ SetTop()

void Burger::Rect_t::SetTop ( int32_t iTop)
inlinenoexcept

Set the top most Y coordinate of a rectangle.


Set the top most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
iTopRequested top most Y coordinate of the rectangle.
See also
GetTop() or SetBottom()

◆ SetWidth()

void Burger::Rect_t::SetWidth ( int32_t iWidth)
inlinenoexcept

Set the width of a rectangle.


Set the right most X coordinate so the rectangle will be the requested width. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
iWidthRequested width of the rectangle.
See also
GetWidth() or SetHeight()

◆ Sort()

void Burger::Rect_t::Sort ( void )
noexcept

Ensure that the rectangle is sorted.


If a rectangle is sorted (Left<=Right and Top<=Bottom) this function does nothing. Otherwise, the Left and Right entries and the Top and Bottom entries are sorted so they pass the above test. This will fix any rectangle that may have reveresed entries.

See also
SetSorted(int32_t,int32_t,int32_t,int32_t)

◆ Union()

void Burger::Rect_t::Union ( const Rect_t * pInput1,
const Rect_t * pInput2 )
noexcept

Generate the union between two rects.


Create a rectangle that will encompass both input retangles

Parameters
pInput1Pointer to the first non-empty rectangle
pInput2Pointer to the second non-empt rectangle
See also
Intersection(const Rect_t *,const Rect_t *);

Member Data Documentation

◆ m_iBottom

int32_t Burger::Rect_t::m_iBottom

Bottommost y of rectangle.

◆ m_iLeft

int32_t Burger::Rect_t::m_iLeft

Leftmost x of rectangle.

◆ m_iRight

int32_t Burger::Rect_t::m_iRight

Rightmost x of rectangle.

◆ m_iTop

int32_t Burger::Rect_t::m_iTop

Topmost y of rectangle.