2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/PcxUtils/pcxutils.h $
15 * header file for PCX utilities
18 * Revision 1.2 2002/06/09 04:41:14 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 6 8/10/99 6:54p Dave
26 * Mad optimizations. Added paging to the nebula effect.
28 * 5 2/05/99 12:52p Dave
29 * Fixed Glide nondarkening textures.
31 * 4 12/01/98 4:46p Dave
32 * Put in targa bitmap support (16 bit).
34 * 3 11/30/98 1:07p Dave
35 * 16 bit conversion, first run.
37 * 2 10/07/98 10:53a Dave
40 * 1 10/07/98 10:50a Dave
42 * 7 9/03/97 4:32p John
43 * changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
44 * to bm_load functions not needed. Made bmpman keep track of palettes
45 * for bitmaps not mapped into game palettes.
47 * 6 11/26/96 9:28a Allender
48 * get palette info when getting pcx info
50 * 5 11/18/96 12:36p John
51 * Added code to dump screen to a PCX file.
53 * 4 11/13/96 4:51p Allender
54 * started overhaul of bitmap manager. bm_load no longer actually load
55 * the data, only the info for the bitmap. Locking the bitmap now forces
56 * load when no data present (or will if bpp changes)
72 #define PCX_ERROR_NONE 0
73 #define PCX_ERROR_OPENING 1
74 #define PCX_ERROR_NO_HEADER 2
75 #define PCX_ERROR_WRONG_VERSION 3
76 #define PCX_ERROR_READING 4
77 #define PCX_ERROR_NO_PALETTE 5
78 #define PCX_ERROR_WRITING 6
79 #define PCX_ERROR_MEMORY 7
81 extern int pcx_read_header(char *filename, int *w, int *h, ubyte *pal );
82 extern int pcx_read_bitmap_8bpp( char * filename, ubyte *org_data, ubyte *palette );
83 extern int pcx_read_bitmap_16bpp( char * filename, ubyte *org_data );
84 extern int pcx_read_bitmap_16bpp_aabitmap( char *filename, ubyte *org_data );
85 extern int pcx_read_bitmap_16bpp_nondark( char *filename, ubyte *org_data );
88 // Dumps a 8bpp bitmap to a file.
89 // Set rowoff to -w for upside down bitmaps.
90 extern int pcx_write_bitmap( char * filename, int w, int h, ubyte ** row_ptrs, ubyte * palette );