Rotated Rectangles

Data Structures

struct  stg_rotrect_t


stg_polygon_tstg_polygons_from_rotrects (stg_rotrect_t *rects, size_t count, double width, double height)
int stg_rotrects_from_image_file (const char *filename, stg_rotrect_t **rects, int *rect_count, int *widthp, int *heightp)
void stg_rotrects_normalize (stg_rotrect_t *rects, int num)

Function Documentation

stg_polygon_t* stg_polygons_from_rotrects stg_rotrect_t rects,
size_t  count,
double  width,
double  height

converts an array of rectangles into an array of polygons

convert a rotrect array into polygons. All polys are given the size (width,height). Caller must free the returned array of polygons

int stg_rotrects_from_image_file const char *  filename,
stg_rotrect_t **  rects,
int *  rect_count,
int *  widthp,
int *  heightp

load the image file [filename] and convert it to an array of rectangles, filling in the number of rects, width and height. Memory is allocated for the rectangle array [rects], so the caller must free [rects].

void stg_rotrects_normalize stg_rotrect_t rects,
int  num

normalizes the set [rects] of [num] rectangles, so that they fit exactly in a unit square.

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