home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / utils / fbm2fl03.lha / fpfli.h < prev    next >
C/C++ Source or Header  |  1993-10-05  |  2KB  |  99 lines

  1. /* fpfli.h */
  2.  
  3. /******
  4.   Copyright (C) 1993 by Klaus Ehrenfried. 
  5.  
  6.   Permission to use, copy, modify, and distribute this software
  7.   is hereby granted, provided that the above copyright notice appears 
  8.   in all copies and that the software is available to all free of charge. 
  9.   The author disclaims all warranties with regard to this software, 
  10.   including all implied warranties of merchant-ability and fitness. 
  11.   The code is simply distributed as it is.
  12. *******/
  13.  
  14. #define UBYTE unsigned char
  15. #define SHORT short
  16. #define USHORT unsigned short
  17. #define LONG long
  18. #define ULONG unsigned long
  19.  
  20. #define FLI_MAX_X  1280
  21. #define FLI_MAX_Y  1024
  22. #define FLI_MAX_COLORS 256
  23. #define FLI_MAX_FRAMES 4000
  24. #define FLI_FILE_OLD_MAGIC 0xaf11    /* File header old Magic */
  25. #define FLI_FILE_MAGIC 0xaf12        /* File header Magic */
  26. #define FLI_FRAME_MAGIC 0xf1fa        /* Frame Magic */
  27.  
  28. #define FLI_FILE_HEADER_SIZE 128
  29. #define FLI_FRAME_HEADER_SIZE 16
  30.  
  31. /* types of chunk in a fli_frame */
  32. #define FLI_256_COLOR 4
  33. #define FLI_DELTA 7
  34. #define FLI_64_COLOR 11
  35. #define FLI_LC    12
  36. #define FLI_BLACK 13
  37. #define FLI_BRUN 15
  38. #define FLI_COPY 16
  39.  
  40. #define IOM_SBYTE  1
  41. #define IOM_UBYTE  2
  42. #define IOM_SWORD  3
  43. #define IOM_UWORD  4
  44. #define IOM_LONG  5
  45.  
  46. #define MAP_FIRST_FRAME 1
  47. #define MAP_NEXT_FRAME 2
  48. #define MAP_CLOSE_LOOP 3
  49.  
  50. #ifdef MAIN
  51. #define EXT extern
  52. #else
  53. #define EXT
  54. #endif
  55.  
  56. /* #define BORDER_COLOR 0xFF */
  57.  
  58. /* external variables */
  59.  
  60. EXT UBYTE *big_buffer;
  61. EXT UBYTE *pixel_chunk_buffer;
  62. EXT UBYTE color_chunk_buffer[3 * FLI_MAX_COLORS + 10];
  63. EXT int fli_width, fli_height, fli_size, fli_speed;
  64. EXT int border_color, double_buffer;
  65. EXT int Xorigin, Yorigin, Xorigin_flag, Yorigin_flag;
  66. EXT LONG map_color[FLI_MAX_COLORS], map_color_flag;
  67. EXT FILE *input, *output;
  68. EXT int old_format_flag;
  69.  
  70. /* prototypes */
  71.  
  72. int exitialise(int);
  73.  
  74. int get_image(char *fname, UBYTE *data, LONG color[], int without_data);
  75.  
  76. int make_fli();
  77.  
  78. int fli_write_frame(UBYTE *prepre_pixel,
  79.     UBYTE *pre_pixel,
  80.     UBYTE *curr_pixel,
  81.     LONG curr_color[],
  82.     int first_flag);
  83.  
  84. void add_bytes(UBYTE record[], int *ipos, int value, int mode);
  85.  
  86. int make_color_chunk(LONG color[], int first_flag);
  87.  
  88. int make_brun_chunk(UBYTE *image);
  89.  
  90. int make_delta_chunk(unsigned char *preprevious,
  91.     unsigned char *previous,
  92.     unsigned char *current);
  93.  
  94. int make_lc_chunk(unsigned char *preprevious,
  95.     unsigned char *previous,
  96.     unsigned char *current);
  97.  
  98. int get_next_line(FILE *input, char buff[], int len);
  99.