Back to index

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