
enum { FILEFORMAT_UNKNOWN, FILEFORMAT_GIF, FILEFORMAT_JPEG, FILEFORMAT_TARGA };

extern int image_fileformat;
extern int image_width;
extern int image_height;

/* Image data is raw byte(s)-per-pixel */
extern unsigned char *image_data;
/* Palette data is 256 red, green and blue values (0-63) */
extern unsigned char *image_palette;

extern int image_bytesperpixel;
extern int image_colors;

void loadgif( FILE *f );
void loadjpg( FILE *f );

#define min(x, y) ((x <= y) ? x : y)
#define max(x, y) ((x >= y) ? x : y)
