Polygons
[libstage API reference]


Detailed Description

Creating and manipulating polygons


Data Structures

struct  stg_polygon_t

Functions

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

Function Documentation

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_polygon_print stg_polygon_t poly  ) 
 

print a human-readable description of a polygon on stdout

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.

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_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.

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_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_unit_polygon_create void   ) 
 

creates a unit square polygon


Generated on Thu Dec 13 13:55:22 2007 for Stage by  doxygen 1.4.6