| 1 |
|
| 2 |
|
| 3 |
#ifndef __RENDER_BMP_H__ |
| 4 |
#define __RENDER_BMP_H__ |
| 5 |
|
| 6 |
#ifndef OFFSET_OF |
| 7 |
#if (defined (__GNUC__) && __GNUC__ >= 4) || defined (__clang__) |
| 8 |
#define OFFSET_OF(TYPE, Field) ((size_t) __builtin_offsetof(TYPE, Field)) |
| 9 |
#endif |
| 10 |
#endif |
| 11 |
|
| 12 |
#ifndef OFFSET_OF |
| 13 |
#define OFFSET_OF(TYPE, Field) ((size_t) &(((TYPE *)0)->Field)) |
| 14 |
#endif |
| 15 |
|
| 16 |
#pragma pack(1) |
| 17 |
|
| 18 |
struct bmp_color_map { |
| 19 |
uint8_t Blue; |
| 20 |
uint8_t Green; |
| 21 |
uint8_t Red; |
| 22 |
uint8_t Reserved; |
| 23 |
}; |
| 24 |
|
| 25 |
struct bmp_image_header { |
| 26 |
char CharB; |
| 27 |
char CharM; |
| 28 |
uint32_t Size; |
| 29 |
uint16_t Reserved[2]; |
| 30 |
uint32_t ImageOffset; |
| 31 |
uint32_t HeaderSize; |
| 32 |
uint32_t PixelWidth; |
| 33 |
uint32_t PixelHeight; |
| 34 |
uint16_t Planes; |
| 35 |
uint16_t BitPerPixel; |
| 36 |
uint32_t CompressionType; |
| 37 |
uint32_t ImageSize; |
| 38 |
uint32_t XPixelsPerMeter; |
| 39 |
uint32_t YPixelsPerMeter; |
| 40 |
uint32_t NumberOfColors; |
| 41 |
uint32_t ImportantColors; |
| 42 |
}; |
| 43 |
|
| 44 |
struct blt_pixel { |
| 45 |
uint8_t Blue; |
| 46 |
uint8_t Green; |
| 47 |
uint8_t Red; |
| 48 |
uint8_t Reserved; |
| 49 |
}; |
| 50 |
|
| 51 |
struct logo_coordinates { |
| 52 |
uint32_t x; |
| 53 |
uint32_t y; |
| 54 |
}; |
| 55 |
|
| 56 |
#pragma pack() |
| 57 |
|
| 58 |
#endif |