1 /* $Id: pcx.h,v 1.4 2004-08-28 23:17:45 schaffner Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 * Routines to read/write pcx images.
24 #define PCX_ERROR_NONE 0
25 #define PCX_ERROR_OPENING 1
26 #define PCX_ERROR_NO_HEADER 2
27 #define PCX_ERROR_WRONG_VERSION 3
28 #define PCX_ERROR_READING 4
29 #define PCX_ERROR_NO_PALETTE 5
30 #define PCX_ERROR_WRITING 6
31 #define PCX_ERROR_MEMORY 7
33 // Reads filename into bitmap bmp, and fills in palette. If bmp->bm_data==NULL,
34 // then bmp->bm_data is allocated and the w,h are filled.
35 // If palette==NULL the palette isn't read in. Returns error code.
37 extern int pcx_get_dimensions( char *filename, int *width, int *height);
39 extern int pcx_read_bitmap( char * filename, grs_bitmap * bmp, int bitmap_type, ubyte * palette );
41 // Writes the bitmap bmp to filename, using palette. Returns error code.
43 extern int pcx_write_bitmap( char * filename, grs_bitmap * bmp, ubyte * palette );
45 extern char *pcx_errormsg(int error_number);
48 extern int pcx_read_bitmap_palette( char *filename, ubyte *palette);
51 int pcx_read_fullscr(char * filename, ubyte * palette);