Rotated Rectangles
[Internals]


Data Structures

struct  stg_rotrect_t

Functions

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

References stg_polygon_t::bbox, stg_rotrect_t::pose, stg_rotrect_t::size, stg_polygon_set_points(), stg_polygons_create(), stg_size_t::x, stg_pose_t::x, stg_point_t::x, stg_size_t::y, stg_pose_t::y, and stg_point_t::y.

Referenced by stg_polygons_from_image_file().

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

References stg_pose_t::a, pb_pixel_is_set(), pb_set_rect(), stg_rotrect_t::pose, stg_rotrect_t::size, stg_size_t::x, stg_pose_t::x, stg_size_t::y, and stg_pose_t::y.

Referenced by stg_polygons_from_image_file().

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.

References BILLION, stg_rotrect_t::pose, stg_rotrect_t::size, stg_size_t::x, stg_pose_t::x, stg_size_t::y, and stg_pose_t::y.


Generated on Wed Jun 3 23:12:29 2009 for Stage by  doxygen 1.5.9