[libpng16] Changed ICC profile support to allow use of an external color

management system (CMS). In practice it is not possible to obtain cHRM
information reliably using just the end-point tags because they do not exist
in the vast majority of profiles.  Instead it is necessary to run the endpoints
through the ICC colorimetric intent transform (as described in the v4
spec).  Since this is likely to be too much code inside libpng for too
little gain (it implies a fairly complete CMS implementation) the code
has been changed to allow an external CMS to be used.  This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
This commit is contained in:
John Bowler
2012-10-25 19:30:02 -05:00
committed by Glenn Randers-Pehrson
parent e6b710cb3f
commit f8dfd123e2
14 changed files with 821 additions and 944 deletions

View File

@@ -478,6 +478,20 @@ option WRITE_TEXT requires WRITE_ANCILLARY_CHUNKS enables TEXT
option GAMMA disabled
option COLORSPACE enables GAMMA disabled
# ICC profile support; basic ICC profile support is enabled if iCCP chunk read
# or write is enabled. The application must perform all iCCP profile handling
# itself. If full support is enabled with the option below libpng will attempt
# to do more processing using the profile data itself, this includes setting
# appropriate values for cHRM and gAMA chunks if not present in the stream.
#
# ICC profile support is not build in to core libpng because of the size of the
# code required; an external ICC implementation must be passed to libpng to
# enable it.
#
# WARNING: this option is CURRENTLY UNTESTED because a test CMS implementation
# has not yet been written, as a result it is disabled in current beta builds.
option ICC requires iCCP enables SAVE_INT_32 disabled
# When an ICC profile is read, or png_set, it will be checked for a match
# against known sRGB profiles if the sRGB handling is enabled. This
# setting controls how much work is done during the check:
@@ -694,9 +708,10 @@ option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
option WRITE_FILTER requires WRITE
option SAVE_INT_32 requires WRITE
# png_save_int_32 is required by the ancillary chunks oFFs and pCAL
option SAVE_INT_32 disabled
# png_save_int_32 is required internally for writing the ancillary chunks oFFs
# and pCAL and for both reading and writing iCCP (for the generation/checking of
# the corresponding cHRM/gAMA chunks) if full ICC is supported.
# added at libpng-1.5.4

View File

@@ -3,7 +3,7 @@
/* pnglibconf.h - library build configuration */
/* Libpng 1.6.0beta31 - October 24, 2012 */
/* Libpng 1.6.0beta31 - October 26, 2012 */
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
@@ -63,6 +63,7 @@
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
/*#undef PNG_ICC_SUPPORTED*/
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED

View File

@@ -205,7 +205,6 @@ EXPORTS
png_get_y_offset_inches @197
png_get_pHYs_dpi @198
png_get_io_state @199
;png_get_io_chunk_name @200
png_get_uint_32 @201
png_get_uint_16 @202
png_get_int_32 @203
@@ -248,3 +247,5 @@ EXPORTS
png_image_write_to_stdio @240
png_convert_to_rfc1123_buffer @241
png_set_check_for_invalid_index @242
png_set_cms @243
png_set_cms_output @244

View File

@@ -42,6 +42,7 @@
#define PNG_READ_BIG_ENDIAN_SUPPORTED /* should do nothing! */
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
#define PNG_ICC_SUPPORTED /* currently disabled */
#undef PNG_H
#include "../png.h"