home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / rflic2 / flic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-06  |  2.8 KB  |  82 lines

  1. /* Flic.h - header file containing structure of a flic file. 
  2.  *
  3.  * Copyright (c) 1992 Jim Kent.  This file may be freely used, modified,
  4.  * copied and distributed.  This file was first published as part of
  5.  * an article for Dr. Dobb's Journal March 1993 issue.
  6.  */
  7.  
  8. #ifndef FLIC_H        /* Keep this from being included twice */
  9. #define FLIC_H
  10.  
  11.     /* Flic Header */
  12. typedef struct
  13.     {
  14.     Long    size;        /* Size of flic including this header. */
  15.     Ushort     type;        /* Either FLI_TYPE or FLC_TYPE below. */
  16.     Ushort    frames;        /* Number of frames in flic. */
  17.     Ushort    width;        /* Flic width in pixels. */
  18.     Ushort    height;        /* Flic height in pixels. */
  19.     Ushort    depth;        /* Bits per pixel.  (Always 8 now.) */
  20.     Ushort    flags;        /* FLI_FINISHED | FLI_LOOPED ideally. */ 
  21.     Long     speed;        /* Delay between frames. */
  22.     Short    reserved1;    /* Set to zero. */
  23.     Ulong    created;    /* Date of flic creation. (FLC only.) */
  24.     Ulong    creator;    /* Serial # of flic creator. (FLC only.) */
  25.     Ulong    updated;    /* Date of flic update. (FLC only.) */
  26.     Ulong    updater;    /* Serial # of flic updater. (FLC only.) */
  27.     Ushort    aspect_dx;    /* Width of square rectangle. (FLC only.) */
  28.     Ushort    aspect_dy;    /* Height of square rectangle. (FLC only.) */
  29.     Char     reserved2[38];/* Set to zero. */
  30.     Long     oframe1;    /* Offset to frame 1. (FLC only.) */
  31.     Long     oframe2;    /* Offset to frame 2. (FLC only.) */
  32.     Char     reserved3[40];/* Set to zero. */
  33.     } FlicHead;
  34.     /* Values for FlicHead.type */
  35. #define FLI_TYPE 0xAF11u    /* 320x200 .FLI type ID */
  36. #define FLC_TYPE 0xAF12u    /* Variable rez .FLC type ID */
  37.     /* Values for FlicHead.flags */
  38. #define FLI_FINISHED 0x0001
  39. #define FLI_LOOPED     0x0002
  40.  
  41.     /* Optional Prefix Header */
  42. typedef struct
  43.     {
  44.     Long size;        /* Size of prefix including header. */
  45.     Ushort type;    /* Always PREFIX_TYPE. */
  46.     Short chunks;    /* Number of subchunks in prefix. */
  47.     Char reserved[8];/* Always 0. */
  48.     } PrefixHead;
  49.     /* Value for PrefixHead.type */
  50. #define PREFIX_TYPE  0xF100u
  51.  
  52.     /* Frame Header */
  53. typedef struct
  54.     {
  55.     Long size;        /* Size of frame including header. */
  56.     Ushort type;    /* Always FRAME_TYPE */
  57.     Short chunks;    /* Number of chunks in frame. */
  58.     Char reserved[8];/* Always 0. */
  59.     } FrameHead;
  60.     /* Value for FrameHead.type */
  61. #define FRAME_TYPE 0xF1FAu
  62.  
  63.     /* Chunk Header */
  64. typedef struct
  65.     {
  66.     Long size;        /* Size of chunk including header. */
  67.     Ushort type;    /* Value from ChunkTypes below. */
  68.     } ChunkHead;
  69. enum ChunkTypes 
  70.     {
  71.     COLOR_256 = 4,    /* 256 level color pallette info. (FLC only.) */
  72.     DELTA_FLC = 7,    /* Word-oriented delta compression. (FLC only.) */
  73.     COLOR_64 = 11,    /* 64 level color pallette info. */
  74.     DELTA_FLI = 12,    /* Byte-oriented delta compression. */
  75.     BLACK = 13,        /* whole frame is color 0 */
  76.     BYTE_RUN = 15,    /* Byte run-length compression. */
  77.     LITERAL = 16,    /* Uncompressed pixels. */
  78.     PSTAMP = 18,    /* "Postage stamp" chunk. (FLC only.) */
  79.     };
  80.  
  81. #endif /* FLIC_H */
  82.