3 * Copyright (C) 2003,2004 Develer S.r.l. (http://www.develer.com/)
4 * Copyright (C) 1999 Bernardo Innocenti <bernie@develer.com>
5 * This file is part of DevLib - See devlib/README for information.
9 * \author Bernardo Innocenti <bernie@develer.com>
10 * \author Stefano Fedrigo <aleph@develer.com>
12 * \brief General pourpose graphics routines
17 * Revision 1.4 2004/08/10 07:00:16 bernie
20 * Revision 1.3 2004/08/04 03:16:59 bernie
21 * Switch to new DevLib CONFIG_ convention.
23 * Revision 1.2 2004/06/03 11:27:09 bernie
24 * Add dual-license information.
26 * Revision 1.1 2004/05/23 15:43:16 bernie
27 * Import mware modules.
29 * Revision 1.4 2004/02/09 00:21:28 aleph
32 * Revision 1.3 2004/01/27 23:24:19 aleph
33 * Add new graphics primitives
35 * Revision 1.2 2004/01/07 23:33:01 aleph
36 * Change copyright email
38 * Revision 1.1 2004/01/07 19:05:31 aleph
39 * Add graphics routines
50 /*! Common type for coordinates expressed in pixel units */
53 #if CONFIG_GFX_VCOORDS
54 /*! Common type for coordinates expressed in logical units */
55 typedef float vcoord_t;
56 #endif /* CONFIG_GFX_VCOORDS */
59 typedef struct Rect { coord_t xmin, ymin, xmax, ymax; } Rect;
63 * Control structure to draw in a bitmap
67 uint8_t *raster; /*!< Pointer to byte array to hold the data */
68 coord_t width, height; /*!< Width/Height in pixels */
69 coord_t penX, penY; /*!< Current pen position MoveTo()/LineTo() */
71 Rect cr; /*!< Clip drawing inside this rectangle */
73 #if CONFIG_GFX_VCOORDS
75 * \name Logical coordinate system
79 vcoord_t scaleX, scaleY;
81 #endif /* CONFIG_GFX_VCOORDS */
86 /* Function prototypes */
87 extern void gfx_InitBitmap(Bitmap *bm, uint8_t *raster, coord_t w, coord_t h);
88 extern void gfx_ClearBitmap(Bitmap *bm);
89 extern void gfx_blitBitmap_P(Bitmap *bm, const prog_uchar *raster);
90 extern void gfx_DrawLine(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2);
91 extern void gfx_FillRect(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2);
92 extern void gfx_DrawRect(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2);
93 extern void gfx_ClearRect(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2);
94 extern void gfx_MoveTo(Bitmap *bm, coord_t x, coord_t y);
95 extern void gfx_LineTo(Bitmap *bm, coord_t x, coord_t y);
96 extern void gfx_SetClipRect(Bitmap *bm, coord_t xmin, coord_t ymin, coord_t xmax, coord_t ymax);
98 #if CONFIG_GFX_VCOORDS
99 extern void gfx_SetViewRect(Bitmap *bm, vcoord_t x1, vcoord_t y1, vcoord_t x2, vcoord_t y2);
100 extern coord_t gfx_TransformX(Bitmap *bm, vcoord_t x);
101 extern coord_t gfx_TransformY(Bitmap *bm, vcoord_t y);
102 extern void gfx_VDrawLine(Bitmap *bm, vcoord_t x1, vcoord_t y1, vcoord_t x2, vcoord_t y2);
103 #endif /* CONFIG_GFX_VCOORDS */
105 #endif /* MWARE_GFX_H */