Documentation improvements.
[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  * \version $Id$
12  * \author Bernardo Innocenti <bernie@develer.com>
13  */
14
15 /*
16  * $Log$
17  * Revision 1.1  2004/08/04 03:16:30  bernie
18  * Import simple chart drawing code.
19  *
20  */
21 #ifndef MWARE_CHARTS_H
22 #define MWARE_CHARTS_H
23
24 #include <gfx.h> /* vcoord_t */
25
26 /*!
27  * \name Width/height of the chart bitmap in pixels
28  * \{
29  */
30 #define BM_WIDTH       PRT_HRES
31 #define BM_HEIGHT      120
32 /*\}*/
33
34 /*!
35  * \name Width/height of the small ticks drawn over the axes
36  * \{
37  */
38 #define TICKS_HEIGHT     2
39 #define TICKS_WIDTH      3
40 /*\}*/
41
42 /*!
43  * \name Chart frame dimensions
44  * \{
45  */
46 #define CHART_BORDERTOP       0
47 #define CHART_BORDERBOTTOM    TICKS_HEIGHT
48 #define CHART_BORDERLEFT      TICKS_WIDTH
49 #define CHART_BORDERRIGHT     0
50 /*\}*/
51
52 /*!
53  * \name Chart size in pixels
54  * \{
55  */
56 #define CHART_WIDTH     (BM_WIDTH - CHART_BORDERLEFT - CHART_BORDERRIGHT)
57 #define CHART_HEIGHT    (BM_HEIGHT  - CHART_BORDERTOP - CHART_BORDERBOTTOM)
58 /*\}*/
59
60
61 /* Public function protos */
62 extern BitMap *chart_init(vcoord_t xmin, vcoord_t ymin, float xmax, float ymax);
63 extern void chart_drawAxis(BitMap *bm);
64 extern void chart_drawCurve(BitMap *bm, const vcoord_t *curve_y, int curve_cnt);
65 extern void chart_drawDots(BitMap *bm, const vcoord_t *dotsx, const float *dotsy, int cnt);
66
67 #endif /* MWARE_CHARTS_H */