Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Polygons
[Utilities]


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_polygon_create (void)
stg_polygon_tstg_unit_polygon_create (void)
void stg_polygon_destroy (stg_polygon_t *p)
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)
stg_polygon_tstg_rects_to_polygons (stg_rotrect_t *rects, size_t count)
void stg_normalize_polygons (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)

Detailed Description

Creating and manipulating polygons

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_polygon_create void   ) 
 

return a single polygon structure. Caller must free() the space.

stg_polygon_t* stg_unit_polygon_create void   ) 
 

creates a unit square polygon

void stg_polygon_destroy stg_polygon_t p  ) 
 

destroy a single polygon

load [filename], an image format understood by gdk-pixbuf, and return a set of rectangles that approximate the image. Caller must free the array of rectangles. If width and height are non-null, they are filled in with the size of the image in pixels

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] into polygon [poly], allocating memory if mecessary.

stg_polygon_t* stg_rects_to_polygons stg_rotrect_t rects,
size_t  count
 

void stg_normalize_polygons 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


Generated on Thu Aug 4 13:08:48 2005 for Stage by  doxygen 1.4.3-20050530