|
|
@ -13,8 +13,8 @@
|
|
|
|
* wxWindows Library License for more details.
|
|
|
|
* wxWindows Library License for more details.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// This provides rudimentary facilities for loading and saving true color
|
|
|
|
/* This provides rudimentary facilities for loading and saving true color */
|
|
|
|
// BMP and PPM files
|
|
|
|
/* BMP and PPM files */
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __BMP_H__
|
|
|
|
#ifndef __BMP_H__
|
|
|
|
#define __BMP_H__
|
|
|
|
#define __BMP_H__
|
|
|
@ -26,16 +26,20 @@ enum BMPPIXELFORMAT {BMP_RGB=0, BMP_RGBX, BMP_BGR, BMP_BGRX, BMP_XBGR, BMP_XRGB}
|
|
|
|
extern "C" {
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// This will load a Windows bitmap from a file and return a buffer with the
|
|
|
|
/*
|
|
|
|
// specified pixel format, scanline alignment, and orientation. The width and
|
|
|
|
* This will load a Windows bitmap from a file and return a buffer with the
|
|
|
|
// height are returned in w and h.
|
|
|
|
* specified pixel format, scanline alignment, and orientation. The width and
|
|
|
|
|
|
|
|
* height are returned in w and h.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
|
|
|
int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
|
|
|
enum BMPPIXELFORMAT f, int align, int dstbottomup);
|
|
|
|
enum BMPPIXELFORMAT f, int align, int dstbottomup);
|
|
|
|
|
|
|
|
|
|
|
|
// This will save a buffer with the specified pixel format, pitch, orientation,
|
|
|
|
/*
|
|
|
|
// width, and height as a 24-bit Windows bitmap or PPM (the filename determines
|
|
|
|
* This will save a buffer with the specified pixel format, pitch, orientation,
|
|
|
|
// which format to use)
|
|
|
|
* width, and height as a 24-bit Windows bitmap or PPM (the filename determines
|
|
|
|
|
|
|
|
* which format to use)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int savebmp(char *filename, unsigned char *buf, int w, int h,
|
|
|
|
int savebmp(char *filename, unsigned char *buf, int w, int h,
|
|
|
|
enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup);
|
|
|
|
enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup);
|
|
|
|