bitmap.h
 1  /*
 2  ** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
 3  **
 4  **
 5  ** This program is free software; you can redistribute it and/or
 6  ** modify it under the terms of version 2 of the GNU Library General 
 7  ** Public License as published by the Free Software Foundation.
 8  **
 9  ** This program is distributed in the hope that it will be useful, 
10  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12  ** Library General Public License for more details.  To obtain a 
13  ** copy of the GNU Library General Public License, write to the Free 
14  ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15  **
16  ** Any permitted reproduction of these routines, in whole or in part,
17  ** must bear this legend.
18  **
19  **
20  ** bitmap.h
21  **
22  ** Bitmap object defines / prototypes
23  ** $Id: bitmap.h,v 1.2 2001/04/27 14:37:11 neil Exp $
24  */
25  
26  #ifndef _BITMAP_H_
27  #define _BITMAP_H_
28  
29  #include "noftypes.h"
30  
31  /* a bitmap rectangle */
32  typedef struct rect_s
33  {
34     int16 x, y;
35     uint16 w, h;
36  } rect_t;
37  
38  typedef struct rgb_s
39  {
40     int r, g, b;
41  } rgb_t;
42  
43  typedef struct bitmap_s
44  {
45     int width, height, pitch;
46     bool hardware;             /* is data a hardware region? */
47     uint8 *data;               /* protected */
48     uint8 *line[ZERO_LENGTH];  /* will hold line pointers */
49  } bitmap_t;
50  
51  extern void bmp_clear(const bitmap_t *bitmap, uint8 color);
52  extern bitmap_t *bmp_create(int width, int height, int overdraw);
53  extern bitmap_t *bmp_createhw(uint8 *addr, int width, int height, int pitch);
54  extern void bmp_destroy(bitmap_t **bitmap);
55  
56  #endif /* _BITMAP_H_ */
57  
58  /*
59  ** $Log: bitmap.h,v $
60  ** Revision 1.2  2001/04/27 14:37:11  neil
61  ** wheeee
62  **
63  ** Revision 1.1.1.1  2001/04/27 07:03:54  neil
64  ** initial
65  **
66  ** Revision 1.12  2000/11/05 16:37:18  matt
67  ** rolled rgb.h into bitmap.h
68  **
69  ** Revision 1.11  2000/10/10 13:58:13  matt
70  ** stroustrup squeezing his way in the door
71  **
72  ** Revision 1.10  2000/09/18 02:06:48  matt
73  ** -pedantic is your friend
74  **
75  ** Revision 1.9  2000/07/31 04:28:46  matt
76  ** one million cleanups
77  **
78  ** Revision 1.8  2000/07/24 04:31:43  matt
79  ** pitch/data area on non-hw bitmaps get padded to 32-bit boundaries
80  **
81  ** Revision 1.7  2000/07/17 01:52:27  matt
82  ** made sure last line of all source files is a newline
83  **
84  ** Revision 1.6  2000/07/09 14:43:01  matt
85  ** pitch is now configurable for bmp_createhw()
86  **
87  ** Revision 1.5  2000/07/06 16:46:57  matt
88  ** added bmp_clear() routine
89  **
90  ** Revision 1.4  2000/06/09 15:12:25  matt
91  ** initial revision
92  **
93  */