Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Bmp.h
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: nGenEx.lib
6
FILE: Bmp.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
BMP image file loader
13
*/
14
15
#ifndef BMP_H
16
#define BMP_H
17
18
// +--------------------------------------------------------------------+
19
20
enum
{
BMP_OK
,
BMP_NOMEM
,
BMP_INVALID
,
BMP_NOFILE
};
21
22
struct
BmpFileHeader
23
{
24
WORD
type
;
25
DWORD
size
;
26
WORD
rsvd1
;
27
WORD
rsvd2
;
28
DWORD
offset
;
29
};
30
31
struct
BmpInfoHeader
32
{
33
DWORD
hdr_size
;
34
DWORD
width
;
35
DWORD
height
;
36
WORD
planes
;
37
WORD
bit_count
;
38
DWORD
compression
;
39
DWORD
img_size
;
40
DWORD
x_pixels_per_meter
;
41
DWORD
y_pixels_per_meter
;
42
DWORD
colors_used
;
43
DWORD
colors_important
;
44
};
45
46
const
int
BMP_FILE_HDR_SIZE
= 14;
47
const
int
BMP_INFO_HDR_SIZE
= 40;
48
49
// +--------------------------------------------------------------------+
50
51
struct
BmpImage
52
{
53
static
const
char
*
TYPENAME
() {
return
"BmpImage"
; }
54
55
BmpImage
(
short
w,
short
h,
unsigned
long
* hibits);
56
57
BmpImage
();
58
~BmpImage
();
59
60
int
Load
(
char
*filename);
61
int
Save
(
char
*filename);
62
63
int
LoadBuffer
(
unsigned
char
* buf,
int
len);
64
65
BmpFileHeader
file_hdr
;
66
BmpInfoHeader
info_hdr
;
67
DWORD
palette
[256];
68
DWORD*
image
;
69
WORD
width
;
70
WORD
height
;
71
};
72
73
// +--------------------------------------------------------------------+
74
75
76
#endif BMP_H
nGenEx
Bmp.h
Generated on Thu May 31 2012 16:30:51 for Starshatter_Open by
1.8.1