SignDoc SDK (C)  5.0.0
SIGNDOC_Rect Class Reference

A rectangle (document coordinates). More...

#include <SignDocSDK-c.h>

Public Member Functions

struct SIGNDOC_RectSIGNDOC_Rect_new (struct SIGNDOC_Exception **aEx)
 SIGNDOC_Rect constructor. More...
 
struct SIGNDOC_RectSIGNDOC_Rect_newXY (struct SIGNDOC_Exception **aEx, double aX1, double aY1, double aX2, double aY2)
 SIGNDOC_Rect constructor. More...
 
struct SIGNDOC_RectSIGNDOC_Rect_clone (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Rect *aObj)
 Clone a SIGNDOC_Rect object. More...
 
void SIGNDOC_Rect_delete (struct SIGNDOC_Rect *aObj)
 SIGNDOC_Rect destructor. More...
 
void SIGNDOC_Rect_get (const struct SIGNDOC_Rect *aObj, double *aX1, double *aY1, double *aX2, double *aY2)
 Get the four coordinate of a SIGNDOC_Rect object. More...
 
void SIGNDOC_Rect_assign (struct SIGNDOC_Rect *aObj, const struct SIGNDOC_Rect *aSource)
 SIGNDOC_Rect assignment operator. More...
 
void SIGNDOC_Rect_setXY (struct SIGNDOC_Rect *aObj, double aX1, double aY1, double aX2, double aY2)
 Set the coordinates of a SIGNDOC_Rect object. More...
 
double SIGNDOC_Rect_getX1 (const struct SIGNDOC_Rect *aObj)
 Get the first X coordinate of a SIGNDOC_Rect object. More...
 
double SIGNDOC_Rect_getY1 (const struct SIGNDOC_Rect *aObj)
 Get the first Y coordinate of a SIGNDOC_Rect object. More...
 
double SIGNDOC_Rect_getX2 (const struct SIGNDOC_Rect *aObj)
 Get the second X coordinate of a SIGNDOC_Rect object. More...
 
double SIGNDOC_Rect_getY2 (const struct SIGNDOC_Rect *aObj)
 Get the second Y coordinate of a SIGNDOC_Rect object. More...
 
double SIGNDOC_Rect_getWidth (const struct SIGNDOC_Rect *aObj)
 Get the width of the rectangle. More...
 
double SIGNDOC_Rect_getHeight (const struct SIGNDOC_Rect *aObj)
 Get the height of the rectangle. More...
 
void SIGNDOC_Rect_normalize (struct SIGNDOC_Rect *aObj)
 Normalize the rectangle. More...
 
void SIGNDOC_Rect_scale (struct SIGNDOC_Rect *aObj, double aFactor)
 Scale the rectangle. More...
 
void SIGNDOC_Rect_scaleXY (struct SIGNDOC_Rect *aObj, double aFactorX, double aFactorY)
 Scale the rectangle. More...
 
SIGNDOC_Boolean SIGNDOC_Rect_isEmpty (const struct SIGNDOC_Rect *aObj)
 Check if the rectangle is empty. More...
 
void SIGNDOC_Rect_intersectWith (struct SIGNDOC_Rect *aObj, const struct SIGNDOC_Rect *aOther)
 Intersect this rectangle with another one. More...
 
void SIGNDOC_Rect_uniteWith (struct SIGNDOC_Rect *aObj, const struct SIGNDOC_Rect *aOther)
 Unite this rectangle with another one. More...
 

Public Attributes

double mX1
 The first X coordinate. More...
 
double mY1
 The first Y coordinate. More...
 
double mX2
 The second X coordinate. More...
 
double mY2
 The second Y coordinate. More...
 

Detailed Description

A rectangle (document coordinates).

If coordinates are given in pixels (this is true for TIFF documents), the right and top coordinates are exclusive.

See Coordinate Systems.

The edges of the rectangle are parallel to the axes.

Member Function Documentation

void SIGNDOC_Rect_assign ( struct SIGNDOC_Rect aObj,
const struct SIGNDOC_Rect aSource 
)

SIGNDOC_Rect assignment operator.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aSourceA pointer to the source SIGNDOC_Rect object.
struct SIGNDOC_Rect * SIGNDOC_Rect_clone ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Rect aObj 
)

Clone a SIGNDOC_Rect object.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
A pointer to the new SIGNDOC_Rect object.
void SIGNDOC_Rect_delete ( struct SIGNDOC_Rect aObj)

SIGNDOC_Rect destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
void SIGNDOC_Rect_get ( const struct SIGNDOC_Rect aObj,
double *  aX1,
double *  aY1,
double *  aX2,
double *  aY2 
)

Get the four coordinate of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[out]aX1A pointer to an object that will receive the first X coordinate.
[out]aY1A pointer to an object that will receive the first Y coordinate.
[out]aX2A pointer to an object that will receive the second X coordinate.
[out]aY2A pointer to an object that will receive the second Y coordinate.
double SIGNDOC_Rect_getHeight ( const struct SIGNDOC_Rect aObj)

Get the height of the rectangle.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The height of the rectangle.
double SIGNDOC_Rect_getWidth ( const struct SIGNDOC_Rect aObj)

Get the width of the rectangle.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The width of the rectangle.
double SIGNDOC_Rect_getX1 ( const struct SIGNDOC_Rect aObj)

Get the first X coordinate of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The first X coordinate.
double SIGNDOC_Rect_getX2 ( const struct SIGNDOC_Rect aObj)

Get the second X coordinate of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The second X coordinate.
double SIGNDOC_Rect_getY1 ( const struct SIGNDOC_Rect aObj)

Get the first Y coordinate of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The first Y coordinate.
double SIGNDOC_Rect_getY2 ( const struct SIGNDOC_Rect aObj)

Get the second Y coordinate of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
The second Y coordinate.
void SIGNDOC_Rect_intersectWith ( struct SIGNDOC_Rect aObj,
const struct SIGNDOC_Rect aOther 
)

Intersect this rectangle with another one.

If either rectangle is empty, this rectangle will be empty. The resulting rectangle will be normalized.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aOtherA pointer to the other SIGNDOC_Rect object.
SIGNDOC_Boolean SIGNDOC_Rect_isEmpty ( const struct SIGNDOC_Rect aObj)

Check if the rectangle is empty.

A rectangle is empty if the two X coordinates are equal or if the two Y coordinates are equal.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
Returns
SIGNDOC_TRUE iff the rectangle is empty.
struct SIGNDOC_Rect * SIGNDOC_Rect_new ( struct SIGNDOC_Exception **  aEx)

SIGNDOC_Rect constructor.

All coordinates will be 0.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
Returns
A pointer to the new SIGNDOC_Rect object.
struct SIGNDOC_Rect * SIGNDOC_Rect_newXY ( struct SIGNDOC_Exception **  aEx,
double  aX1,
double  aY1,
double  aX2,
double  aY2 
)

SIGNDOC_Rect constructor.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aX1The first X coordinate.
[in]aY1The first Y coordinate.
[in]aX2The second X coordinate.
[in]aY2The second Y coordinate.
Returns
A pointer to the new SIGNDOC_Rect object.
void SIGNDOC_Rect_normalize ( struct SIGNDOC_Rect aObj)

Normalize the rectangle.

Normalize the rectangle to the one with lower-left and upper-right corners assuming that the origin is in the lower-left corner of the page.

This function assumes that document coordinates are used, see Coordinate Systems).

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
void SIGNDOC_Rect_scale ( struct SIGNDOC_Rect aObj,
double  aFactor 
)

Scale the rectangle.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aFactorThe factor by which the rectangle is to be scaled.
void SIGNDOC_Rect_scaleXY ( struct SIGNDOC_Rect aObj,
double  aFactorX,
double  aFactorY 
)

Scale the rectangle.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aFactorXThe factor by which the rectangle is to be scaled horizontally.
[in]aFactorYThe factor by which the rectangle is to be scaled vertically.
void SIGNDOC_Rect_setXY ( struct SIGNDOC_Rect aObj,
double  aX1,
double  aY1,
double  aX2,
double  aY2 
)

Set the coordinates of a SIGNDOC_Rect object.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aX1The first X coordinate.
[in]aY1The first Y coordinate.
[in]aX2The second X coordinate.
[in]aY2The second Y coordinate.
void SIGNDOC_Rect_uniteWith ( struct SIGNDOC_Rect aObj,
const struct SIGNDOC_Rect aOther 
)

Unite this rectangle with another one.

Replace this rectangle with the smallest rectangle that contains both retangles.

If this rectangle is empty, it will be set to aOther. If aOther is empty, this rectangle won't be modified. The resulting rectangle will be normalized.

Parameters
[in]aObjA pointer to the SIGNDOC_Rect object.
[in]aOtherA pointer to the other SIGNDOC_Rect object.

Member Data Documentation

double mX1

The first X coordinate.

double mX2

The second X coordinate.

double mY1

The first Y coordinate.

double mY2

The second Y coordinate.


The documentation for this class was generated from the following file: