摘自:
https://blog.csdn.net/lk_luck/article/details/115122351
https://blog.csdn.net/wdykanq/article/details/7748837
BMP位图数据格式
文件信息结构体
typedef struct tag_bitmap_file_header{
unsigned short file_type;
unsigned int file_size;
unsigned short reserved1;
unsigned short reserved2;
unsigned int offset_bits;
} __attribute__((packed)) bitmap_file_header;
位图信息结构体
typedef struct tag_bitmap_info_header {
unsigned int bitmap_info_size;
int bitmap_width;
int bitmap_height;
unsigned short planes;
unsigned short image_depth;
unsigned int compression;
unsigned int image_size;
int x_pels_permeter;
int y_pels_permeter;
unsigned int color_used;
unsigned int color_important;
} __attribute__((packed)) bitmap_info_header;
调色板信息结构体
typedef struct tag_bitmap_palette {
unsigned char blue;
unsigned char green;
unsigned char red;
unsigned char reserved;
} __attribute__((packed)) bitmap_palette;