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/. */
6 #ifndef mozilla_image_ICOFileHeaders_h
7 #define mozilla_image_ICOFileHeaders_h
12 #define ICONFILEHEADERSIZE 6
13 #define ICODIRENTRYSIZE 16
14 #define PNGSIGNATURESIZE 8
15 #define BMPFILEHEADERSIZE 14
18 * The header that comes right at the start of an icon file. (This
19 * corresponds to the Windows ICONDIR structure.)
28 * 1 for icon (.ICO) image (or 2 for cursor (.CUR) image (icon with the
29 * addition of a hotspot), but we don't support cursor).
33 * The number of BMP/PNG images contained in the icon file.
39 * For each BMP/PNG image that the icon file contains there must be a
40 * corresponding icon dir entry. (This corresponds to the Windows
41 * ICONDIRENTRY structure.) These entries are encoded directly after the
49 * The number of colors in the color palette of the BMP/PNG that this dir
50 * entry corresponds to, or 0 if the image does not use a color palette.
58 uint16_t mPlanes
; // ICO
59 uint16_t mXHotspot
; // CUR
62 uint16_t mBitCount
; // ICO (bits per pixel)
63 uint16_t mYHotspot
; // CUR
66 * "bytes in resource" is the length of the encoded BMP/PNG that this dir
67 * entry corresponds to.
71 * The offset of the start of the encoded BMP/PNG that this dir entry
72 * corresponds to (from the start of the icon file).
74 uint32_t mImageOffset
;
79 } // namespace mozilla
81 #endif // mozilla_image_ICOFileHeaders_h