37 lines
857 B
C
37 lines
857 B
C
|
|
#ifndef SPECTRE_GRAPHICS_IMAGE_FORMAT_BMP_H
|
|
#define SPECTRE_GRAPHICS_IMAGE_FORMAT_BMP_H
|
|
|
|
#define BMP_MAGIC 0x4D42 /* "BM" in little endian */
|
|
|
|
/**
|
|
* Bitmap information header (DIB)
|
|
*/
|
|
struct BMP_DIB {
|
|
uint32_t size; // Size of header (40 bytes)
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint16_t planes;
|
|
uint16_t bits_per_pixel;
|
|
uint32_t compression; // See compression method constants below.
|
|
int32_t x_ppm; // Pixels per meter
|
|
int32_t y_ppm; // Pixels per meter
|
|
uint32_t colors_used;
|
|
uint32_t colors_important;
|
|
};
|
|
|
|
/**
|
|
* Compression method constants.
|
|
*/
|
|
#define BI_RGB 0
|
|
#define BI_RLE8 1
|
|
#define BI_RLE4 2
|
|
#define BI_BITFIELDS 3
|
|
#define BI_JPEG 4 /* RLE-24 */
|
|
#define BI_PNG 5
|
|
#define BI_ALPHABITFIELDS 6
|
|
#define BI_CMYK 11
|
|
#define BI_CMYKRLE8 12
|
|
#define BI_CMYKRLE4 13
|
|
|
|
#endif /* SPECTRE_GRAPHICS_IMAGE_FORMAT_BMP_H */
|