diff options
author | John Bowler <jbowler@acm.org> | 2012-10-25 19:30:02 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2012-10-25 19:30:02 -0500 |
commit | f8dfd123e2b337f0ce3c484bbcfec10c4c8daddc (patch) | |
tree | 104fc10e92f7852a2c5131a308b1449d88997828 /pngstruct.h | |
parent | e6b710cb3fc573688c2150f9b777156f5d053518 (diff) |
[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.
Diffstat (limited to 'pngstruct.h')
-rw-r--r-- | pngstruct.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pngstruct.h b/pngstruct.h index a0a913b5a..ab1d789ad 100644 --- a/pngstruct.h +++ b/pngstruct.h @@ -203,8 +203,9 @@ typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; #define PNG_COLORSPACE_HAVE_INTENT 0x0004 #define PNG_COLORSPACE_FROM_gAMA 0x0008 #define PNG_COLORSPACE_FROM_cHRM 0x0010 -#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0020 -#define PNG_COLORSPACE_MATCHES_sRGB 0x0040 /* exact match on profile */ +#define PNG_COLORSPACE_FROM_sRGB 0x0020 +#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 +#define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ #define PNG_COLORSPACE_INVALID 0x8000 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) #endif /* COLORSPACE || GAMMA */ @@ -547,5 +548,17 @@ struct png_struct_def png_colorspace colorspace; #endif #endif + +#ifdef PNG_ICC_SUPPORTED + /* Full ICC support requires an external CMS be registered in the png_struct + * after it is created. The registration stores this information. + */ + png_cms_transform_ptr cms_transform_fn; + png_cms_datap cms_data_ptr; +#ifdef PNG_READ_SUPPORTED + int cms_bytes_per_pixel; /* non-standard output size */ + int cms_intent; /* for non-standard output */ +#endif +#endif /* PNG_ICC_SUPPORTED */ }; #endif /* PNGSTRUCT_H */ |