[libpng16] Add support for reading and writing the cICP chunk

This chunk was added in the third edition of the PNG specification and
contains Coding Independent Code Points (related to color space
description). It is fairly simple as it only contains four fields of one
byte each: Colour Primaries, Transfer Function, Matrix Coefficients,
Video Full Range Flag.

The test file originally comes from the related WPT test case:
https://github.com/web-platform-tests/wpt/blob/master/png/support/cicp-display-p3.png

Note that I reencoded the file to make it match libpng's default
encoding parameters (it only modifies the IDAT chunk).

This is a cherry-pick of commit 65925ad4b2cbed934d5d850fe764dc46c4becbcb
from branch 'libpng18'.

Reviewed-by: John Bowler <jbowler@acm.org>
Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Lucas CHOLLET
2024-06-22 00:35:55 -04:00
committed by Cosmin Truta
parent 6f786ff0f6
commit 75748d93ce
17 changed files with 185 additions and 1 deletions

View File

@@ -253,3 +253,5 @@ EXPORTS
png_set_eXIf @247
png_get_eXIf_1 @248
png_set_eXIf_1 @249
png_get_cICP @250
png_set_cICP @251