| 1 |
/* 'checkit_tiff' is a conformance checker for baseline TIFFs |
| 2 |
* |
| 3 |
* author: Andreas Romeyke, 2015-2022 |
| 4 |
* licensed under conditions of libtiff |
| 5 |
* (see http://libtiff.maptools.org/misc.html) |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef VALIDATE_ICC |
| 10 |
#define VALIDATE_ICC |
| 11 |
|
| 12 |
#define ICC_IS_VALID 0 |
| 13 |
#define ICC_ERROR_OFFSET 100 |
| 14 |
|
| 15 |
typedef enum { |
| 16 |
icc_profile_1v43_2010, |
| 17 |
icc_profile_v240_v430, |
| 18 |
icc_profile_v500_2016, |
| 19 |
} icc_profile_version_t; |
| 20 |
|
| 21 |
typedef enum { |
| 22 |
icc_is_valid = ICC_IS_VALID, |
| 23 |
icc_error_profileclass = ICC_ERROR_OFFSET, /* profile class ('%s'), should be one of following strings for device classes: 'scnr', 'mntr', 'prtr' or for profile classes: 'link', 'spac', 'abst', 'nmcl'" */ |
| 24 |
icc_error_colorspacedata = ICC_ERROR_OFFSET + 1, /* colorspace data ('%s'), should be one of following strings: 'XYZ ' 'Lab ' 'Luv ' 'YCbr' 'Yvx ' 'RGB ' 'GRAY' 'HSV ' 'HLS ' 'CMYK' 'CMY ' '2CLR' '3CLR' '4CLR' '5CLR' '6CLR' '7CLR' '8CLR' '9CLR' 'ACLR' 'BCLR' 'CCLR' 'DCLR' 'ECLR' 'FCLR'" */ |
| 25 |
icc_error_connectionspacedata = ICC_ERROR_OFFSET + 2, /* "connection space data ('%s') should be one of following strings: 'XYZ ' 'Lab '" */ |
| 26 |
icc_error_primaryplatformsignature = ICC_ERROR_OFFSET + 3, /* primary plattform signature ('%s') should be empty or one of following strings: 'APPL', 'MSFT', 'SGI ', 'SUNW', 'TGNT' */ |
| 27 |
icc_error_header_1v43_2010 = ICC_ERROR_OFFSET + 4, /* Invalid ICC profile 1v43_2010, see http://www.color.org/specification/ICC1v43_2010-12.pdf for details */ |
| 28 |
icc_error_header_v240_v430 = ICC_ERROR_OFFSET + 5, /* Invalid ICC profile ICC.1:2001-04, see http://www.color.org/ICC_Minor_Revision_for_Web.pdf for details */ |
| 29 |
icc_error_header_generic = ICC_ERROR_OFFSET + 6, /* size < 10 */ |
| 30 |
icc_error_preferredcmmtype = ICC_ERROR_OFFSET + 7, /* preferred cmmtype ('%s') should be empty or (possibly, because ICC validation is alpha code) one of following strings: 'ADBE' 'ACMS' 'appl' 'CCMS' 'UCCM' 'UCMS' 'EFI ' 'FF ' 'EXAC' 'HCMM' 'argl' 'LgoS' 'HDM ' 'lcms' 'KCMS' 'MCML' 'WCS ' 'SIGN' 'RGMS' 'SICC' 'TCMM' '32BT' 'WTG ' 'zc00'" */ |
| 31 |
icc_error_committed_size_differs = ICC_ERROR_OFFSET + 8, /* committed ICC size differs from encoded profilesize */ |
| 32 |
icc_error_header_v500_2016 = ICC_ERROR_OFFSET + 9, /* Invalid ICC profile ICC.1:2001-04, see http://www.color.org/iccmax/ICC.2-2016-7.pdf for details */ |
| 33 |
icc_error_header_version_undefined = ICC_ERROR_OFFSET +10, /* if header version was undefined yet */ |
| 34 |
icc_error_header_version_outdated = ICC_ERROR_OFFSET +11, /* if header version was outdated */ |
| 35 |
icc_error_badprofile_id = ICC_ERROR_OFFSET +12, /* if md5 missmatch */ |
| 36 |
icc_error_not_ascii = ICC_ERROR_OFFSET +13, /* if text fields uses 8bit */ |
| 37 |
icc_error_profile_description_tag = ICC_ERROR_OFFSET +14, /* if profile description tag has wrong length */ |
| 38 |
icc_error_found_by_IccProfLib = ICC_ERROR_OFFSET +90, /* generic error by IccProfLib */ |
| 39 |
icc_hard_error_found_by_IccProfLib = ICC_ERROR_OFFSET +91, /* generic hard error by IccProfLib */ |
| 40 |
icc_should_not_occur = ICC_ERROR_OFFSET +99, |
| 41 |
} icc_returncode_t; |
| 42 |
|
| 43 |
icc_returncode_t parse_icc(unsigned long iccsize, const char* iccdata, unsigned long errsize, char * errorneous_value); |
| 44 |
#ifdef HAVE_IccProfLib |
| 45 |
|
| 46 |
#ifdef __cplusplus |
| 47 |
extern "C" { |
| 48 |
#endif /* __cplusplus */ |
| 49 |
// C++ Code |
| 50 |
#include "strcopy.h" |
| 51 |
icc_returncode_t validate_icc_with_IccProfLib(unsigned long iccsize, const char* iccdata, unsigned long errsize, char * errorneous_value); |
| 52 |
#ifdef __cplusplus |
| 53 |
} |
| 54 |
#endif /* __cplusplus */ |
| 55 |
#endif /* HAVE_IccProfLib */ |
| 56 |
#endif |