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/. */
5 #ifndef mozilla_image_ICOFileHeaders_h
6 #define mozilla_image_ICOFileHeaders_h
11 #define ICONFILEHEADERSIZE 6
12 #define ICODIRENTRYSIZE 16
13 #define PNGSIGNATURESIZE 8
14 #define BMPFILEHEADERSIZE 14
17 * The header that comes right at the start of an icon file. (This
18 * corresponds to the Windows ICONDIR structure.)
20 struct IconFileHeader
{
26 * 1 for icon (.ICO) image (or 2 for cursor (.CUR) image (icon with the
27 * addition of a hotspot), but we don't support cursor).
31 * The number of BMP/PNG images contained in the icon file.
37 * For each BMP/PNG image that the icon file contains there must be a
38 * corresponding icon dir entry. (This corresponds to the Windows
39 * ICONDIRENTRY structure.) These entries are encoded directly after the
46 * The number of colors in the color palette of the BMP/PNG that this dir
47 * entry corresponds to, or 0 if the image does not use a color palette.
55 uint16_t mPlanes
; // ICO
56 uint16_t mXHotspot
; // CUR
59 uint16_t mBitCount
; // ICO (bits per pixel)
60 uint16_t mYHotspot
; // CUR
63 * "bytes in resource" is the length of the encoded BMP/PNG that this dir
64 * entry corresponds to.
68 * The offset of the start of the encoded BMP/PNG that this dir entry
69 * corresponds to (from the start of the icon file).
71 uint32_t mImageOffset
;
75 } // namespace mozilla
77 #endif // mozilla_image_ICOFileHeaders_h