Foxit PDF SDK
|
Inherits CFX_Object.
Public Member Functions | |
CFX_FloatRect () | |
Construct an empty rectangle. | |
CFX_FloatRect (FX_FLOAT left1, FX_FLOAT bottom1, FX_FLOAT right1, FX_FLOAT top1) | |
Construct a rectangle with left-bottom and right-top corners. More... | |
CFX_FloatRect (const FX_FLOAT *pArray) | |
Construct a rectangle with an array of left, bottom, right, top values. More... | |
CFX_FloatRect (const FX_RECT &rect) | |
Construct a rectangle with a FX_RECT object. More... | |
FX_BOOL | Contains (const CFX_FloatRect &other_rect) const |
Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one. More... | |
FX_BOOL | Contains (FX_FLOAT x, FX_FLOAT y) const |
Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle. More... | |
void | Deflate (FX_FLOAT x, FX_FLOAT y) |
Decreases the width and height of the rectangle. More... | |
void | Deflate (FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top) |
Decreases the width and height of the rectangle. More... | |
void | Deflate (const CFX_FloatRect &rt) |
Decreases the width and height of the rectangle. More... | |
FX_RECT | GetClosestRect () const |
Get a closest integer rectangle. More... | |
FX_RECT | GetInnerRect () const |
Convert to an inner integer rectangle. More... | |
FX_RECT | GetOutterRect () const |
Convert to an outer integer rectangle. More... | |
FX_FLOAT | Height () const |
Get the height of the rectangle. More... | |
void | Inflate (FX_FLOAT x, FX_FLOAT y) |
Increases the width and height of the rectangle. More... | |
void | Inflate (FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top) |
Increases the width and height of the rectangle. More... | |
void | Inflate (const CFX_FloatRect &rt) |
Increases the width and height of the rectangle. More... | |
void | InitRect (FX_FLOAT x, FX_FLOAT y) |
Initialize the rectangle to a single point. More... | |
void | Intersect (const CFX_FloatRect &other_rect) |
Intersect with a rect. More... | |
FX_BOOL | IsEmpty () const |
Verify whether the rect is empty. More... | |
void | Normalize () |
Normalize the rect. Make sure left <= right, and bottom <= top. More... | |
FX_BOOL | operator!= (const CFX_FloatRect &src) const |
Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first. More... | |
FX_BOOL | operator== (const CFX_FloatRect &src) const |
Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first. More... | |
void | Reset () |
Reset rectangle, set coordinates to 0. More... | |
int | Substract4 (CFX_FloatRect &substract_rect, CFX_FloatRect *pRects) |
Subtract a rectangle area from this rectangle. The result might be up to 4 rectangles. The number of result rectangles are returned. Caller must prepare enough rectangles (up to 4). More... | |
void | Transform (const CFX_Matrix *pMatrix) |
Transform a rectangle. The result rectangle is always normalized. More... | |
void | Translate (FX_FLOAT e, FX_FLOAT f) |
Translate rectangle. More... | |
void | Union (const CFX_FloatRect &other_rect) |
Union with a rect. More... | |
void | UpdateRect (FX_FLOAT x, FX_FLOAT y) |
Update the rectangle to contain the specified point. More... | |
FX_FLOAT | Width () const |
Get the width of the rectangle. More... | |
Static Public Member Functions | |
static CFX_FloatRect | GetBBox (const CFX_PointF *pPoints, int nPoints) |
Get the bounding box of input points array. More... | |
Public Attributes | |
FX_FLOAT | bottom |
The bottom. | |
FX_FLOAT | left |
The left. | |
FX_FLOAT | right |
The right. | |
FX_FLOAT | top |
The top. | |
A float-point coordination rectangle. A normalized float-point rectangle always has top larger than bottom, which is the opposite of Windows rectangle.
|
inline |
Construct a rectangle with left-bottom and right-top corners.
[in] | left1 | The x-coordinate of the input left-bottom corner. |
[in] | bottom1 | The y-coordinate of the input left-bottom corner. |
[in] | right1 | The x-coordinate of the input right-top corner. |
[in] | top1 | The y-coordinate of the input right-top corner. |
|
inline |
Construct a rectangle with an array of left, bottom, right, top values.
[in] | pArray | The input array. |
CFX_FloatRect::CFX_FloatRect | ( | const FX_RECT & | rect | ) |
Construct a rectangle with a FX_RECT object.
[in] | rect | The input FX_RECT object. |
FX_BOOL CFX_FloatRect::Contains | ( | const CFX_FloatRect & | other_rect | ) | const |
Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.
[in] | other_rect | The other provided rect. |
Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle.
[in] | x | The x coordinate of the provided point. |
[in] | y | The y coordinate of the provided point. |
Decreases the width and height of the rectangle.
[in] | x | The number to deflate the left and right of the rectangle. |
[in] | y | The number to deflate the top and bottom of the rectangle. |
Decreases the width and height of the rectangle.
[in] | left | The number to deflate the left of the rectangle. |
[in] | bottom | The number to deflate the bottom of the rectangle. |
[in] | right | The number to deflate the right of the rectangle. |
[in] | top | The number to deflate the top of the rectangle. |
|
inline |
Decreases the width and height of the rectangle.
[in] | rt | The rectangle to deflate each side. |
|
static |
Get the bounding box of input points array.
[in] | pPoints | The input points array. |
[in] | nPoints | The number of points in the array. |
FX_RECT CFX_FloatRect::GetClosestRect | ( | ) | const |
Get a closest integer rectangle.
FX_RECT CFX_FloatRect::GetInnerRect | ( | ) | const |
Convert to an inner integer rectangle.
FX_RECT CFX_FloatRect::GetOutterRect | ( | ) | const |
Convert to an outer integer rectangle.
|
inline |
Get the height of the rectangle.
Increases the width and height of the rectangle.
[in] | x | The number to inflate the left and right of the rectangle. |
[in] | y | The number to inflate the top and bottom of the rectangle. |
Increases the width and height of the rectangle.
[in] | left | The number to inflate the left of the rectangle. |
[in] | bottom | The number to inflate the bottom of the rectangle. |
[in] | right | The number to inflate the right of the rectangle. |
[in] | top | The number to inflate the top of the rectangle. |
|
inline |
Increases the width and height of the rectangle.
[in] | rt | The rectangle to inflate each side. |
Initialize the rectangle to a single point.
[in] | x | The x-coordinate of the input point. |
[in] | y | The y-coordinate of the input point. |
void CFX_FloatRect::Intersect | ( | const CFX_FloatRect & | other_rect | ) |
Intersect with a rect.
[in] | other_rect | The rect to intersect with. |
|
inline |
Verify whether the rect is empty.
void CFX_FloatRect::Normalize | ( | ) |
Normalize the rect. Make sure left <= right, and bottom <= top.
|
inline |
Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first.
[in] | src | The rect to compare. |
|
inline |
Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first.
[in] | src | The rect to compare. |
|
inline |
Reset rectangle, set coordinates to 0.
int CFX_FloatRect::Substract4 | ( | CFX_FloatRect & | substract_rect, |
CFX_FloatRect * | pRects | ||
) |
Subtract a rectangle area from this rectangle. The result might be up to 4 rectangles. The number of result rectangles are returned. Caller must prepare enough rectangles (up to 4).
[in] | substract_rect | The rectangle to be subtracted. |
[out] | pRects | The rectangle array to receive result rectangles. |
void CFX_FloatRect::Transform | ( | const CFX_Matrix * | pMatrix | ) |
Transform a rectangle. The result rectangle is always normalized.
[in] | pMatrix | The transformation matrix. |
Translate rectangle.
[in] | e | Offset in X-axis. |
[in] | f | Offset in Y-axis. |
void CFX_FloatRect::Union | ( | const CFX_FloatRect & | other_rect | ) |
Union with a rect.
[in] | other_rect | The rect to union with. |
Update the rectangle to contain the specified point.
[in] | x | The x-coordinate of the input point. |
[in] | y | The y-coordinate of the input point. |
|
inline |
Get the width of the rectangle.