Foxit PDF SDK
FSRectF Class Reference

Inherits NSObject.

Instance Methods

(BOOL) - contains:
 Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.
More...
 
(BOOL) - containsPointF:
 Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle.
More...
 
(void) - defalteWithValues:y:
 Decreases the width and height of the rectangle.
More...
 
(void) - deflate:
 Decreases the width and height of the rectangle.
More...
 
(FSRectI *) - getClosestRect
 Get a closest integer rectangle.
More...
 
(FSRectI *) - getInnerRect
 Convert to an inner integer rectangle.
More...
 
(FSRectI *) - getOuterRect
 Convert to an outer integer rectangle.
More...
 
(float) - height
 Get the height of the rectangle.
More...
 
(void) - inflate:
 Increases the width and height of the rectangle.
More...
 
(void) - inflateWithValues:y:
 Increases the width and height of the rectangle.
More...
 
(id) - init
 Construct an empty rectangle.

 
(void) - initRect:y:
 Initialize the rectangle to a single point.
More...
 
(id) - initWithLeft1:bottom1:right1:top1:
 Construct a rectangle with left-bottom and right-top corners.
More...
 
(id) - initWithRect:
 Construct a rectangle with a rectangle object.
More...
 
(void) - intersect:
 Intersect with a rect.
More...
 
(BOOL) - 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) - transform:
 Transform a rectangle. The result rectangle is always normalized.
More...
 
(void) - translate:f:
 Translate rectangle.
More...
 
(void) - union:
 Union with a rect.
More...
 
(void) - updateRect:y:
 Update the rectangle to contain the specified point.
More...
 
(float) - width
 Get the width of the rectangle.
More...
 

Class Methods

(FSRectF *) + getBBox:nPoints:
 Get the bounding box of input points array.
More...
 

Properties

float bottom
 The bottom.

 
float left
 The left.

 
float right
 The right.

 
float top
 The top.

 

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.

Method Documentation

◆ contains:()

- (BOOL) contains: (FSRectF*)  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
YES means current rectangle fully contains the other one, while NO means not.

◆ containsPointF:()

- (int) containsPointF: (FSPointF*)  point

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

Returns
YES means current rectangle contains the provided point, while NO means not.

◆ defalteWithValues:y:()

- (void) defalteWithValues: (float)  x
y: (float)  y 

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.

◆ deflate:()

- (void) deflate: (FSRectF*)  rt

Decreases the width and height of the rectangle.

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

◆ getBBox:nPoints:()

+ (FSRectF *) getBBox: (FSPointF*)  pPoints
nPoints: (int)  nPoints 

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()

- (FSRectI *) getClosestRect

Get a closest integer rectangle.

Returns
The closest integer rectangle.

◆ getInnerRect()

- (FSRectI *) getInnerRect

Convert to an inner integer rectangle.

Returns
The inner integer rectangle.

◆ getOuterRect()

- (FSRectI *) getOuterRect

Convert to an outer integer rectangle.

Returns
The outer integer rectangle.

◆ height()

- (float) height

Get the height of the rectangle.

Returns
Height of the rectangle.

◆ inflate:()

- (void) inflate: (FSRectF*)  rt

Increases the width and height of the rectangle.

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

◆ inflateWithValues:y:()

- (void) inflateWithValues: (float)  x
y: (float)  y 

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:y:()

- (void) initRect: (float)  x
y: (float)  y 

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.

◆ initWithLeft1:bottom1:right1:top1:()

- (id) initWithLeft1: (float)  left1
bottom1: (float)  bottom1
right1: (float)  right1
top1: (float)  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.

◆ initWithRect:()

- (id) initWithRect: (FSRectI*)  rect

Construct a rectangle with a rectangle object.

Parameters
[in]rectThe input rectangle object.

◆ intersect:()

- (void) intersect: (FSRectF*)  other_rect

Intersect with a rect.

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

◆ isEmpty()

- (BOOL) isEmpty

Verify whether the rect is empty.

Returns
YES meanas current rect is empty, while NO means not.

◆ normalize()

- (void) normalize

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

Returns
None.

◆ reset()

- (void) reset

Reset rectangle, set coordinates to 0.

Returns
None.

◆ transform:()

- (void) transform: (FSMatrix2D*)  pMatrix

Transform a rectangle. The result rectangle is always normalized.

Parameters
[in]pMatrixThe transformation matrix.
Returns
None.

◆ translate:f:()

- (void) translate: (float)  e
f: (float)  f 

Translate rectangle.

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

◆ union:()

- (void) union: (FSRectF*)  other_rect

Union with a rect.

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

◆ updateRect:y:()

- (void) updateRect: (float)  x
y: (float)  y 

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()

- (float) width

Get the width of the rectangle.

Returns
Width of the rectangle.