Files
palemoon27/image/ICOFileHeaders.h
T
roytam1 6b6341f075 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1102048 (Part 20, imgLoader) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (0a8270ba4)
- Bug 1102048 (Part 23, encoders) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (6625ca535)
- Bug 1102048 (Part 39, decoders/icon) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (55956f847)
- Bug 1102048 (Part 24, decoders) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (cf2b002a7)
- Bug 1102048 (Part 04, ClippedImage) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (c9f1451ad)
- Bug 1102048 (Part 30, imgTools) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (2e3378d34)
- Bug 1082837 - Track insecure redirects on imgRequest. r=? (466a14e22)
- Bug 1139225 (Part 3) - Make OnDataAvailable threadsafe. r=tn (d10208a8b)
- Bug 1139225 (Part 1) - Remove unused imgRequest::mBlockingOnload flag. r=tn (c0d80facd)
- Bug 1102048 (Part 11, imgRequest) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (63ee15eb8)
- Bug 1102048 (Part 38, ShutdownTracker) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (a58d515ed)
- Bug 1102048 (Part 37, ProgressTracker) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (04b07cb06)
- Bug 1102048 (Part 14, NotificationObserver) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (ca32242a4)
- Bug 1102048 (Part 13, RasterImage) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (8f3931f31)
- Bug 1102048 (Part 10, imgFrame) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (2f2b22e70)
- Bug 1102048 (Part 36, DynamicImage) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (2cce04d2b)
- Bug 1102048 (Part 09, Image) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (2f3743d2e)
- Bug 1102048 (Part 29, imgRequestProxy) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (bf2824c08)
- Bug 1102048 (Part 31, SurfaceCache) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (c6849f4d9)
- Bug 1102048 (Part 25, header guards) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (bde0a4979)
- Bug 1102048 (Part 33, SVGDocument) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (71f5f960c)
- Bug 1102048 (Part 05, Decoder) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (48b1d5a80)
- Bug 1102048 (Part 34, Multipart) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (fb65aa069)
- Bug 1102048 (Part 35, Downscaler) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (2eb0be1f7)
- Bug 1102048 (Part 19, ImageMetadata) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (749305ddd)
- Bug 1102048 (Part 32, FrameAnimator) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (1df4850d6)
- Bug 1102048 (Part 26) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (52550fb88)
- Bug 1102048 (Part 03) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth (438e52a57)
2020-12-29 11:56:14 +08:00

82 lines
2.0 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_image_ICOFileHeaders_h
#define mozilla_image_ICOFileHeaders_h
namespace mozilla {
namespace image {
#define ICONFILEHEADERSIZE 6
#define ICODIRENTRYSIZE 16
#define PNGSIGNATURESIZE 8
#define BMPFILEHEADERSIZE 14
/**
* The header that comes right at the start of an icon file. (This
* corresponds to the Windows ICONDIR structure.)
*/
struct IconFileHeader
{
/**
* Must be set to 0;
*/
uint16_t mReserved;
/**
* 1 for icon (.ICO) image (or 2 for cursor (.CUR) image (icon with the
* addition of a hotspot), but we don't support cursor).
*/
uint16_t mType;
/**
* The number of BMP/PNG images contained in the icon file.
*/
uint16_t mCount;
};
/**
* For each BMP/PNG image that the icon file contains there must be a
* corresponding icon dir entry. (This corresponds to the Windows
* ICONDIRENTRY structure.) These entries are encoded directly after the
* IconFileHeader.
*/
struct IconDirEntry
{
uint8_t mWidth;
uint8_t mHeight;
/**
* The number of colors in the color palette of the BMP/PNG that this dir
* entry corresponds to, or 0 if the image does not use a color palette.
*/
uint8_t mColorCount;
/**
* Should be set to 0.
*/
uint8_t mReserved;
union {
uint16_t mPlanes; // ICO
uint16_t mXHotspot; // CUR
};
union {
uint16_t mBitCount; // ICO (bits per pixel)
uint16_t mYHotspot; // CUR
};
/**
* "bytes in resource" is the length of the encoded BMP/PNG that this dir
* entry corresponds to.
*/
uint32_t mBytesInRes;
/**
* The offset of the start of the encoded BMP/PNG that this dir entry
* corresponds to (from the start of the icon file).
*/
uint32_t mImageOffset;
};
} // namespace image
} // namespace mozilla
#endif // mozilla_image_ICOFileHeaders_h