Back to index

radiance  4R0+20100331
targa.h
Go to the documentation of this file.
00001 /* RCSid: $Id: targa.h,v 1.2 2003/07/14 22:24:00 schorsch Exp $ */
00002 /*
00003  *  tardev.h - header file for reading and writing Targa format files.
00004  *
00005  *     8/25/88
00006  */
00007 #ifndef _RAD_TARGA_H_
00008 #define _RAD_TARGA_H_
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013 
00014                      /* header structure adapted from tardev.h */
00015 struct hdStruct {
00016        char textSize;                     /* size of info. line ( < 256) */
00017        char mapType;               /* color map type */
00018        char dataType;                     /* data type */
00019        int  mapOrig;               /* first color index */
00020        int  mapLength;                    /* length of file map */
00021        char CMapBits;                     /* bits per map entry */
00022        int  XOffset;               /* picture offset */
00023        int  YOffset;
00024        int  x;                            /* picture size */
00025        int  y;
00026        int  dataBits;                     /* bits per pixel */
00027        int  imType;                /* image descriptor byte */
00028 };
00029 
00030 #define  IM_NODATA   0             /* no data included */
00031 #define  IM_CMAP     1             /* color-mapped */
00032 #define  IM_RGB             2             /* straight RGB */
00033 #define  IM_MONO     3             /* straight monochrome */
00034 #define  IM_CCMAP    9             /* compressed color-mapped */
00035 #define  IM_CRGB     10            /* compressed RGB */
00036 #define  IM_CMONO    11            /* compressed monochrome */
00037 
00038                             /* color map types */
00039 #define  CM_NOMAP    0             /* no color map */
00040 #define  CM_HASMAP   1             /* has color map */
00041 
00042 #define  bits_bytes(n)      (((n)+7)>>3)  /* number of bits to number of bytes */
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 #endif /* _RAD_TARGA_H_ */
00048