Macros | Functions
Rectangle_api

Macros

#define min(a, b)   (((a) < (b)) ? (a) : (b))
 
#define max(a, b)   (((a) < (b)) ? (b) : (a))
 

Functions

void GrRectDraw (const tContext *pContext, const tRectangle *pRect)
 
void GrRectFill (const tContext *pContext, const tRectangle *pRect)
 
long GrRectOverlapCheck (tRectangle *psRect1, tRectangle *psRect2)
 
long GrRectIntersectGet (tRectangle *psRect1, tRectangle *psRect2, tRectangle *psIntersect)
 

Detailed Description

Macro Definition Documentation

#define min (   a,
 
)    (((a) < (b)) ? (a) : (b))

Referenced by GrRectIntersectGet().

#define max (   a,
 
)    (((a) < (b)) ? (b) : (a))

Referenced by GrRectIntersectGet().

Function Documentation

void GrRectDraw ( const tContext pContext,
const tRectangle pRect 
)

Draws a rectangle.

Parameters
pContextis a pointer to the drawing context to use.
pRectis a pointer to the structure containing the extents of the rectangle.

This function draws a rectangle. The rectangle will extend from lXMin to lXMax and lYMin to lYMax, inclusive.

Returns
None.

References GrLineDrawH(), GrLineDrawV(), tRectangle::sXMax, tRectangle::sXMin, tRectangle::sYMax, and tRectangle::sYMin.

void GrRectFill ( const tContext pContext,
const tRectangle pRect 
)

Draws a filled rectangle.

Parameters
pContextis a pointer to the drawing context to use.
pRectis a pointer to the structure containing the extents of the rectangle.

This function draws a filled rectangle. The rectangle will extend from lXMin to lXMax and lYMin to lYMax, inclusive. The clipping of the rectangle to the clipping rectangle is performed within this routine; the display driver's rectangle fill routine is used to perform the actual rectangle fill.

Returns
None.

References DpyRectFill, tContext::pDisplay, tContext::sClipRegion, tRectangle::sXMax, tRectangle::sXMin, tRectangle::sYMax, tRectangle::sYMin, and tContext::ulForeground.

long GrRectOverlapCheck ( tRectangle psRect1,
tRectangle psRect2 
)

Determines if two rectangles overlap.

Parameters
psRect1is a pointer to the first rectangle.
psRect2is a pointer to the second rectangle.

This function determines whether two rectangles overlap. It assumes that rectangles psRect1 and psRect2 are valid with sXMin < sXMax and sYMin < sYMax.

Returns
Returns 1 if there is an overlap or 0 if not.

References tRectangle::sXMax, tRectangle::sXMin, tRectangle::sYMax, and tRectangle::sYMin.

Referenced by GrRectIntersectGet().

long GrRectIntersectGet ( tRectangle psRect1,
tRectangle psRect2,
tRectangle psIntersect 
)

Determines the intersection of two rectangles.

Parameters
psRect1is a pointer to the first rectangle.
psRect2is a pointer to the second rectangle.
psIntersectis a pointer to a rectangle which will be written with the intersection of psRect1 and psRect2.

This function determines if two rectangles overlap and, if they do, calculates the rectangle representing their intersection. If the rectangles do not overlap, 0 is returned and psIntersect is not written.

Returns
Returns 1 if there is an overlap or 0 if not.

References GrRectOverlapCheck(), max, min, tRectangle::sXMax, tRectangle::sXMin, tRectangle::sYMax, and tRectangle::sYMin.


Copyright 2013, Texas Instruments Incorporated