Foxit PDF SDK
FSDK.RectF Class Reference

Public Member Functions

 constructor ()
 Construct an empty rectangle.
 
 constructor (left1, bottom1, Fight1, top1)
 Construct a rectangle with left-bottom and right-top corners. More...
 
 Contains (other_rect) Contains(x
 Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one. More...
 
 Deflate (left, bottom, right, top,)
 Decreases the width and height of the rectangle. More...
 
 Deflate (x, y)
 Decreases the width and height of the rectangle. More...
 
 Deflatert (rt)
 Decreases the width and height of the rectangle. More...
 
 GetClosestRect ()
 Get a closest integer rectangle. More...
 
 GetInnerRect ()
 Convert to an inner integer rectangle. More...
 
 GetOutterRect ()
 Convert to an outer integer rectangle. More...
 
 Height ()
 Get the height of the rectangle. More...
 
 Inflate (left, bottom, right, top,)
 Increases the width and height of the rectangle. More...
 
 Inflate (rt)
 Increases the width and height of the rectangle. More...
 
 Inflate (x, y)
 Increases the width and height of the rectangle. More...
 
 InitRect (x, y)
 Initialize the rectangle to a single point. More...
 
 Intersect (other_rect)
 Intersect with a rect. More...
 
 IsEmpty ()
 Verify whether the rect is empty. More...
 
 Normalize ()
 Normalize the rect. Make sure left <= right, and bottom <= top. More...
 
 Reset ()
 Reset rectangle, set coordinates to 0. More...
 
 Substract4 (substract_rect, 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...
 
 Transform (pMatrix)
 Transform a rectangle. The result rectangle is always normalized. More...
 
 Translate (e, f)
 Translate rectangle. More...
 
 Union (other_rect)
 Union with a rect. More...
 
 UpdateRect (x, y)
 Update the rectangle to contain the specified point. More...
 
 Width ()
 Get the width of the rectangle. More...
 

Static Public Member Functions

static GetBBox (pPoints, nPoints)
 Get the bounding box of input points array. More...
 

Public Attributes

 bottom
 The bottom.
 
 left
 The left.
 
 right
 The right.
 
 top
 The top.
 

Member Function Documentation

◆ constructor()

FSDK.RectF.constructor ( left1  ,
bottom1  ,
Fight1  ,
top1   
)

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

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

◆ Contains()

FSDK.RectF.Contains (   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
[in]other_rectThe other provided rect.
Returns
true means current rectangle fully contains the other one, while false means not.

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

Parameters
[in]xThe x coordinate of the provided point.
[in]yThe y coordinate of the provided point.
Returns
true means current rectangle contains the provided point, while false means not.

◆ Deflate() [1/2]

FSDK.RectF.Deflate ( left  ,
bottom  ,
right  ,
top   
)

Decreases the width and height of the rectangle.

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

◆ Deflate() [2/2]

FSDK.RectF.Deflate ( ,
 
)

Decreases the width and height of the rectangle.

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

◆ Deflatert()

FSDK.RectF.Deflatert ( rt  )

Decreases the width and height of the rectangle.

Parameters
[in]rtThe rectangle to deflate each side.
Returns
None.

◆ GetBBox()

static FSDK.RectF.GetBBox ( pPoints  ,
nPoints   
)
static

Get the bounding box of input points array.

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

◆ GetClosestRect()

FSDK.RectF.GetClosestRect ( )

Get a closest integer rectangle.

Returns
The closest integer rectangle.

◆ GetInnerRect()

FSDK.RectF.GetInnerRect ( )

Convert to an inner integer rectangle.

Returns
The inner integer rectangle.

◆ GetOutterRect()

FSDK.RectF.GetOutterRect ( )

Convert to an outer integer rectangle.

Returns
The outer integer rectangle.

◆ Height()

FSDK.RectF.Height ( )

Get the height of the rectangle.

Returns
Height of the rectangle.

◆ Inflate() [1/3]

FSDK.RectF.Inflate ( left  ,
bottom  ,
right  ,
top   
)

Increases the width and height of the rectangle.

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

◆ Inflate() [2/3]

FSDK.RectF.Inflate ( rt  )

Increases the width and height of the rectangle.

Parameters
[in]rtThe rectangle to inflate each side.
Returns
None.

◆ Inflate() [3/3]

FSDK.RectF.Inflate ( ,
 
)

Increases the width and height of the rectangle.

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

◆ InitRect()

FSDK.RectF.InitRect ( ,
 
)

Initialize the rectangle to a single point.

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

◆ Intersect()

FSDK.RectF.Intersect ( other_rect  )

Intersect with a rect.

Parameters
[in]other_rectThe rect to intersect with.
Returns
None.

◆ IsEmpty()

FSDK.RectF.IsEmpty ( )

Verify whether the rect is empty.

Returns
true meanas current rect is empty, while false means not.

◆ Normalize()

FSDK.RectF.Normalize ( )

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

Returns
None.

◆ Reset()

FSDK.RectF.Reset ( )

Reset rectangle, set coordinates to 0.

Returns
None.

◆ Substract4()

FSDK.RectF.Substract4 ( substract_rect  ,
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).

Parameters
[in]substract_rectThe rectangle to be subtracted.
[out]pRectsThe rectangle array to receive result rectangles.
Returns
The number of result rectangles.

◆ Transform()

FSDK.RectF.Transform ( pMatrix  )

Transform a rectangle. The result rectangle is always normalized.

Parameters
[in]pMatrixThe transformation matrix.
Returns
None.

◆ Translate()

FSDK.RectF.Translate ( ,
 
)

Translate rectangle.

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

◆ Union()

FSDK.RectF.Union ( other_rect  )

Union with a rect.

Parameters
[in]other_rectThe rect to union with.
Returns
None.

◆ UpdateRect()

FSDK.RectF.UpdateRect ( ,
 
)

Update the rectangle to contain the specified point.

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

◆ Width()

FSDK.RectF.Width ( )

Get the width of the rectangle.

Returns
Width of the rectangle.