home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / gfli / fli.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-14  |  3.8 KB  |  103 lines

  1. /*
  2.  * Written 1998 Jens Ch. Restemeier <jchrr@hrz.uni-bielefeld.de>
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  *
  18.  */
  19. #ifndef _FLI_H
  20. #define _FLI_H
  21.  
  22. /** structures */
  23.  
  24. typedef struct _fli_header {
  25.     unsigned long filesize;
  26.     unsigned short magic;
  27.     unsigned short frames;
  28.     unsigned short width;
  29.     unsigned short height;
  30.     unsigned short depth;
  31.     unsigned short flags;
  32.     unsigned long speed;
  33.     unsigned long created;
  34.     unsigned long creator;
  35.     unsigned long updated;
  36.     unsigned short aspect_x, aspect_y;
  37.     unsigned long oframe1, oframe2;
  38. } s_fli_header;
  39.  
  40. typedef struct _fli_frame {
  41.     unsigned long size;
  42.     unsigned short magic;
  43.     unsigned short chunks;
  44. } s_fli_frame;
  45.  
  46. typedef struct _fli_chunk {
  47.     unsigned long size;
  48.     unsigned short magic;
  49.     unsigned char *data;
  50. } s_fli_chunk;
  51.  
  52. /** chunk magics */
  53. #define NO_HEADER    0
  54. #define HEADER_FLI    0xAF11
  55. #define HEADER_FLC    0xAF12
  56. #define FRAME        0xF1FA
  57.  
  58. /** codec magics */
  59. #define FLI_COLOR    11
  60. #define FLI_BLACK    13
  61. #define FLI_BRUN    15
  62. #define FLI_COPY    16
  63. #define FLI_LC        12
  64. #define FLI_LC_2    7
  65. #define FLI_COLOR_2    4
  66. #define FLI_MINI    18
  67.  
  68. /** codec masks */
  69. #define W_COLOR        0x0001
  70. #define W_BLACK        0x0002
  71. #define W_BRUN        0x0004
  72. #define W_COPY        0x0008
  73. #define W_LC        0x0010
  74. #define W_LC_2        0x0020
  75. #define W_COLOR_2    0x0040
  76. #define W_MINI        0x0080
  77. #define W_ALL        0xFFFF
  78.  
  79. /** functions */
  80. void fli_read_header(FILE *f, s_fli_header *fli_header);
  81. void fli_read_frame(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *old_cmap, unsigned char *framebuf, unsigned char *cmap);
  82.  
  83. void fli_read_color(FILE *f, s_fli_header *fli_header, unsigned char *old_cmap, unsigned char *cmap); 
  84. void fli_read_color_2(FILE *f, s_fli_header *fli_header, unsigned char *old_cmap, unsigned char *cmap); 
  85. void fli_read_black(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  86. void fli_read_brun(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  87. void fli_read_copy(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  88. void fli_read_lc(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *framebuf); 
  89. void fli_read_lc_2(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *framebuf);
  90.  
  91. void fli_write_header(FILE *f, s_fli_header *fli_header);
  92. void fli_write_frame(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *old_cmap, unsigned char *framebuf, unsigned char *cmap, unsigned short codec_mask);
  93.  
  94. int fli_write_color(FILE *f, s_fli_header *fli_header, unsigned char *old_cmap, unsigned char *cmap); 
  95. int fli_write_color_2(FILE *f, s_fli_header *fli_header, unsigned char *old_cmap, unsigned char *cmap); 
  96. void fli_write_black(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  97. void fli_write_brun(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  98. void fli_write_copy(FILE *f, s_fli_header *fli_header, unsigned char *framebuf); 
  99. void fli_write_lc(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *framebuf); 
  100. void fli_write_lc_2(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *framebuf);
  101.  
  102. #endif
  103.