X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_gfx.h;h=4263d8ac9efba0ecc05dc20b1343835e5aba6c80;hb=7e9d021d4b981dd1017e4e36617b5b60005582f3;hp=77c2f33c92c25e3fc28e57c073457eb07ea41a32;hpb=a390dded3e87ac8fd340175a7aa8cf7bce4d02f3;p=rrdtool.git diff --git a/src/rrd_gfx.h b/src/rrd_gfx.h index 77c2f33..4263d8a 100644 --- a/src/rrd_gfx.h +++ b/src/rrd_gfx.h @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2001 + * RRDtool 1.2.1 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_gfx.h generic graphics adapter library ****************************************************************************/ @@ -7,9 +7,12 @@ #ifndef RRD_GFX_H #define RRD_GFX_H #define LIBART_COMPILATION -#include -enum gfx_if_en {IF_PNG=0,IF_SVG,IF_EPS}; +#include +#include +#include "art_rgba_svp.h" + +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 }; @@ -20,13 +23,12 @@ typedef struct gfx_node_t { gfx_color_t color; /* color of element 0xRRGGBBAA alpha 0xff is solid*/ double size; /* font size, line width */ double dash_on, dash_off; /* dash line fragments lengths */ - ArtVpath *path; /* path */ int closed_path; int points; int points_max; - ArtSVP *svp; /* svp */ char *filename; /* font or image filename */ char *text; + ArtVpath *path; /* path */ double x,y; /* position */ double angle; /* text angle */ enum gfx_h_align_en halign; /* text alignement */ @@ -45,7 +47,6 @@ typedef struct gfx_canvas_t double zoom; /* zoom for graph */ } gfx_canvas_t; - gfx_canvas_t *gfx_new_canvas (void); /* create a new line */ @@ -86,7 +87,7 @@ 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, @@ -102,9 +103,8 @@ int gfx_destroy (gfx_canvas_t *canvas); 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); +double gfx_get_text_width_libart ( double start, char* font, double size, + double tabwidth, char* text, int rotation); /* SVG support */ int gfx_render_svg (gfx_canvas_t *canvas, @@ -116,4 +116,9 @@ 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