4 * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 1999, 2000, 2001, 2003 Bernardo Innocenti <bernie@develer.com>
6 * This file is part of DevLib - See devlib/README for information.
9 * \brief Simple charts on top of mware/gfx routines (interface).
12 * - \c CONFIG_CHART_TYPE_X: type for the input dataset of X-coordinates
13 * - \c CONFIG_CHART_TYPE_Y: type for the input dataset of Y-coordinates
16 * \author Bernardo Innocenti <bernie@develer.com>
21 *#* Revision 1.4 2004/08/25 14:12:09 rasky
22 *#* Aggiornato il comment block dei log RCS
24 *#* Revision 1.3 2004/08/11 19:39:12 bernie
25 *#* Use chart_x_t and chart_y_t for the input dataset.
27 *#* Revision 1.1 2004/08/04 03:16:30 bernie
28 *#* Import simple chart drawing code.
31 #ifndef MWARE_CHARTS_H
32 #define MWARE_CHARTS_H
34 #include <mware/gfx.h> /* vcoord_t */
35 #include <config.h> /* CONFIG_ stuff */
38 * \name Width/height of the small ticks drawn over the axes
41 #define TICKS_HEIGHT 2
46 * \name Chart frame dimensions
49 #define CHART_BORDERTOP 0
50 #define CHART_BORDERBOTTOM TICKS_HEIGHT
51 #define CHART_BORDERLEFT TICKS_WIDTH
52 #define CHART_BORDERRIGHT 0
56 * \name Chart size in pixels
59 #define CHART_WIDTH (bm->width - CHART_BORDERLEFT - CHART_BORDERRIGHT)
60 #define CHART_HEIGHT (bm->height - CHART_BORDERTOP - CHART_BORDERBOTTOM)
63 #ifndef CONFIG_CHART_TYPE_X
64 #define CONFIG_CHART_TYPE_X vcoord_t
66 #ifndef CONFIG_CHART_TYPE_Y
67 #define CONFIG_CHART_TYPE_Y vcoord_t
71 typedef CONFIG_CHART_TYPE_X chart_x_t;
72 typedef CONFIG_CHART_TYPE_Y chart_y_t;
75 /* Public function protos */
76 extern void chart_init(Bitmap *bm, vcoord_t xmin, vcoord_t ymin, vcoord_t xmax, vcoord_t ymax);
77 extern void chart_drawAxis(Bitmap *bm);
78 extern void chart_drawCurve(Bitmap *bm, const chart_y_t *curve_y, int curve_cnt);
79 extern void chart_drawDots(Bitmap *bm, const chart_x_t *dots_x, const chart_y_t *dots_y, int cnt);
81 #endif /* MWARE_CHARTS_H */