icc34.h 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. /* Header file guard bands */
  2. #ifndef ICC_H
  3. #define ICC_H
  4. /*****************************************************************
  5. Copyright (c) 1994-1996 SunSoft, Inc.
  6. Rights Reserved
  7. Permission is hereby granted, free of charge, to any person
  8. obtaining a copy of this software and associated documentation
  9. files (the "Software"), to deal in the Software without restrict-
  10. ion, including without limitation the rights to use, copy, modify,
  11. merge, publish distribute, sublicense, and/or sell copies of the
  12. Software, and to permit persons to whom the Software is furnished
  13. to do so, subject to the following conditions:
  14. The above copyright notice and this permission notice shall be
  15. included in all copies or substantial portions of the Software.
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  18. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-
  19. INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT
  20. COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  21. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. OTHER DEALINGS IN THE SOFTWARE.
  24. Except as contained in this notice, the name of SunSoft, Inc.
  25. shall not be used in advertising or otherwise to promote the
  26. sale, use or other dealings in this Software without written
  27. authorization from SunSoft Inc.
  28. ******************************************************************/
  29. /*
  30. * This version of the header file corresponds to the profile
  31. * specification version 3.4.
  32. *
  33. * All header file entries are pre-fixed with "ic" to help
  34. * avoid name space collisions. Signatures are pre-fixed with
  35. * icSig.
  36. *
  37. * The structures defined in this header file were created to
  38. * represent a description of an ICC profile on disk. Rather
  39. * than use pointers a technique is used where a single byte array
  40. * was placed at the end of each structure. This allows us in "C"
  41. * to extend the structure by allocating more data than is needed
  42. * to account for variable length structures.
  43. *
  44. * This also ensures that data following is allocated
  45. * contiguously and makes it easier to write and read data from
  46. * the file.
  47. *
  48. * For example to allocate space for a 256 count length UCR
  49. * and BG array, and fill the allocated data. Note strlen + 1
  50. * to remember NULL terminator.
  51. *
  52. icUcrBgCurve *ucrCurve, *bgCurve;
  53. int ucr_nbytes, bg_nbytes, string_bytes;
  54. icUcrBg *ucrBgWrite;
  55. char ucr_string[100], *ucr_char;
  56. strcpy(ucr_string, "Example ucrBG curves");
  57. ucr_nbytes = sizeof(icUInt32Number) +
  58. (UCR_CURVE_SIZE * sizeof(icUInt16Number));
  59. bg_nbytes = sizeof(icUInt32Number) +
  60. (BG_CURVE_SIZE * sizeof(icUInt16Number));
  61. string_bytes = strlen(ucr_string) + 1;
  62. ucrBgWrite = (icUcrBg *)malloc(
  63. (ucr_nbytes + bg_nbytes + string_bytes));
  64. ucrCurve = (icUcrBgCurve *)ucrBgWrite->data;
  65. ucrCurve->count = UCR_CURVE_SIZE;
  66. for (i=0; i<ucrCurve->count; i++)
  67. ucrCurve->curve[i] = (icUInt16Number)i;
  68. bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes);
  69. bgCurve->count = BG_CURVE_SIZE;
  70. for (i=0; i<bgCurve->count; i++)
  71. bgCurve->curve[i] = 255 - (icUInt16Number)i;
  72. ucr_char = (char *)((char *)bgCurve + bg_nbytes);
  73. memcpy(ucr_char, ucr_string, string_bytes);
  74. *
  75. */
  76. /*
  77. * Many of the structures contain variable length arrays. This
  78. * is represented by the use of the convention.
  79. *
  80. * type data[icAny];
  81. */
  82. /*------------------------------------------------------------------------*/
  83. /*
  84. * Defines used in the specification
  85. */
  86. #define icMagicNumber 0x61637370L /* 'acsp' */
  87. #define icVersionNumber 0x02100000L /* 2.1.0, BCD */
  88. /* Screening Encodings */
  89. #define icPrtrDefaultScreensFalse 0x00000000L /* Bit pos 0 */
  90. #define icPrtrDefaultScreensTrue 0x00000001L /* Bit pos 0 */
  91. #define icLinesPerInch 0x00000002L /* Bit pos 1 */
  92. #define icLinesPerCm 0x00000000L /* Bit pos 1 */
  93. /*
  94. * Device attributes, currently defined values correspond
  95. * to the low 4 bytes of the 8 byte attribute quantity, see
  96. * the header for their location.
  97. */
  98. #define icReflective 0x00000000L /* Bit pos 0 */
  99. #define icTransparency 0x00000001L /* Bit pos 0 */
  100. #define icGlossy 0x00000000L /* Bit pos 1 */
  101. #define icMatte 0x00000002L /* Bit pos 1 */
  102. /*
  103. * Profile header flags, the low 16 bits are reserved for consortium
  104. * use.
  105. */
  106. #define icEmbeddedProfileFalse 0x00000000L /* Bit pos 0 */
  107. #define icEmbeddedProfileTrue 0x00000001L /* Bit pos 0 */
  108. #define icUseAnywhere 0x00000000L /* Bit pos 1 */
  109. #define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */
  110. /* Ascii or Binary data */
  111. #define icAsciiData 0x00000000L
  112. #define icBinaryData 0x00000001L
  113. /*
  114. * Define used to indicate that this is a variable length array
  115. */
  116. #define icAny 1
  117. /*------------------------------------------------------------------------*/
  118. /*
  119. * Use this area to translate platform definitions of long
  120. * etc into icXXX form. The rest of the header uses the icXXX
  121. * typedefs. Signatures are 4 byte quantities.
  122. *
  123. */
  124. #ifdef PACKAGE_NAME
  125. /*
  126. June 9, 2003, Adapted for use with configure by Bob Friesenhahn
  127. Added the stupid check for autoconf by Marti Maria.
  128. PACKAGE_NAME is defined if autoconf is being used
  129. */
  130. typedef @UINT8_T@ icUInt8Number;
  131. typedef @UINT16_T@ icUInt16Number;
  132. typedef @UINT32_T@ icUInt32Number;
  133. typedef @UINT32_T@ icUInt64Number[2];
  134. typedef @INT8_T@ icInt8Number;
  135. typedef @INT16_T@ icInt16Number;
  136. typedef @INT32_T@ icInt32Number;
  137. typedef @INT32_T@ icInt64Number[2];
  138. #elif defined (__digital__) && defined (__unix__)
  139. /*
  140. *Apr-17-2002: Modified by Marti Maria in order to provide wider portability.
  141. */
  142. /* Tru64 */
  143. #include <inttypes.h>
  144. typedef uint8_t icUInt8Number;
  145. typedef uint16_t icUInt16Number;
  146. typedef uint32_t icUInt32Number;
  147. typedef uint32_t icUInt64Number[2];
  148. typedef int8_t icInt8Number;
  149. typedef int16_t icInt16Number;
  150. typedef int32_t icInt32Number;
  151. typedef int32_t icInt64Number[2];
  152. #elif defined(__sgi)
  153. #include "sgidefs.h"
  154. /*
  155. * Number definitions
  156. */
  157. /* Unsigned integer numbers */
  158. typedef unsigned char icUInt8Number;
  159. typedef unsigned short icUInt16Number;
  160. typedef __uint32_t icUInt32Number;
  161. typedef __uint32_t icUInt64Number[2];
  162. /* Signed numbers */
  163. typedef char icInt8Number;
  164. typedef short icInt16Number;
  165. typedef __int32_t icInt32Number;
  166. typedef __int32_t icInt64Number[2];
  167. #elif defined(__GNUC__) || defined(__unix__) || defined(__unix)
  168. #include <sys/types.h>
  169. #if defined(__sun) || defined(__hpux) || defined (__MINGW) || defined(__MINGW32__) || defined(HAVE_STDINT_H)
  170. #if defined (__MINGW) || defined(__MINGW32__) || defined(HAVE_STDINT_H)
  171. #include <stdint.h>
  172. #endif
  173. typedef uint8_t icUInt8Number;
  174. typedef uint16_t icUInt16Number;
  175. typedef uint32_t icUInt32Number;
  176. typedef uint32_t icUInt64Number[2];
  177. #else
  178. /* Unsigned integer numbers */
  179. typedef u_int8_t icUInt8Number;
  180. typedef u_int16_t icUInt16Number;
  181. typedef u_int32_t icUInt32Number;
  182. typedef u_int32_t icUInt64Number[2];
  183. #endif /* defined(__sun) || defined(__hpux) || defined (__MINGW) || defined(__MINGW32__) || defined(HAVE_STDINT_H) */
  184. /* Signed numbers */
  185. typedef int8_t icInt8Number;
  186. typedef int16_t icInt16Number;
  187. typedef int32_t icInt32Number;
  188. typedef int32_t icInt64Number[2];
  189. #else /* default definitions */
  190. /*
  191. * Number definitions
  192. */
  193. /* Unsigned integer numbers */
  194. typedef unsigned char icUInt8Number;
  195. typedef unsigned short icUInt16Number;
  196. typedef unsigned long icUInt32Number;
  197. typedef unsigned long icUInt64Number[2];
  198. /* Signed numbers */
  199. typedef char icInt8Number;
  200. typedef short icInt16Number;
  201. typedef long icInt32Number;
  202. typedef long icInt64Number[2];
  203. #endif /* default defs */
  204. /* Base types */
  205. typedef icInt32Number icSignature;
  206. typedef icInt32Number icS15Fixed16Number;
  207. typedef icUInt32Number icU16Fixed16Number;
  208. /*------------------------------------------------------------------------*/
  209. /* public tags and sizes */
  210. typedef enum {
  211. icSigAToB0Tag = 0x41324230L, /* 'A2B0' */
  212. icSigAToB1Tag = 0x41324231L, /* 'A2B1' */
  213. icSigAToB2Tag = 0x41324232L, /* 'A2B2' */
  214. icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */
  215. icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */
  216. icSigBToA0Tag = 0x42324130L, /* 'B2A0' */
  217. icSigBToA1Tag = 0x42324131L, /* 'B2A1' */
  218. icSigBToA2Tag = 0x42324132L, /* 'B2A2' */
  219. icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
  220. icSigCharTargetTag = 0x74617267L, /* 'targ' */
  221. icSigCopyrightTag = 0x63707274L, /* 'cprt' */
  222. icSigCrdInfoTag = 0x63726469L, /* 'crdi' */
  223. icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
  224. icSigDeviceModelDescTag = 0x646D6464L, /* 'dmdd' */
  225. icSigGamutTag = 0x67616D74L, /* 'gamt ' */
  226. icSigGrayTRCTag = 0x6b545243L, /* 'kTRC' */
  227. icSigGreenColorantTag = 0x6758595AL, /* 'gXYZ' */
  228. icSigGreenTRCTag = 0x67545243L, /* 'gTRC' */
  229. icSigLuminanceTag = 0x6C756d69L, /* 'lumi' */
  230. icSigMeasurementTag = 0x6D656173L, /* 'meas' */
  231. icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
  232. icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */
  233. icSigNamedColorTag = 0x6E636f6CL, /* 'ncol'
  234. * OBSOLETE, use ncl2 */
  235. icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
  236. icSigPreview0Tag = 0x70726530L, /* 'pre0' */
  237. icSigPreview1Tag = 0x70726531L, /* 'pre1' */
  238. icSigPreview2Tag = 0x70726532L, /* 'pre2' */
  239. icSigProfileDescriptionTag = 0x64657363L, /* 'desc' */
  240. icSigProfileSequenceDescTag = 0x70736571L, /* 'pseq' */
  241. icSigPs2CRD0Tag = 0x70736430L, /* 'psd0' */
  242. icSigPs2CRD1Tag = 0x70736431L, /* 'psd1' */
  243. icSigPs2CRD2Tag = 0x70736432L, /* 'psd2' */
  244. icSigPs2CRD3Tag = 0x70736433L, /* 'psd3' */
  245. icSigPs2CSATag = 0x70733273L, /* 'ps2s' */
  246. icSigPs2RenderingIntentTag = 0x70733269L, /* 'ps2i' */
  247. icSigRedColorantTag = 0x7258595AL, /* 'rXYZ' */
  248. icSigRedTRCTag = 0x72545243L, /* 'rTRC' */
  249. icSigScreeningDescTag = 0x73637264L, /* 'scrd' */
  250. icSigScreeningTag = 0x7363726EL, /* 'scrn' */
  251. icSigTechnologyTag = 0x74656368L, /* 'tech' */
  252. icSigUcrBgTag = 0x62666420L, /* 'bfd ' */
  253. icSigViewingCondDescTag = 0x76756564L, /* 'vued' */
  254. icSigViewingConditionsTag = 0x76696577L, /* 'view' */
  255. } icTagSignature;
  256. /* technology signature descriptions */
  257. typedef enum {
  258. icSigDigitalCamera = 0x6463616DL, /* 'dcam' */
  259. icSigFilmScanner = 0x6673636EL, /* 'fscn' */
  260. icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */
  261. icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */
  262. icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */
  263. icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
  264. icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */
  265. icSigDyeSublimationPrinter = 0x64737562L, /* 'dsub' */
  266. icSigPhotographicPaperPrinter = 0x7270686FL, /* 'rpho' */
  267. icSigFilmWriter = 0x6670726EL, /* 'fprn' */
  268. icSigVideoMonitor = 0x7669646DL, /* 'vidm' */
  269. icSigVideoCamera = 0x76696463L, /* 'vidc' */
  270. icSigProjectionTelevision = 0x706A7476L, /* 'pjtv' */
  271. icSigCRTDisplay = 0x43525420L, /* 'CRT ' */
  272. icSigPMDisplay = 0x504D4420L, /* 'PMD ' */
  273. icSigAMDisplay = 0x414D4420L, /* 'AMD ' */
  274. icSigPhotoCD = 0x4B504344L, /* 'KPCD' */
  275. icSigPhotoImageSetter = 0x696D6773L, /* 'imgs' */
  276. icSigGravure = 0x67726176L, /* 'grav' */
  277. icSigOffsetLithography = 0x6F666673L, /* 'offs' */
  278. icSigSilkscreen = 0x73696C6BL, /* 'silk' */
  279. icSigFlexography = 0x666C6578L, /* 'flex' */
  280. } icTechnologySignature;
  281. /* type signatures */
  282. typedef enum {
  283. icSigCurveType = 0x63757276L, /* 'curv' */
  284. icSigDataType = 0x64617461L, /* 'data' */
  285. icSigDateTimeType = 0x6474696DL, /* 'dtim' */
  286. icSigLut16Type = 0x6d667432L, /* 'mft2' */
  287. icSigLut8Type = 0x6d667431L, /* 'mft1' */
  288. icSigMeasurementType = 0x6D656173L, /* 'meas' */
  289. icSigNamedColorType = 0x6E636f6CL, /* 'ncol'
  290. * OBSOLETE, use ncl2 */
  291. icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */
  292. icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */
  293. icSigScreeningType = 0x7363726EL, /* 'scrn' */
  294. icSigSignatureType = 0x73696720L, /* 'sig ' */
  295. icSigTextType = 0x74657874L, /* 'text' */
  296. icSigTextDescriptionType = 0x64657363L, /* 'desc' */
  297. icSigU16Fixed16ArrayType = 0x75663332L, /* 'uf32' */
  298. icSigUcrBgType = 0x62666420L, /* 'bfd ' */
  299. icSigUInt16ArrayType = 0x75693136L, /* 'ui16' */
  300. icSigUInt32ArrayType = 0x75693332L, /* 'ui32' */
  301. icSigUInt64ArrayType = 0x75693634L, /* 'ui64' */
  302. icSigUInt8ArrayType = 0x75693038L, /* 'ui08' */
  303. icSigViewingConditionsType = 0x76696577L, /* 'view' */
  304. icSigXYZType = 0x58595A20L, /* 'XYZ ' */
  305. icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */
  306. icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */
  307. icSigCrdInfoType = 0x63726469L, /* 'crdi' */
  308. } icTagTypeSignature;
  309. /*
  310. * Color Space Signatures
  311. * Note that only icSigXYZData and icSigLabData are valid
  312. * Profile Connection Spaces (PCSs)
  313. */
  314. typedef enum {
  315. icSigXYZData = 0x58595A20L, /* 'XYZ ' */
  316. icSigLabData = 0x4C616220L, /* 'Lab ' */
  317. icSigLuvData = 0x4C757620L, /* 'Luv ' */
  318. icSigYCbCrData = 0x59436272L, /* 'YCbr' */
  319. icSigYxyData = 0x59787920L, /* 'Yxy ' */
  320. icSigRgbData = 0x52474220L, /* 'RGB ' */
  321. icSigGrayData = 0x47524159L, /* 'GRAY' */
  322. icSigHsvData = 0x48535620L, /* 'HSV ' */
  323. icSigHlsData = 0x484C5320L, /* 'HLS ' */
  324. icSigCmykData = 0x434D594BL, /* 'CMYK' */
  325. icSigCmyData = 0x434D5920L, /* 'CMY ' */
  326. icSig2colorData = 0x32434C52L, /* '2CLR' */
  327. icSig3colorData = 0x33434C52L, /* '3CLR' */
  328. icSig4colorData = 0x34434C52L, /* '4CLR' */
  329. icSig5colorData = 0x35434C52L, /* '5CLR' */
  330. icSig6colorData = 0x36434C52L, /* '6CLR' */
  331. icSig7colorData = 0x37434C52L, /* '7CLR' */
  332. icSig8colorData = 0x38434C52L, /* '8CLR' */
  333. icSig9colorData = 0x39434C52L, /* '9CLR' */
  334. icSig10colorData = 0x41434C52L, /* 'ACLR' */
  335. icSig11colorData = 0x42434C52L, /* 'BCLR' */
  336. icSig12colorData = 0x43434C52L, /* 'CCLR' */
  337. icSig13colorData = 0x44434C52L, /* 'DCLR' */
  338. icSig14colorData = 0x45434C52L, /* 'ECLR' */
  339. icSig15colorData = 0x46434C52L, /* 'FCLR' */
  340. } icColorSpaceSignature;
  341. /* profileClass enumerations */
  342. typedef enum {
  343. icSigInputClass = 0x73636E72L, /* 'scnr' */
  344. icSigDisplayClass = 0x6D6E7472L, /* 'mntr' */
  345. icSigOutputClass = 0x70727472L, /* 'prtr' */
  346. icSigLinkClass = 0x6C696E6BL, /* 'link' */
  347. icSigAbstractClass = 0x61627374L, /* 'abst' */
  348. icSigColorSpaceClass = 0x73706163L, /* 'spac' */
  349. icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */
  350. } icProfileClassSignature;
  351. /* Platform Signatures */
  352. typedef enum {
  353. icSigMacintosh = 0x4150504CL, /* 'APPL' */
  354. icSigMicrosoft = 0x4D534654L, /* 'MSFT' */
  355. icSigSolaris = 0x53554E57L, /* 'SUNW' */
  356. icSigSGI = 0x53474920L, /* 'SGI ' */
  357. icSigTaligent = 0x54474E54L, /* 'TGNT' */
  358. } icPlatformSignature;
  359. /*------------------------------------------------------------------------*/
  360. /*
  361. * Other enums
  362. */
  363. /* Measurement Flare, used in the measurmentType tag */
  364. typedef enum {
  365. icFlare0 = 0x00000000L, /* 0% flare */
  366. icFlare100 = 0x00000001L, /* 100% flare */
  367. } icMeasurementFlare;
  368. /* Measurement Geometry, used in the measurmentType tag */
  369. typedef enum {
  370. icGeometryUnknown = 0x00000000L, /* Unknown */
  371. icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */
  372. icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */
  373. } icMeasurementGeometry;
  374. /* Rendering Intents, used in the profile header */
  375. typedef enum {
  376. icPerceptual = 0,
  377. icRelativeColorimetric = 1,
  378. icSaturation = 2,
  379. icAbsoluteColorimetric = 3,
  380. } icRenderingIntent;
  381. /* Different Spot Shapes currently defined, used for screeningType */
  382. typedef enum {
  383. icSpotShapeUnknown = 0,
  384. icSpotShapePrinterDefault = 1,
  385. icSpotShapeRound = 2,
  386. icSpotShapeDiamond = 3,
  387. icSpotShapeEllipse = 4,
  388. icSpotShapeLine = 5,
  389. icSpotShapeSquare = 6,
  390. icSpotShapeCross = 7,
  391. } icSpotShape;
  392. /* Standard Observer, used in the measurmentType tag */
  393. typedef enum {
  394. icStdObsUnknown = 0x00000000L, /* Unknown */
  395. icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
  396. icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */
  397. } icStandardObserver;
  398. /* Pre-defined illuminants, used in measurement and viewing conditions type */
  399. typedef enum {
  400. icIlluminantUnknown = 0x00000000L,
  401. icIlluminantD50 = 0x00000001L,
  402. icIlluminantD65 = 0x00000002L,
  403. icIlluminantD93 = 0x00000003L,
  404. icIlluminantF2 = 0x00000004L,
  405. icIlluminantD55 = 0x00000005L,
  406. icIlluminantA = 0x00000006L,
  407. icIlluminantEquiPowerE = 0x00000007L,
  408. icIlluminantF8 = 0x00000008L,
  409. } icIlluminant;
  410. /*------------------------------------------------------------------------*/
  411. /*
  412. * Arrays of numbers
  413. */
  414. /* Int8 Array */
  415. typedef struct {
  416. icInt8Number data[icAny]; /* Variable array of values */
  417. } icInt8Array;
  418. /* UInt8 Array */
  419. typedef struct {
  420. icUInt8Number data[icAny]; /* Variable array of values */
  421. } icUInt8Array;
  422. /* uInt16 Array */
  423. typedef struct {
  424. icUInt16Number data[icAny]; /* Variable array of values */
  425. } icUInt16Array;
  426. /* Int16 Array */
  427. typedef struct {
  428. icInt16Number data[icAny]; /* Variable array of values */
  429. } icInt16Array;
  430. /* uInt32 Array */
  431. typedef struct {
  432. icUInt32Number data[icAny]; /* Variable array of values */
  433. } icUInt32Array;
  434. /* Int32 Array */
  435. typedef struct {
  436. icInt32Number data[icAny]; /* Variable array of values */
  437. } icInt32Array;
  438. /* UInt64 Array */
  439. typedef struct {
  440. icUInt64Number data[icAny]; /* Variable array of values */
  441. } icUInt64Array;
  442. /* Int64 Array */
  443. typedef struct {
  444. icInt64Number data[icAny]; /* Variable array of values */
  445. } icInt64Array;
  446. /* u16Fixed16 Array */
  447. typedef struct {
  448. icU16Fixed16Number data[icAny]; /* Variable array of values */
  449. } icU16Fixed16Array;
  450. /* s15Fixed16 Array */
  451. typedef struct {
  452. icS15Fixed16Number data[icAny]; /* Variable array of values */
  453. } icS15Fixed16Array;
  454. /* The base date time number */
  455. typedef struct {
  456. icUInt16Number year;
  457. icUInt16Number month;
  458. icUInt16Number day;
  459. icUInt16Number hours;
  460. icUInt16Number minutes;
  461. icUInt16Number seconds;
  462. } icDateTimeNumber;
  463. /* XYZ Number */
  464. typedef struct {
  465. icS15Fixed16Number X;
  466. icS15Fixed16Number Y;
  467. icS15Fixed16Number Z;
  468. } icXYZNumber;
  469. /* XYZ Array */
  470. typedef struct {
  471. icXYZNumber data[icAny]; /* Variable array of XYZ numbers */
  472. } icXYZArray;
  473. /* Curve */
  474. typedef struct {
  475. icUInt32Number count; /* Number of entries */
  476. icUInt16Number data[icAny]; /* The actual table data, real
  477. * number is determined by count
  478. * Interpretation depends on how
  479. * data is used with a given tag
  480. */
  481. } icCurve;
  482. /* Data */
  483. typedef struct {
  484. icUInt32Number dataFlag; /* 0 = ascii, 1 = binary */
  485. icInt8Number data[icAny]; /* Data, size from tag */
  486. } icData;
  487. /* lut16 */
  488. typedef struct {
  489. icUInt8Number inputChan; /* Number of input channels */
  490. icUInt8Number outputChan; /* Number of output channels */
  491. icUInt8Number clutPoints; /* Number of grid points */
  492. icInt8Number pad; /* Padding for byte alignment */
  493. icS15Fixed16Number e00; /* e00 in the 3 * 3 */
  494. icS15Fixed16Number e01; /* e01 in the 3 * 3 */
  495. icS15Fixed16Number e02; /* e02 in the 3 * 3 */
  496. icS15Fixed16Number e10; /* e10 in the 3 * 3 */
  497. icS15Fixed16Number e11; /* e11 in the 3 * 3 */
  498. icS15Fixed16Number e12; /* e12 in the 3 * 3 */
  499. icS15Fixed16Number e20; /* e20 in the 3 * 3 */
  500. icS15Fixed16Number e21; /* e21 in the 3 * 3 */
  501. icS15Fixed16Number e22; /* e22 in the 3 * 3 */
  502. icUInt16Number inputEnt; /* Num of in-table entries */
  503. icUInt16Number outputEnt; /* Num of out-table entries */
  504. icUInt16Number data[icAny]; /* Data follows see spec */
  505. /*
  506. * Data that follows is of this form
  507. *
  508. * icUInt16Number inputTable[inputChan][icAny]; * The in-table
  509. * icUInt16Number clutTable[icAny]; * The clut
  510. * icUInt16Number outputTable[outputChan][icAny]; * The out-table
  511. */
  512. } icLut16;
  513. /* lut8, input & output tables are always 256 bytes in length */
  514. typedef struct {
  515. icUInt8Number inputChan; /* Num of input channels */
  516. icUInt8Number outputChan; /* Num of output channels */
  517. icUInt8Number clutPoints; /* Num of grid points */
  518. icInt8Number pad;
  519. icS15Fixed16Number e00; /* e00 in the 3 * 3 */
  520. icS15Fixed16Number e01; /* e01 in the 3 * 3 */
  521. icS15Fixed16Number e02; /* e02 in the 3 * 3 */
  522. icS15Fixed16Number e10; /* e10 in the 3 * 3 */
  523. icS15Fixed16Number e11; /* e11 in the 3 * 3 */
  524. icS15Fixed16Number e12; /* e12 in the 3 * 3 */
  525. icS15Fixed16Number e20; /* e20 in the 3 * 3 */
  526. icS15Fixed16Number e21; /* e21 in the 3 * 3 */
  527. icS15Fixed16Number e22; /* e22 in the 3 * 3 */
  528. icUInt8Number data[icAny]; /* Data follows see spec */
  529. /*
  530. * Data that follows is of this form
  531. *
  532. * icUInt8Number inputTable[inputChan][256]; * The in-table
  533. * icUInt8Number clutTable[icAny]; * The clut
  534. * icUInt8Number outputTable[outputChan][256]; * The out-table
  535. */
  536. } icLut8;
  537. /* Measurement Data */
  538. typedef struct {
  539. icStandardObserver stdObserver; /* Standard observer */
  540. icXYZNumber backing; /* XYZ for backing */
  541. icMeasurementGeometry geometry; /* Meas. geometry */
  542. icMeasurementFlare flare; /* Measurement flare */
  543. icIlluminant illuminant; /* Illuminant */
  544. } icMeasurement;
  545. /* Named color */
  546. /*
  547. * icNamedColor2 takes the place of icNamedColor
  548. */
  549. typedef struct {
  550. icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
  551. icUInt32Number count; /* Count of named colors */
  552. icUInt32Number nDeviceCoords; /* Num of device coordinates */
  553. icInt8Number prefix[32]; /* Prefix for each color name */
  554. icInt8Number suffix[32]; /* Suffix for each color name */
  555. icInt8Number data[icAny]; /* Named color data follows */
  556. /*
  557. * Data that follows is of this form
  558. *
  559. * icInt8Number root1[32]; * Root name for 1st color
  560. * icUInt16Number pcsCoords1[icAny]; * PCS coords of 1st color
  561. * icUInt16Number deviceCoords1[icAny]; * Dev coords of 1st color
  562. * icInt8Number root2[32]; * Root name for 2nd color
  563. * icUInt16Number pcsCoords2[icAny]; * PCS coords of 2nd color
  564. * icUInt16Number deviceCoords2[icAny]; * Dev coords of 2nd color
  565. * :
  566. * :
  567. * Repeat for name and PCS and device color coordinates up to (count-1)
  568. *
  569. * NOTES:
  570. * PCS and device space can be determined from the header.
  571. *
  572. * PCS coordinates are icUInt16 numbers and are described in Annex A of
  573. * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of
  574. * coordinates is consistent with the headers PCS.
  575. *
  576. * Device coordinates are icUInt16 numbers where 0x0000 represents
  577. * the minimum value and 0xFFFF represents the maximum value.
  578. * If the nDeviceCoords value is 0 this field is not given.
  579. */
  580. } icNamedColor2;
  581. /* Profile sequence structure */
  582. typedef struct {
  583. icSignature deviceMfg; /* Dev Manufacturer */
  584. icSignature deviceModel; /* Dev Model */
  585. icUInt64Number attributes; /* Dev attributes */
  586. icTechnologySignature technology; /* Technology sig */
  587. icInt8Number data[icAny]; /* Desc text follows */
  588. /*
  589. * Data that follows is of this form, this is an icInt8Number
  590. * to avoid problems with a compiler generating bad code as
  591. * these arrays are variable in length.
  592. *
  593. * icTextDescription deviceMfgDesc; * Manufacturer text
  594. * icTextDescription modelDesc; * Model text
  595. */
  596. } icDescStruct;
  597. /* Profile sequence description */
  598. typedef struct {
  599. icUInt32Number count; /* Number of descriptions */
  600. icUInt8Number data[icAny]; /* Array of desc structs */
  601. } icProfileSequenceDesc;
  602. /* textDescription */
  603. typedef struct {
  604. icUInt32Number count; /* Description length */
  605. icInt8Number data[icAny]; /* Descriptions follow */
  606. /*
  607. * Data that follows is of this form
  608. *
  609. * icInt8Number desc[count] * NULL terminated ascii string
  610. * icUInt32Number ucLangCode; * UniCode language code
  611. * icUInt32Number ucCount; * UniCode description length
  612. * icInt16Number ucDesc[ucCount];* The UniCode description
  613. * icUInt16Number scCode; * ScriptCode code
  614. * icUInt8Number scCount; * ScriptCode count
  615. * icInt8Number scDesc[67]; * ScriptCode Description
  616. */
  617. } icTextDescription;
  618. /* Screening Data */
  619. typedef struct {
  620. icS15Fixed16Number frequency; /* Frequency */
  621. icS15Fixed16Number angle; /* Screen angle */
  622. icSpotShape spotShape; /* Spot Shape encodings below */
  623. } icScreeningData;
  624. typedef struct {
  625. icUInt32Number screeningFlag; /* Screening flag */
  626. icUInt32Number channels; /* Number of channels */
  627. icScreeningData data[icAny]; /* Array of screening data */
  628. } icScreening;
  629. /* Text Data */
  630. typedef struct {
  631. icInt8Number data[icAny]; /* Variable array of chars */
  632. } icText;
  633. /* Structure describing either a UCR or BG curve */
  634. typedef struct {
  635. icUInt32Number count; /* Curve length */
  636. icUInt16Number curve[icAny]; /* The array of curve values */
  637. } icUcrBgCurve;
  638. /* Under color removal, black generation */
  639. typedef struct {
  640. icInt8Number data[icAny]; /* The Ucr BG data */
  641. /*
  642. * Data that follows is of this form, this is a icInt8Number
  643. * to avoid problems with a compiler generating bad code as
  644. * these arrays are variable in length.
  645. *
  646. * icUcrBgCurve ucr; * Ucr curve
  647. * icUcrBgCurve bg; * Bg curve
  648. * icInt8Number string; * UcrBg description
  649. */
  650. } icUcrBg;
  651. /* viewingConditionsType */
  652. typedef struct {
  653. icXYZNumber illuminant; /* In candelas per sq. meter */
  654. icXYZNumber surround; /* In candelas per sq. meter */
  655. icIlluminant stdIluminant; /* See icIlluminant defines */
  656. } icViewingCondition;
  657. /* CrdInfo type */
  658. typedef struct {
  659. icUInt32Number count; /* Char count includes NULL */
  660. icInt8Number desc[icAny]; /* Null terminated string */
  661. } icCrdInfo;
  662. /*------------------------------------------------------------------------*/
  663. /*
  664. * Tag Type definitions
  665. */
  666. /*
  667. * Many of the structures contain variable length arrays. This
  668. * is represented by the use of the convention.
  669. *
  670. * type data[icAny];
  671. */
  672. /* The base part of each tag */
  673. typedef struct {
  674. icTagTypeSignature sig; /* Signature */
  675. icInt8Number reserved[4]; /* Reserved, set to 0 */
  676. } icTagBase;
  677. /* curveType */
  678. typedef struct {
  679. icTagBase base; /* Signature, "curv" */
  680. icCurve curve; /* The curve data */
  681. } icCurveType;
  682. /* dataType */
  683. typedef struct {
  684. icTagBase base; /* Signature, "data" */
  685. icData data; /* The data structure */
  686. } icDataType;
  687. /* dateTimeType */
  688. typedef struct {
  689. icTagBase base; /* Signature, "dtim" */
  690. icDateTimeNumber date; /* The date */
  691. } icDateTimeType;
  692. /* lut16Type */
  693. typedef struct {
  694. icTagBase base; /* Signature, "mft2" */
  695. icLut16 lut; /* Lut16 data */
  696. } icLut16Type;
  697. /* lut8Type, input & output tables are always 256 bytes in length */
  698. typedef struct {
  699. icTagBase base; /* Signature, "mft1" */
  700. icLut8 lut; /* Lut8 data */
  701. } icLut8Type;
  702. /* Measurement Type */
  703. typedef struct {
  704. icTagBase base; /* Signature, "meas" */
  705. icMeasurement measurement; /* Measurement data */
  706. } icMeasurementType;
  707. /* Named color type */
  708. /* icNamedColor2Type, replaces icNamedColorType */
  709. typedef struct {
  710. icTagBase base; /* Signature, "ncl2" */
  711. icNamedColor2 ncolor; /* Named color data */
  712. } icNamedColor2Type;
  713. /* Profile sequence description type */
  714. typedef struct {
  715. icTagBase base; /* Signature, "pseq" */
  716. icProfileSequenceDesc desc; /* The seq description */
  717. } icProfileSequenceDescType;
  718. /* textDescriptionType */
  719. typedef struct {
  720. icTagBase base; /* Signature, "desc" */
  721. icTextDescription desc; /* The description */
  722. } icTextDescriptionType;
  723. /* s15Fixed16Type */
  724. typedef struct {
  725. icTagBase base; /* Signature, "sf32" */
  726. icS15Fixed16Array data; /* Array of values */
  727. } icS15Fixed16ArrayType;
  728. typedef struct {
  729. icTagBase base; /* Signature, "scrn" */
  730. icScreening screen; /* Screening structure */
  731. } icScreeningType;
  732. /* sigType */
  733. typedef struct {
  734. icTagBase base; /* Signature, "sig" */
  735. icSignature signature; /* The signature data */
  736. } icSignatureType;
  737. /* textType */
  738. typedef struct {
  739. icTagBase base; /* Signature, "text" */
  740. icText data; /* Variable array of chars */
  741. } icTextType;
  742. /* u16Fixed16Type */
  743. typedef struct {
  744. icTagBase base; /* Signature, "uf32" */
  745. icU16Fixed16Array data; /* Variable array of values */
  746. } icU16Fixed16ArrayType;
  747. /* Under color removal, black generation type */
  748. typedef struct {
  749. icTagBase base; /* Signature, "bfd " */
  750. icUcrBg data; /* ucrBg structure */
  751. } icUcrBgType;
  752. /* uInt16Type */
  753. typedef struct {
  754. icTagBase base; /* Signature, "ui16" */
  755. icUInt16Array data; /* Variable array of values */
  756. } icUInt16ArrayType;
  757. /* uInt32Type */
  758. typedef struct {
  759. icTagBase base; /* Signature, "ui32" */
  760. icUInt32Array data; /* Variable array of values */
  761. } icUInt32ArrayType;
  762. /* uInt64Type */
  763. typedef struct {
  764. icTagBase base; /* Signature, "ui64" */
  765. icUInt64Array data; /* Variable array of values */
  766. } icUInt64ArrayType;
  767. /* uInt8Type */
  768. typedef struct {
  769. icTagBase base; /* Signature, "ui08" */
  770. icUInt8Array data; /* Variable array of values */
  771. } icUInt8ArrayType;
  772. /* viewingConditionsType */
  773. typedef struct {
  774. icTagBase base; /* Signature, "view" */
  775. icViewingCondition view; /* Viewing conditions */
  776. } icViewingConditionType;
  777. /* XYZ Type */
  778. typedef struct {
  779. icTagBase base; /* Signature, "XYZ" */
  780. icXYZArray data; /* Variable array of XYZ nums */
  781. } icXYZType;
  782. /* CRDInfoType where [0] is the CRD product name count and string and
  783. * [1] -[5] are the rendering intents 0-4 counts and strings
  784. */
  785. typedef struct {
  786. icTagBase base; /* Signature, "crdi" */
  787. icCrdInfo info; /* 5 sets of counts & strings */
  788. }icCrdInfoType;
  789. /* icCrdInfo productName; PS product count/string */
  790. /* icCrdInfo CRDName0; CRD name for intent 0 */
  791. /* icCrdInfo CRDName1; CRD name for intent 1 */
  792. /* icCrdInfo CRDName2; CRD name for intent 2 */
  793. /* icCrdInfo CRDName3; CRD name for intent 3 */
  794. /*------------------------------------------------------------------------*/
  795. /*
  796. * Lists of tags, tags, profile header and profile structure
  797. */
  798. /* A tag */
  799. typedef struct {
  800. icTagSignature sig; /* The tag signature */
  801. icUInt32Number offset; /* Start of tag relative to
  802. * start of header, Spec
  803. * Clause 5 */
  804. icUInt32Number size; /* Size in bytes */
  805. } icTag;
  806. /* A Structure that may be used independently for a list of tags */
  807. typedef struct {
  808. icUInt32Number count; /* Num tags in the profile */
  809. icTag tags[icAny]; /* Variable array of tags */
  810. } icTagList;
  811. /* The Profile header */
  812. typedef struct {
  813. icUInt32Number size; /* Prof size in bytes */
  814. icSignature cmmId; /* CMM for profile */
  815. icUInt32Number version; /* Format version */
  816. icProfileClassSignature deviceClass; /* Type of profile */
  817. icColorSpaceSignature colorSpace; /* Clr space of data */
  818. icColorSpaceSignature pcs; /* PCS, XYZ or Lab */
  819. icDateTimeNumber date; /* Creation Date */
  820. icSignature magic; /* icMagicNumber */
  821. icPlatformSignature platform; /* Primary Platform */
  822. icUInt32Number flags; /* Various bits */
  823. icSignature manufacturer; /* Dev manufacturer */
  824. icUInt32Number model; /* Dev model number */
  825. icUInt64Number attributes; /* Device attributes */
  826. icUInt32Number renderingIntent;/* Rendering intent */
  827. icXYZNumber illuminant; /* Profile illuminant */
  828. icSignature creator; /* Profile creator */
  829. icInt8Number reserved[44]; /* Reserved */
  830. } icHeader;
  831. /*
  832. * A profile,
  833. * we can't use icTagList here because its not at the end of the structure
  834. */
  835. typedef struct {
  836. icHeader header; /* The header */
  837. icUInt32Number count; /* Num tags in the profile */
  838. icInt8Number data[icAny]; /* The tagTable and tagData */
  839. /*
  840. * Data that follows is of the form
  841. *
  842. * icTag tagTable[icAny]; * The tag table
  843. * icInt8Number tagData[icAny]; * The tag data
  844. */
  845. } icProfile;
  846. /*------------------------------------------------------------------------*/
  847. /* Obsolete entries */
  848. /* icNamedColor was replaced with icNamedColor2 */
  849. typedef struct {
  850. icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
  851. icUInt32Number count; /* Count of named colors */
  852. icInt8Number data[icAny]; /* Named color data follows */
  853. /*
  854. * Data that follows is of this form
  855. *
  856. * icInt8Number prefix[icAny]; * Prefix
  857. * icInt8Number suffix[icAny]; * Suffix
  858. * icInt8Number root1[icAny]; * Root name
  859. * icInt8Number coords1[icAny]; * Color coordinates
  860. * icInt8Number root2[icAny]; * Root name
  861. * icInt8Number coords2[icAny]; * Color coordinates
  862. * :
  863. * :
  864. * Repeat for root name and color coordinates up to (count-1)
  865. */
  866. } icNamedColor;
  867. /* icNamedColorType was replaced by icNamedColor2Type */
  868. typedef struct {
  869. icTagBase base; /* Signature, "ncol" */
  870. icNamedColor ncolor; /* Named color data */
  871. } icNamedColorType;
  872. #endif /* ICC_H */