com.foxit.sdk.common.fxcrt.RectF Class Reference

Public Member Functions

 RectF ()
 Construct an empty rectangle.

 
 RectF (float left1, float bottom1, float right1, float top1)
 Construct a rectangle with left-bottom and right-top corners.
More...
 
 RectF (RectI rect)
 Construct a rectangle with a FX_RECT object.
More...
 
boolean contains (RectF other_rect)
 Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.
More...
 
boolean contains (float x, float y)
 Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle.
More...
 
void deflate (float x, float y)
 Decreases the width and height of the rectangle.
More...
 
void deflate (float left, float bottom, float right, float top)
 Decreases the width and height of the rectangle.
More...
 
void deflate (RectF rt)
 Decreases the width and height of the rectangle.
More...
 
float getBottom ()
 Get the bottom. More...
 
RectI getClosestRect ()
 Get a closest integer rectangle.
More...
 
RectI getInnerRect ()
 Convert to an inner integer rectangle.
More...
 
float getLeft ()
 Get the left. More...
 
RectI getOuterRect ()
 Convert to an outer integer rectangle.
More...
 
float getRight ()
 Get the right. More...
 
float getTop ()
 Get the top. More...
 
float height ()
 Get the height of the rectangle.
More...
 
void inflate (float x, float y)
 Increases the width and height of the rectangle.
More...
 
void inflate (float left, float bottom, float right, float top)
 Increases the width and height of the rectangle.
More...
 
void inflate (RectF rt)
 Increases the width and height of the rectangle.
More...
 
void initRect (float x, float y)
 Initialize the rectangle to a single point.
More...
 
void intersect (RectF other_rect)
 Intersect with a rect.
More...
 
boolean isEmpty ()
 Verify whether the rect is empty.
More...
 
void normalize ()
 Normalize the rect. Make sure left <= right, and bottom <= top.
More...
 
void reset ()
 Reset rectangle, set coordinates to 0.
More...
 
void setBottom (float value)
 Set the bottom. More...
 
void setLeft (float value)
 Set the left. More...
 
void setRight (float value)
 Set the right. More...
 
void setTop (float value)
 Set the top. More...
 
void transform (Matrix2D pMatrix)
 Transform a rectangle. The result rectangle is always normalized.
More...
 
void translate (float e, float f)
 Translate rectangle.
More...
 
void union (RectF other_rect)
 Union with a rect.
More...
 
void updateRect (float x, float y)
 Update the rectangle to contain the specified point.
More...
 
float width ()
 Get the width of the rectangle.
More...
 

Static Public Member Functions

static RectF getBBox (PointF pPoints, int nPoints)
 Get the bounding box of input points array.
More...
 

Detailed Description

A float-point coordination rectangle. A normalized float-point rectangle always has top larger than bottom, which is the opposite of Windows rectangle.

Constructor & Destructor Documentation

◆ RectF() [1/2]

com.foxit.sdk.common.fxcrt.RectF.RectF ( float  left1,
float  bottom1,
float  right1,
float  top1 
)

Construct a rectangle with left-bottom and right-top corners.

Parameters
left1The x-coordinate of the input left-bottom corner.
bottom1The y-coordinate of the input left-bottom corner.
right1The x-coordinate of the input right-top corner.
top1The y-coordinate of the input right-top corner.

◆ RectF() [2/2]

com.foxit.sdk.common.fxcrt.RectF.RectF ( RectI  rect)

Construct a rectangle with a FX_RECT object.

Parameters
rectThe input FX_RECT object.

Member Function Documentation

◆ contains() [1/2]

boolean com.foxit.sdk.common.fxcrt.RectF.contains ( RectF  other_rect)

Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.

Parameters
other_rectThe other provided rect.
Returns
TRUE means current rectangle fully contains the other one, while FALSE means not.

◆ contains() [2/2]

boolean com.foxit.sdk.common.fxcrt.RectF.contains ( float  x,
float  y 
)

Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle.

Parameters
xThe x coordinate of the provided point.
yThe y coordinate of the provided point.
Returns
TRUE means current rectangle contains the provided point, while FALSE means not.

◆ deflate() [1/3]

void com.foxit.sdk.common.fxcrt.RectF.deflate ( float  x,
float  y 
)

Decreases the width and height of the rectangle.

Parameters
xThe number to deflate the left and right of the rectangle.
yThe number to deflate the top and bottom of the rectangle.
Returns
None.

◆ deflate() [2/3]

void com.foxit.sdk.common.fxcrt.RectF.deflate ( float  left,
float  bottom,
float  right,
float  top 
)

Decreases the width and height of the rectangle.

Parameters
leftThe number to deflate the left of the rectangle.
bottomThe number to deflate the bottom of the rectangle.
rightThe number to deflate the right of the rectangle.
topThe number to deflate the top of the rectangle.
Returns
None.

◆ deflate() [3/3]

void com.foxit.sdk.common.fxcrt.RectF.deflate ( RectF  rt)

Decreases the width and height of the rectangle.

Parameters
rtThe rectangle to deflate each side.
Returns
None.

◆ getBBox()

static RectF com.foxit.sdk.common.fxcrt.RectF.getBBox ( PointF  pPoints,
int  nPoints 
)
static

Get the bounding box of input points array.

Parameters
pPointsThe input points array.
nPointsThe number of points in the array.
Returns
A floating-point coordination rectangle.

◆ getBottom()

com.foxit.sdk.common.fxcrt.RectF.getBottom ( )

Get the bottom.

Returns
The bottom.

◆ getClosestRect()

RectI com.foxit.sdk.common.fxcrt.RectF.getClosestRect ( )

Get a closest integer rectangle.

Returns
The closest integer rectangle.

◆ getInnerRect()

RectI com.foxit.sdk.common.fxcrt.RectF.getInnerRect ( )

Convert to an inner integer rectangle.

Returns
The inner integer rectangle.

◆ getLeft()

com.foxit.sdk.common.fxcrt.RectF.getLeft ( )

Get the left.

Returns
The left.

◆ getOuterRect()

RectI com.foxit.sdk.common.fxcrt.RectF.getOuterRect ( )

Convert to an outer integer rectangle.

Returns
The outer integer rectangle.

◆ getRight()

com.foxit.sdk.common.fxcrt.RectF.getRight ( )

Get the right.

Returns
The right.

◆ getTop()

com.foxit.sdk.common.fxcrt.RectF.getTop ( )

Get the top.

Returns
The top.

◆ height()

float com.foxit.sdk.common.fxcrt.RectF.height ( )

Get the height of the rectangle.

Returns
Height of the rectangle.

◆ inflate() [1/3]

void com.foxit.sdk.common.fxcrt.RectF.inflate ( float  x,
float  y 
)

Increases the width and height of the rectangle.

Parameters
xThe number to inflate the left and right of the rectangle.
yThe number to inflate the top and bottom of the rectangle.
Returns
None.

◆ inflate() [2/3]

void com.foxit.sdk.common.fxcrt.RectF.inflate ( float  left,
float  bottom,
float  right,
float  top 
)

Increases the width and height of the rectangle.

Parameters
leftThe number to inflate the left of the rectangle.
bottomThe number to inflate the bottom of the rectangle.
rightThe number to inflate the right of the rectangle.
topThe number to inflate the top of the rectangle.
Returns
None.

◆ inflate() [3/3]

void com.foxit.sdk.common.fxcrt.RectF.inflate ( RectF  rt)

Increases the width and height of the rectangle.

Parameters
rtThe rectangle to inflate each side.
Returns
None.

◆ initRect()

void com.foxit.sdk.common.fxcrt.RectF.initRect ( float  x,
float  y 
)

Initialize the rectangle to a single point.

Parameters
xThe x-coordinate of the input point.
yThe y-coordinate of the input point.
Returns
None.

◆ intersect()

void com.foxit.sdk.common.fxcrt.RectF.intersect ( RectF  other_rect)

Intersect with a rect.

Parameters
other_rectThe rect to intersect with.
Returns
None.

◆ isEmpty()

boolean com.foxit.sdk.common.fxcrt.RectF.isEmpty ( )

Verify whether the rect is empty.

Returns
TRUE meanas current rect is empty, while FALSE means not.

◆ normalize()

void com.foxit.sdk.common.fxcrt.RectF.normalize ( )

Normalize the rect. Make sure left <= right, and bottom <= top.

Returns
None.

◆ reset()

void com.foxit.sdk.common.fxcrt.RectF.reset ( )

Reset rectangle, set coordinates to 0.

Returns
None.

◆ setBottom()

com.foxit.sdk.common.fxcrt.RectF.setBottom ( float  value)

Set the bottom.

Parameters
[in]bottomThe bottom.
Returns
None.

◆ setLeft()

com.foxit.sdk.common.fxcrt.RectF.setLeft ( float  value)

Set the left.

Parameters
[in]leftThe left.
Returns
None.

◆ setRight()

com.foxit.sdk.common.fxcrt.RectF.setRight ( float  value)

Set the right.

Parameters
[in]rightThe right.
Returns
None.

◆ setTop()

com.foxit.sdk.common.fxcrt.RectF.setTop ( float  value)

Set the top.

Parameters
[in]topThe top.
Returns
None.

◆ transform()

void com.foxit.sdk.common.fxcrt.RectF.transform ( Matrix2D  pMatrix)

Transform a rectangle. The result rectangle is always normalized.

Parameters
pMatrixThe transformation matrix.
Returns
None.

◆ translate()

void com.foxit.sdk.common.fxcrt.RectF.translate ( float  e,
float  f 
)

Translate rectangle.

Parameters
eOffset in X-axis.
fOffset in Y-axis.
Returns
None.

◆ union()

void com.foxit.sdk.common.fxcrt.RectF.union ( RectF  other_rect)

Union with a rect.

Parameters
other_rectThe rect to union with.
Returns
None.

◆ updateRect()

void com.foxit.sdk.common.fxcrt.RectF.updateRect ( float  x,
float  y 
)

Update the rectangle to contain the specified point.

Parameters
xThe x-coordinate of the input point.
yThe y-coordinate of the input point.
Returns
None.

◆ width()

float com.foxit.sdk.common.fxcrt.RectF.width ( )

Get the width of the rectangle.

Returns
Width of the rectangle.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.