home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilss / sprtools / h / ras < prev    next >
Text File  |  1994-07-18  |  3KB  |  51 lines

  1. /***************************************************************************
  2.  *                                                                         *
  3.  * ras.h    Sun rasterfile.h 1.11 89/08/21                                 *
  4.  *                                                                         *
  5.  * Version 2.00 (16-Nov-1993)                                              *
  6.  *                                                                         *
  7.  * NOTES:                                                                  *
  8.  *   Each line of the image is rounded out to a multiple of 16 bits.       *
  9.  * This corresponds to the rounding convention used by the memory pixrect  *
  10.  * package (/usr/include/pixrect/memvar.h) of the SunWindows system.       *
  11.  *   The ras_encoding field (always set to 0 by Sun's supported software)  *
  12.  * was renamed to ras_length in release 2.0.  As a result, rasterfiles     *
  13.  * of type 0 generated by the old software claim to have 0 length; for     *
  14.  * compatibility, code reading rasterfiles must be prepared to compute the *
  15.  * true length from the width, height, and depth fields.                   *
  16.  *                                                                         *
  17.  ***************************************************************************/
  18.  
  19.  
  20. #define RAS_MAGIC       0x59a66a95
  21.  
  22.                                 /* Sun supported ras_type's */
  23. #define RT_OLD          0       /* Raw pixrect image in 68000 byte order */
  24. #define RT_STANDARD     1       /* Raw pixrect image in 68000 byte order */
  25. #define RT_BYTE_ENCODED 2       /* Run-length compression of bytes */
  26. #define RT_FORMAT_RGB   3       /* XRGB or RGB instead of XBGR or BGR */
  27. #define RT_FORMAT_TIFF  4       /* tiff <-> standard rasterfile */
  28. #define RT_FORMAT_IFF   5       /* iff (TAAC format) <-> standard rasterfile */
  29. #define RT_EXPERIMENTAL 0xffff  /* Reserved for testing */
  30.  
  31.                                 /* Sun registered ras_maptype's */
  32. #define RMT_RAW         2
  33.                                 /* Sun supported ras_maptype's */
  34. #define RMT_NONE        0       /* ras_maplength is expected to be 0 */
  35. #define RMT_EQUAL_RGB   1       /* red[ras_maplength/3],green[],blue[] */
  36.  
  37. typedef struct {
  38.         int     ras_magic;              /* magic number */
  39.         int     ras_width;              /* width (pixels) of image */
  40.         int     ras_height;             /* height (pixels) of image */
  41.         int     ras_depth;              /* depth (1, 8, or 24 bits) of pixel */
  42.         int     ras_length;             /* length (bytes) of image */
  43.         int     ras_type;               /* type of file; see RT_* below */
  44.         int     ras_maptype;            /* type of colormap; see RMT_* below */
  45.         int     ras_maplength;          /* length (bytes) of following map */
  46.  
  47.         /* color map follows for ras_maplength bytes, followed by image */
  48. } rasterfile;
  49.  
  50. int rasterfile_descr[] = { 4, 4,4,4, 4, 4, 4,4, -1 };
  51.