PCX.H 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. #ifndef _PCX_H
  14. #define _PCX_H
  15. #define PCX_ERROR_NONE 0
  16. #define PCX_ERROR_OPENING 1
  17. #define PCX_ERROR_NO_HEADER 2
  18. #define PCX_ERROR_WRONG_VERSION 3
  19. #define PCX_ERROR_READING 4
  20. #define PCX_ERROR_NO_PALETTE 5
  21. #define PCX_ERROR_WRITING 6
  22. #define PCX_ERROR_MEMORY 7
  23. // Reads filename into bitmap bmp, and fills in palette. If bmp->bm_data==NULL,
  24. // then bmp->bm_data is allocated and the w,h are filled.
  25. // If palette==NULL the palette isn't read in. Returns error code.
  26. extern int pcx_get_dimensions( char *filename, int *width, int *height);
  27. extern int pcx_read_bitmap( char * filename, grs_bitmap * bmp, int bitmap_type, ubyte * palette );
  28. // Writes the bitmap bmp to filename, using palette. Returns error code.
  29. extern int pcx_write_bitmap( char * filename, grs_bitmap * bmp, ubyte * palette );
  30. extern char *pcx_errormsg(int error_number);
  31. #ifdef MACINTOSH
  32. extern int pcx_read_bitmap_palette( char *filename, ubyte *palette);
  33. #endif
  34. #endif