BMPHeaders.h (1270B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef mozilla_image_BMPHeaders_h 6 #define mozilla_image_BMPHeaders_h 7 8 #include <stddef.h> 9 #include <stdint.h> 10 11 namespace mozilla { 12 namespace image { 13 namespace bmp { 14 15 // The length of the file header as defined in the BMP spec. 16 static const size_t FILE_HEADER_LENGTH = 14; 17 18 // This lengths of the info header for the different BMP versions. 19 struct InfoHeaderLength { 20 enum { 21 WIN_V2 = 12, 22 WIN_V3 = 40, 23 WIN_V4 = 108, 24 WIN_V5 = 124, 25 26 // OS2_V1 is omitted; it's the same as WIN_V2. 27 OS2_V2_MIN = 16, // Minimum allowed value for OS2v2. 28 OS2_V2_MAX = 64, // Maximum allowed value for OS2v2. 29 30 WIN_ICO = WIN_V3, 31 }; 32 }; 33 34 enum class InfoColorSpace : uint32_t { 35 CALIBRATED_RGB = 0x00000000, 36 SRGB = 0x73524742, 37 WIN = 0x57696E20, 38 LINKED = 0x4C494E4B, 39 EMBEDDED = 0x4D424544, 40 }; 41 42 enum class InfoColorIntent : uint32_t { 43 BUSINESS = 0x00000001, 44 GRAPHICS = 0x00000002, 45 IMAGES = 0x00000004, 46 ABS_COLORIMETRIC = 0x00000008, 47 }; 48 49 } // namespace bmp 50 } // namespace image 51 } // namespace mozilla 52 53 #endif // mozilla_image_BMPHeaders_h