Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef __FILEBMP_INCLUDED__
Toshihiro Shimizu 890ddd
#define __FILEBMP_INCLUDED__
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
extern "C" {
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
/*
Toshihiro Shimizu 890ddd
#if defined(WIN32)
Toshihiro Shimizu 890ddd
typedef struct {unsigned char b,g,r,m;}  LPIXEL;
Toshihiro Shimizu 890ddd
#elif defined(__sgi)
Toshihiro Shimizu 890ddd
typedef struct { unsigned char  m,b,g,r; } LPIXEL;
Toshihiro Shimizu 890ddd
#elif defined (LINUX)
Toshihiro Shimizu 890ddd
typedef struct { unsigned char  r,g,b,m; } LPIXEL;
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#error	Not yet implemented
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
enum BMP_ERROR_CODE {
Toshihiro Shimizu 890ddd
	OK,
Toshihiro Shimizu 890ddd
	UNSUPPORTED_BMP_FORMAT = -1,
Toshihiro Shimizu 890ddd
	OUT_OF_MEMORY = -2,
Toshihiro Shimizu 890ddd
	UNEXPECTED_EOF = -3,
Toshihiro Shimizu 890ddd
	CANT_OPEN_FILE = -4,
Toshihiro Shimizu 890ddd
	WRITE_ERROR = -5
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef const wchar_t *MYSTRING;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
int writebmp(const MYSTRING filename, int xsize, int ysize, void *buffer, int bpp);
Toshihiro Shimizu 890ddd
int readbmp(const MYSTRING filename, int *xsize, int *ysize, void **buffer);
Toshihiro Shimizu 890ddd
int readbmpregion(const MYSTRING fname, void **pimg, int x1, int y1, int x2, int y2, int scale);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
int readbmp_size(const MYSTRING fname, int *lx, int *ly);
Toshihiro Shimizu 890ddd
int readbmp_bbox(const MYSTRING fname, int *x0, int *y0, int *x1, int *y1);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif