std/png: parse cICP chunk

Updates #180
This commit is contained in:
Nigel Tao committed 2026-10-18 18:13:59 +11:00
1 parent ab24b06450
commit c677bef7fd
7 files changed
+294 -24

No files matched your search

+3
View File
@@ -414,6 +414,9 @@ redirect:
if (flags & DecodeImageArgFlags::REPORT_METADATA_CHRM) {
image_decoder->set_report_metadata(WUFFS_BASE__FOURCC__CHRM, true);
}
if (flags & DecodeImageArgFlags::REPORT_METADATA_CICP) {
image_decoder->set_report_metadata(WUFFS_BASE__FOURCC__CICP, true);
}
if (flags & DecodeImageArgFlags::REPORT_METADATA_EXIF) {
interested_in_metadata_after_the_frame = true;
image_decoder->set_report_metadata(WUFFS_BASE__FOURCC__EXIF, true);
+11 -9
View File
@@ -236,27 +236,29 @@ struct DecodeImageArgFlags {
static constexpr uint64_t REPORT_METADATA_BGCL = 0x0001;
// Primary Chromaticities and White Point.
static constexpr uint64_t REPORT_METADATA_CHRM = 0x0002;
// Coding-Independent Code Points for video signal type identification.
static constexpr uint64_t REPORT_METADATA_CICP = 0x0004;
// Exchangeable Image File Format.
static constexpr uint64_t REPORT_METADATA_EXIF = 0x0004;
static constexpr uint64_t REPORT_METADATA_EXIF = 0x0008;
// Gamma Correction.
static constexpr uint64_t REPORT_METADATA_GAMA = 0x0008;
static constexpr uint64_t REPORT_METADATA_GAMA = 0x0010;
// International Color Consortium Profile.
static constexpr uint64_t REPORT_METADATA_ICCP = 0x0010;
static constexpr uint64_t REPORT_METADATA_ICCP = 0x0020;
// Key-Value Pair.
//
// For PNG files, this includes iTXt, tEXt and zTXt chunks. In the
// HandleMetadata callback, the raw argument contains UTF-8 strings.
static constexpr uint64_t REPORT_METADATA_KVP = 0x0020;
static constexpr uint64_t REPORT_METADATA_KVP = 0x0040;
// Modification Time.
static constexpr uint64_t REPORT_METADATA_MTIM = 0x0040;
static constexpr uint64_t REPORT_METADATA_MTIM = 0x0080;
// Offset (2-Dimensional).
static constexpr uint64_t REPORT_METADATA_OFS2 = 0x0080;
static constexpr uint64_t REPORT_METADATA_OFS2 = 0x0100;
// Physical Dimensions.
static constexpr uint64_t REPORT_METADATA_PHYD = 0x0100;
static constexpr uint64_t REPORT_METADATA_PHYD = 0x0200;
// Standard Red Green Blue (Rendering Intent).
static constexpr uint64_t REPORT_METADATA_SRGB = 0x0200;
static constexpr uint64_t REPORT_METADATA_SRGB = 0x0400;
// Extensible Metadata Platform.
static constexpr uint64_t REPORT_METADATA_XMP = 0x0400;
static constexpr uint64_t REPORT_METADATA_XMP = 0x0800;
uint64_t repr;
};