Polygons
[Utilities]


Detailed Description

Creating and manipulating polygons


Data Structures

struct  stg_polygon_t

Functions

stg_polygon_tstg_polygons_create (int count)
void stg_polygons_destroy (stg_polygon_t *p, size_t count)
stg_polygon_tstg_unit_polygon_create (void)
void stg_polygon_set_points (stg_polygon_t *poly, stg_point_t *pts, size_t count)
void stg_polygon_append_points (stg_polygon_t *poly, stg_point_t *pts, size_t count)
void stg_polygons_normalize (stg_polygon_t *polys, int num, double width, double height)
void stg_polygon_print (stg_polygon_t *poly)
void stg_polygons_print (stg_polygon_t *polys, unsigned int count)
stg_polygon_tstg_polygons_from_image_file (const char *filename, size_t *count)

Function Documentation

stg_polygon_t* stg_polygons_create int  count  ) 
 

return an array of [count] polygons. Caller must free() the space.

void stg_polygons_destroy stg_polygon_t p,
size_t  count
 

destroy an array of [count] polygons

stg_polygon_t* stg_unit_polygon_create void   ) 
 

creates a unit square polygon

void stg_polygon_set_points stg_polygon_t poly,
stg_point_t pts,
size_t  count
 

Copies [count] points from [pts] into polygon [poly], allocating memory if mecessary. Any previous points in [poly] are overwritten.

void stg_polygon_append_points stg_polygon_t poly,
stg_point_t pts,
size_t  count
 

Appends [count] points from [pts] to the point list of polygon [poly], allocating memory if mecessary.

void stg_polygons_normalize stg_polygon_t polys,
int  num,
double  width,
double  height
 

scale the array of [num] polygons so that all its points fit exactly in a rectagle of pwidth] by [height] units

void stg_polygon_print stg_polygon_t poly  ) 
 

print a human-readable description of a polygon on stdout

void stg_polygons_print stg_polygon_t polys,
unsigned int  count
 

print a human-readable description of an array of polygons on stdout

stg_polygon_t* stg_polygons_from_image_file const char *  filename,
size_t *  poly_count
 

interpret a bitmap file as a set of polygons. Returns an array of polygons. On exit [poly_count] is the number of polygons found.


Generated on Thu Aug 11 13:08:10 2005 for Stage by  doxygen 1.4.0