X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_gfx.h;h=ad04f46aad82cec07e8034ee697f880e3cd86422;hb=61a736a2e1ad057f78cb5c2245207c9d02d86f29;hp=ed107cb0188ecd62f6816bee6c121c8086ad15be;hpb=badb4b5a280242c6991970d25c4069bc12e77f10;p=rrdtool.git diff --git a/src/rrd_gfx.h b/src/rrd_gfx.h index ed107cb..ad04f46 100644 --- a/src/rrd_gfx.h +++ b/src/rrd_gfx.h @@ -7,9 +7,9 @@ #ifndef RRD_GFX_H #define RRD_GFX_H #define LIBART_COMPILATION -#include +#include -enum gfx_if_en {IF_PNG=0,IF_SVG}; +enum gfx_if_en {IF_PNG=0,IF_SVG,IF_EPS,IF_PDF}; enum gfx_en { GFX_LINE=0,GFX_AREA,GFX_TEXT }; enum gfx_h_align_en { GFX_H_NULL=0, GFX_H_LEFT, GFX_H_RIGHT, GFX_H_CENTER }; enum gfx_v_align_en { GFX_V_NULL=0, GFX_V_TOP, GFX_V_BOTTOM, GFX_V_CENTER }; @@ -45,26 +45,25 @@ typedef struct gfx_canvas_t double zoom; /* zoom for graph */ } gfx_canvas_t; - gfx_canvas_t *gfx_new_canvas (void); /* create a new line */ gfx_node_t *gfx_new_line (gfx_canvas_t *canvas, - double x0, double y0, - double x1, double y1, + double X0, double Y0, + double X1, double Y1, double width, gfx_color_t color); gfx_node_t *gfx_new_dashed_line (gfx_canvas_t *canvas, - double x0, double y0, - double x1, double y1, + double X0, double Y0, + double X1, double Y1, double width, gfx_color_t color, double dash_on, double dash_off); /* create a new area */ gfx_node_t *gfx_new_area (gfx_canvas_t *canvas, - double x0, double y0, - double x1, double y1, - double x2, double y2, + double X0, double Y0, + double X1, double Y1, + double X2, double Y2, gfx_color_t color); /* add a point to a line or to an area */ @@ -86,31 +85,39 @@ gfx_node_t *gfx_new_text (gfx_canvas_t *canvas, /* measure width of a text string */ double gfx_get_text_width ( gfx_canvas_t *canvas, double start, char* font, double size, - double tabwidth, char* text); + double tabwidth, char* text, int rotation); + +/* save image to file */ +int gfx_render (gfx_canvas_t *canvas, + art_u32 width, art_u32 height, + gfx_color_t background, FILE *fo); +/* free memory used by nodes this will also remove memory required for + node chain and associated material */ +int gfx_destroy (gfx_canvas_t *canvas); -/* turn graph into a png image */ +/* PNG support*/ int gfx_render_png (gfx_canvas_t *canvas, art_u32 width, art_u32 height, gfx_color_t background, FILE *fo); double gfx_get_text_width_libart ( gfx_canvas_t *canvas, double start, char* font, double size, - double tabwidth, char* text); - -int gfx_render (gfx_canvas_t *canvas, + double tabwidth, char* text, int rotation); + +/* SVG support */ +int gfx_render_svg (gfx_canvas_t *canvas, art_u32 width, art_u32 height, gfx_color_t background, FILE *fo); - -/* free memory used by nodes this will also remove memory required for - node chain and associated material */ -int gfx_destroy (gfx_canvas_t *canvas); - -#endif -/* turn graph into an svg image */ -int gfx_render_svg (gfx_canvas_t *canvas, +/* EPS support */ +int gfx_render_eps (gfx_canvas_t *canvas, art_u32 width, art_u32 height, gfx_color_t background, FILE *fo); +/* PDF support */ +int gfx_render_pdf (gfx_canvas_t *canvas, + art_u32 width, art_u32 height, + gfx_color_t background, FILE *fo); +#endif