artwrap.h

Go to the documentation of this file.
00001 /****************************************************
00002  *
00003  * ARTWRAP.H
00004  *
00005  * Wrapper around libart function calls that makes
00006  * using libart more like gtk.
00007  *
00008  * written by Mike Montemerlo (mmde@cs.cmu.edu)
00009  * Carngie Mellon Univeristy
00010  *
00011  ****************************************************/
00012 
00013 
00015 // @{
00016 
00026 #ifndef CARMEN_ARTWRAP_H
00027 #define CARMEN_ARTWRAP_H
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 #include <libart_lgpl/art_misc.h>
00034 #include <libart_lgpl/art_vpath.h>
00035 #include <libart_lgpl/art_svp.h>
00036 #include <libart_lgpl/art_svp_vpath.h>
00037 #include <libart_lgpl/art_gray_svp.h>
00038 #include <libart_lgpl/art_rgb_svp.h>
00039 #include <libart_lgpl/art_svp_vpath_stroke.h>
00040 #include <libart_lgpl/art_svp_ops.h>
00041 #include <libart_lgpl/art_affine.h>
00042 #include <libart_lgpl/art_rgb.h>
00043 #include <libart_lgpl/art_rgb_affine.h>
00044 #include <libart_lgpl/art_rgb_bitmap_affine.h>
00045 #include <libart_lgpl/art_rgb_rgba_affine.h>
00046 #include <libart_lgpl/art_alphagamma.h>
00047 #include <libart_lgpl/art_svp_point.h>
00048 #include <libart_lgpl/art_rect_svp.h>
00049 #include <libart_lgpl/art_vpath_dash.h>
00050 #include <libart_lgpl/art_render.h>
00051 #include <libart_lgpl/art_render_gradient.h>
00052 #include <libart_lgpl/art_render_svp.h>
00053 #include <libart_lgpl/art_uta.h>
00054 #include <libart_lgpl/art_uta_vpath.h>
00055 #include <libart_lgpl/art_rect_uta.h>
00056 
00057 typedef struct {
00058   int width, height;
00059   art_u8 *buffer;
00060 } art_buffer_t, *art_buffer_p;
00061 
00062 typedef struct {
00063   art_u32 current_color;
00064   int current_linewidth;
00065   int current_miterlimit;
00066   int current_jointype;
00067   int current_captype;
00068   float current_flatness;
00069   int current_dash_on, current_dash_off;
00070 } art_context_t, *art_context_p;
00071 
00072 #define art_red     0xff0000ff
00073 #define art_blue    0x0000ffff
00074 #define art_green   0x00ff00ff
00075 #define art_white   0xffffffff
00076 #define art_black   0x000000ff
00077 #define art_yellow  0xffff00ff
00078 #define art_orange  0xff6347ff
00079 #define art_grey    0x808080ff
00080 
00081 art_buffer_p art_new_buffer(int width, int height);
00082 
00083 art_context_p art_new_context(void);
00084 
00085 void art_set_color_rgba(art_context_p context, unsigned char r, 
00086                         unsigned char g, unsigned char b, unsigned char a);
00087 
00088 void art_set_color(art_context_p context, long int color);
00089 
00090 void art_set_linewidth(art_context_p context, int width);
00091 
00092 void art_set_miterlimit(art_context_p context, int limit);
00093 
00094 void art_set_jointype(art_context_p context, int jointype);
00095 
00096 void art_set_captype(art_context_p context, int captype);
00097      
00098 void art_set_dash(art_context_p context, int dash_on, int dash_off);
00099 
00100 void art_clear(art_buffer_p buffer, art_context_p context);
00101 
00102 void art_draw_point(art_buffer_p buffer, art_context_p context,
00103                     float x_1, float y_1);
00104 
00105 void art_draw_points(art_buffer_p buffer, art_context_p context,
00106                      float *x_1, float *y_1, int num);
00107 
00108 void art_draw_line(art_buffer_p buffer, art_context_p context, 
00109                    float x_1, float y_1, float x_2, float y_2);
00110 
00111 void art_draw_x(art_buffer_p buffer, art_context_p context, 
00112                 float x, float y, float r);
00113 
00114 void art_draw_poly(art_buffer_p buffer, art_context_p context, int filled,
00115                    float *x, float *y, int n, int closed);
00116 
00117 void art_draw_circle(art_buffer_p buffer, art_context_p context, int filled,
00118                      float x, float y, float r);
00119 
00120 void art_draw_ellipse(art_buffer_p buffer, art_context_p context, int filled,
00121                       float x, float y, float x_var, 
00122                       float xy_cov, float y_var, float k);
00123 
00124 void art_draw_gaussian(art_buffer_p buffer, art_context_p context,
00125                        float x, float y, float x_var, 
00126                        float xy_cov, float y_var, float k);
00127 
00128 void art_draw_gaussian_pca(art_buffer_p buffer, art_context_p context,
00129                        float x, float y, float x_var, 
00130                            float xy_cov, float y_var, float k);
00131 
00132 void art_draw_rectangle(art_buffer_p buffer, art_context_p context, int filled,
00133                         float x_1, float y_1, float x_2, float y_2);
00134 
00135 void art_draw_arc(art_buffer_p buffer, art_context_p context,
00136                   float x, float y, float r, float a1, float deltaa);
00137 
00138 void art_draw_wedge(art_buffer_p buffer, art_context_p context, int filled,
00139                     float x, float y, float r, float a1, float deltaa);
00140 
00141 void art_draw_rgb_image(art_buffer_p dest_buffer, int dest_x, int dest_y,
00142                         int dest_width, int dest_height, 
00143                         unsigned char *src_buffer, int src_width,
00144                         int src_height);
00145 
00146 void art_draw_transformed_rgb_image(art_buffer_p dest_buffer, 
00147                                     unsigned char *src_buffer, int src_width,
00148                                     int src_height, int dest_x, int dest_y,
00149                                     float angle, float scale);
00150 
00151 void art_draw_transformed_rgba_image(art_buffer_p dest_buffer, 
00152                                      unsigned char *src_buffer, int src_width,
00153                                      int src_height, int dest_x, int dest_y,
00154                                      float angle, float scale);
00155 
00156 void art_draw_rgba_image(art_buffer_p dest_buffer, int dest_x, int dest_y,
00157                          int dest_width, int dest_height, 
00158                          unsigned char *src_buffer, int src_width,
00159                          int src_height);
00160 
00161 int art_write_buffer_ppm(art_buffer_p buffer, char *filename);
00162 
00163 int art_write_buffer_png(art_buffer_p buffer, char *filename);
00164 
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168 
00169 #endif
00170 
00171 
00172 // @}

Generated on Wed Apr 5 18:34:17 2006 for CARMEN by  doxygen 1.4.4