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