mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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:
committed by
Cosmin Truta
parent
6f786ff0f6
commit
75748d93ce
10
pngwrite.c
10
pngwrite.c
@@ -236,6 +236,16 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
||||
png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_cICP_SUPPORTED
|
||||
if ((info_ptr->valid & PNG_INFO_cICP) != 0)
|
||||
{
|
||||
png_write_cICP(png_ptr, info_ptr->cicp_colour_primaries,
|
||||
info_ptr->cicp_transfer_function,
|
||||
info_ptr->cicp_matrix_coefficients,
|
||||
info_ptr->cicp_video_full_range_flag);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_eXIf_SUPPORTED
|
||||
if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user