1 #ifndef IMAGE_H 2 #define IMAGE_H 3 4 #include <gd.h> /* libgd2-dev libgd2 */ 5 #include <gdfontt.h> /* gdFontGetTiny() */ 6 #include <gdfonts.h> /* gdFontGetSmall() */ 7 #include <gdfontmb.h> /* gdFontGetMediumBold() */ 8 #include <gdfontl.h> /* gdFontGetLarge() */ 9 #include <gdfontg.h> /* gdFontGetGiant() */ 10 11 /* rectangle size */ 12 #define YBEGINOFFSET (-1) 13 14 #define FIVEMINHEIGHTOFFSET 4 15 #define FIVEMINWIDTHFULLPADDING 10 16 #define FIVEMINWIDTHPADDING 2 17 #define FIVEMINEXTRASPACE 78 18 19 #define SCALEMINPIXELS 25 20 21 typedef struct { 22 gdImagePtr im; 23 gdFontPtr font; 24 interfaceinfo interface; 25 int cbackground, cedge, cheader, cheadertitle, cheaderdate, ctext, cline, clinel, cvnstat; 26 int crx, crxd, ctx, ctxd, cbgoffset, cbgoffsetmore, showheader, showedge, showlegend, altdate; 27 int lineheight, large; 28 char headertext[65], databegin[18], dataend[18]; 29 time_t current; 30 } IMAGECONTENT; 31 32 typedef struct { 33 time_t date; 34 uint64_t rx, tx; 35 } HOURDATA; 36 37 void initimagecontent(IMAGECONTENT *ic); 38 void drawimage(IMAGECONTENT *ic); 39 #if HAVE_DECL_GD_NEAREST_NEIGHBOUR 40 void scaleimage(IMAGECONTENT *ic); 41 #endif 42 int drawhours(IMAGECONTENT *ic, const int xpos, const int ypos, const int rate); 43 void drawhourly(IMAGECONTENT *ic, const int rate); 44 void drawlist(IMAGECONTENT *ic, const char *listname); 45 void drawsummary(IMAGECONTENT *ic, const int layout, const int rate); 46 void drawsummary_alltime(IMAGECONTENT *ic, const int x, const int y); 47 void drawsummary_digest(IMAGECONTENT *ic, const int x, const int y, const char *mode); 48 void drawfivegraph(IMAGECONTENT *ic, const int rate, const int resultcount, const int height); 49 int drawfiveminutes(IMAGECONTENT *ic, const int xpos, const int ypos, const int rate, const int resultcount, const int height); 50 51 #endif 52