#include <IMG_Rect.h>
Public Methods | |
IMG_Rect (TInt32 l=0,TInt32 t=0,TInt32 r=0,TInt32 b=0) | |
Constructs a rectangle with the given values. More... | |
IMG_Rect (const IMG_Rect &r) | |
Copy constructor. More... | |
virtual | ~IMG_Rect () |
Destructor. | |
virtual TInt32 | getWidth ()const |
Access to rectangle width. More... | |
virtual TInt32 | getHeight ()const |
Access to rectangle height. More... | |
virtual void | set (TInt32 l,TInt32 t,TInt32 r,TInt32 b) |
Sets all members of the rectangle. More... | |
virtual bool | isEmpty ()const |
Returns whether this rectangle is empty. More... | |
virtual bool | isValid ()const |
Returns whether this rectangle is valid. More... | |
virtual void | inset (TInt32 i) |
Grows (or shrinks the rectangle). More... | |
virtual void | unionRect (const IMG_Rect &r) |
Does a union of the rectangle given and this rectangle. More... | |
virtual void | unionPoint (TInt32 x,TInt32 y) |
Grows the rectangle to included a point. More... | |
virtual bool | isInside (TInt32 x,TInt32 y)const |
Returns whether the point is inside this rectangle. More... | |
virtual TVisibility | getVisibility (IMG_Rect &r)const |
Returns whether the rectangle is inside this rectangle. More... | |
virtual TVisibility | getVisibility (IMG_Line &l)const |
Returns whether the line is inside this rectangle. More... | |
virtual void | setCenter (TInt32 cx,TInt32 cy) |
Sets rectangle members. More... | |
virtual void | setCenter (TInt32 cx,TInt32 cy,TInt32 w,TInt32 h) |
Sets rectangle members. More... | |
virtual bool | clip (IMG_Rect &r)const |
Clips a rectangle. More... | |
virtual bool | clip (IMG_Line &l)const |
Clips a line. More... | |
Public Attributes | |
TInt32 | m_l |
Left coordinate of the rectangle. | |
TInt32 | m_t |
Top coordinate of the rectangle. | |
TInt32 | m_r |
Right coordinate of the rectangle. | |
TInt32 | m_b |
Bottom coordinate of the rectangle. |
Used for bounds in images. The four extreme coordinates are stored as left, top, right and bottom. left is assumed to be smaller than or equal to right. top is assumed to be smaller than or equal to bottom.
|
Constructs a rectangle with the given values.
|
|
Copy constructor.
|
|
Clips a line. Updates the line given such that it will fit within this rectangle. This can result in an empty line.
|
|
Clips a rectangle. Updates the rectangle given such that it will fit within this one. This can result in an empty rectangle.
|
|
Access to rectangle height.
|
|
Returns whether the line is inside this rectangle.
|
|
Returns whether the rectangle is inside this rectangle.
|
|
Access to rectangle width.
|
|
Grows (or shrinks the rectangle). The method avoids negative insets making the rectangle invalid
|
|
Returns whether this rectangle is empty. Empty rectangles are rectangles that have width==0 and/or height==0.
|
|
Returns whether the point is inside this rectangle. Point on the boundary is considered inside.
|
|
Returns whether this rectangle is valid. Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
|
|
Sets all members of the rectangle.
|
|
Sets rectangle members. Sets rectangle members such that it is centered at the given location, with the width requested.
|
|
Sets rectangle members. Sets rectangle members such that it is centered at the given location.
|
|
Grows the rectangle to included a point.
|
|
Does a union of the rectangle given and this rectangle. The result is stored in this rectangle.
|