Leptonica 1.68
C Image Processing Library
|
Read/write bmp format, from/to file and memory. More...
Go to the source code of this file.
Defines | |
#define | DEBUG 0 |
Functions | |
PIX * | pixReadStreamBmp (FILE *fp) |
l_int32 | pixWriteStreamBmp (FILE *fp, PIX *pix) |
PIX * | pixReadMemBmp (const l_uint8 *cdata, size_t size) |
l_int32 | pixWriteMemBmp (l_uint8 **pdata, size_t *psize, PIX *pix) |
Variables | |
RGBA_QUAD | bwmap [2] = { {255,255,255,0}, {0,0,0,0} } |
Read/write bmp format, from/to file and memory.
Read bmp from file PIX *pixReadStreamBmp() Write bmp to file l_int32 pixWriteStreamBmp() Read/write to memory [only on linux] PIX *pixReadMemBmp() l_int32 pixWriteMemBmp()
Definition in file bmpio.c.
PIX* pixReadStreamBmp | ( | FILE * | fp | ) |
Input: stream opened for read Return: pix, or null on error
Notes: (1) Here are references on the bmp file format: http://en.wikipedia.org/wiki/BMP_file_format http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html
Definition at line 57 of file bmpio.c.
References PixColormap::array, BMP_InfoHeader::biClrImportant, BMP_InfoHeader::biClrUsed, BMP_InfoHeader::biPlanes, BMP_InfoHeader::biSize, BMP_FHBYTES, BMP_ID, BMP_IHBYTES, CALLOC, COLOR_BLUE, COLOR_GREEN, COLOR_RED, convertOnBigEnd16(), convertOnBigEnd32(), ERROR_PTR, FREE, L_MIN, L_WARNING, PixColormap::n, NULL, pixcmapCreate(), pixCreate(), pixDestroy(), pixEndianByteSwap(), pixGetData(), pixGetWpl(), pixRemoveColormap(), pixSetColormap(), pixSetXRes(), pixSetYRes(), PROCNAME, and REMOVE_CMAP_BASED_ON_SRC.
Referenced by pixReadStream().
Input: stream opened for write pix (1, 4, 8, 32 bpp) Return: 0 if OK, 1 on error
Notes: (1) We position fp at the beginning of the stream, so it truncates any existing data (2) 2 bpp Bmp files are apparently not valid!. We can write and read them, but nobody else can read ours.
Definition at line 297 of file bmpio.c.
References PixColormap::array, BMP_InfoHeader::biBitCount, BMP_InfoHeader::biClrImportant, BMP_InfoHeader::biClrUsed, BMP_InfoHeader::biCompression, BMP_InfoHeader::biHeight, BMP_InfoHeader::biPlanes, BMP_InfoHeader::biSize, BMP_InfoHeader::biSizeImage, BMP_InfoHeader::biWidth, BMP_InfoHeader::biXPelsPerMeter, BMP_InfoHeader::biYPelsPerMeter, RGBA_Quad::blue, BMP_FHBYTES, BMP_ID, BMP_IHBYTES, bwmap, CALLOC, COLOR_BLUE, COLOR_GREEN, COLOR_RED, convertOnBigEnd16(), convertOnBigEnd32(), ERROR_INT, FREE, RGBA_Quad::green, L_WARNING, NULL, pixcmapGetCount(), pixEndianByteSwap(), pixGetColormap(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), pixGetXRes(), pixGetYRes(), pixInvert(), PROCNAME, RGBA_Quad::red, and x0.
Referenced by pixWriteStream().
Definition at line 586 of file bmpio.c.
References ERROR_PTR, and NULL.
Referenced by pixReadHeaderMem(), and pixReadMem().
Definition at line 38 of file bmpio.c.
Referenced by pixWriteStreamBmp().