stage.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <assert.h>
#include <unistd.h>
#include <math.h>
#include <glib.h>
#include <locale.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "replace.h"
#include "stage_internal.h"

Functions

int stg_init (int argc, char **argv)
const char * stg_get_version_string (void)
void stg_err (const char *err)
void stg_print_geom (stg_geom_t *geom)
void stg_print_laser_config (stg_laser_config_t *slc)
stg_msec_t stg_timenow (void)
int stg_quit_test (void)
void stg_quit_request (void)
void stg_quit_cancel (void)
stg_color_t stg_lookup_color (const char *name)
void stg_normalize_polygons (stg_polygon_t *polys, int num, double width, double height)
void stg_normalize_lines (stg_line_t *lines, int num)
void stg_scale_lines (stg_line_t *lines, int num, double xscale, double yscale)
void stg_translate_lines (stg_line_t *lines, int num, double xtrans, double ytrans)
void stg_normalize_rects (stg_rotrect_t *rects, int num)
stg_line_t * stg_rects_to_lines (stg_rotrect_t *rects, int num_rects)
stg_polygon_t * stg_rects_to_polygons (stg_rotrect_t *rects, size_t count)
void stg_polygon_print (stg_polygon_t *poly)
void stg_polygons_print (stg_polygon_t *polys, unsigned int count)
void stg_pose_sum (stg_pose_t *result, stg_pose_t *p1, stg_pose_t *p2)
guchar * pb_get_pixel (GdkPixbuf *pb, int x, int y)
void pb_zero_pixel (GdkPixbuf *pb, int x, int y)
void pb_zero_rect (GdkPixbuf *pb, int x, int y, int width, int height)
gboolean pb_pixel_is_set (GdkPixbuf *pb, int x, int y)
int stg_load_image (const char *filename, stg_rotrect_t **rects, int *rect_count, int *widthp, int *heightp)
stg_polygon_t * stg_polygons_create (int count)
void stg_polygons_destroy (stg_polygon_t *p, size_t count)
stg_polygon_t * stg_polygon_create (void)
void stg_polygon_destroy (stg_polygon_t *p)
stg_polygon_t * stg_unit_polygon_create (void)
stg_point_t * stg_points_create (size_t count)
stg_point_t * stg_point_create (void)
void stg_points_destroy (stg_point_t *pts)
void stg_point_destroy (stg_point_t *pt)
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)

Variables

int _stg_quit = FALSE
int _stg_disable_gui = FALSE

Function Documentation

int stg_init int  argc,
char **  argv
 

const char* stg_get_version_string void   ) 
 

void stg_err const char *  err  ) 
 

void stg_print_geom stg_geom_t *  geom  ) 
 

void stg_print_laser_config stg_laser_config_t *  slc  ) 
 

stg_msec_t stg_timenow void   ) 
 

int stg_quit_test void   ) 
 

void stg_quit_request void   ) 
 

void stg_quit_cancel void   ) 
 

stg_color_t stg_lookup_color const char *  name  ) 
 

void stg_normalize_polygons stg_polygon_t *  polys,
int  num,
double  width,
double  height
 

void stg_normalize_lines stg_line_t *  lines,
int  num
 

void stg_scale_lines stg_line_t *  lines,
int  num,
double  xscale,
double  yscale
 

void stg_translate_lines stg_line_t *  lines,
int  num,
double  xtrans,
double  ytrans
 

void stg_normalize_rects stg_rotrect_t *  rects,
int  num
 

stg_line_t* stg_rects_to_lines stg_rotrect_t *  rects,
int  num_rects
 

stg_polygon_t* stg_rects_to_polygons stg_rotrect_t *  rects,
size_t  count
 

converts an array of rectangles into an array of polygons

void stg_polygon_print stg_polygon_t *  poly  ) 
 

void stg_polygons_print stg_polygon_t *  polys,
unsigned int  count
 

void stg_pose_sum stg_pose_t *  result,
stg_pose_t *  p1,
stg_pose_t *  p2
 

guchar* pb_get_pixel GdkPixbuf *  pb,
int  x,
int  y
 

void pb_zero_pixel GdkPixbuf *  pb,
int  x,
int  y
 

void pb_zero_rect GdkPixbuf *  pb,
int  x,
int  y,
int  width,
int  height
 

gboolean pb_pixel_is_set GdkPixbuf *  pb,
int  x,
int  y
 

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

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 polygons

stg_polygon_t* stg_polygon_create void   ) 
 

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

void stg_polygon_destroy stg_polygon_t *  p  ) 
 

destroy a single polygon

stg_polygon_t* stg_unit_polygon_create void   ) 
 

stg_point_t* stg_points_create size_t  count  ) 
 

stg_point_t* stg_point_create void   ) 
 

void stg_points_destroy stg_point_t *  pts  ) 
 

void stg_point_destroy stg_point_t *  pt  ) 
 

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.


Variable Documentation

int _stg_quit = FALSE
 

int _stg_disable_gui = FALSE