home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / sunraster.h < prev    next >
C/C++ Source or Header  |  1993-10-21  |  2KB  |  51 lines

  1. /* sunraster.h
  2.  *
  3.  * this describes the header for Sun rasterfiles.  if you have SunOS, a
  4.  * better description is in /usr/include/rasterfile.h.  this is used
  5.  * instead to improve portability and to avoid distribution problems.
  6.  *
  7.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  8.  * copyright information.
  9.  */
  10.  
  11. #include "copyright.h"
  12.  
  13. struct rheader {
  14.   unsigned char magic[4];   /* magic number */
  15.   unsigned char width[4];   /* width of image in pixels */
  16.   unsigned char height[4];  /* height of image in pixels */
  17.   unsigned char depth[4];   /* depth of each pixel */
  18.   unsigned char length[4];  /* length of the image in bytes */
  19.   unsigned char type[4];    /* format of file */
  20.   unsigned char maptype[4]; /* type of colormap */
  21.   unsigned char maplen[4];  /* length of colormap in bytes */
  22. };
  23.  
  24. /* following the header is the colormap (unless maplen is zero) then
  25.  * the image.  each row of the image is rounded to 2 bytes.
  26.  */
  27.  
  28. #define RMAGICNUMBER 0x59a66a95 /* magic number of this file type */
  29.  
  30. /* these are the possible file formats
  31.  */
  32.  
  33. #define ROLD       0 /* old format, see /usr/include/rasterfile.h */
  34. #define RSTANDARD  1 /* standard format */
  35. #define RRLENCODED 2 /* run length encoding to compress the image */
  36. #define RRGB       3 /* RGB-format instead of BGR in 24 or 32-bit mode */
  37. #define RTIFF      4 /* TIFF <-> rasterfile */
  38. #define RIFF       5 /* IFF (TAAC) <-> rasterfile */
  39.  
  40. /* these are the possible colormap types.  if it's in RGB format,
  41.  * the map is made up of three byte arrays (red, green, then blue)
  42.  * that are each 1/3 of the colormap length.
  43.  */
  44.  
  45. #define RNOMAP  0 /* no colormap follows the header */
  46. #define RRGBMAP 1 /* rgb colormap */
  47. #define RRAWMAP 2 /* raw colormap; good luck */
  48.  
  49. #define RESC 128 /* run-length encoding escape character */
  50.  
  51.