home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / rad386 / radiosit / src / rasterfi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-24  |  2.3 KB  |  57 lines

  1. /*    @(#)rasterfile.h 1.9 88/02/07 SMI    */
  2.  
  3. /*
  4.  * Description of header for files containing raster images
  5.  */
  6.  
  7. #ifdef __BORLANDC__
  8. struct rasterfile {
  9.     long    ras_magic;        /* magic number */
  10.     long    ras_width;        /* width (pixels) of image */
  11.     long    ras_height;        /* height (pixels) of image */
  12.     long    ras_depth;        /* depth (1, 8, or 24 bits) of pixel */
  13.     long    ras_length;        /* length (bytes) of image */
  14.     long    ras_type;        /* type of file; see RT_* below */
  15.     long    ras_maptype;        /* type of colormap; see RMT_* below */
  16.     long    ras_maplength;        /* length (bytes) of following map */
  17.     /* color map follows for ras_maplength bytes, followed by image */
  18. };
  19. #else
  20. struct rasterfile {
  21.     int    ras_magic;        /* magic number */
  22.     int    ras_width;        /* width (pixels) of image */
  23.     int    ras_height;        /* height (pixels) of image */
  24.     int    ras_depth;        /* depth (1, 8, or 24 bits) of pixel */
  25.     int    ras_length;        /* length (bytes) of image */
  26.     int    ras_type;        /* type of file; see RT_* below */
  27.     int    ras_maptype;        /* type of colormap; see RMT_* below */
  28.     int    ras_maplength;        /* length (bytes) of following map */
  29.     /* color map follows for ras_maplength bytes, followed by image */
  30. };
  31. #endif
  32. #define    RAS_MAGIC    0x59a66a95
  33.  
  34.     /* Sun supported ras_type's */
  35. #define RT_OLD        0    /* Raw pixrect image in 68000 byte order */
  36. #define RT_STANDARD    1    /* Raw pixrect image in 68000 byte order */
  37. #define RT_BYTE_ENCODED    2    /* Run-length compression of bytes */
  38. #define RT_EXPERIMENTAL 0xffff    /* Reserved for testing */
  39.  
  40.     /* Sun registered ras_maptype's */
  41. #define RMT_RAW        2
  42.     /* Sun supported ras_maptype's */
  43. #define RMT_NONE    0    /* ras_maplength is expected to be 0 */
  44. #define RMT_EQUAL_RGB    1    /* red[ras_maplength/3],green[],blue[] */
  45.  
  46. /*
  47.  * NOTES:
  48.  *     Each line of the image is rounded out to a multiple of 16 bits.
  49.  *   This corresponds to the rounding convention used by the memory pixrect
  50.  *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
  51.  *    The ras_encoding field (always set to 0 by Sun's supported software)
  52.  *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
  53.  *   of type 0 generated by the old software claim to have 0 length; for
  54.  *   compatibility, code reading rasterfiles must be prepared to compute the
  55.  *   true length from the width, height, and depth fields.
  56.  */
  57.