home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics 16,000
/
graphics-16000.iso
/
msdos
/
utils
/
fbm2fl03.lha
/
fpfli.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-05
|
2KB
|
99 lines
/* fpfli.h */
/******
Copyright (C) 1993 by Klaus Ehrenfried.
Permission to use, copy, modify, and distribute this software
is hereby granted, provided that the above copyright notice appears
in all copies and that the software is available to all free of charge.
The author disclaims all warranties with regard to this software,
including all implied warranties of merchant-ability and fitness.
The code is simply distributed as it is.
*******/
#define UBYTE unsigned char
#define SHORT short
#define USHORT unsigned short
#define LONG long
#define ULONG unsigned long
#define FLI_MAX_X 1280
#define FLI_MAX_Y 1024
#define FLI_MAX_COLORS 256
#define FLI_MAX_FRAMES 4000
#define FLI_FILE_OLD_MAGIC 0xaf11 /* File header old Magic */
#define FLI_FILE_MAGIC 0xaf12 /* File header Magic */
#define FLI_FRAME_MAGIC 0xf1fa /* Frame Magic */
#define FLI_FILE_HEADER_SIZE 128
#define FLI_FRAME_HEADER_SIZE 16
/* types of chunk in a fli_frame */
#define FLI_256_COLOR 4
#define FLI_DELTA 7
#define FLI_64_COLOR 11
#define FLI_LC 12
#define FLI_BLACK 13
#define FLI_BRUN 15
#define FLI_COPY 16
#define IOM_SBYTE 1
#define IOM_UBYTE 2
#define IOM_SWORD 3
#define IOM_UWORD 4
#define IOM_LONG 5
#define MAP_FIRST_FRAME 1
#define MAP_NEXT_FRAME 2
#define MAP_CLOSE_LOOP 3
#ifdef MAIN
#define EXT extern
#else
#define EXT
#endif
/* #define BORDER_COLOR 0xFF */
/* external variables */
EXT UBYTE *big_buffer;
EXT UBYTE *pixel_chunk_buffer;
EXT UBYTE color_chunk_buffer[3 * FLI_MAX_COLORS + 10];
EXT int fli_width, fli_height, fli_size, fli_speed;
EXT int border_color, double_buffer;
EXT int Xorigin, Yorigin, Xorigin_flag, Yorigin_flag;
EXT LONG map_color[FLI_MAX_COLORS], map_color_flag;
EXT FILE *input, *output;
EXT int old_format_flag;
/* prototypes */
int exitialise(int);
int get_image(char *fname, UBYTE *data, LONG color[], int without_data);
int make_fli();
int fli_write_frame(UBYTE *prepre_pixel,
UBYTE *pre_pixel,
UBYTE *curr_pixel,
LONG curr_color[],
int first_flag);
void add_bytes(UBYTE record[], int *ipos, int value, int mode);
int make_color_chunk(LONG color[], int first_flag);
int make_brun_chunk(UBYTE *image);
int make_delta_chunk(unsigned char *preprevious,
unsigned char *previous,
unsigned char *current);
int make_lc_chunk(unsigned char *preprevious,
unsigned char *previous,
unsigned char *current);
int get_next_line(FILE *input, char buff[], int len);