home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / grafix / netpbm / rletopnm.lha / src / rle.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-11  |  1.4 KB  |  38 lines

  1. /* rle.h - header file for Utah Raster Toolkit files */
  2.  
  3. #define RLE_MAGIC   0xcc52
  4.  
  5. typedef struct {
  6.     unsigned short  magic;
  7.     unsigned short  xpos, ypos;
  8.     unsigned short  xsize, ysize;
  9.     unsigned char   flags;
  10.     unsigned char   ncolors;        /* no of color channels - 0 = only color map, 1 = B&W, 3 = RGB */
  11.     unsigned char   pixelbits;      /* bits per pixel, per color channel (max 8) */
  12.     unsigned char   ncmap;          /* no of color map channels */
  13.     unsigned char   cmaplen;        /* no of entries in color map for each channel (log base 2, i.e. 8 = 256 entries) */
  14. } Header;
  15.  
  16. /* flags */
  17. #define H_CLEARFIRST        0x01    /* clear frame buffer -- ignored (we always clear) */
  18. #define H_NO_BACKGROUND     0x02    /* no background color provided */
  19. #define H_ALPHA             0x04    /* has alpha channel (color channel -1, not counted in Header.ncolors) */
  20. #define H_COMMENT           0x08    /* comments after header */
  21.  
  22. /* image encoding opcodes */
  23. #define OP_SKIPLINES        0x01
  24. #define OP_SETCOLOR         0x02
  25. #define OP_SKIPPIXELS       0x03
  26. #define OP_BYTEDATA         0x05
  27. #define OP_RUNDATA          0x06
  28. #define OP_EOF              0x07
  29.  
  30. #define OP_LONG_DATUM       0x40
  31.  
  32. /* SetColor datum values */
  33. #define CHANNEL_RED           0x00
  34. #define CHANNEL_GREEN         0x01
  35. #define CHANNEL_BLUE          0x02
  36. #define CHANNEL_ALPHA         0xff  /* -1 */
  37.  
  38.