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