Make more portable.
[bertos.git] / mware / charts.h
1 /*!
2  * \file
3  * <!--
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.
7  * -->
8  *
9  * \brief Simple charts on top of mware/gfx routines (interface).
10  *
11  * Configuration:
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
14  *
15  * \version $Id$
16  * \author Bernardo Innocenti <bernie@develer.com>
17  */
18
19 /*#*
20  *#* $Log$
21  *#* Revision 1.5  2004/09/14 20:56:39  bernie
22  *#* Make more generic and adapt to new gfx functions.
23  *#*
24  *#* Revision 1.3  2004/08/11 19:39:12  bernie
25  *#* Use chart_x_t and chart_y_t for the input dataset.
26  *#*
27  *#* Revision 1.1  2004/08/04 03:16:30  bernie
28  *#* Import simple chart drawing code.
29  *#*
30  *#*/
31 #ifndef MWARE_CHARTS_H
32 #define MWARE_CHARTS_H
33
34 #include <mware/gfx.h> /* vcoord_t */
35 #include <config.h> /* CONFIG_ stuff */
36
37 /*!
38  * \name Width/height of the small ticks drawn over the axes
39  * \{
40  */
41 #define TICKS_HEIGHT     2
42 #define TICKS_WIDTH      2
43 /*\}*/
44
45 /*!
46  * \name Chart frame dimensions
47  * \{
48  */
49 #define CHART_BORDERTOP       0
50 #define CHART_BORDERBOTTOM    0
51 #define CHART_BORDERLEFT      0
52 #define CHART_BORDERRIGHT     0
53 /*\}*/
54
55 #ifndef CONFIG_CHART_TYPE_X
56 #define CONFIG_CHART_TYPE_X vcoord_t
57 #endif
58 #ifndef CONFIG_CHART_TYPE_Y
59 #define CONFIG_CHART_TYPE_Y vcoord_t
60 #endif
61
62
63 typedef CONFIG_CHART_TYPE_X chart_x_t;
64 typedef CONFIG_CHART_TYPE_Y chart_y_t;
65
66
67 /* Public function protos */
68 void chart_init(Bitmap *bm, coord_t xmin, coord_t ymin, coord_t xmax, coord_t ymax);
69 void chart_setScale(Bitmap *bm, chart_x_t xmin, chart_y_t ymin, chart_x_t xmax, chart_y_t ymax);
70 void chart_drawAxis(Bitmap *bm);
71 void chart_drawCurve(Bitmap *bm, const chart_y_t *curve_y, int curve_cnt);
72 void chart_drawDots(Bitmap *bm, const chart_x_t *dots_x, const chart_y_t *dots_y, int cnt);
73
74 #endif /* MWARE_CHARTS_H */