1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FXCODEC_BMP_FX_BMP_H_
8 #define CORE_FXCODEC_BMP_FX_BMP_H_
9 
10 #include <stdint.h>
11 
12 #pragma pack(1)
13 struct BmpFileHeader {
14   uint16_t bfType;
15   uint32_t bfSize;
16   uint16_t bfReserved1;
17   uint16_t bfReserved2;
18   uint32_t bfOffBits;
19 };
20 
21 struct BmpCoreHeader {
22   uint32_t bcSize;
23   uint16_t bcWidth;
24   uint16_t bcHeight;
25   uint16_t bcPlanes;
26   uint16_t bcBitCount;
27 };
28 
29 struct BmpInfoHeader {
30   uint32_t biSize;
31   int32_t biWidth;
32   int32_t biHeight;
33   uint16_t biPlanes;
34   uint16_t biBitCount;
35   uint32_t biCompression;
36   uint32_t biSizeImage;
37   int32_t biXPelsPerMeter;
38   int32_t biYPelsPerMeter;
39   uint32_t biClrUsed;
40   uint32_t biClrImportant;
41 };
42 #pragma pack()
43 
44 static_assert(sizeof(BmpFileHeader) == 14, "BmpFileHeader has wrong size");
45 static_assert(sizeof(BmpCoreHeader) == 12, "BmpCoreHeader has wrong size");
46 static_assert(sizeof(BmpInfoHeader) == 40, "BmpInfoHeader has wrong size");
47 
48 #endif  // CORE_FXCODEC_BMP_FX_BMP_H_
49