Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Related Pages  

Nano-X region API.
[Nano-X public API]

Functions for handling clipping regions - these are used for clipping drawing, and for non-rectangular windows. More...

Functions

GR_REGION_ID GrNewRegion (void)
 Creates a new region structure.

void GrDestroyRegion (GR_REGION_ID region)
 Destroys a region structure.

void GrUnionRectWithRegion (GR_REGION_ID region, GR_RECT *rect)
 Makes a union of the specified region and the specified rectangle.

void GrUnionRegion (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2)
 Makes a union of two regions.

void GrSubtractRegion (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2)
 Subtracts the second source region from the first source region and places the result in the specified destination region.

void GrXorRegion (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2)
 Performs a logical exclusive OR operation on the specified source regions and places the result in the destination region.

void GrIntersectRegion (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2)
 Calculates the intersection of the two specified source regions and places the result in the specified destination region.

void GrSetGCRegion (GR_GC_ID gc, GR_REGION_ID region)
 Sets the clip mask of the specified graphics context to the specified region.

GR_BOOL GrPointInRegion (GR_REGION_ID region, GR_COORD x, GR_COORD y)
 Tests whether the specified point is within the specified region, and then returns either True or False depending on the result.

int GrRectInRegion (GR_REGION_ID region, GR_COORD x, GR_COORD y, GR_COORD w, GR_COORD h)
 Tests whether the specified rectangle is contained within the specified region.

GR_BOOL GrEmptyRegion (GR_REGION_ID region)
 Determines whether the specified region is empty.

GR_BOOL GrEqualRegion (GR_REGION_ID rgn1, GR_REGION_ID rgn2)
 Determines whether the specified regions are identical, and returns GR_TRUE if it is, or GR_FALSE otherwise.

void GrOffsetRegion (GR_REGION_ID region, GR_SIZE dx, GR_SIZE dy)
 Offsets the specified region by the specified distance.

int GrGetRegionBox (GR_REGION_ID region, GR_RECT *rect)
 Fills in the specified rectangle structure with a bounding box that would completely enclose the specified region, and also returns the type of the specified region.

GR_REGION_ID GrNewPolygonRegion (int mode, GR_COUNT count, GR_POINT *points)
 Creates a new region structure, fills it with the region described by the specified polygon, and returns the ID used to refer to it.

GR_REGION_ID GrNewBitmapRegion (GR_BITMAP *bitmap, GR_SIZE width, GR_SIZE height)
 Creates a new region structure, fills it with the region described by the specified polygon, and returns the ID used to refer to it.


Detailed Description

Functions for handling clipping regions - these are used for clipping drawing, and for non-rectangular windows.


Function Documentation

void GrDestroyRegion GR_REGION_ID  region  ) 
 

Destroys a region structure.

Parameters:
region The ID of the region structure to destroy.

GR_BOOL GrEmptyRegion GR_REGION_ID  region  ) 
 

Determines whether the specified region is empty.

Parameters:
region The ID of the region to examine.
Returns:
GR_TRUE if the region is empty, or GR_FALSE if it is not.

GR_BOOL GrEqualRegion GR_REGION_ID  rgn1,
GR_REGION_ID  rgn2
 

Determines whether the specified regions are identical, and returns GR_TRUE if it is, or GR_FALSE otherwise.

Parameters:
rgn1 The ID of the first region to examine.
rgn2 The ID of the second region to examine.
Returns:
GR_TRUE if the regions are equal, or GR_FALSE otherwise

int GrGetRegionBox GR_REGION_ID  region,
GR_RECT rect
 

Fills in the specified rectangle structure with a bounding box that would completely enclose the specified region, and also returns the type of the specified region.

Parameters:
region The ID of the region to get the bounding box of
rect Pointer to a rectangle structure
Returns:
The region type

Todo:
FIXME check Doxygen comments from this point down.

void GrIntersectRegion GR_REGION_ID  dst_rgn,
GR_REGION_ID  src_rgn1,
GR_REGION_ID  src_rgn2
 

Calculates the intersection of the two specified source regions and places the result in the specified destination region.

The destination region will contain only the parts of the source regions which overlap each other.

Parameters:
dst_rgn The ID of the destination region.
src_rgn1 The ID of the first source region.
src_rgn2 The ID of the second source region.

GR_REGION_ID GrNewBitmapRegion GR_BITMAP *  bitmap,
GR_SIZE  width,
GR_SIZE  height
 

Creates a new region structure, fills it with the region described by the specified polygon, and returns the ID used to refer to it.

1 bits in the bitmap specify areas inside the region and 0 bits specify areas outside it.

Parameters:
bitmap pointer to a GR_BITMAP array specifying the region mask
width the width of the bitmap
height the height of the bitmap
Returns:
the ID of the newly allocated region structure, or 0 on error

GR_REGION_ID GrNewPolygonRegion int  mode,
GR_COUNT  count,
GR_POINT *  points
 

Creates a new region structure, fills it with the region described by the specified polygon, and returns the ID used to refer to it.

Parameters:
mode the polygon mode to use (GR_POLY_EVENODD or GR_POLY_WINDING)
count the number of points in the polygon
points pointer to an array of point structures describing the polygon
Returns:
the ID of the newly allocated region structure, or 0 on error

GR_REGION_ID GrNewRegion void   ) 
 

Creates a new region structure.

The structure is initialised with a set of default parameters.

Returns:
the ID of the newly created region

void GrOffsetRegion GR_REGION_ID  region,
GR_SIZE  dx,
GR_SIZE  dy
 

Offsets the specified region by the specified distance.

Parameters:
region The ID of the region to offset
dx The distance to offset the region by in the X axis
dy The distance to offset the region by in the Y axis

GR_BOOL GrPointInRegion GR_REGION_ID  region,
GR_COORD  x,
GR_COORD  y
 

Tests whether the specified point is within the specified region, and then returns either True or False depending on the result.

Parameters:
region the ID of the region to examine.
x the X coordinate of the point to test for.
y the Y coordinate of the point to test for.
Returns:
TRUE if the point is within the region, otherwise FALSE.

int GrRectInRegion GR_REGION_ID  region,
GR_COORD  x,
GR_COORD  y,
GR_COORD  w,
GR_COORD  h
 

Tests whether the specified rectangle is contained within the specified region.

Returns GR_RECT_OUT if it is not inside it at all, GR_RECT_ALLIN if it is completely contained within the region, or GR_RECT_PARTIN if it is partially contained within the region.

Parameters:
region The ID of the region to examine.
x The X coordinates of the rectangle to test.
y The Y coordinates of the rectangle to test.
w The width of the rectangle to test.
h The height of the rectangle to test.
Returns:
GR_RECT_PARTIN, GR_RECT_ALLIN, or GR_RECT_OUT.

void GrSetGCRegion GR_GC_ID  gc,
GR_REGION_ID  region
 

Sets the clip mask of the specified graphics context to the specified region.

Subsequent drawing operations using this graphics context will not draw outside the specified region. The region ID can be set to 0 to remove the clipping region from the specified graphics context.

Parameters:
gc The ID of the graphics context to set the clip mask of.
region The ID of the region to use as the clip mask, or 0 for none.

void GrSubtractRegion GR_REGION_ID  dst_rgn,
GR_REGION_ID  src_rgn1,
GR_REGION_ID  src_rgn2
 

Subtracts the second source region from the first source region and places the result in the specified destination region.

Parameters:
dst_rgn The ID of the destination region.
src_rgn1 The ID of the first source region.
src_rgn2 The ID of the second source region.

void GrUnionRectWithRegion GR_REGION_ID  region,
GR_RECT rect
 

Makes a union of the specified region and the specified rectangle.

Places the result back in the source region.

Parameters:
region The ID of the region to modify.
rect A pointer to the rectangle to add to the region.

void GrUnionRegion GR_REGION_ID  dst_rgn,
GR_REGION_ID  src_rgn1,
GR_REGION_ID  src_rgn2
 

Makes a union of two regions.

Places the result in the specified destination region.

Parameters:
dst_rgn The ID of the destination region.
src_rgn1 The ID of the first source region.
src_rgn2 The ID of the second source region.

void GrXorRegion GR_REGION_ID  dst_rgn,
GR_REGION_ID  src_rgn1,
GR_REGION_ID  src_rgn2
 

Performs a logical exclusive OR operation on the specified source regions and places the result in the destination region.

The destination region will contain only the parts of the source regions which do not overlap.

Parameters:
dst_rgn The ID of the destination region.
src_rgn1 The ID of the first source region.
src_rgn2 The ID of the second source region.


Generated on Sun May 18 21:03:07 2003 for Microwindows Nano-X API by doxygen1.3