image_compressor_pack 0.1.3-amd64-freebsd-10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.txt +22 -0
- data/lib/.paths.yml +12 -0
- data/lib/image_compressor_pack/dynamically_linked_recipes.yml +99 -0
- data/lib/image_compressor_pack/recipes.rb +42 -0
- data/lib/image_compressor_pack/statically_linked_recipes.yml +106 -0
- data/lib/image_compressor_pack/version.rb +3 -0
- data/lib/image_compressor_pack.rb +24 -0
- data/ports/advancecomp-1.2-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/archives/2.1.1.tar.gz +0 -0
- data/ports/archives/2.7.1.tar.gz +0 -0
- data/ports/archives/advancecomp-1.20.tar.gz +0 -0
- data/ports/archives/gifsicle-1.88.tar.gz +0 -0
- data/ports/archives/jhead-3.00.tar.gz +0 -0
- data/ports/archives/jpegoptim-1.4.3.tar.gz +0 -0
- data/ports/archives/lcms2-2.7.tar.gz +0 -0
- data/ports/archives/libpng-1.6.21.tar.gz +0 -0
- data/ports/archives/mozjpeg-3.1-release-source.tar.gz +0 -0
- data/ports/archives/nasm-2.12.01.tar.gz +0 -0
- data/ports/archives/optipng-0.7.6.tar.gz +0 -0
- data/ports/archives/pngcrush-1.8.1.tar.gz +0 -0
- data/ports/archives/zlib-1.2.8.tar.gz +0 -0
- data/ports/gifsicle-1.88-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/jhead-3.0-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/jpeg-archive-2.1.1-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/jpegoptim-1.4.3-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/lcms2-2.7-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/libpng-1.6.21-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/mozjpeg-3.1-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/nasm-2.12.01-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/optipng-0.7.6-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/pngcrush-1.8.1-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/pngquant-2.7.1-x86_64-unknown-freebsd10.3.installed +0 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/bin/advdef +0 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/bin/advmng +0 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/bin/advpng +0 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/bin/advzip +0 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/share/man/man1/advdef.1 +83 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/share/man/man1/advmng.1 +197 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/share/man/man1/advpng.1 +93 -0
- data/ports/x86_64-unknown-freebsd10.3/advancecomp/1.2/share/man/man1/advzip.1 +116 -0
- data/ports/x86_64-unknown-freebsd10.3/gifsicle/1.88/bin/gifsicle +0 -0
- data/ports/x86_64-unknown-freebsd10.3/gifsicle/1.88/share/man/man1/gifsicle.1 +1318 -0
- data/ports/x86_64-unknown-freebsd10.3/jhead/3.0/bin/jhead +0 -0
- data/ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-archive +40 -0
- data/ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-compare +0 -0
- data/ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-hash +0 -0
- data/ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-recompress +0 -0
- data/ports/x86_64-unknown-freebsd10.3/jpegoptim/1.4.3/bin/jpegoptim +0 -0
- data/ports/x86_64-unknown-freebsd10.3/jpegoptim/1.4.3/share/man/man1/jpegoptim.1 +186 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/bin/linkicc +0 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/bin/psicc +0 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/bin/transicc +0 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/include/lcms2.h +1889 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/include/lcms2_plugin.h +637 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/lib/liblcms2.a +0 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/lib/liblcms2.la +41 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/lib/pkgconfig/lcms2.pc +11 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/share/man/man1/jpgicc.1 +122 -0
- data/ports/x86_64-unknown-freebsd10.3/lcms2/2.7/share/man/man1/tificc.1 +117 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/libpng16/png.h +3130 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/libpng16/pngconf.h +622 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/libpng16/pnglibconf.h +212 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/png.h +1 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/pngconf.h +1 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/include/pnglibconf.h +1 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/lib/libpng.a +1 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/lib/libpng.la +1 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/lib/libpng16.a +0 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/lib/libpng16.la +41 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/lib/pkgconfig/libpng16.pc +11 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/share/man/man3/libpng.3 +6124 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/share/man/man3/libpngpf.3 +18 -0
- data/ports/x86_64-unknown-freebsd10.3/libpng/1.6.21/share/man/man5/png.5 +74 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/cjpeg +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/djpeg +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/jpegtran +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/rdjpgcom +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/tjbench +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/bin/wrjpgcom +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/include/jconfig.h +71 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/include/jerror.h +320 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/include/jmorecfg.h +390 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/include/jpeglib.h +1185 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/include/turbojpeg.h +1538 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/lib/libjpeg.a +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/lib/libjpeg.la +41 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/lib/libturbojpeg.a +0 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/lib/libturbojpeg.la +41 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/README +281 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/README-mozilla.txt +194 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/README-turbo.txt +363 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/example.c +433 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/libjpeg.txt +3015 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/structure.txt +906 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/usage.txt +649 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/doc/wizard.txt +211 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/man/man1/cjpeg.1 +352 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/man/man1/djpeg.1 +278 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/man/man1/jpegtran.1 +269 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/man/man1/rdjpgcom.1 +63 -0
- data/ports/x86_64-unknown-freebsd10.3/mozjpeg/3.1/share/man/man1/wrjpgcom.1 +103 -0
- data/ports/x86_64-unknown-freebsd10.3/nasm/2.12.01/bin/nasm +0 -0
- data/ports/x86_64-unknown-freebsd10.3/nasm/2.12.01/bin/ndisasm +0 -0
- data/ports/x86_64-unknown-freebsd10.3/nasm/2.12.01/share/man/man1/nasm.1 +429 -0
- data/ports/x86_64-unknown-freebsd10.3/nasm/2.12.01/share/man/man1/ndisasm.1 +120 -0
- data/ports/x86_64-unknown-freebsd10.3/optipng/0.7.6/bin/optipng +0 -0
- data/ports/x86_64-unknown-freebsd10.3/optipng/0.7.6/man/man1/optipng.1 +343 -0
- data/ports/x86_64-unknown-freebsd10.3/pngcrush/1.8.1/bin/pngcrush +0 -0
- data/ports/x86_64-unknown-freebsd10.3/pngquant/2.7.1/bin/pngquant +0 -0
- data/ports/x86_64-unknown-freebsd10.3/pngquant/2.7.1/share/man/man1/pngquant.1 +127 -0
- data/ports/x86_64-unknown-freebsd10.3/zlib/1.2.8/include/zconf.h +511 -0
- data/ports/x86_64-unknown-freebsd10.3/zlib/1.2.8/include/zlib.h +1768 -0
- data/ports/x86_64-unknown-freebsd10.3/zlib/1.2.8/lib/libz.a +0 -0
- data/ports/x86_64-unknown-freebsd10.3/zlib/1.2.8/lib/pkgconfig/zlib.pc +13 -0
- data/ports/x86_64-unknown-freebsd10.3/zlib/1.2.8/share/man/man3/zlib.3 +151 -0
- data/ports/zlib-1.2.8-x86_64-unknown-freebsd10.3.installed +0 -0
- data.tar.gz.sig +0 -0
- metadata +264 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,1889 @@
|
|
1
|
+
//---------------------------------------------------------------------------------
|
2
|
+
//
|
3
|
+
// Little Color Management System
|
4
|
+
// Copyright (c) 1998-2014 Marti Maria Saguer
|
5
|
+
//
|
6
|
+
// Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
// a copy of this software and associated documentation files (the "Software"),
|
8
|
+
// to deal in the Software without restriction, including without limitation
|
9
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
10
|
+
// and/or sell copies of the Software, and to permit persons to whom the Software
|
11
|
+
// is furnished to do so, subject to the following conditions:
|
12
|
+
//
|
13
|
+
// The above copyright notice and this permission notice shall be included in
|
14
|
+
// all copies or substantial portions of the Software.
|
15
|
+
//
|
16
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
18
|
+
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
//
|
24
|
+
//---------------------------------------------------------------------------------
|
25
|
+
//
|
26
|
+
// Version 2.7
|
27
|
+
//
|
28
|
+
|
29
|
+
#ifndef _lcms2_H
|
30
|
+
|
31
|
+
// ********** Configuration toggles ****************************************
|
32
|
+
|
33
|
+
// Uncomment this one if you are using big endian machines
|
34
|
+
// #define CMS_USE_BIG_ENDIAN 1
|
35
|
+
|
36
|
+
// Uncomment this one if your compiler/machine does NOT support the
|
37
|
+
// "long long" type.
|
38
|
+
// #define CMS_DONT_USE_INT64 1
|
39
|
+
|
40
|
+
// Uncomment this if your compiler doesn't work with fast floor function
|
41
|
+
// #define CMS_DONT_USE_FAST_FLOOR 1
|
42
|
+
|
43
|
+
// Uncomment this line if you want lcms to use the black point tag in profile,
|
44
|
+
// if commented, lcms will compute the black point by its own.
|
45
|
+
// It is safer to leave it commented out
|
46
|
+
// #define CMS_USE_PROFILE_BLACK_POINT_TAG 1
|
47
|
+
|
48
|
+
// Uncomment this line if you are compiling as C++ and want a C++ API
|
49
|
+
// #define CMS_USE_CPP_API
|
50
|
+
|
51
|
+
// Uncomment this line if you need strict CGATS syntax. Makes CGATS files to
|
52
|
+
// require "KEYWORD" on undefined identifiers, keep it comented out unless needed
|
53
|
+
// #define CMS_STRICT_CGATS 1
|
54
|
+
|
55
|
+
// Uncomment to get rid of the tables for "half" float support
|
56
|
+
// #define CMS_NO_HALF_SUPPORT 1
|
57
|
+
|
58
|
+
// Uncomment to get rid of pthreads/windows dependency
|
59
|
+
// #define CMS_NO_PTHREADS 1
|
60
|
+
|
61
|
+
// ********** End of configuration toggles ******************************
|
62
|
+
|
63
|
+
// Needed for streams
|
64
|
+
#include <stdio.h>
|
65
|
+
|
66
|
+
// Needed for portability (C99 per 7.1.2)
|
67
|
+
#include <limits.h>
|
68
|
+
#include <time.h>
|
69
|
+
#include <stddef.h>
|
70
|
+
|
71
|
+
#ifndef CMS_USE_CPP_API
|
72
|
+
# ifdef __cplusplus
|
73
|
+
extern "C" {
|
74
|
+
# endif
|
75
|
+
#endif
|
76
|
+
|
77
|
+
// Version/release
|
78
|
+
#define LCMS_VERSION 2070
|
79
|
+
|
80
|
+
// I will give the chance of redefining basic types for compilers that are not fully C99 compliant
|
81
|
+
#ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
|
82
|
+
|
83
|
+
// Base types
|
84
|
+
typedef unsigned char cmsUInt8Number; // That is guaranteed by the C99 spec
|
85
|
+
typedef signed char cmsInt8Number; // That is guaranteed by the C99 spec
|
86
|
+
|
87
|
+
#if CHAR_BIT != 8
|
88
|
+
# error "Unable to find 8 bit type, unsupported compiler"
|
89
|
+
#endif
|
90
|
+
|
91
|
+
// IEEE float storage numbers
|
92
|
+
typedef float cmsFloat32Number;
|
93
|
+
typedef double cmsFloat64Number;
|
94
|
+
|
95
|
+
// 16-bit base types
|
96
|
+
#if (USHRT_MAX == 65535U)
|
97
|
+
typedef unsigned short cmsUInt16Number;
|
98
|
+
#elif (UINT_MAX == 65535U)
|
99
|
+
typedef unsigned int cmsUInt16Number;
|
100
|
+
#else
|
101
|
+
# error "Unable to find 16 bits unsigned type, unsupported compiler"
|
102
|
+
#endif
|
103
|
+
|
104
|
+
#if (SHRT_MAX == 32767)
|
105
|
+
typedef short cmsInt16Number;
|
106
|
+
#elif (INT_MAX == 32767)
|
107
|
+
typedef int cmsInt16Number;
|
108
|
+
#else
|
109
|
+
# error "Unable to find 16 bits signed type, unsupported compiler"
|
110
|
+
#endif
|
111
|
+
|
112
|
+
// 32-bit base type
|
113
|
+
#if (UINT_MAX == 4294967295U)
|
114
|
+
typedef unsigned int cmsUInt32Number;
|
115
|
+
#elif (ULONG_MAX == 4294967295U)
|
116
|
+
typedef unsigned long cmsUInt32Number;
|
117
|
+
#else
|
118
|
+
# error "Unable to find 32 bit unsigned type, unsupported compiler"
|
119
|
+
#endif
|
120
|
+
|
121
|
+
#if (INT_MAX == +2147483647)
|
122
|
+
typedef int cmsInt32Number;
|
123
|
+
#elif (LONG_MAX == +2147483647)
|
124
|
+
typedef long cmsInt32Number;
|
125
|
+
#else
|
126
|
+
# error "Unable to find 32 bit signed type, unsupported compiler"
|
127
|
+
#endif
|
128
|
+
|
129
|
+
// 64-bit base types
|
130
|
+
#ifndef CMS_DONT_USE_INT64
|
131
|
+
# if (ULONG_MAX == 18446744073709551615U)
|
132
|
+
typedef unsigned long cmsUInt64Number;
|
133
|
+
# elif (ULLONG_MAX == 18446744073709551615U)
|
134
|
+
typedef unsigned long long cmsUInt64Number;
|
135
|
+
# else
|
136
|
+
# define CMS_DONT_USE_INT64 1
|
137
|
+
# endif
|
138
|
+
# if (LONG_MAX == +9223372036854775807)
|
139
|
+
typedef long cmsInt64Number;
|
140
|
+
# elif (LLONG_MAX == +9223372036854775807)
|
141
|
+
typedef long long cmsInt64Number;
|
142
|
+
# else
|
143
|
+
# define CMS_DONT_USE_INT64 1
|
144
|
+
# endif
|
145
|
+
#endif
|
146
|
+
#endif
|
147
|
+
|
148
|
+
// In the case 64 bit numbers are not supported by the compiler
|
149
|
+
#ifdef CMS_DONT_USE_INT64
|
150
|
+
typedef cmsUInt32Number cmsUInt64Number[2];
|
151
|
+
typedef cmsInt32Number cmsInt64Number[2];
|
152
|
+
#endif
|
153
|
+
|
154
|
+
// Derivative types
|
155
|
+
typedef cmsUInt32Number cmsSignature;
|
156
|
+
typedef cmsUInt16Number cmsU8Fixed8Number;
|
157
|
+
typedef cmsInt32Number cmsS15Fixed16Number;
|
158
|
+
typedef cmsUInt32Number cmsU16Fixed16Number;
|
159
|
+
|
160
|
+
// Boolean type, which will be using the native integer
|
161
|
+
typedef int cmsBool;
|
162
|
+
|
163
|
+
// Try to detect windows
|
164
|
+
#if defined (_WIN32) || defined(_WIN64) || defined(WIN32) || defined(_WIN32_)
|
165
|
+
# define CMS_IS_WINDOWS_ 1
|
166
|
+
#endif
|
167
|
+
|
168
|
+
#ifdef _MSC_VER
|
169
|
+
# define CMS_IS_WINDOWS_ 1
|
170
|
+
#endif
|
171
|
+
|
172
|
+
#ifdef __BORLANDC__
|
173
|
+
# define CMS_IS_WINDOWS_ 1
|
174
|
+
#endif
|
175
|
+
|
176
|
+
// Try to detect big endian platforms. This list can be endless, so only some checks are performed over here.
|
177
|
+
// you can pass this toggle to the compiler by using -DCMS_USE_BIG_ENDIAN or something similar
|
178
|
+
|
179
|
+
#if defined(__sgi__) || defined(__sgi) || defined(sparc)
|
180
|
+
# define CMS_USE_BIG_ENDIAN 1
|
181
|
+
#endif
|
182
|
+
|
183
|
+
#if defined(__s390__) || defined(__s390x__)
|
184
|
+
# define CMS_USE_BIG_ENDIAN 1
|
185
|
+
#endif
|
186
|
+
|
187
|
+
|
188
|
+
#if defined(__powerpc__) || defined(__ppc__) || defined(TARGET_CPU_PPC)
|
189
|
+
# if __powerpc__ || __ppc__ || TARGET_CPU_PPC
|
190
|
+
# define CMS_USE_BIG_ENDIAN 1
|
191
|
+
# if defined (__GNUC__) && defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
|
192
|
+
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
193
|
+
// Don't use big endian for PowerPC little endian mode
|
194
|
+
# undef CMS_USE_BIG_ENDIAN
|
195
|
+
# endif
|
196
|
+
# endif
|
197
|
+
# endif
|
198
|
+
#endif
|
199
|
+
|
200
|
+
#ifdef macintosh
|
201
|
+
# ifdef __BIG_ENDIAN__
|
202
|
+
# define CMS_USE_BIG_ENDIAN 1
|
203
|
+
# endif
|
204
|
+
# ifdef __LITTLE_ENDIAN__
|
205
|
+
# undef CMS_USE_BIG_ENDIAN
|
206
|
+
# endif
|
207
|
+
#endif
|
208
|
+
|
209
|
+
// WORDS_BIGENDIAN takes precedence
|
210
|
+
#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
|
211
|
+
# define CMS_USE_BIG_ENDIAN 1
|
212
|
+
#endif
|
213
|
+
|
214
|
+
|
215
|
+
// Calling convention -- this is hardly platform and compiler dependent
|
216
|
+
#ifdef CMS_IS_WINDOWS_
|
217
|
+
# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
|
218
|
+
# ifdef __BORLANDC__
|
219
|
+
# define CMSEXPORT __stdcall _export
|
220
|
+
# define CMSAPI
|
221
|
+
# else
|
222
|
+
# define CMSEXPORT _stdcall
|
223
|
+
# ifdef CMS_DLL_BUILD
|
224
|
+
# define CMSAPI __declspec(dllexport)
|
225
|
+
# else
|
226
|
+
# define CMSAPI __declspec(dllimport)
|
227
|
+
# endif
|
228
|
+
# endif
|
229
|
+
# else
|
230
|
+
# define CMSEXPORT
|
231
|
+
# define CMSAPI
|
232
|
+
# endif
|
233
|
+
#else
|
234
|
+
# define CMSEXPORT
|
235
|
+
# define CMSAPI
|
236
|
+
#endif
|
237
|
+
|
238
|
+
#ifdef HasTHREADS
|
239
|
+
# if HasTHREADS == 1
|
240
|
+
# undef CMS_NO_PTHREADS
|
241
|
+
# else
|
242
|
+
# define CMS_NO_PTHREADS 1
|
243
|
+
# endif
|
244
|
+
#endif
|
245
|
+
|
246
|
+
// Some common definitions
|
247
|
+
#define cmsMAX_PATH 256
|
248
|
+
|
249
|
+
#ifndef FALSE
|
250
|
+
# define FALSE 0
|
251
|
+
#endif
|
252
|
+
#ifndef TRUE
|
253
|
+
# define TRUE 1
|
254
|
+
#endif
|
255
|
+
|
256
|
+
// D50 XYZ normalized to Y=1.0
|
257
|
+
#define cmsD50X 0.9642
|
258
|
+
#define cmsD50Y 1.0
|
259
|
+
#define cmsD50Z 0.8249
|
260
|
+
|
261
|
+
// V4 perceptual black
|
262
|
+
#define cmsPERCEPTUAL_BLACK_X 0.00336
|
263
|
+
#define cmsPERCEPTUAL_BLACK_Y 0.0034731
|
264
|
+
#define cmsPERCEPTUAL_BLACK_Z 0.00287
|
265
|
+
|
266
|
+
// Definitions in ICC spec
|
267
|
+
#define cmsMagicNumber 0x61637370 // 'acsp'
|
268
|
+
#define lcmsSignature 0x6c636d73 // 'lcms'
|
269
|
+
|
270
|
+
|
271
|
+
// Base ICC type definitions
|
272
|
+
typedef enum {
|
273
|
+
cmsSigChromaticityType = 0x6368726D, // 'chrm'
|
274
|
+
cmsSigColorantOrderType = 0x636C726F, // 'clro'
|
275
|
+
cmsSigColorantTableType = 0x636C7274, // 'clrt'
|
276
|
+
cmsSigCrdInfoType = 0x63726469, // 'crdi'
|
277
|
+
cmsSigCurveType = 0x63757276, // 'curv'
|
278
|
+
cmsSigDataType = 0x64617461, // 'data'
|
279
|
+
cmsSigDictType = 0x64696374, // 'dict'
|
280
|
+
cmsSigDateTimeType = 0x6474696D, // 'dtim'
|
281
|
+
cmsSigDeviceSettingsType = 0x64657673, // 'devs'
|
282
|
+
cmsSigLut16Type = 0x6d667432, // 'mft2'
|
283
|
+
cmsSigLut8Type = 0x6d667431, // 'mft1'
|
284
|
+
cmsSigLutAtoBType = 0x6d414220, // 'mAB '
|
285
|
+
cmsSigLutBtoAType = 0x6d424120, // 'mBA '
|
286
|
+
cmsSigMeasurementType = 0x6D656173, // 'meas'
|
287
|
+
cmsSigMultiLocalizedUnicodeType = 0x6D6C7563, // 'mluc'
|
288
|
+
cmsSigMultiProcessElementType = 0x6D706574, // 'mpet'
|
289
|
+
cmsSigNamedColorType = 0x6E636f6C, // 'ncol' -- DEPRECATED!
|
290
|
+
cmsSigNamedColor2Type = 0x6E636C32, // 'ncl2'
|
291
|
+
cmsSigParametricCurveType = 0x70617261, // 'para'
|
292
|
+
cmsSigProfileSequenceDescType = 0x70736571, // 'pseq'
|
293
|
+
cmsSigProfileSequenceIdType = 0x70736964, // 'psid'
|
294
|
+
cmsSigResponseCurveSet16Type = 0x72637332, // 'rcs2'
|
295
|
+
cmsSigS15Fixed16ArrayType = 0x73663332, // 'sf32'
|
296
|
+
cmsSigScreeningType = 0x7363726E, // 'scrn'
|
297
|
+
cmsSigSignatureType = 0x73696720, // 'sig '
|
298
|
+
cmsSigTextType = 0x74657874, // 'text'
|
299
|
+
cmsSigTextDescriptionType = 0x64657363, // 'desc'
|
300
|
+
cmsSigU16Fixed16ArrayType = 0x75663332, // 'uf32'
|
301
|
+
cmsSigUcrBgType = 0x62666420, // 'bfd '
|
302
|
+
cmsSigUInt16ArrayType = 0x75693136, // 'ui16'
|
303
|
+
cmsSigUInt32ArrayType = 0x75693332, // 'ui32'
|
304
|
+
cmsSigUInt64ArrayType = 0x75693634, // 'ui64'
|
305
|
+
cmsSigUInt8ArrayType = 0x75693038, // 'ui08'
|
306
|
+
cmsSigVcgtType = 0x76636774, // 'vcgt'
|
307
|
+
cmsSigViewingConditionsType = 0x76696577, // 'view'
|
308
|
+
cmsSigXYZType = 0x58595A20 // 'XYZ '
|
309
|
+
|
310
|
+
|
311
|
+
} cmsTagTypeSignature;
|
312
|
+
|
313
|
+
// Base ICC tag definitions
|
314
|
+
typedef enum {
|
315
|
+
cmsSigAToB0Tag = 0x41324230, // 'A2B0'
|
316
|
+
cmsSigAToB1Tag = 0x41324231, // 'A2B1'
|
317
|
+
cmsSigAToB2Tag = 0x41324232, // 'A2B2'
|
318
|
+
cmsSigBlueColorantTag = 0x6258595A, // 'bXYZ'
|
319
|
+
cmsSigBlueMatrixColumnTag = 0x6258595A, // 'bXYZ'
|
320
|
+
cmsSigBlueTRCTag = 0x62545243, // 'bTRC'
|
321
|
+
cmsSigBToA0Tag = 0x42324130, // 'B2A0'
|
322
|
+
cmsSigBToA1Tag = 0x42324131, // 'B2A1'
|
323
|
+
cmsSigBToA2Tag = 0x42324132, // 'B2A2'
|
324
|
+
cmsSigCalibrationDateTimeTag = 0x63616C74, // 'calt'
|
325
|
+
cmsSigCharTargetTag = 0x74617267, // 'targ'
|
326
|
+
cmsSigChromaticAdaptationTag = 0x63686164, // 'chad'
|
327
|
+
cmsSigChromaticityTag = 0x6368726D, // 'chrm'
|
328
|
+
cmsSigColorantOrderTag = 0x636C726F, // 'clro'
|
329
|
+
cmsSigColorantTableTag = 0x636C7274, // 'clrt'
|
330
|
+
cmsSigColorantTableOutTag = 0x636C6F74, // 'clot'
|
331
|
+
cmsSigColorimetricIntentImageStateTag = 0x63696973, // 'ciis'
|
332
|
+
cmsSigCopyrightTag = 0x63707274, // 'cprt'
|
333
|
+
cmsSigCrdInfoTag = 0x63726469, // 'crdi'
|
334
|
+
cmsSigDataTag = 0x64617461, // 'data'
|
335
|
+
cmsSigDateTimeTag = 0x6474696D, // 'dtim'
|
336
|
+
cmsSigDeviceMfgDescTag = 0x646D6E64, // 'dmnd'
|
337
|
+
cmsSigDeviceModelDescTag = 0x646D6464, // 'dmdd'
|
338
|
+
cmsSigDeviceSettingsTag = 0x64657673, // 'devs'
|
339
|
+
cmsSigDToB0Tag = 0x44324230, // 'D2B0'
|
340
|
+
cmsSigDToB1Tag = 0x44324231, // 'D2B1'
|
341
|
+
cmsSigDToB2Tag = 0x44324232, // 'D2B2'
|
342
|
+
cmsSigDToB3Tag = 0x44324233, // 'D2B3'
|
343
|
+
cmsSigBToD0Tag = 0x42324430, // 'B2D0'
|
344
|
+
cmsSigBToD1Tag = 0x42324431, // 'B2D1'
|
345
|
+
cmsSigBToD2Tag = 0x42324432, // 'B2D2'
|
346
|
+
cmsSigBToD3Tag = 0x42324433, // 'B2D3'
|
347
|
+
cmsSigGamutTag = 0x67616D74, // 'gamt'
|
348
|
+
cmsSigGrayTRCTag = 0x6b545243, // 'kTRC'
|
349
|
+
cmsSigGreenColorantTag = 0x6758595A, // 'gXYZ'
|
350
|
+
cmsSigGreenMatrixColumnTag = 0x6758595A, // 'gXYZ'
|
351
|
+
cmsSigGreenTRCTag = 0x67545243, // 'gTRC'
|
352
|
+
cmsSigLuminanceTag = 0x6C756d69, // 'lumi'
|
353
|
+
cmsSigMeasurementTag = 0x6D656173, // 'meas'
|
354
|
+
cmsSigMediaBlackPointTag = 0x626B7074, // 'bkpt'
|
355
|
+
cmsSigMediaWhitePointTag = 0x77747074, // 'wtpt'
|
356
|
+
cmsSigNamedColorTag = 0x6E636f6C, // 'ncol' // Deprecated by the ICC
|
357
|
+
cmsSigNamedColor2Tag = 0x6E636C32, // 'ncl2'
|
358
|
+
cmsSigOutputResponseTag = 0x72657370, // 'resp'
|
359
|
+
cmsSigPerceptualRenderingIntentGamutTag = 0x72696730, // 'rig0'
|
360
|
+
cmsSigPreview0Tag = 0x70726530, // 'pre0'
|
361
|
+
cmsSigPreview1Tag = 0x70726531, // 'pre1'
|
362
|
+
cmsSigPreview2Tag = 0x70726532, // 'pre2'
|
363
|
+
cmsSigProfileDescriptionTag = 0x64657363, // 'desc'
|
364
|
+
cmsSigProfileDescriptionMLTag = 0x6473636d, // 'dscm'
|
365
|
+
cmsSigProfileSequenceDescTag = 0x70736571, // 'pseq'
|
366
|
+
cmsSigProfileSequenceIdTag = 0x70736964, // 'psid'
|
367
|
+
cmsSigPs2CRD0Tag = 0x70736430, // 'psd0'
|
368
|
+
cmsSigPs2CRD1Tag = 0x70736431, // 'psd1'
|
369
|
+
cmsSigPs2CRD2Tag = 0x70736432, // 'psd2'
|
370
|
+
cmsSigPs2CRD3Tag = 0x70736433, // 'psd3'
|
371
|
+
cmsSigPs2CSATag = 0x70733273, // 'ps2s'
|
372
|
+
cmsSigPs2RenderingIntentTag = 0x70733269, // 'ps2i'
|
373
|
+
cmsSigRedColorantTag = 0x7258595A, // 'rXYZ'
|
374
|
+
cmsSigRedMatrixColumnTag = 0x7258595A, // 'rXYZ'
|
375
|
+
cmsSigRedTRCTag = 0x72545243, // 'rTRC'
|
376
|
+
cmsSigSaturationRenderingIntentGamutTag = 0x72696732, // 'rig2'
|
377
|
+
cmsSigScreeningDescTag = 0x73637264, // 'scrd'
|
378
|
+
cmsSigScreeningTag = 0x7363726E, // 'scrn'
|
379
|
+
cmsSigTechnologyTag = 0x74656368, // 'tech'
|
380
|
+
cmsSigUcrBgTag = 0x62666420, // 'bfd '
|
381
|
+
cmsSigViewingCondDescTag = 0x76756564, // 'vued'
|
382
|
+
cmsSigViewingConditionsTag = 0x76696577, // 'view'
|
383
|
+
cmsSigVcgtTag = 0x76636774, // 'vcgt'
|
384
|
+
cmsSigMetaTag = 0x6D657461 // 'meta'
|
385
|
+
|
386
|
+
} cmsTagSignature;
|
387
|
+
|
388
|
+
|
389
|
+
// ICC Technology tag
|
390
|
+
typedef enum {
|
391
|
+
cmsSigDigitalCamera = 0x6463616D, // 'dcam'
|
392
|
+
cmsSigFilmScanner = 0x6673636E, // 'fscn'
|
393
|
+
cmsSigReflectiveScanner = 0x7273636E, // 'rscn'
|
394
|
+
cmsSigInkJetPrinter = 0x696A6574, // 'ijet'
|
395
|
+
cmsSigThermalWaxPrinter = 0x74776178, // 'twax'
|
396
|
+
cmsSigElectrophotographicPrinter = 0x6570686F, // 'epho'
|
397
|
+
cmsSigElectrostaticPrinter = 0x65737461, // 'esta'
|
398
|
+
cmsSigDyeSublimationPrinter = 0x64737562, // 'dsub'
|
399
|
+
cmsSigPhotographicPaperPrinter = 0x7270686F, // 'rpho'
|
400
|
+
cmsSigFilmWriter = 0x6670726E, // 'fprn'
|
401
|
+
cmsSigVideoMonitor = 0x7669646D, // 'vidm'
|
402
|
+
cmsSigVideoCamera = 0x76696463, // 'vidc'
|
403
|
+
cmsSigProjectionTelevision = 0x706A7476, // 'pjtv'
|
404
|
+
cmsSigCRTDisplay = 0x43525420, // 'CRT '
|
405
|
+
cmsSigPMDisplay = 0x504D4420, // 'PMD '
|
406
|
+
cmsSigAMDisplay = 0x414D4420, // 'AMD '
|
407
|
+
cmsSigPhotoCD = 0x4B504344, // 'KPCD'
|
408
|
+
cmsSigPhotoImageSetter = 0x696D6773, // 'imgs'
|
409
|
+
cmsSigGravure = 0x67726176, // 'grav'
|
410
|
+
cmsSigOffsetLithography = 0x6F666673, // 'offs'
|
411
|
+
cmsSigSilkscreen = 0x73696C6B, // 'silk'
|
412
|
+
cmsSigFlexography = 0x666C6578, // 'flex'
|
413
|
+
cmsSigMotionPictureFilmScanner = 0x6D706673, // 'mpfs'
|
414
|
+
cmsSigMotionPictureFilmRecorder = 0x6D706672, // 'mpfr'
|
415
|
+
cmsSigDigitalMotionPictureCamera = 0x646D7063, // 'dmpc'
|
416
|
+
cmsSigDigitalCinemaProjector = 0x64636A70 // 'dcpj'
|
417
|
+
|
418
|
+
} cmsTechnologySignature;
|
419
|
+
|
420
|
+
|
421
|
+
// ICC Color spaces
|
422
|
+
typedef enum {
|
423
|
+
cmsSigXYZData = 0x58595A20, // 'XYZ '
|
424
|
+
cmsSigLabData = 0x4C616220, // 'Lab '
|
425
|
+
cmsSigLuvData = 0x4C757620, // 'Luv '
|
426
|
+
cmsSigYCbCrData = 0x59436272, // 'YCbr'
|
427
|
+
cmsSigYxyData = 0x59787920, // 'Yxy '
|
428
|
+
cmsSigRgbData = 0x52474220, // 'RGB '
|
429
|
+
cmsSigGrayData = 0x47524159, // 'GRAY'
|
430
|
+
cmsSigHsvData = 0x48535620, // 'HSV '
|
431
|
+
cmsSigHlsData = 0x484C5320, // 'HLS '
|
432
|
+
cmsSigCmykData = 0x434D594B, // 'CMYK'
|
433
|
+
cmsSigCmyData = 0x434D5920, // 'CMY '
|
434
|
+
cmsSigMCH1Data = 0x4D434831, // 'MCH1'
|
435
|
+
cmsSigMCH2Data = 0x4D434832, // 'MCH2'
|
436
|
+
cmsSigMCH3Data = 0x4D434833, // 'MCH3'
|
437
|
+
cmsSigMCH4Data = 0x4D434834, // 'MCH4'
|
438
|
+
cmsSigMCH5Data = 0x4D434835, // 'MCH5'
|
439
|
+
cmsSigMCH6Data = 0x4D434836, // 'MCH6'
|
440
|
+
cmsSigMCH7Data = 0x4D434837, // 'MCH7'
|
441
|
+
cmsSigMCH8Data = 0x4D434838, // 'MCH8'
|
442
|
+
cmsSigMCH9Data = 0x4D434839, // 'MCH9'
|
443
|
+
cmsSigMCHAData = 0x4D434841, // 'MCHA'
|
444
|
+
cmsSigMCHBData = 0x4D434842, // 'MCHB'
|
445
|
+
cmsSigMCHCData = 0x4D434843, // 'MCHC'
|
446
|
+
cmsSigMCHDData = 0x4D434844, // 'MCHD'
|
447
|
+
cmsSigMCHEData = 0x4D434845, // 'MCHE'
|
448
|
+
cmsSigMCHFData = 0x4D434846, // 'MCHF'
|
449
|
+
cmsSigNamedData = 0x6e6d636c, // 'nmcl'
|
450
|
+
cmsSig1colorData = 0x31434C52, // '1CLR'
|
451
|
+
cmsSig2colorData = 0x32434C52, // '2CLR'
|
452
|
+
cmsSig3colorData = 0x33434C52, // '3CLR'
|
453
|
+
cmsSig4colorData = 0x34434C52, // '4CLR'
|
454
|
+
cmsSig5colorData = 0x35434C52, // '5CLR'
|
455
|
+
cmsSig6colorData = 0x36434C52, // '6CLR'
|
456
|
+
cmsSig7colorData = 0x37434C52, // '7CLR'
|
457
|
+
cmsSig8colorData = 0x38434C52, // '8CLR'
|
458
|
+
cmsSig9colorData = 0x39434C52, // '9CLR'
|
459
|
+
cmsSig10colorData = 0x41434C52, // 'ACLR'
|
460
|
+
cmsSig11colorData = 0x42434C52, // 'BCLR'
|
461
|
+
cmsSig12colorData = 0x43434C52, // 'CCLR'
|
462
|
+
cmsSig13colorData = 0x44434C52, // 'DCLR'
|
463
|
+
cmsSig14colorData = 0x45434C52, // 'ECLR'
|
464
|
+
cmsSig15colorData = 0x46434C52, // 'FCLR'
|
465
|
+
cmsSigLuvKData = 0x4C75764B // 'LuvK'
|
466
|
+
|
467
|
+
} cmsColorSpaceSignature;
|
468
|
+
|
469
|
+
// ICC Profile Class
|
470
|
+
typedef enum {
|
471
|
+
cmsSigInputClass = 0x73636E72, // 'scnr'
|
472
|
+
cmsSigDisplayClass = 0x6D6E7472, // 'mntr'
|
473
|
+
cmsSigOutputClass = 0x70727472, // 'prtr'
|
474
|
+
cmsSigLinkClass = 0x6C696E6B, // 'link'
|
475
|
+
cmsSigAbstractClass = 0x61627374, // 'abst'
|
476
|
+
cmsSigColorSpaceClass = 0x73706163, // 'spac'
|
477
|
+
cmsSigNamedColorClass = 0x6e6d636c // 'nmcl'
|
478
|
+
|
479
|
+
} cmsProfileClassSignature;
|
480
|
+
|
481
|
+
// ICC Platforms
|
482
|
+
typedef enum {
|
483
|
+
cmsSigMacintosh = 0x4150504C, // 'APPL'
|
484
|
+
cmsSigMicrosoft = 0x4D534654, // 'MSFT'
|
485
|
+
cmsSigSolaris = 0x53554E57, // 'SUNW'
|
486
|
+
cmsSigSGI = 0x53474920, // 'SGI '
|
487
|
+
cmsSigTaligent = 0x54474E54, // 'TGNT'
|
488
|
+
cmsSigUnices = 0x2A6E6978 // '*nix' // From argyll -- Not official
|
489
|
+
|
490
|
+
} cmsPlatformSignature;
|
491
|
+
|
492
|
+
// Reference gamut
|
493
|
+
#define cmsSigPerceptualReferenceMediumGamut 0x70726d67 //'prmg'
|
494
|
+
|
495
|
+
// For cmsSigColorimetricIntentImageStateTag
|
496
|
+
#define cmsSigSceneColorimetryEstimates 0x73636F65 //'scoe'
|
497
|
+
#define cmsSigSceneAppearanceEstimates 0x73617065 //'sape'
|
498
|
+
#define cmsSigFocalPlaneColorimetryEstimates 0x66706365 //'fpce'
|
499
|
+
#define cmsSigReflectionHardcopyOriginalColorimetry 0x72686F63 //'rhoc'
|
500
|
+
#define cmsSigReflectionPrintOutputColorimetry 0x72706F63 //'rpoc'
|
501
|
+
|
502
|
+
// Multi process elements types
|
503
|
+
typedef enum {
|
504
|
+
cmsSigCurveSetElemType = 0x63767374, //'cvst'
|
505
|
+
cmsSigMatrixElemType = 0x6D617466, //'matf'
|
506
|
+
cmsSigCLutElemType = 0x636C7574, //'clut'
|
507
|
+
|
508
|
+
cmsSigBAcsElemType = 0x62414353, // 'bACS'
|
509
|
+
cmsSigEAcsElemType = 0x65414353, // 'eACS'
|
510
|
+
|
511
|
+
// Custom from here, not in the ICC Spec
|
512
|
+
cmsSigXYZ2LabElemType = 0x6C327820, // 'l2x '
|
513
|
+
cmsSigLab2XYZElemType = 0x78326C20, // 'x2l '
|
514
|
+
cmsSigNamedColorElemType = 0x6E636C20, // 'ncl '
|
515
|
+
cmsSigLabV2toV4 = 0x32203420, // '2 4 '
|
516
|
+
cmsSigLabV4toV2 = 0x34203220, // '4 2 '
|
517
|
+
|
518
|
+
// Identities
|
519
|
+
cmsSigIdentityElemType = 0x69646E20, // 'idn '
|
520
|
+
|
521
|
+
// Float to floatPCS
|
522
|
+
cmsSigLab2FloatPCS = 0x64326C20, // 'd2l '
|
523
|
+
cmsSigFloatPCS2Lab = 0x6C326420, // 'l2d '
|
524
|
+
cmsSigXYZ2FloatPCS = 0x64327820, // 'd2x '
|
525
|
+
cmsSigFloatPCS2XYZ = 0x78326420, // 'x2d '
|
526
|
+
cmsSigClipNegativesElemType = 0x636c7020 // 'clp '
|
527
|
+
|
528
|
+
} cmsStageSignature;
|
529
|
+
|
530
|
+
// Types of CurveElements
|
531
|
+
typedef enum {
|
532
|
+
|
533
|
+
cmsSigFormulaCurveSeg = 0x70617266, // 'parf'
|
534
|
+
cmsSigSampledCurveSeg = 0x73616D66, // 'samf'
|
535
|
+
cmsSigSegmentedCurve = 0x63757266 // 'curf'
|
536
|
+
|
537
|
+
} cmsCurveSegSignature;
|
538
|
+
|
539
|
+
// Used in ResponseCurveType
|
540
|
+
#define cmsSigStatusA 0x53746141 //'StaA'
|
541
|
+
#define cmsSigStatusE 0x53746145 //'StaE'
|
542
|
+
#define cmsSigStatusI 0x53746149 //'StaI'
|
543
|
+
#define cmsSigStatusT 0x53746154 //'StaT'
|
544
|
+
#define cmsSigStatusM 0x5374614D //'StaM'
|
545
|
+
#define cmsSigDN 0x444E2020 //'DN '
|
546
|
+
#define cmsSigDNP 0x444E2050 //'DN P'
|
547
|
+
#define cmsSigDNN 0x444E4E20 //'DNN '
|
548
|
+
#define cmsSigDNNP 0x444E4E50 //'DNNP'
|
549
|
+
|
550
|
+
// Device attributes, currently defined values correspond to the low 4 bytes
|
551
|
+
// of the 8 byte attribute quantity
|
552
|
+
#define cmsReflective 0
|
553
|
+
#define cmsTransparency 1
|
554
|
+
#define cmsGlossy 0
|
555
|
+
#define cmsMatte 2
|
556
|
+
|
557
|
+
// Common structures in ICC tags
|
558
|
+
typedef struct {
|
559
|
+
cmsUInt32Number len;
|
560
|
+
cmsUInt32Number flag;
|
561
|
+
cmsUInt8Number data[1];
|
562
|
+
|
563
|
+
} cmsICCData;
|
564
|
+
|
565
|
+
// ICC date time
|
566
|
+
typedef struct {
|
567
|
+
cmsUInt16Number year;
|
568
|
+
cmsUInt16Number month;
|
569
|
+
cmsUInt16Number day;
|
570
|
+
cmsUInt16Number hours;
|
571
|
+
cmsUInt16Number minutes;
|
572
|
+
cmsUInt16Number seconds;
|
573
|
+
|
574
|
+
} cmsDateTimeNumber;
|
575
|
+
|
576
|
+
// ICC XYZ
|
577
|
+
typedef struct {
|
578
|
+
cmsS15Fixed16Number X;
|
579
|
+
cmsS15Fixed16Number Y;
|
580
|
+
cmsS15Fixed16Number Z;
|
581
|
+
|
582
|
+
} cmsEncodedXYZNumber;
|
583
|
+
|
584
|
+
|
585
|
+
// Profile ID as computed by MD5 algorithm
|
586
|
+
typedef union {
|
587
|
+
cmsUInt8Number ID8[16];
|
588
|
+
cmsUInt16Number ID16[8];
|
589
|
+
cmsUInt32Number ID32[4];
|
590
|
+
|
591
|
+
} cmsProfileID;
|
592
|
+
|
593
|
+
|
594
|
+
// ----------------------------------------------------------------------------------------------
|
595
|
+
// ICC profile internal base types. Strictly, shouldn't be declared in this header, but maybe
|
596
|
+
// somebody want to use this info for accessing profile header directly, so here it is.
|
597
|
+
|
598
|
+
// Profile header -- it is 32-bit aligned, so no issues are expected on alignment
|
599
|
+
typedef struct {
|
600
|
+
cmsUInt32Number size; // Profile size in bytes
|
601
|
+
cmsSignature cmmId; // CMM for this profile
|
602
|
+
cmsUInt32Number version; // Format version number
|
603
|
+
cmsProfileClassSignature deviceClass; // Type of profile
|
604
|
+
cmsColorSpaceSignature colorSpace; // Color space of data
|
605
|
+
cmsColorSpaceSignature pcs; // PCS, XYZ or Lab only
|
606
|
+
cmsDateTimeNumber date; // Date profile was created
|
607
|
+
cmsSignature magic; // Magic Number to identify an ICC profile
|
608
|
+
cmsPlatformSignature platform; // Primary Platform
|
609
|
+
cmsUInt32Number flags; // Various bit settings
|
610
|
+
cmsSignature manufacturer; // Device manufacturer
|
611
|
+
cmsUInt32Number model; // Device model number
|
612
|
+
cmsUInt64Number attributes; // Device attributes
|
613
|
+
cmsUInt32Number renderingIntent;// Rendering intent
|
614
|
+
cmsEncodedXYZNumber illuminant; // Profile illuminant
|
615
|
+
cmsSignature creator; // Profile creator
|
616
|
+
cmsProfileID profileID; // Profile ID using MD5
|
617
|
+
cmsInt8Number reserved[28]; // Reserved for future use
|
618
|
+
|
619
|
+
} cmsICCHeader;
|
620
|
+
|
621
|
+
// ICC base tag
|
622
|
+
typedef struct {
|
623
|
+
cmsTagTypeSignature sig;
|
624
|
+
cmsInt8Number reserved[4];
|
625
|
+
|
626
|
+
} cmsTagBase;
|
627
|
+
|
628
|
+
// A tag entry in directory
|
629
|
+
typedef struct {
|
630
|
+
cmsTagSignature sig; // The tag signature
|
631
|
+
cmsUInt32Number offset; // Start of tag
|
632
|
+
cmsUInt32Number size; // Size in bytes
|
633
|
+
|
634
|
+
} cmsTagEntry;
|
635
|
+
|
636
|
+
// ----------------------------------------------------------------------------------------------
|
637
|
+
|
638
|
+
// Little CMS specific typedefs
|
639
|
+
|
640
|
+
typedef void* cmsHANDLE ; // Generic handle
|
641
|
+
typedef void* cmsHPROFILE; // Opaque typedefs to hide internals
|
642
|
+
typedef void* cmsHTRANSFORM;
|
643
|
+
|
644
|
+
#define cmsMAXCHANNELS 16 // Maximum number of channels in ICC profiles
|
645
|
+
|
646
|
+
// Format of pixel is defined by one cmsUInt32Number, using bit fields as follows
|
647
|
+
//
|
648
|
+
// 2 1 0
|
649
|
+
// 3 2 10987 6 5 4 3 2 1 098 7654 321
|
650
|
+
// A O TTTTT U Y F P X S EEE CCCC BBB
|
651
|
+
//
|
652
|
+
// A: Floating point -- With this flag we can differentiate 16 bits as float and as int
|
653
|
+
// O: Optimized -- previous optimization already returns the final 8-bit value
|
654
|
+
// T: Pixeltype
|
655
|
+
// F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
|
656
|
+
// P: Planar? 0=Chunky, 1=Planar
|
657
|
+
// X: swap 16 bps endianess?
|
658
|
+
// S: Do swap? ie, BGR, KYMC
|
659
|
+
// E: Extra samples
|
660
|
+
// C: Channels (Samples per pixel)
|
661
|
+
// B: bytes per sample
|
662
|
+
// Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
|
663
|
+
|
664
|
+
#define FLOAT_SH(a) ((a) << 22)
|
665
|
+
#define OPTIMIZED_SH(s) ((s) << 21)
|
666
|
+
#define COLORSPACE_SH(s) ((s) << 16)
|
667
|
+
#define SWAPFIRST_SH(s) ((s) << 14)
|
668
|
+
#define FLAVOR_SH(s) ((s) << 13)
|
669
|
+
#define PLANAR_SH(p) ((p) << 12)
|
670
|
+
#define ENDIAN16_SH(e) ((e) << 11)
|
671
|
+
#define DOSWAP_SH(e) ((e) << 10)
|
672
|
+
#define EXTRA_SH(e) ((e) << 7)
|
673
|
+
#define CHANNELS_SH(c) ((c) << 3)
|
674
|
+
#define BYTES_SH(b) (b)
|
675
|
+
|
676
|
+
// These macros unpack format specifiers into integers
|
677
|
+
#define T_FLOAT(a) (((a)>>22)&1)
|
678
|
+
#define T_OPTIMIZED(o) (((o)>>21)&1)
|
679
|
+
#define T_COLORSPACE(s) (((s)>>16)&31)
|
680
|
+
#define T_SWAPFIRST(s) (((s)>>14)&1)
|
681
|
+
#define T_FLAVOR(s) (((s)>>13)&1)
|
682
|
+
#define T_PLANAR(p) (((p)>>12)&1)
|
683
|
+
#define T_ENDIAN16(e) (((e)>>11)&1)
|
684
|
+
#define T_DOSWAP(e) (((e)>>10)&1)
|
685
|
+
#define T_EXTRA(e) (((e)>>7)&7)
|
686
|
+
#define T_CHANNELS(c) (((c)>>3)&15)
|
687
|
+
#define T_BYTES(b) ((b)&7)
|
688
|
+
|
689
|
+
|
690
|
+
// Pixel types
|
691
|
+
#define PT_ANY 0 // Don't check colorspace
|
692
|
+
// 1 & 2 are reserved
|
693
|
+
#define PT_GRAY 3
|
694
|
+
#define PT_RGB 4
|
695
|
+
#define PT_CMY 5
|
696
|
+
#define PT_CMYK 6
|
697
|
+
#define PT_YCbCr 7
|
698
|
+
#define PT_YUV 8 // Lu'v'
|
699
|
+
#define PT_XYZ 9
|
700
|
+
#define PT_Lab 10
|
701
|
+
#define PT_YUVK 11 // Lu'v'K
|
702
|
+
#define PT_HSV 12
|
703
|
+
#define PT_HLS 13
|
704
|
+
#define PT_Yxy 14
|
705
|
+
|
706
|
+
#define PT_MCH1 15
|
707
|
+
#define PT_MCH2 16
|
708
|
+
#define PT_MCH3 17
|
709
|
+
#define PT_MCH4 18
|
710
|
+
#define PT_MCH5 19
|
711
|
+
#define PT_MCH6 20
|
712
|
+
#define PT_MCH7 21
|
713
|
+
#define PT_MCH8 22
|
714
|
+
#define PT_MCH9 23
|
715
|
+
#define PT_MCH10 24
|
716
|
+
#define PT_MCH11 25
|
717
|
+
#define PT_MCH12 26
|
718
|
+
#define PT_MCH13 27
|
719
|
+
#define PT_MCH14 28
|
720
|
+
#define PT_MCH15 29
|
721
|
+
|
722
|
+
#define PT_LabV2 30 // Identical to PT_Lab, but using the V2 old encoding
|
723
|
+
|
724
|
+
// Some (not all!) representations
|
725
|
+
|
726
|
+
#ifndef TYPE_RGB_8 // TYPE_RGB_8 is a very common identifier, so don't include ours
|
727
|
+
// if user has it already defined.
|
728
|
+
|
729
|
+
#define TYPE_GRAY_8 (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1))
|
730
|
+
#define TYPE_GRAY_8_REV (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1)|FLAVOR_SH(1))
|
731
|
+
#define TYPE_GRAY_16 (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2))
|
732
|
+
#define TYPE_GRAY_16_REV (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|FLAVOR_SH(1))
|
733
|
+
#define TYPE_GRAY_16_SE (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))
|
734
|
+
#define TYPE_GRAYA_8 (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1))
|
735
|
+
#define TYPE_GRAYA_16 (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2))
|
736
|
+
#define TYPE_GRAYA_16_SE (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))
|
737
|
+
#define TYPE_GRAYA_8_PLANAR (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1)|PLANAR_SH(1))
|
738
|
+
#define TYPE_GRAYA_16_PLANAR (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|PLANAR_SH(1))
|
739
|
+
|
740
|
+
#define TYPE_RGB_8 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1))
|
741
|
+
#define TYPE_RGB_8_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
742
|
+
#define TYPE_BGR_8 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))
|
743
|
+
#define TYPE_BGR_8_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|PLANAR_SH(1))
|
744
|
+
#define TYPE_RGB_16 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2))
|
745
|
+
#define TYPE_RGB_16_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
746
|
+
#define TYPE_RGB_16_SE (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
747
|
+
#define TYPE_BGR_16 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
|
748
|
+
#define TYPE_BGR_16_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))
|
749
|
+
#define TYPE_BGR_16_SE (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
750
|
+
|
751
|
+
#define TYPE_RGBA_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1))
|
752
|
+
#define TYPE_RGBA_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
753
|
+
#define TYPE_RGBA_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))
|
754
|
+
#define TYPE_RGBA_16_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
755
|
+
#define TYPE_RGBA_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
756
|
+
|
757
|
+
#define TYPE_ARGB_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|SWAPFIRST_SH(1))
|
758
|
+
#define TYPE_ARGB_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|SWAPFIRST_SH(1)|PLANAR_SH(1))
|
759
|
+
#define TYPE_ARGB_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|SWAPFIRST_SH(1))
|
760
|
+
|
761
|
+
#define TYPE_ABGR_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))
|
762
|
+
#define TYPE_ABGR_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|PLANAR_SH(1))
|
763
|
+
#define TYPE_ABGR_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
|
764
|
+
#define TYPE_ABGR_16_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))
|
765
|
+
#define TYPE_ABGR_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
766
|
+
|
767
|
+
#define TYPE_BGRA_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
|
768
|
+
#define TYPE_BGRA_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1)|PLANAR_SH(1))
|
769
|
+
#define TYPE_BGRA_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
|
770
|
+
#define TYPE_BGRA_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
|
771
|
+
|
772
|
+
#define TYPE_CMY_8 (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1))
|
773
|
+
#define TYPE_CMY_8_PLANAR (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
774
|
+
#define TYPE_CMY_16 (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2))
|
775
|
+
#define TYPE_CMY_16_PLANAR (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
776
|
+
#define TYPE_CMY_16_SE (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
777
|
+
|
778
|
+
#define TYPE_CMYK_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1))
|
779
|
+
#define TYPE_CMYKA_8 (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1))
|
780
|
+
#define TYPE_CMYK_8_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1))
|
781
|
+
#define TYPE_YUVK_8 TYPE_CMYK_8_REV
|
782
|
+
#define TYPE_CMYK_8_PLANAR (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|PLANAR_SH(1))
|
783
|
+
#define TYPE_CMYK_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2))
|
784
|
+
#define TYPE_CMYK_16_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1))
|
785
|
+
#define TYPE_YUVK_16 TYPE_CMYK_16_REV
|
786
|
+
#define TYPE_CMYK_16_PLANAR (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|PLANAR_SH(1))
|
787
|
+
#define TYPE_CMYK_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1))
|
788
|
+
|
789
|
+
#define TYPE_KYMC_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1))
|
790
|
+
#define TYPE_KYMC_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1))
|
791
|
+
#define TYPE_KYMC_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
792
|
+
|
793
|
+
#define TYPE_KCMY_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|SWAPFIRST_SH(1))
|
794
|
+
#define TYPE_KCMY_8_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1)|SWAPFIRST_SH(1))
|
795
|
+
#define TYPE_KCMY_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|SWAPFIRST_SH(1))
|
796
|
+
#define TYPE_KCMY_16_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1)|SWAPFIRST_SH(1))
|
797
|
+
#define TYPE_KCMY_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1)|SWAPFIRST_SH(1))
|
798
|
+
|
799
|
+
#define TYPE_CMYK5_8 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(1))
|
800
|
+
#define TYPE_CMYK5_16 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2))
|
801
|
+
#define TYPE_CMYK5_16_SE (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|ENDIAN16_SH(1))
|
802
|
+
#define TYPE_KYMC5_8 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(1)|DOSWAP_SH(1))
|
803
|
+
#define TYPE_KYMC5_16 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1))
|
804
|
+
#define TYPE_KYMC5_16_SE (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
805
|
+
#define TYPE_CMYK6_8 (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(1))
|
806
|
+
#define TYPE_CMYK6_8_PLANAR (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(1)|PLANAR_SH(1))
|
807
|
+
#define TYPE_CMYK6_16 (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2))
|
808
|
+
#define TYPE_CMYK6_16_PLANAR (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2)|PLANAR_SH(1))
|
809
|
+
#define TYPE_CMYK6_16_SE (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2)|ENDIAN16_SH(1))
|
810
|
+
#define TYPE_CMYK7_8 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(1))
|
811
|
+
#define TYPE_CMYK7_16 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2))
|
812
|
+
#define TYPE_CMYK7_16_SE (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|ENDIAN16_SH(1))
|
813
|
+
#define TYPE_KYMC7_8 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(1)|DOSWAP_SH(1))
|
814
|
+
#define TYPE_KYMC7_16 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1))
|
815
|
+
#define TYPE_KYMC7_16_SE (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
816
|
+
#define TYPE_CMYK8_8 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(1))
|
817
|
+
#define TYPE_CMYK8_16 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2))
|
818
|
+
#define TYPE_CMYK8_16_SE (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|ENDIAN16_SH(1))
|
819
|
+
#define TYPE_KYMC8_8 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(1)|DOSWAP_SH(1))
|
820
|
+
#define TYPE_KYMC8_16 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1))
|
821
|
+
#define TYPE_KYMC8_16_SE (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
822
|
+
#define TYPE_CMYK9_8 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(1))
|
823
|
+
#define TYPE_CMYK9_16 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2))
|
824
|
+
#define TYPE_CMYK9_16_SE (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|ENDIAN16_SH(1))
|
825
|
+
#define TYPE_KYMC9_8 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(1)|DOSWAP_SH(1))
|
826
|
+
#define TYPE_KYMC9_16 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1))
|
827
|
+
#define TYPE_KYMC9_16_SE (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
828
|
+
#define TYPE_CMYK10_8 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(1))
|
829
|
+
#define TYPE_CMYK10_16 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2))
|
830
|
+
#define TYPE_CMYK10_16_SE (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|ENDIAN16_SH(1))
|
831
|
+
#define TYPE_KYMC10_8 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(1)|DOSWAP_SH(1))
|
832
|
+
#define TYPE_KYMC10_16 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1))
|
833
|
+
#define TYPE_KYMC10_16_SE (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
834
|
+
#define TYPE_CMYK11_8 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(1))
|
835
|
+
#define TYPE_CMYK11_16 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2))
|
836
|
+
#define TYPE_CMYK11_16_SE (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|ENDIAN16_SH(1))
|
837
|
+
#define TYPE_KYMC11_8 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(1)|DOSWAP_SH(1))
|
838
|
+
#define TYPE_KYMC11_16 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1))
|
839
|
+
#define TYPE_KYMC11_16_SE (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
840
|
+
#define TYPE_CMYK12_8 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(1))
|
841
|
+
#define TYPE_CMYK12_16 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2))
|
842
|
+
#define TYPE_CMYK12_16_SE (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|ENDIAN16_SH(1))
|
843
|
+
#define TYPE_KYMC12_8 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(1)|DOSWAP_SH(1))
|
844
|
+
#define TYPE_KYMC12_16 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1))
|
845
|
+
#define TYPE_KYMC12_16_SE (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
|
846
|
+
|
847
|
+
// Colorimetric
|
848
|
+
#define TYPE_XYZ_16 (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(2))
|
849
|
+
#define TYPE_Lab_8 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1))
|
850
|
+
#define TYPE_LabV2_8 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(1))
|
851
|
+
|
852
|
+
#define TYPE_ALab_8 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1))
|
853
|
+
#define TYPE_ALabV2_8 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1))
|
854
|
+
#define TYPE_Lab_16 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2))
|
855
|
+
#define TYPE_LabV2_16 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(2))
|
856
|
+
#define TYPE_Yxy_16 (COLORSPACE_SH(PT_Yxy)|CHANNELS_SH(3)|BYTES_SH(2))
|
857
|
+
|
858
|
+
// YCbCr
|
859
|
+
#define TYPE_YCbCr_8 (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1))
|
860
|
+
#define TYPE_YCbCr_8_PLANAR (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
861
|
+
#define TYPE_YCbCr_16 (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2))
|
862
|
+
#define TYPE_YCbCr_16_PLANAR (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
863
|
+
#define TYPE_YCbCr_16_SE (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
864
|
+
|
865
|
+
// YUV
|
866
|
+
#define TYPE_YUV_8 (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1))
|
867
|
+
#define TYPE_YUV_8_PLANAR (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
868
|
+
#define TYPE_YUV_16 (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2))
|
869
|
+
#define TYPE_YUV_16_PLANAR (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
870
|
+
#define TYPE_YUV_16_SE (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
871
|
+
|
872
|
+
// HLS
|
873
|
+
#define TYPE_HLS_8 (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1))
|
874
|
+
#define TYPE_HLS_8_PLANAR (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
875
|
+
#define TYPE_HLS_16 (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2))
|
876
|
+
#define TYPE_HLS_16_PLANAR (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
877
|
+
#define TYPE_HLS_16_SE (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
878
|
+
|
879
|
+
// HSV
|
880
|
+
#define TYPE_HSV_8 (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1))
|
881
|
+
#define TYPE_HSV_8_PLANAR (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
|
882
|
+
#define TYPE_HSV_16 (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2))
|
883
|
+
#define TYPE_HSV_16_PLANAR (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
|
884
|
+
#define TYPE_HSV_16_SE (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
|
885
|
+
|
886
|
+
// Named color index. Only 16 bits allowed (don't check colorspace)
|
887
|
+
#define TYPE_NAMED_COLOR_INDEX (CHANNELS_SH(1)|BYTES_SH(2))
|
888
|
+
|
889
|
+
// Float formatters.
|
890
|
+
#define TYPE_XYZ_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(4))
|
891
|
+
#define TYPE_Lab_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(4))
|
892
|
+
#define TYPE_LabA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))
|
893
|
+
#define TYPE_GRAY_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(4))
|
894
|
+
#define TYPE_RGB_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4))
|
895
|
+
|
896
|
+
#define TYPE_RGBA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))
|
897
|
+
#define TYPE_ARGB_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|SWAPFIRST_SH(1))
|
898
|
+
#define TYPE_BGR_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))
|
899
|
+
#define TYPE_BGRA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
|
900
|
+
#define TYPE_ABGR_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))
|
901
|
+
|
902
|
+
#define TYPE_CMYK_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(4))
|
903
|
+
|
904
|
+
// Floating point formatters.
|
905
|
+
// NOTE THAT 'BYTES' FIELD IS SET TO ZERO ON DLB because 8 bytes overflows the bitfield
|
906
|
+
#define TYPE_XYZ_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(0))
|
907
|
+
#define TYPE_Lab_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(0))
|
908
|
+
#define TYPE_GRAY_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(0))
|
909
|
+
#define TYPE_RGB_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0))
|
910
|
+
#define TYPE_BGR_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0)|DOSWAP_SH(1))
|
911
|
+
#define TYPE_CMYK_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(0))
|
912
|
+
|
913
|
+
// IEEE 754-2008 "half"
|
914
|
+
#define TYPE_GRAY_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2))
|
915
|
+
#define TYPE_RGB_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2))
|
916
|
+
#define TYPE_RGBA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))
|
917
|
+
#define TYPE_CMYK_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2))
|
918
|
+
|
919
|
+
#define TYPE_RGBA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))
|
920
|
+
#define TYPE_ARGB_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|SWAPFIRST_SH(1))
|
921
|
+
#define TYPE_BGR_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
|
922
|
+
#define TYPE_BGRA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
|
923
|
+
#define TYPE_ABGR_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
|
924
|
+
|
925
|
+
#endif
|
926
|
+
|
927
|
+
// Colorspaces
|
928
|
+
typedef struct {
|
929
|
+
cmsFloat64Number X;
|
930
|
+
cmsFloat64Number Y;
|
931
|
+
cmsFloat64Number Z;
|
932
|
+
|
933
|
+
} cmsCIEXYZ;
|
934
|
+
|
935
|
+
typedef struct {
|
936
|
+
cmsFloat64Number x;
|
937
|
+
cmsFloat64Number y;
|
938
|
+
cmsFloat64Number Y;
|
939
|
+
|
940
|
+
} cmsCIExyY;
|
941
|
+
|
942
|
+
typedef struct {
|
943
|
+
cmsFloat64Number L;
|
944
|
+
cmsFloat64Number a;
|
945
|
+
cmsFloat64Number b;
|
946
|
+
|
947
|
+
} cmsCIELab;
|
948
|
+
|
949
|
+
typedef struct {
|
950
|
+
cmsFloat64Number L;
|
951
|
+
cmsFloat64Number C;
|
952
|
+
cmsFloat64Number h;
|
953
|
+
|
954
|
+
} cmsCIELCh;
|
955
|
+
|
956
|
+
typedef struct {
|
957
|
+
cmsFloat64Number J;
|
958
|
+
cmsFloat64Number C;
|
959
|
+
cmsFloat64Number h;
|
960
|
+
|
961
|
+
} cmsJCh;
|
962
|
+
|
963
|
+
typedef struct {
|
964
|
+
cmsCIEXYZ Red;
|
965
|
+
cmsCIEXYZ Green;
|
966
|
+
cmsCIEXYZ Blue;
|
967
|
+
|
968
|
+
} cmsCIEXYZTRIPLE;
|
969
|
+
|
970
|
+
typedef struct {
|
971
|
+
cmsCIExyY Red;
|
972
|
+
cmsCIExyY Green;
|
973
|
+
cmsCIExyY Blue;
|
974
|
+
|
975
|
+
} cmsCIExyYTRIPLE;
|
976
|
+
|
977
|
+
// Illuminant types for structs below
|
978
|
+
#define cmsILLUMINANT_TYPE_UNKNOWN 0x0000000
|
979
|
+
#define cmsILLUMINANT_TYPE_D50 0x0000001
|
980
|
+
#define cmsILLUMINANT_TYPE_D65 0x0000002
|
981
|
+
#define cmsILLUMINANT_TYPE_D93 0x0000003
|
982
|
+
#define cmsILLUMINANT_TYPE_F2 0x0000004
|
983
|
+
#define cmsILLUMINANT_TYPE_D55 0x0000005
|
984
|
+
#define cmsILLUMINANT_TYPE_A 0x0000006
|
985
|
+
#define cmsILLUMINANT_TYPE_E 0x0000007
|
986
|
+
#define cmsILLUMINANT_TYPE_F8 0x0000008
|
987
|
+
|
988
|
+
typedef struct {
|
989
|
+
cmsUInt32Number Observer; // 0 = unknown, 1=CIE 1931, 2=CIE 1964
|
990
|
+
cmsCIEXYZ Backing; // Value of backing
|
991
|
+
cmsUInt32Number Geometry; // 0=unknown, 1=45/0, 0/45 2=0d, d/0
|
992
|
+
cmsFloat64Number Flare; // 0..1.0
|
993
|
+
cmsUInt32Number IlluminantType;
|
994
|
+
|
995
|
+
} cmsICCMeasurementConditions;
|
996
|
+
|
997
|
+
typedef struct {
|
998
|
+
cmsCIEXYZ IlluminantXYZ; // Not the same struct as CAM02,
|
999
|
+
cmsCIEXYZ SurroundXYZ; // This is for storing the tag
|
1000
|
+
cmsUInt32Number IlluminantType; // viewing condition
|
1001
|
+
|
1002
|
+
} cmsICCViewingConditions;
|
1003
|
+
|
1004
|
+
// Get LittleCMS version (for shared objects) -----------------------------------------------------------------------------
|
1005
|
+
|
1006
|
+
CMSAPI int CMSEXPORT cmsGetEncodedCMMversion(void);
|
1007
|
+
|
1008
|
+
// Support of non-standard functions --------------------------------------------------------------------------------------
|
1009
|
+
|
1010
|
+
CMSAPI int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2);
|
1011
|
+
CMSAPI long int CMSEXPORT cmsfilelength(FILE* f);
|
1012
|
+
|
1013
|
+
|
1014
|
+
// Context handling --------------------------------------------------------------------------------------------------------
|
1015
|
+
|
1016
|
+
// Each context holds its owns globals and its own plug-ins. There is a global context with the id = 0 for lecacy compatibility
|
1017
|
+
// though using the global context is not recomended. Proper context handling makes lcms more thread-safe.
|
1018
|
+
|
1019
|
+
typedef struct _cmsContext_struct* cmsContext;
|
1020
|
+
|
1021
|
+
CMSAPI cmsContext CMSEXPORT cmsCreateContext(void* Plugin, void* UserData);
|
1022
|
+
CMSAPI void CMSEXPORT cmsDeleteContext(cmsContext ContexID);
|
1023
|
+
CMSAPI cmsContext CMSEXPORT cmsDupContext(cmsContext ContextID, void* NewUserData);
|
1024
|
+
CMSAPI void* CMSEXPORT cmsGetContextUserData(cmsContext ContextID);
|
1025
|
+
|
1026
|
+
// Plug-In registering --------------------------------------------------------------------------------------------------
|
1027
|
+
|
1028
|
+
CMSAPI cmsBool CMSEXPORT cmsPlugin(void* Plugin);
|
1029
|
+
CMSAPI cmsBool CMSEXPORT cmsPluginTHR(cmsContext ContextID, void* Plugin);
|
1030
|
+
CMSAPI void CMSEXPORT cmsUnregisterPlugins(void);
|
1031
|
+
CMSAPI void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID);
|
1032
|
+
|
1033
|
+
// Error logging ----------------------------------------------------------------------------------------------------------
|
1034
|
+
|
1035
|
+
// There is no error handling at all. When a function fails, it returns proper value.
|
1036
|
+
// For example, all create functions does return NULL on failure. Other may return FALSE.
|
1037
|
+
// It may be interesting, for the developer, to know why the function is failing.
|
1038
|
+
// for that reason, lcms2 does offer a logging function. This function will get
|
1039
|
+
// an ENGLISH string with some clues on what is going wrong. You can show this
|
1040
|
+
// info to the end user if you wish, or just create some sort of log on disk.
|
1041
|
+
// The logging function should NOT terminate the program, as this obviously can leave
|
1042
|
+
// unfreed resources. It is the programmer's responsibility to check each function
|
1043
|
+
// return code to make sure it didn't fail.
|
1044
|
+
|
1045
|
+
#define cmsERROR_UNDEFINED 0
|
1046
|
+
#define cmsERROR_FILE 1
|
1047
|
+
#define cmsERROR_RANGE 2
|
1048
|
+
#define cmsERROR_INTERNAL 3
|
1049
|
+
#define cmsERROR_NULL 4
|
1050
|
+
#define cmsERROR_READ 5
|
1051
|
+
#define cmsERROR_SEEK 6
|
1052
|
+
#define cmsERROR_WRITE 7
|
1053
|
+
#define cmsERROR_UNKNOWN_EXTENSION 8
|
1054
|
+
#define cmsERROR_COLORSPACE_CHECK 9
|
1055
|
+
#define cmsERROR_ALREADY_DEFINED 10
|
1056
|
+
#define cmsERROR_BAD_SIGNATURE 11
|
1057
|
+
#define cmsERROR_CORRUPTION_DETECTED 12
|
1058
|
+
#define cmsERROR_NOT_SUITABLE 13
|
1059
|
+
|
1060
|
+
// Error logger is called with the ContextID when a message is raised. This gives the
|
1061
|
+
// chance to know which thread is responsible of the warning and any environment associated
|
1062
|
+
// with it. Non-multithreading applications may safely ignore this parameter.
|
1063
|
+
// Note that under certain special circumstances, ContextID may be NULL.
|
1064
|
+
typedef void (* cmsLogErrorHandlerFunction)(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text);
|
1065
|
+
|
1066
|
+
// Allows user to set any specific logger
|
1067
|
+
CMSAPI void CMSEXPORT cmsSetLogErrorHandler(cmsLogErrorHandlerFunction Fn);
|
1068
|
+
CMSAPI void CMSEXPORT cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandlerFunction Fn);
|
1069
|
+
|
1070
|
+
// Conversions --------------------------------------------------------------------------------------------------------------
|
1071
|
+
|
1072
|
+
// Returns pointers to constant structs
|
1073
|
+
CMSAPI const cmsCIEXYZ* CMSEXPORT cmsD50_XYZ(void);
|
1074
|
+
CMSAPI const cmsCIExyY* CMSEXPORT cmsD50_xyY(void);
|
1075
|
+
|
1076
|
+
// Colorimetric space conversions
|
1077
|
+
CMSAPI void CMSEXPORT cmsXYZ2xyY(cmsCIExyY* Dest, const cmsCIEXYZ* Source);
|
1078
|
+
CMSAPI void CMSEXPORT cmsxyY2XYZ(cmsCIEXYZ* Dest, const cmsCIExyY* Source);
|
1079
|
+
CMSAPI void CMSEXPORT cmsXYZ2Lab(const cmsCIEXYZ* WhitePoint, cmsCIELab* Lab, const cmsCIEXYZ* xyz);
|
1080
|
+
CMSAPI void CMSEXPORT cmsLab2XYZ(const cmsCIEXYZ* WhitePoint, cmsCIEXYZ* xyz, const cmsCIELab* Lab);
|
1081
|
+
CMSAPI void CMSEXPORT cmsLab2LCh(cmsCIELCh*LCh, const cmsCIELab* Lab);
|
1082
|
+
CMSAPI void CMSEXPORT cmsLCh2Lab(cmsCIELab* Lab, const cmsCIELCh* LCh);
|
1083
|
+
|
1084
|
+
// Encoding /Decoding on PCS
|
1085
|
+
CMSAPI void CMSEXPORT cmsLabEncoded2Float(cmsCIELab* Lab, const cmsUInt16Number wLab[3]);
|
1086
|
+
CMSAPI void CMSEXPORT cmsLabEncoded2FloatV2(cmsCIELab* Lab, const cmsUInt16Number wLab[3]);
|
1087
|
+
CMSAPI void CMSEXPORT cmsFloat2LabEncoded(cmsUInt16Number wLab[3], const cmsCIELab* Lab);
|
1088
|
+
CMSAPI void CMSEXPORT cmsFloat2LabEncodedV2(cmsUInt16Number wLab[3], const cmsCIELab* Lab);
|
1089
|
+
CMSAPI void CMSEXPORT cmsXYZEncoded2Float(cmsCIEXYZ* fxyz, const cmsUInt16Number XYZ[3]);
|
1090
|
+
CMSAPI void CMSEXPORT cmsFloat2XYZEncoded(cmsUInt16Number XYZ[3], const cmsCIEXYZ* fXYZ);
|
1091
|
+
|
1092
|
+
// DeltaE metrics
|
1093
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsDeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);
|
1094
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsCIE94DeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);
|
1095
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsBFDdeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);
|
1096
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsCMCdeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2, cmsFloat64Number l, cmsFloat64Number c);
|
1097
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsCIE2000DeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2, cmsFloat64Number Kl, cmsFloat64Number Kc, cmsFloat64Number Kh);
|
1098
|
+
|
1099
|
+
// Temperature <-> Chromaticity (Black body)
|
1100
|
+
CMSAPI cmsBool CMSEXPORT cmsWhitePointFromTemp(cmsCIExyY* WhitePoint, cmsFloat64Number TempK);
|
1101
|
+
CMSAPI cmsBool CMSEXPORT cmsTempFromWhitePoint(cmsFloat64Number* TempK, const cmsCIExyY* WhitePoint);
|
1102
|
+
|
1103
|
+
// Chromatic adaptation
|
1104
|
+
CMSAPI cmsBool CMSEXPORT cmsAdaptToIlluminant(cmsCIEXYZ* Result, const cmsCIEXYZ* SourceWhitePt,
|
1105
|
+
const cmsCIEXYZ* Illuminant,
|
1106
|
+
const cmsCIEXYZ* Value);
|
1107
|
+
|
1108
|
+
// CIECAM02 ---------------------------------------------------------------------------------------------------
|
1109
|
+
|
1110
|
+
// Viewing conditions. Please note those are CAM model viewing conditions, and not the ICC tag viewing
|
1111
|
+
// conditions, which I'm naming cmsICCViewingConditions to make differences evident. Unfortunately, the tag
|
1112
|
+
// cannot deal with surround La, Yb and D value so is basically useless to store CAM02 viewing conditions.
|
1113
|
+
|
1114
|
+
|
1115
|
+
#define AVG_SURROUND 1
|
1116
|
+
#define DIM_SURROUND 2
|
1117
|
+
#define DARK_SURROUND 3
|
1118
|
+
#define CUTSHEET_SURROUND 4
|
1119
|
+
|
1120
|
+
#define D_CALCULATE (-1)
|
1121
|
+
|
1122
|
+
typedef struct {
|
1123
|
+
cmsCIEXYZ whitePoint;
|
1124
|
+
cmsFloat64Number Yb;
|
1125
|
+
cmsFloat64Number La;
|
1126
|
+
int surround;
|
1127
|
+
cmsFloat64Number D_value;
|
1128
|
+
|
1129
|
+
} cmsViewingConditions;
|
1130
|
+
|
1131
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsCIECAM02Init(cmsContext ContextID, const cmsViewingConditions* pVC);
|
1132
|
+
CMSAPI void CMSEXPORT cmsCIECAM02Done(cmsHANDLE hModel);
|
1133
|
+
CMSAPI void CMSEXPORT cmsCIECAM02Forward(cmsHANDLE hModel, const cmsCIEXYZ* pIn, cmsJCh* pOut);
|
1134
|
+
CMSAPI void CMSEXPORT cmsCIECAM02Reverse(cmsHANDLE hModel, const cmsJCh* pIn, cmsCIEXYZ* pOut);
|
1135
|
+
|
1136
|
+
|
1137
|
+
// Tone curves -----------------------------------------------------------------------------------------
|
1138
|
+
|
1139
|
+
// This describes a curve segment. For a table of supported types, see the manual. User can increase the number of
|
1140
|
+
// available types by using a proper plug-in. Parametric segments allow 10 parameters at most
|
1141
|
+
|
1142
|
+
typedef struct {
|
1143
|
+
cmsFloat32Number x0, x1; // Domain; for x0 < x <= x1
|
1144
|
+
cmsInt32Number Type; // Parametric type, Type == 0 means sampled segment. Negative values are reserved
|
1145
|
+
cmsFloat64Number Params[10]; // Parameters if Type != 0
|
1146
|
+
cmsUInt32Number nGridPoints; // Number of grid points if Type == 0
|
1147
|
+
cmsFloat32Number* SampledPoints; // Points to an array of floats if Type == 0
|
1148
|
+
|
1149
|
+
} cmsCurveSegment;
|
1150
|
+
|
1151
|
+
// The internal representation is none of your business.
|
1152
|
+
typedef struct _cms_curve_struct cmsToneCurve;
|
1153
|
+
|
1154
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsBuildSegmentedToneCurve(cmsContext ContextID, cmsInt32Number nSegments, const cmsCurveSegment Segments[]);
|
1155
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsBuildParametricToneCurve(cmsContext ContextID, cmsInt32Number Type, const cmsFloat64Number Params[]);
|
1156
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsBuildGamma(cmsContext ContextID, cmsFloat64Number Gamma);
|
1157
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurve16(cmsContext ContextID, cmsInt32Number nEntries, const cmsUInt16Number values[]);
|
1158
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cmsUInt32Number nEntries, const cmsFloat32Number values[]);
|
1159
|
+
CMSAPI void CMSEXPORT cmsFreeToneCurve(cmsToneCurve* Curve);
|
1160
|
+
CMSAPI void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3]);
|
1161
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsDupToneCurve(const cmsToneCurve* Src);
|
1162
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsReverseToneCurve(const cmsToneCurve* InGamma);
|
1163
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsReverseToneCurveEx(cmsInt32Number nResultSamples, const cmsToneCurve* InGamma);
|
1164
|
+
CMSAPI cmsToneCurve* CMSEXPORT cmsJoinToneCurve(cmsContext ContextID, const cmsToneCurve* X, const cmsToneCurve* Y, cmsUInt32Number nPoints);
|
1165
|
+
CMSAPI cmsBool CMSEXPORT cmsSmoothToneCurve(cmsToneCurve* Tab, cmsFloat64Number lambda);
|
1166
|
+
CMSAPI cmsFloat32Number CMSEXPORT cmsEvalToneCurveFloat(const cmsToneCurve* Curve, cmsFloat32Number v);
|
1167
|
+
CMSAPI cmsUInt16Number CMSEXPORT cmsEvalToneCurve16(const cmsToneCurve* Curve, cmsUInt16Number v);
|
1168
|
+
CMSAPI cmsBool CMSEXPORT cmsIsToneCurveMultisegment(const cmsToneCurve* InGamma);
|
1169
|
+
CMSAPI cmsBool CMSEXPORT cmsIsToneCurveLinear(const cmsToneCurve* Curve);
|
1170
|
+
CMSAPI cmsBool CMSEXPORT cmsIsToneCurveMonotonic(const cmsToneCurve* t);
|
1171
|
+
CMSAPI cmsBool CMSEXPORT cmsIsToneCurveDescending(const cmsToneCurve* t);
|
1172
|
+
CMSAPI cmsInt32Number CMSEXPORT cmsGetToneCurveParametricType(const cmsToneCurve* t);
|
1173
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsEstimateGamma(const cmsToneCurve* t, cmsFloat64Number Precision);
|
1174
|
+
|
1175
|
+
// Tone curve tabular estimation
|
1176
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetToneCurveEstimatedTableEntries(const cmsToneCurve* t);
|
1177
|
+
CMSAPI const cmsUInt16Number* CMSEXPORT cmsGetToneCurveEstimatedTable(const cmsToneCurve* t);
|
1178
|
+
|
1179
|
+
|
1180
|
+
// Implements pipelines of multi-processing elements -------------------------------------------------------------
|
1181
|
+
|
1182
|
+
// Nothing to see here, move along
|
1183
|
+
typedef struct _cmsPipeline_struct cmsPipeline;
|
1184
|
+
typedef struct _cmsStage_struct cmsStage;
|
1185
|
+
|
1186
|
+
// Those are hi-level pipelines
|
1187
|
+
CMSAPI cmsPipeline* CMSEXPORT cmsPipelineAlloc(cmsContext ContextID, cmsUInt32Number InputChannels, cmsUInt32Number OutputChannels);
|
1188
|
+
CMSAPI void CMSEXPORT cmsPipelineFree(cmsPipeline* lut);
|
1189
|
+
CMSAPI cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* Orig);
|
1190
|
+
|
1191
|
+
CMSAPI cmsContext CMSEXPORT cmsGetPipelineContextID(const cmsPipeline* lut);
|
1192
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineInputChannels(const cmsPipeline* lut);
|
1193
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineOutputChannels(const cmsPipeline* lut);
|
1194
|
+
|
1195
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineStageCount(const cmsPipeline* lut);
|
1196
|
+
CMSAPI cmsStage* CMSEXPORT cmsPipelineGetPtrToFirstStage(const cmsPipeline* lut);
|
1197
|
+
CMSAPI cmsStage* CMSEXPORT cmsPipelineGetPtrToLastStage(const cmsPipeline* lut);
|
1198
|
+
|
1199
|
+
CMSAPI void CMSEXPORT cmsPipelineEval16(const cmsUInt16Number In[], cmsUInt16Number Out[], const cmsPipeline* lut);
|
1200
|
+
CMSAPI void CMSEXPORT cmsPipelineEvalFloat(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsPipeline* lut);
|
1201
|
+
CMSAPI cmsBool CMSEXPORT cmsPipelineEvalReverseFloat(cmsFloat32Number Target[], cmsFloat32Number Result[], cmsFloat32Number Hint[], const cmsPipeline* lut);
|
1202
|
+
CMSAPI cmsBool CMSEXPORT cmsPipelineCat(cmsPipeline* l1, const cmsPipeline* l2);
|
1203
|
+
CMSAPI cmsBool CMSEXPORT cmsPipelineSetSaveAs8bitsFlag(cmsPipeline* lut, cmsBool On);
|
1204
|
+
|
1205
|
+
// Where to place/locate the stages in the pipeline chain
|
1206
|
+
typedef enum { cmsAT_BEGIN, cmsAT_END } cmsStageLoc;
|
1207
|
+
|
1208
|
+
CMSAPI int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe);
|
1209
|
+
CMSAPI void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage** mpe);
|
1210
|
+
|
1211
|
+
// This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements
|
1212
|
+
// that conform the Pipeline. It should be called with the Pipeline, the number of expected elements and
|
1213
|
+
// then a list of expected types followed with a list of double pointers to Stage elements. If
|
1214
|
+
// the function founds a match with current pipeline, it fills the pointers and returns TRUE
|
1215
|
+
// if not, returns FALSE without touching anything.
|
1216
|
+
CMSAPI cmsBool CMSEXPORT cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, cmsUInt32Number n, ...);
|
1217
|
+
|
1218
|
+
// Matrix has double precision and CLUT has only float precision. That is because an ICC profile can encode
|
1219
|
+
// matrices with far more precision that CLUTS
|
1220
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocIdentity(cmsContext ContextID, cmsUInt32Number nChannels);
|
1221
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Number nChannels, cmsToneCurve* const Curves[]);
|
1222
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number Rows, cmsUInt32Number Cols, const cmsFloat64Number* Matrix, const cmsFloat64Number* Offset);
|
1223
|
+
|
1224
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLut16bit(cmsContext ContextID, cmsUInt32Number nGridPoints, cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsUInt16Number* Table);
|
1225
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLutFloat(cmsContext ContextID, cmsUInt32Number nGridPoints, cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsFloat32Number* Table);
|
1226
|
+
|
1227
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID, const cmsUInt32Number clutPoints[], cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsUInt16Number* Table);
|
1228
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const cmsUInt32Number clutPoints[], cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsFloat32Number* Table);
|
1229
|
+
|
1230
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageDup(cmsStage* mpe);
|
1231
|
+
CMSAPI void CMSEXPORT cmsStageFree(cmsStage* mpe);
|
1232
|
+
CMSAPI cmsStage* CMSEXPORT cmsStageNext(const cmsStage* mpe);
|
1233
|
+
|
1234
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsStageInputChannels(const cmsStage* mpe);
|
1235
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsStageOutputChannels(const cmsStage* mpe);
|
1236
|
+
CMSAPI cmsStageSignature CMSEXPORT cmsStageType(const cmsStage* mpe);
|
1237
|
+
CMSAPI void* CMSEXPORT cmsStageData(const cmsStage* mpe);
|
1238
|
+
|
1239
|
+
// Sampling
|
1240
|
+
typedef cmsInt32Number (* cmsSAMPLER16) (register const cmsUInt16Number In[],
|
1241
|
+
register cmsUInt16Number Out[],
|
1242
|
+
register void * Cargo);
|
1243
|
+
|
1244
|
+
typedef cmsInt32Number (* cmsSAMPLERFLOAT)(register const cmsFloat32Number In[],
|
1245
|
+
register cmsFloat32Number Out[],
|
1246
|
+
register void * Cargo);
|
1247
|
+
|
1248
|
+
// Use this flag to prevent changes being written to destination
|
1249
|
+
#define SAMPLER_INSPECT 0x01000000
|
1250
|
+
|
1251
|
+
// For CLUT only
|
1252
|
+
CMSAPI cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, void* Cargo, cmsUInt32Number dwFlags);
|
1253
|
+
CMSAPI cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler, void* Cargo, cmsUInt32Number dwFlags);
|
1254
|
+
|
1255
|
+
// Slicers
|
1256
|
+
CMSAPI cmsBool CMSEXPORT cmsSliceSpace16(cmsUInt32Number nInputs, const cmsUInt32Number clutPoints[],
|
1257
|
+
cmsSAMPLER16 Sampler, void * Cargo);
|
1258
|
+
|
1259
|
+
CMSAPI cmsBool CMSEXPORT cmsSliceSpaceFloat(cmsUInt32Number nInputs, const cmsUInt32Number clutPoints[],
|
1260
|
+
cmsSAMPLERFLOAT Sampler, void * Cargo);
|
1261
|
+
|
1262
|
+
// Multilocalized Unicode management ---------------------------------------------------------------------------------------
|
1263
|
+
|
1264
|
+
typedef struct _cms_MLU_struct cmsMLU;
|
1265
|
+
|
1266
|
+
#define cmsNoLanguage "\0\0"
|
1267
|
+
#define cmsNoCountry "\0\0"
|
1268
|
+
|
1269
|
+
CMSAPI cmsMLU* CMSEXPORT cmsMLUalloc(cmsContext ContextID, cmsUInt32Number nItems);
|
1270
|
+
CMSAPI void CMSEXPORT cmsMLUfree(cmsMLU* mlu);
|
1271
|
+
CMSAPI cmsMLU* CMSEXPORT cmsMLUdup(const cmsMLU* mlu);
|
1272
|
+
|
1273
|
+
CMSAPI cmsBool CMSEXPORT cmsMLUsetASCII(cmsMLU* mlu,
|
1274
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1275
|
+
const char* ASCIIString);
|
1276
|
+
CMSAPI cmsBool CMSEXPORT cmsMLUsetWide(cmsMLU* mlu,
|
1277
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1278
|
+
const wchar_t* WideString);
|
1279
|
+
|
1280
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetASCII(const cmsMLU* mlu,
|
1281
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1282
|
+
char* Buffer, cmsUInt32Number BufferSize);
|
1283
|
+
|
1284
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetWide(const cmsMLU* mlu,
|
1285
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1286
|
+
wchar_t* Buffer, cmsUInt32Number BufferSize);
|
1287
|
+
|
1288
|
+
CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(const cmsMLU* mlu,
|
1289
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1290
|
+
char ObtainedLanguage[3], char ObtainedCountry[3]);
|
1291
|
+
|
1292
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsMLUtranslationsCount(const cmsMLU* mlu);
|
1293
|
+
|
1294
|
+
CMSAPI cmsBool CMSEXPORT cmsMLUtranslationsCodes(const cmsMLU* mlu,
|
1295
|
+
cmsUInt32Number idx,
|
1296
|
+
char LanguageCode[3],
|
1297
|
+
char CountryCode[3]);
|
1298
|
+
|
1299
|
+
// Undercolorremoval & black generation -------------------------------------------------------------------------------------
|
1300
|
+
|
1301
|
+
typedef struct {
|
1302
|
+
cmsToneCurve* Ucr;
|
1303
|
+
cmsToneCurve* Bg;
|
1304
|
+
cmsMLU* Desc;
|
1305
|
+
|
1306
|
+
} cmsUcrBg;
|
1307
|
+
|
1308
|
+
// Screening ----------------------------------------------------------------------------------------------------------------
|
1309
|
+
|
1310
|
+
#define cmsPRINTER_DEFAULT_SCREENS 0x0001
|
1311
|
+
#define cmsFREQUENCE_UNITS_LINES_CM 0x0000
|
1312
|
+
#define cmsFREQUENCE_UNITS_LINES_INCH 0x0002
|
1313
|
+
|
1314
|
+
#define cmsSPOT_UNKNOWN 0
|
1315
|
+
#define cmsSPOT_PRINTER_DEFAULT 1
|
1316
|
+
#define cmsSPOT_ROUND 2
|
1317
|
+
#define cmsSPOT_DIAMOND 3
|
1318
|
+
#define cmsSPOT_ELLIPSE 4
|
1319
|
+
#define cmsSPOT_LINE 5
|
1320
|
+
#define cmsSPOT_SQUARE 6
|
1321
|
+
#define cmsSPOT_CROSS 7
|
1322
|
+
|
1323
|
+
typedef struct {
|
1324
|
+
cmsFloat64Number Frequency;
|
1325
|
+
cmsFloat64Number ScreenAngle;
|
1326
|
+
cmsUInt32Number SpotShape;
|
1327
|
+
|
1328
|
+
} cmsScreeningChannel;
|
1329
|
+
|
1330
|
+
typedef struct {
|
1331
|
+
cmsUInt32Number Flag;
|
1332
|
+
cmsUInt32Number nChannels;
|
1333
|
+
cmsScreeningChannel Channels[cmsMAXCHANNELS];
|
1334
|
+
|
1335
|
+
} cmsScreening;
|
1336
|
+
|
1337
|
+
|
1338
|
+
// Named color -----------------------------------------------------------------------------------------------------------------
|
1339
|
+
|
1340
|
+
typedef struct _cms_NAMEDCOLORLIST_struct cmsNAMEDCOLORLIST;
|
1341
|
+
|
1342
|
+
CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID,
|
1343
|
+
cmsUInt32Number n,
|
1344
|
+
cmsUInt32Number ColorantCount,
|
1345
|
+
const char* Prefix, const char* Suffix);
|
1346
|
+
|
1347
|
+
CMSAPI void CMSEXPORT cmsFreeNamedColorList(cmsNAMEDCOLORLIST* v);
|
1348
|
+
CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsDupNamedColorList(const cmsNAMEDCOLORLIST* v);
|
1349
|
+
CMSAPI cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* v, const char* Name,
|
1350
|
+
cmsUInt16Number PCS[3],
|
1351
|
+
cmsUInt16Number Colorant[cmsMAXCHANNELS]);
|
1352
|
+
|
1353
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsNamedColorCount(const cmsNAMEDCOLORLIST* v);
|
1354
|
+
CMSAPI cmsInt32Number CMSEXPORT cmsNamedColorIndex(const cmsNAMEDCOLORLIST* v, const char* Name);
|
1355
|
+
|
1356
|
+
CMSAPI cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cmsUInt32Number nColor,
|
1357
|
+
char* Name,
|
1358
|
+
char* Prefix,
|
1359
|
+
char* Suffix,
|
1360
|
+
cmsUInt16Number* PCS,
|
1361
|
+
cmsUInt16Number* Colorant);
|
1362
|
+
|
1363
|
+
// Retrieve named color list from transform
|
1364
|
+
CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsGetNamedColorList(cmsHTRANSFORM xform);
|
1365
|
+
|
1366
|
+
// Profile sequence -----------------------------------------------------------------------------------------------------
|
1367
|
+
|
1368
|
+
// Profile sequence descriptor. Some fields come from profile sequence descriptor tag, others
|
1369
|
+
// come from Profile Sequence Identifier Tag
|
1370
|
+
typedef struct {
|
1371
|
+
|
1372
|
+
cmsSignature deviceMfg;
|
1373
|
+
cmsSignature deviceModel;
|
1374
|
+
cmsUInt64Number attributes;
|
1375
|
+
cmsTechnologySignature technology;
|
1376
|
+
cmsProfileID ProfileID;
|
1377
|
+
cmsMLU* Manufacturer;
|
1378
|
+
cmsMLU* Model;
|
1379
|
+
cmsMLU* Description;
|
1380
|
+
|
1381
|
+
} cmsPSEQDESC;
|
1382
|
+
|
1383
|
+
typedef struct {
|
1384
|
+
|
1385
|
+
cmsUInt32Number n;
|
1386
|
+
cmsContext ContextID;
|
1387
|
+
cmsPSEQDESC* seq;
|
1388
|
+
|
1389
|
+
} cmsSEQ;
|
1390
|
+
|
1391
|
+
CMSAPI cmsSEQ* CMSEXPORT cmsAllocProfileSequenceDescription(cmsContext ContextID, cmsUInt32Number n);
|
1392
|
+
CMSAPI cmsSEQ* CMSEXPORT cmsDupProfileSequenceDescription(const cmsSEQ* pseq);
|
1393
|
+
CMSAPI void CMSEXPORT cmsFreeProfileSequenceDescription(cmsSEQ* pseq);
|
1394
|
+
|
1395
|
+
// Dictionaries --------------------------------------------------------------------------------------------------------
|
1396
|
+
|
1397
|
+
typedef struct _cmsDICTentry_struct {
|
1398
|
+
|
1399
|
+
struct _cmsDICTentry_struct* Next;
|
1400
|
+
|
1401
|
+
cmsMLU *DisplayName;
|
1402
|
+
cmsMLU *DisplayValue;
|
1403
|
+
wchar_t* Name;
|
1404
|
+
wchar_t* Value;
|
1405
|
+
|
1406
|
+
} cmsDICTentry;
|
1407
|
+
|
1408
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsDictAlloc(cmsContext ContextID);
|
1409
|
+
CMSAPI void CMSEXPORT cmsDictFree(cmsHANDLE hDict);
|
1410
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsDictDup(cmsHANDLE hDict);
|
1411
|
+
|
1412
|
+
CMSAPI cmsBool CMSEXPORT cmsDictAddEntry(cmsHANDLE hDict, const wchar_t* Name, const wchar_t* Value, const cmsMLU *DisplayName, const cmsMLU *DisplayValue);
|
1413
|
+
CMSAPI const cmsDICTentry* CMSEXPORT cmsDictGetEntryList(cmsHANDLE hDict);
|
1414
|
+
CMSAPI const cmsDICTentry* CMSEXPORT cmsDictNextEntry(const cmsDICTentry* e);
|
1415
|
+
|
1416
|
+
// Access to Profile data ----------------------------------------------------------------------------------------------
|
1417
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateProfilePlaceholder(cmsContext ContextID);
|
1418
|
+
|
1419
|
+
CMSAPI cmsContext CMSEXPORT cmsGetProfileContextID(cmsHPROFILE hProfile);
|
1420
|
+
CMSAPI cmsInt32Number CMSEXPORT cmsGetTagCount(cmsHPROFILE hProfile);
|
1421
|
+
CMSAPI cmsTagSignature CMSEXPORT cmsGetTagSignature(cmsHPROFILE hProfile, cmsUInt32Number n);
|
1422
|
+
CMSAPI cmsBool CMSEXPORT cmsIsTag(cmsHPROFILE hProfile, cmsTagSignature sig);
|
1423
|
+
|
1424
|
+
// Read and write pre-formatted data
|
1425
|
+
CMSAPI void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig);
|
1426
|
+
CMSAPI cmsBool CMSEXPORT cmsWriteTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data);
|
1427
|
+
CMSAPI cmsBool CMSEXPORT cmsLinkTag(cmsHPROFILE hProfile, cmsTagSignature sig, cmsTagSignature dest);
|
1428
|
+
CMSAPI cmsTagSignature CMSEXPORT cmsTagLinkedTo(cmsHPROFILE hProfile, cmsTagSignature sig);
|
1429
|
+
|
1430
|
+
// Read and write raw data
|
1431
|
+
CMSAPI cmsInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, void* Buffer, cmsUInt32Number BufferSize);
|
1432
|
+
CMSAPI cmsBool CMSEXPORT cmsWriteRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data, cmsUInt32Number Size);
|
1433
|
+
|
1434
|
+
// Access header data
|
1435
|
+
#define cmsEmbeddedProfileFalse 0x00000000
|
1436
|
+
#define cmsEmbeddedProfileTrue 0x00000001
|
1437
|
+
#define cmsUseAnywhere 0x00000000
|
1438
|
+
#define cmsUseWithEmbeddedDataOnly 0x00000002
|
1439
|
+
|
1440
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderFlags(cmsHPROFILE hProfile);
|
1441
|
+
CMSAPI void CMSEXPORT cmsGetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number* Flags);
|
1442
|
+
CMSAPI void CMSEXPORT cmsGetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID);
|
1443
|
+
CMSAPI cmsBool CMSEXPORT cmsGetHeaderCreationDateTime(cmsHPROFILE hProfile, struct tm *Dest);
|
1444
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderRenderingIntent(cmsHPROFILE hProfile);
|
1445
|
+
|
1446
|
+
CMSAPI void CMSEXPORT cmsSetHeaderFlags(cmsHPROFILE hProfile, cmsUInt32Number Flags);
|
1447
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderManufacturer(cmsHPROFILE hProfile);
|
1448
|
+
CMSAPI void CMSEXPORT cmsSetHeaderManufacturer(cmsHPROFILE hProfile, cmsUInt32Number manufacturer);
|
1449
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderCreator(cmsHPROFILE hProfile);
|
1450
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderModel(cmsHPROFILE hProfile);
|
1451
|
+
CMSAPI void CMSEXPORT cmsSetHeaderModel(cmsHPROFILE hProfile, cmsUInt32Number model);
|
1452
|
+
CMSAPI void CMSEXPORT cmsSetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number Flags);
|
1453
|
+
CMSAPI void CMSEXPORT cmsSetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID);
|
1454
|
+
CMSAPI void CMSEXPORT cmsSetHeaderRenderingIntent(cmsHPROFILE hProfile, cmsUInt32Number RenderingIntent);
|
1455
|
+
|
1456
|
+
CMSAPI cmsColorSpaceSignature
|
1457
|
+
CMSEXPORT cmsGetPCS(cmsHPROFILE hProfile);
|
1458
|
+
CMSAPI void CMSEXPORT cmsSetPCS(cmsHPROFILE hProfile, cmsColorSpaceSignature pcs);
|
1459
|
+
CMSAPI cmsColorSpaceSignature
|
1460
|
+
CMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile);
|
1461
|
+
CMSAPI void CMSEXPORT cmsSetColorSpace(cmsHPROFILE hProfile, cmsColorSpaceSignature sig);
|
1462
|
+
CMSAPI cmsProfileClassSignature
|
1463
|
+
CMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile);
|
1464
|
+
CMSAPI void CMSEXPORT cmsSetDeviceClass(cmsHPROFILE hProfile, cmsProfileClassSignature sig);
|
1465
|
+
CMSAPI void CMSEXPORT cmsSetProfileVersion(cmsHPROFILE hProfile, cmsFloat64Number Version);
|
1466
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsGetProfileVersion(cmsHPROFILE hProfile);
|
1467
|
+
|
1468
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetEncodedICCversion(cmsHPROFILE hProfile);
|
1469
|
+
CMSAPI void CMSEXPORT cmsSetEncodedICCversion(cmsHPROFILE hProfile, cmsUInt32Number Version);
|
1470
|
+
|
1471
|
+
// How profiles may be used
|
1472
|
+
#define LCMS_USED_AS_INPUT 0
|
1473
|
+
#define LCMS_USED_AS_OUTPUT 1
|
1474
|
+
#define LCMS_USED_AS_PROOF 2
|
1475
|
+
|
1476
|
+
CMSAPI cmsBool CMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number UsedDirection);
|
1477
|
+
CMSAPI cmsBool CMSEXPORT cmsIsMatrixShaper(cmsHPROFILE hProfile);
|
1478
|
+
CMSAPI cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number UsedDirection);
|
1479
|
+
|
1480
|
+
// Translate form/to our notation to ICC
|
1481
|
+
CMSAPI cmsColorSpaceSignature CMSEXPORT _cmsICCcolorSpace(int OurNotation);
|
1482
|
+
CMSAPI int CMSEXPORT _cmsLCMScolorSpace(cmsColorSpaceSignature ProfileSpace);
|
1483
|
+
|
1484
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace);
|
1485
|
+
|
1486
|
+
// Build a suitable formatter for the colorspace of this profile. nBytes=1 means 8 bits, nBytes=2 means 16 bits.
|
1487
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
|
1488
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
|
1489
|
+
|
1490
|
+
|
1491
|
+
// Localized info
|
1492
|
+
typedef enum {
|
1493
|
+
cmsInfoDescription = 0,
|
1494
|
+
cmsInfoManufacturer = 1,
|
1495
|
+
cmsInfoModel = 2,
|
1496
|
+
cmsInfoCopyright = 3
|
1497
|
+
} cmsInfoType;
|
1498
|
+
|
1499
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info,
|
1500
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1501
|
+
wchar_t* Buffer, cmsUInt32Number BufferSize);
|
1502
|
+
|
1503
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info,
|
1504
|
+
const char LanguageCode[3], const char CountryCode[3],
|
1505
|
+
char* Buffer, cmsUInt32Number BufferSize);
|
1506
|
+
|
1507
|
+
// IO handlers ----------------------------------------------------------------------------------------------------------
|
1508
|
+
|
1509
|
+
typedef struct _cms_io_handler cmsIOHANDLER;
|
1510
|
+
|
1511
|
+
CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromFile(cmsContext ContextID, const char* FileName, const char* AccessMode);
|
1512
|
+
CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream);
|
1513
|
+
CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode);
|
1514
|
+
CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromNULL(cmsContext ContextID);
|
1515
|
+
CMSAPI cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile);
|
1516
|
+
CMSAPI cmsBool CMSEXPORT cmsCloseIOhandler(cmsIOHANDLER* io);
|
1517
|
+
|
1518
|
+
// MD5 message digest --------------------------------------------------------------------------------------------------
|
1519
|
+
|
1520
|
+
CMSAPI cmsBool CMSEXPORT cmsMD5computeID(cmsHPROFILE hProfile);
|
1521
|
+
|
1522
|
+
// Profile high level funtions ------------------------------------------------------------------------------------------
|
1523
|
+
|
1524
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess);
|
1525
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFileTHR(cmsContext ContextID, const char *ICCProfile, const char *sAccess);
|
1526
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char* sAccess);
|
1527
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStreamTHR(cmsContext ContextID, FILE* ICCProfile, const char* sAccess);
|
1528
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(const void * MemPtr, cmsUInt32Number dwSize);
|
1529
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void * MemPtr, cmsUInt32Number dwSize);
|
1530
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandlerTHR(cmsContext ContextID, cmsIOHANDLER* io);
|
1531
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2THR(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write);
|
1532
|
+
CMSAPI cmsBool CMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);
|
1533
|
+
|
1534
|
+
CMSAPI cmsBool CMSEXPORT cmsSaveProfileToFile(cmsHPROFILE hProfile, const char* FileName);
|
1535
|
+
CMSAPI cmsBool CMSEXPORT cmsSaveProfileToStream(cmsHPROFILE hProfile, FILE* Stream);
|
1536
|
+
CMSAPI cmsBool CMSEXPORT cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr, cmsUInt32Number* BytesNeeded);
|
1537
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsSaveProfileToIOhandler(cmsHPROFILE hProfile, cmsIOHANDLER* io);
|
1538
|
+
|
1539
|
+
// Predefined virtual profiles ------------------------------------------------------------------------------------------
|
1540
|
+
|
1541
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfileTHR(cmsContext ContextID,
|
1542
|
+
const cmsCIExyY* WhitePoint,
|
1543
|
+
const cmsCIExyYTRIPLE* Primaries,
|
1544
|
+
cmsToneCurve* const TransferFunction[3]);
|
1545
|
+
|
1546
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(const cmsCIExyY* WhitePoint,
|
1547
|
+
const cmsCIExyYTRIPLE* Primaries,
|
1548
|
+
cmsToneCurve* const TransferFunction[3]);
|
1549
|
+
|
1550
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfileTHR(cmsContext ContextID,
|
1551
|
+
const cmsCIExyY* WhitePoint,
|
1552
|
+
const cmsToneCurve* TransferFunction);
|
1553
|
+
|
1554
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(const cmsCIExyY* WhitePoint,
|
1555
|
+
const cmsToneCurve* TransferFunction);
|
1556
|
+
|
1557
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID,
|
1558
|
+
cmsColorSpaceSignature ColorSpace,
|
1559
|
+
cmsToneCurve* const TransferFunctions[]);
|
1560
|
+
|
1561
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsColorSpaceSignature ColorSpace,
|
1562
|
+
cmsToneCurve* const TransferFunctions[]);
|
1563
|
+
|
1564
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID,
|
1565
|
+
cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit);
|
1566
|
+
|
1567
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit);
|
1568
|
+
|
1569
|
+
|
1570
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint);
|
1571
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(const cmsCIExyY* WhitePoint);
|
1572
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint);
|
1573
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(const cmsCIExyY* WhitePoint);
|
1574
|
+
|
1575
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfileTHR(cmsContext ContextID);
|
1576
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void);
|
1577
|
+
|
1578
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID);
|
1579
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void);
|
1580
|
+
|
1581
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID,
|
1582
|
+
int nLUTPoints,
|
1583
|
+
cmsFloat64Number Bright,
|
1584
|
+
cmsFloat64Number Contrast,
|
1585
|
+
cmsFloat64Number Hue,
|
1586
|
+
cmsFloat64Number Saturation,
|
1587
|
+
int TempSrc,
|
1588
|
+
int TempDest);
|
1589
|
+
|
1590
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(int nLUTPoints,
|
1591
|
+
cmsFloat64Number Bright,
|
1592
|
+
cmsFloat64Number Contrast,
|
1593
|
+
cmsFloat64Number Hue,
|
1594
|
+
cmsFloat64Number Saturation,
|
1595
|
+
int TempSrc,
|
1596
|
+
int TempDest);
|
1597
|
+
|
1598
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID);
|
1599
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(void);
|
1600
|
+
|
1601
|
+
// Converts a transform to a devicelink profile
|
1602
|
+
CMSAPI cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat64Number Version, cmsUInt32Number dwFlags);
|
1603
|
+
|
1604
|
+
// Intents ----------------------------------------------------------------------------------------------
|
1605
|
+
|
1606
|
+
// ICC Intents
|
1607
|
+
#define INTENT_PERCEPTUAL 0
|
1608
|
+
#define INTENT_RELATIVE_COLORIMETRIC 1
|
1609
|
+
#define INTENT_SATURATION 2
|
1610
|
+
#define INTENT_ABSOLUTE_COLORIMETRIC 3
|
1611
|
+
|
1612
|
+
// Non-ICC intents
|
1613
|
+
#define INTENT_PRESERVE_K_ONLY_PERCEPTUAL 10
|
1614
|
+
#define INTENT_PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC 11
|
1615
|
+
#define INTENT_PRESERVE_K_ONLY_SATURATION 12
|
1616
|
+
#define INTENT_PRESERVE_K_PLANE_PERCEPTUAL 13
|
1617
|
+
#define INTENT_PRESERVE_K_PLANE_RELATIVE_COLORIMETRIC 14
|
1618
|
+
#define INTENT_PRESERVE_K_PLANE_SATURATION 15
|
1619
|
+
|
1620
|
+
// Call with NULL as parameters to get the intent count
|
1621
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions);
|
1622
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID, cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions);
|
1623
|
+
|
1624
|
+
// Flags
|
1625
|
+
|
1626
|
+
#define cmsFLAGS_NOCACHE 0x0040 // Inhibit 1-pixel cache
|
1627
|
+
#define cmsFLAGS_NOOPTIMIZE 0x0100 // Inhibit optimizations
|
1628
|
+
#define cmsFLAGS_NULLTRANSFORM 0x0200 // Don't transform anyway
|
1629
|
+
|
1630
|
+
// Proofing flags
|
1631
|
+
#define cmsFLAGS_GAMUTCHECK 0x1000 // Out of Gamut alarm
|
1632
|
+
#define cmsFLAGS_SOFTPROOFING 0x4000 // Do softproofing
|
1633
|
+
|
1634
|
+
// Misc
|
1635
|
+
#define cmsFLAGS_BLACKPOINTCOMPENSATION 0x2000
|
1636
|
+
#define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot
|
1637
|
+
#define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accurancy
|
1638
|
+
#define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resouces
|
1639
|
+
|
1640
|
+
// For devicelink creation
|
1641
|
+
#define cmsFLAGS_8BITS_DEVICELINK 0x0008 // Create 8 bits devicelinks
|
1642
|
+
#define cmsFLAGS_GUESSDEVICECLASS 0x0020 // Guess device class (for transform2devicelink)
|
1643
|
+
#define cmsFLAGS_KEEP_SEQUENCE 0x0080 // Keep profile sequence for devicelink creation
|
1644
|
+
|
1645
|
+
// Specific to a particular optimizations
|
1646
|
+
#define cmsFLAGS_FORCE_CLUT 0x0002 // Force CLUT optimization
|
1647
|
+
#define cmsFLAGS_CLUT_POST_LINEARIZATION 0x0001 // create postlinearization tables if possible
|
1648
|
+
#define cmsFLAGS_CLUT_PRE_LINEARIZATION 0x0010 // create prelinearization tables if possible
|
1649
|
+
|
1650
|
+
// Specific to unbounded mode
|
1651
|
+
#define cmsFLAGS_NONEGATIVES 0x8000 // Prevent negative numbers in floating point transforms
|
1652
|
+
|
1653
|
+
|
1654
|
+
// Fine-tune control over number of gridpoints
|
1655
|
+
#define cmsFLAGS_GRIDPOINTS(n) (((n) & 0xFF) << 16)
|
1656
|
+
|
1657
|
+
// CRD special
|
1658
|
+
#define cmsFLAGS_NODEFAULTRESOURCEDEF 0x01000000
|
1659
|
+
|
1660
|
+
// Transforms ---------------------------------------------------------------------------------------------------
|
1661
|
+
|
1662
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID,
|
1663
|
+
cmsHPROFILE Input,
|
1664
|
+
cmsUInt32Number InputFormat,
|
1665
|
+
cmsHPROFILE Output,
|
1666
|
+
cmsUInt32Number OutputFormat,
|
1667
|
+
cmsUInt32Number Intent,
|
1668
|
+
cmsUInt32Number dwFlags);
|
1669
|
+
|
1670
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsHPROFILE Input,
|
1671
|
+
cmsUInt32Number InputFormat,
|
1672
|
+
cmsHPROFILE Output,
|
1673
|
+
cmsUInt32Number OutputFormat,
|
1674
|
+
cmsUInt32Number Intent,
|
1675
|
+
cmsUInt32Number dwFlags);
|
1676
|
+
|
1677
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID,
|
1678
|
+
cmsHPROFILE Input,
|
1679
|
+
cmsUInt32Number InputFormat,
|
1680
|
+
cmsHPROFILE Output,
|
1681
|
+
cmsUInt32Number OutputFormat,
|
1682
|
+
cmsHPROFILE Proofing,
|
1683
|
+
cmsUInt32Number Intent,
|
1684
|
+
cmsUInt32Number ProofingIntent,
|
1685
|
+
cmsUInt32Number dwFlags);
|
1686
|
+
|
1687
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsHPROFILE Input,
|
1688
|
+
cmsUInt32Number InputFormat,
|
1689
|
+
cmsHPROFILE Output,
|
1690
|
+
cmsUInt32Number OutputFormat,
|
1691
|
+
cmsHPROFILE Proofing,
|
1692
|
+
cmsUInt32Number Intent,
|
1693
|
+
cmsUInt32Number ProofingIntent,
|
1694
|
+
cmsUInt32Number dwFlags);
|
1695
|
+
|
1696
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID,
|
1697
|
+
cmsHPROFILE hProfiles[],
|
1698
|
+
cmsUInt32Number nProfiles,
|
1699
|
+
cmsUInt32Number InputFormat,
|
1700
|
+
cmsUInt32Number OutputFormat,
|
1701
|
+
cmsUInt32Number Intent,
|
1702
|
+
cmsUInt32Number dwFlags);
|
1703
|
+
|
1704
|
+
|
1705
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],
|
1706
|
+
cmsUInt32Number nProfiles,
|
1707
|
+
cmsUInt32Number InputFormat,
|
1708
|
+
cmsUInt32Number OutputFormat,
|
1709
|
+
cmsUInt32Number Intent,
|
1710
|
+
cmsUInt32Number dwFlags);
|
1711
|
+
|
1712
|
+
|
1713
|
+
CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID,
|
1714
|
+
cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[],
|
1715
|
+
cmsBool BPC[],
|
1716
|
+
cmsUInt32Number Intents[],
|
1717
|
+
cmsFloat64Number AdaptationStates[],
|
1718
|
+
cmsHPROFILE hGamutProfile,
|
1719
|
+
cmsUInt32Number nGamutPCSposition,
|
1720
|
+
cmsUInt32Number InputFormat,
|
1721
|
+
cmsUInt32Number OutputFormat,
|
1722
|
+
cmsUInt32Number dwFlags);
|
1723
|
+
|
1724
|
+
CMSAPI void CMSEXPORT cmsDeleteTransform(cmsHTRANSFORM hTransform);
|
1725
|
+
|
1726
|
+
CMSAPI void CMSEXPORT cmsDoTransform(cmsHTRANSFORM Transform,
|
1727
|
+
const void * InputBuffer,
|
1728
|
+
void * OutputBuffer,
|
1729
|
+
cmsUInt32Number Size);
|
1730
|
+
|
1731
|
+
CMSAPI void CMSEXPORT cmsDoTransformStride(cmsHTRANSFORM Transform,
|
1732
|
+
const void * InputBuffer,
|
1733
|
+
void * OutputBuffer,
|
1734
|
+
cmsUInt32Number Size,
|
1735
|
+
cmsUInt32Number Stride);
|
1736
|
+
|
1737
|
+
|
1738
|
+
CMSAPI void CMSEXPORT cmsSetAlarmCodes(const cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);
|
1739
|
+
CMSAPI void CMSEXPORT cmsGetAlarmCodes(cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);
|
1740
|
+
|
1741
|
+
|
1742
|
+
CMSAPI void CMSEXPORT cmsSetAlarmCodesTHR(cmsContext ContextID,
|
1743
|
+
const cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]);
|
1744
|
+
CMSAPI void CMSEXPORT cmsGetAlarmCodesTHR(cmsContext ContextID,
|
1745
|
+
cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]);
|
1746
|
+
|
1747
|
+
|
1748
|
+
|
1749
|
+
// Adaptation state for absolute colorimetric intent
|
1750
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsFloat64Number d);
|
1751
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationStateTHR(cmsContext ContextID, cmsFloat64Number d);
|
1752
|
+
|
1753
|
+
|
1754
|
+
|
1755
|
+
// Grab the ContextID from an open transform. Returns NULL if a NULL transform is passed
|
1756
|
+
CMSAPI cmsContext CMSEXPORT cmsGetTransformContextID(cmsHTRANSFORM hTransform);
|
1757
|
+
|
1758
|
+
// Grab the input/output formats
|
1759
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformInputFormat(cmsHTRANSFORM hTransform);
|
1760
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformOutputFormat(cmsHTRANSFORM hTransform);
|
1761
|
+
|
1762
|
+
// For backwards compatibility
|
1763
|
+
CMSAPI cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform,
|
1764
|
+
cmsUInt32Number InputFormat,
|
1765
|
+
cmsUInt32Number OutputFormat);
|
1766
|
+
|
1767
|
+
|
1768
|
+
|
1769
|
+
// PostScript ColorRenderingDictionary and ColorSpaceArray ----------------------------------------------------
|
1770
|
+
|
1771
|
+
typedef enum { cmsPS_RESOURCE_CSA, cmsPS_RESOURCE_CRD } cmsPSResourceType;
|
1772
|
+
|
1773
|
+
// lcms2 unified method to access postscript color resources
|
1774
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptColorResource(cmsContext ContextID,
|
1775
|
+
cmsPSResourceType Type,
|
1776
|
+
cmsHPROFILE hProfile,
|
1777
|
+
cmsUInt32Number Intent,
|
1778
|
+
cmsUInt32Number dwFlags,
|
1779
|
+
cmsIOHANDLER* io);
|
1780
|
+
|
1781
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCSA(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen);
|
1782
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCRD(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen);
|
1783
|
+
|
1784
|
+
|
1785
|
+
// IT8.7 / CGATS.17-200x handling -----------------------------------------------------------------------------
|
1786
|
+
|
1787
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsIT8Alloc(cmsContext ContextID);
|
1788
|
+
CMSAPI void CMSEXPORT cmsIT8Free(cmsHANDLE hIT8);
|
1789
|
+
|
1790
|
+
// Tables
|
1791
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsIT8TableCount(cmsHANDLE hIT8);
|
1792
|
+
CMSAPI cmsInt32Number CMSEXPORT cmsIT8SetTable(cmsHANDLE hIT8, cmsUInt32Number nTable);
|
1793
|
+
|
1794
|
+
// Persistence
|
1795
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromFile(cmsContext ContextID, const char* cFileName);
|
1796
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromMem(cmsContext ContextID, void *Ptr, cmsUInt32Number len);
|
1797
|
+
// CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromIOhandler(cmsContext ContextID, cmsIOHANDLER* io);
|
1798
|
+
|
1799
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SaveToFile(cmsHANDLE hIT8, const char* cFileName);
|
1800
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SaveToMem(cmsHANDLE hIT8, void *MemPtr, cmsUInt32Number* BytesNeeded);
|
1801
|
+
|
1802
|
+
// Properties
|
1803
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetSheetType(cmsHANDLE hIT8);
|
1804
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetSheetType(cmsHANDLE hIT8, const char* Type);
|
1805
|
+
|
1806
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetComment(cmsHANDLE hIT8, const char* cComment);
|
1807
|
+
|
1808
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyStr(cmsHANDLE hIT8, const char* cProp, const char *Str);
|
1809
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyDbl(cmsHANDLE hIT8, const char* cProp, cmsFloat64Number Val);
|
1810
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyHex(cmsHANDLE hIT8, const char* cProp, cmsUInt32Number Val);
|
1811
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char* SubKey, const char *Buffer);
|
1812
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyUncooked(cmsHANDLE hIT8, const char* Key, const char* Buffer);
|
1813
|
+
|
1814
|
+
|
1815
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetProperty(cmsHANDLE hIT8, const char* cProp);
|
1816
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsHANDLE hIT8, const char* cProp);
|
1817
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char *SubKey);
|
1818
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumProperties(cmsHANDLE hIT8, char ***PropertyNames);
|
1819
|
+
CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumPropertyMulti(cmsHANDLE hIT8, const char* cProp, const char ***SubpropertyNames);
|
1820
|
+
|
1821
|
+
// Datasets
|
1822
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetDataRowCol(cmsHANDLE hIT8, int row, int col);
|
1823
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsHANDLE hIT8, int row, int col);
|
1824
|
+
|
1825
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowCol(cmsHANDLE hIT8, int row, int col,
|
1826
|
+
const char* Val);
|
1827
|
+
|
1828
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowColDbl(cmsHANDLE hIT8, int row, int col,
|
1829
|
+
cmsFloat64Number Val);
|
1830
|
+
|
1831
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetData(cmsHANDLE hIT8, const char* cPatch, const char* cSample);
|
1832
|
+
|
1833
|
+
|
1834
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataDbl(cmsHANDLE hIT8, const char* cPatch, const char* cSample);
|
1835
|
+
|
1836
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetData(cmsHANDLE hIT8, const char* cPatch,
|
1837
|
+
const char* cSample,
|
1838
|
+
const char *Val);
|
1839
|
+
|
1840
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetDataDbl(cmsHANDLE hIT8, const char* cPatch,
|
1841
|
+
const char* cSample,
|
1842
|
+
cmsFloat64Number Val);
|
1843
|
+
|
1844
|
+
CMSAPI int CMSEXPORT cmsIT8FindDataFormat(cmsHANDLE hIT8, const char* cSample);
|
1845
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetDataFormat(cmsHANDLE hIT8, int n, const char *Sample);
|
1846
|
+
CMSAPI int CMSEXPORT cmsIT8EnumDataFormat(cmsHANDLE hIT8, char ***SampleNames);
|
1847
|
+
|
1848
|
+
CMSAPI const char* CMSEXPORT cmsIT8GetPatchName(cmsHANDLE hIT8, int nPatch, char* buffer);
|
1849
|
+
CMSAPI int CMSEXPORT cmsIT8GetPatchByName(cmsHANDLE hIT8, const char *cPatch);
|
1850
|
+
|
1851
|
+
// The LABEL extension
|
1852
|
+
CMSAPI int CMSEXPORT cmsIT8SetTableByLabel(cmsHANDLE hIT8, const char* cSet, const char* cField, const char* ExpectedType);
|
1853
|
+
|
1854
|
+
CMSAPI cmsBool CMSEXPORT cmsIT8SetIndexColumn(cmsHANDLE hIT8, const char* cSample);
|
1855
|
+
|
1856
|
+
// Formatter for double
|
1857
|
+
CMSAPI void CMSEXPORT cmsIT8DefineDblFormat(cmsHANDLE hIT8, const char* Formatter);
|
1858
|
+
|
1859
|
+
// Gamut boundary description routines ------------------------------------------------------------------------------
|
1860
|
+
|
1861
|
+
CMSAPI cmsHANDLE CMSEXPORT cmsGBDAlloc(cmsContext ContextID);
|
1862
|
+
CMSAPI void CMSEXPORT cmsGBDFree(cmsHANDLE hGBD);
|
1863
|
+
CMSAPI cmsBool CMSEXPORT cmsGDBAddPoint(cmsHANDLE hGBD, const cmsCIELab* Lab);
|
1864
|
+
CMSAPI cmsBool CMSEXPORT cmsGDBCompute(cmsHANDLE hGDB, cmsUInt32Number dwFlags);
|
1865
|
+
CMSAPI cmsBool CMSEXPORT cmsGDBCheckPoint(cmsHANDLE hGBD, const cmsCIELab* Lab);
|
1866
|
+
|
1867
|
+
// Feature detection ----------------------------------------------------------------------------------------------
|
1868
|
+
|
1869
|
+
// Estimate the black point
|
1870
|
+
CMSAPI cmsBool CMSEXPORT cmsDetectBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags);
|
1871
|
+
CMSAPI cmsBool CMSEXPORT cmsDetectDestinationBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags);
|
1872
|
+
|
1873
|
+
// Estimate total area coverage
|
1874
|
+
CMSAPI cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile);
|
1875
|
+
|
1876
|
+
|
1877
|
+
// Poor man's gamut mapping
|
1878
|
+
CMSAPI cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab,
|
1879
|
+
double amax, double amin,
|
1880
|
+
double bmax, double bmin);
|
1881
|
+
|
1882
|
+
#ifndef CMS_USE_CPP_API
|
1883
|
+
# ifdef __cplusplus
|
1884
|
+
}
|
1885
|
+
# endif
|
1886
|
+
#endif
|
1887
|
+
|
1888
|
+
#define _lcms2_H
|
1889
|
+
#endif
|