tahoma2d/toonz/sources/image/bmp/filebmp.h

45 lines
1 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef __FILEBMP_INCLUDED__
#define __FILEBMP_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
/*
#if defined(_WIN32)
2016-03-19 06:57:51 +13:00
typedef struct {unsigned char b,g,r,m;} LPIXEL;
#elif defined(__sgi)
typedef struct { unsigned char m,b,g,r; } LPIXEL;
#elif defined (LINUX)
typedef struct { unsigned char r,g,b,m; } LPIXEL;
#else
#error Not yet implemented
#endif
*/
enum BMP_ERROR_CODE {
2016-06-15 18:43:10 +12:00
OK,
UNSUPPORTED_BMP_FORMAT = -1,
OUT_OF_MEMORY = -2,
UNEXPECTED_EOF = -3,
CANT_OPEN_FILE = -4,
WRITE_ERROR = -5
2016-03-19 06:57:51 +13:00
};
typedef const wchar_t *MYSTRING;
2016-06-15 18:43:10 +12:00
int writebmp(const MYSTRING filename, int xsize, int ysize, void *buffer,
int bpp);
2016-03-19 06:57:51 +13:00
int readbmp(const MYSTRING filename, int *xsize, int *ysize, void **buffer);
2016-06-15 18:43:10 +12:00
int readbmpregion(const MYSTRING fname, void **pimg, int x1, int y1, int x2,
int y2, int scale);
2016-03-19 06:57:51 +13:00
int readbmp_size(const MYSTRING fname, int *lx, int *ly);
int readbmp_bbox(const MYSTRING fname, int *x0, int *y0, int *x1, int *y1);
#ifdef __cplusplus
}
#endif
#endif