![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
BMP image loader. More...
Go to the source code of this file.
Data Structures | |
struct | gp_bmp_info_header |
A BMP header. More... | |
Enumerations | |
enum | gp_bmp_compress { COMPRESS_RGB = 0 , COMPRESS_RLE8 = 1 , COMPRESS_RLE4 = 2 , COMPRESS_BITFIELDS = 3 , COMPRESS_JPEG = 4 , COMPRESS_PNG = 5 , COMPRESS_ALPHABITFIELDS = 6 , COMPRESS_MAX = COMPRESS_ALPHABITFIELDS } |
BMP compression type. More... | |
enum | gp_bmp_info_header_size { BITMAPCOREHEADER = 12 , BITMAPCOREHEADER2 = 64 , BITMAPINFOHEADER = 40 , BITMAPINFOHEADER2 = 52 , BITMAPINFOHEADER3 = 56 , BITMAPINFOHEADER4 = 108 , BITMAPINFOHEADER5 = 124 } |
BMP header size. More... | |
Functions | |
int | gp_bmp_read_info_header (gp_io *io, struct gp_bmp_info_header *header) |
Attempts to parse BMP info header at current offset in the file IO. | |
gp_pixel_type | gp_bmp_pixel_type (struct gp_bmp_info_header *header) |
Returns a pixel type suitable for a BMP info header. | |
uint32_t | gp_bmp_palette_size (struct gp_bmp_info_header *header) |
Returns palette size in bytes. | |
int | gp_bmp_read_pixels (gp_io *io, struct gp_bmp_info_header *header, gp_pixmap *pixmap, gp_progress_cb *callback) |
Reads a pixel data. | |
BMP image loader.
Internal BMP loader functions, you shouldn't need to touch these unless you need to parse file formats that embedds a BMP images with incomplete header such as ICO file format.
Definition in file gp_bmp.h.
enum gp_bmp_compress |
BMP compression type.
uint32_t gp_bmp_palette_size | ( | struct gp_bmp_info_header * | header | ) |
Returns palette size in bytes.
header | BMP info header structure. |
gp_pixel_type gp_bmp_pixel_type | ( | struct gp_bmp_info_header * | header | ) |
Returns a pixel type suitable for a BMP info header.
Returns a pixel type suitable for an pixmap that could be later passed to the gp_bmp_read_pixels().
header | BMP info header. |
int gp_bmp_read_info_header | ( | gp_io * | io, |
struct gp_bmp_info_header * | header ) |
Attempts to parse BMP info header at current offset in the file IO.
Note that pixel_offset is not set by this function since the offset to the pixels is stored in the bitmap file header. This offset must be filled in by the called before the header is passed to gp_bmp_read_pixels() function.
io | An io stream with an BMP info header at current offset. |
header | BMP info header to be filled in. |
int gp_bmp_read_pixels | ( | gp_io * | io, |
struct gp_bmp_info_header * | header, | ||
gp_pixmap * | pixmap, | ||
gp_progress_cb * | callback ) |
Reads a pixel data.
io | An io stream. |
header | BMP info header. |
pixmap | Pre-allocated pixmap of correct size and pixel type. |
callback | A progress callback. |