api(PNGv3): Add support for mDCV and cLLI

This adds APIs to get/set the two remaining new PNG-v3 colour space
chunks.  The mDCV API matches that of cHRM.  Both chunks support
floating point APIs (all values in the two chunks are real numbers).

Both chunks have a new encoded type, a four-digit-precision fixed-point
number, which cannot be represented in the existing `png_fixed_point`
type, so a `png_uint_32` is used.

Test examples for cICP, cLLI and mDCV are now in pngtest.png, and a
necessary change to the pngunknown.c test program has been made to
accomodate the additions.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
John Bowler
2025-01-03 22:43:00 -08:00
committed by Cosmin Truta
parent 8ffc967e8a
commit 92e8581f12
15 changed files with 716 additions and 5 deletions

View File

@@ -847,11 +847,13 @@ setting IDAT_READ_SIZE default PNG_ZBUF_SIZE
chunk bKGD
chunk cHRM enables COLORSPACE
chunk cICP enables COLORSPACE, GAMMA
chunk cLLI
chunk eXIf
chunk gAMA enables GAMMA
chunk hIST
chunk iCCP enables COLORSPACE, GAMMA
chunk iTXt enables TEXT
chunk mDCV
chunk oFFs
chunk pCAL
chunk pHYs