1 |
greg |
1.1 |
/* RCSid: $Id$ */ |
2 |
|
|
/* |
3 |
|
|
* tardev.h - header file for reading and writing Targa format files. |
4 |
|
|
* |
5 |
|
|
* 8/25/88 |
6 |
|
|
*/ |
7 |
|
|
/* header structure adapted from tardev.h */ |
8 |
|
|
struct hdStruct { |
9 |
|
|
char textSize; /* size of info. line ( < 256) */ |
10 |
|
|
char mapType; /* color map type */ |
11 |
|
|
char dataType; /* data type */ |
12 |
|
|
int mapOrig; /* first color index */ |
13 |
|
|
int mapLength; /* length of file map */ |
14 |
|
|
char CMapBits; /* bits per map entry */ |
15 |
|
|
int XOffset; /* picture offset */ |
16 |
|
|
int YOffset; |
17 |
|
|
int x; /* picture size */ |
18 |
|
|
int y; |
19 |
|
|
int dataBits; /* bits per pixel */ |
20 |
|
|
int imType; /* image descriptor byte */ |
21 |
|
|
}; |
22 |
|
|
|
23 |
|
|
#define IM_NODATA 0 /* no data included */ |
24 |
|
|
#define IM_CMAP 1 /* color-mapped */ |
25 |
|
|
#define IM_RGB 2 /* straight RGB */ |
26 |
|
|
#define IM_MONO 3 /* straight monochrome */ |
27 |
|
|
#define IM_CCMAP 9 /* compressed color-mapped */ |
28 |
|
|
#define IM_CRGB 10 /* compressed RGB */ |
29 |
|
|
#define IM_CMONO 11 /* compressed monochrome */ |
30 |
|
|
|
31 |
|
|
/* color map types */ |
32 |
|
|
#define CM_NOMAP 0 /* no color map */ |
33 |
|
|
#define CM_HASMAP 1 /* has color map */ |
34 |
|
|
|
35 |
|
|
#define bits_bytes(n) (((n)+7)>>3) /* number of bits to number of bytes */ |