Imported Upstream version 2.4
[platform/upstream/lcms2.git] / src / lcms2_internal.h
1
2 //
3 //  Little Color Management System
4 //  Copyright (c) 1998-2011 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
27 #ifndef _lcms_internal_H
28
29 // Include plug-in foundation
30 #ifndef _lcms_plugin_H
31 #   include "lcms2_plugin.h"
32 #endif
33
34 // ctype is part of C99 as per 7.1.2
35 #include <ctype.h>
36
37 // assert macro is part of C99 as per 7.2
38 #include <assert.h>
39
40 // Some needed constants
41 #ifndef M_PI
42 #       define M_PI        3.14159265358979323846
43 #endif
44
45 #ifndef M_LOG10E
46 #       define M_LOG10E    0.434294481903251827651
47 #endif
48
49 // BorlandC 5.5, VC2003 are broken on that
50 #if defined(__BORLANDC__) || (_MSC_VER < 1400) // 1400 == VC++ 8.0
51 #define sinf(x) (float)sin((float)x)
52 #define sqrtf(x) (float)sqrt((float)x)
53 #endif
54
55
56 // Alignment of ICC file format uses 4 bytes (cmsUInt32Number)
57 #define _cmsALIGNLONG(x) (((x)+(sizeof(cmsUInt32Number)-1)) & ~(sizeof(cmsUInt32Number)-1))
58
59 // Alignment to memory pointer
60 #define _cmsALIGNMEM(x)  (((x)+(sizeof(void *) - 1)) & ~(sizeof(void *) - 1))
61
62 // Maximum encodeable values in floating point
63 #define MAX_ENCODEABLE_XYZ  (1.0 + 32767.0/32768.0)
64 #define MIN_ENCODEABLE_ab2  (-128.0)
65 #define MAX_ENCODEABLE_ab2  ((65535.0/256.0) - 128.0)
66 #define MIN_ENCODEABLE_ab4  (-128.0)
67 #define MAX_ENCODEABLE_ab4  (127.0)
68
69 // Maximum of channels for internal pipeline evaluation
70 #define MAX_STAGE_CHANNELS  128
71
72 // Unused parameter warning supression
73 #define cmsUNUSED_PARAMETER(x) ((void)x)
74
75 // The specification for "inline" is section 6.7.4 of the C99 standard (ISO/IEC 9899:1999).
76 // unfortunately VisualC++ does not conform that
77 #if defined(_MSC_VER) || defined(__BORLANDC__)
78 #   define cmsINLINE __inline
79 #else
80 #   define cmsINLINE static inline
81 #endif
82
83 // Other replacement functions
84 #ifdef _MSC_VER
85 # ifndef snprintf
86 #       define snprintf  _snprintf
87 # endif
88 # ifndef vsnprintf
89 #       define vsnprintf  _vsnprintf
90 # endif
91 #endif
92
93
94 // A fast way to convert from/to 16 <-> 8 bits
95 #define FROM_8_TO_16(rgb) (cmsUInt16Number) ((((cmsUInt16Number) (rgb)) << 8)|(rgb))
96 #define FROM_16_TO_8(rgb) (cmsUInt8Number) ((((rgb) * 65281 + 8388608) >> 24) & 0xFF)
97
98 // Code analysis is broken on asserts
99 #ifdef _MSC_VER
100 #    if (_MSC_VER >= 1500)
101 #            define _cmsAssert(a)  { assert((a)); __analysis_assume((a)); }
102 #     else
103 #            define _cmsAssert(a)   assert((a))
104 #     endif
105 #else
106 #      define _cmsAssert(a)   assert((a))
107 #endif
108
109 //---------------------------------------------------------------------------------
110
111 // Determinant lower than that are assumed zero (used on matrix invert)
112 #define MATRIX_DET_TOLERANCE    0.0001
113
114 //---------------------------------------------------------------------------------
115
116 // Fixed point
117 #define FIXED_TO_INT(x)         ((x)>>16)
118 #define FIXED_REST_TO_INT(x)    ((x)&0xFFFFU)
119 #define ROUND_FIXED_TO_INT(x)   (((x)+0x8000)>>16)
120
121 cmsINLINE cmsS15Fixed16Number _cmsToFixedDomain(int a)                   { return a + ((a + 0x7fff) / 0xffff); }
122 cmsINLINE int                 _cmsFromFixedDomain(cmsS15Fixed16Number a) { return a - ((a + 0x7fff) >> 16); }
123
124 // -----------------------------------------------------------------------------------------------------------
125
126 // Fast floor conversion logic. Thanks to Sree Kotay and Stuart Nixon
127 // note than this only works in the range ..-32767...+32767 because
128 // mantissa is interpreted as 15.16 fixed point.
129 // The union is to avoid pointer aliasing overoptimization.
130 cmsINLINE int _cmsQuickFloor(cmsFloat64Number val)
131 {
132 #ifdef CMS_DONT_USE_FAST_FLOOR
133     return (int) floor(val);
134 #else
135     const cmsFloat64Number _lcms_double2fixmagic = 68719476736.0 * 1.5;  // 2^36 * 1.5, (52-16=36) uses limited precision to floor
136     union {
137         cmsFloat64Number val;
138         int halves[2];
139     } temp;
140
141     temp.val = val + _lcms_double2fixmagic;
142
143 #ifdef CMS_USE_BIG_ENDIAN
144     return temp.halves[1] >> 16;
145 #else
146     return temp.halves[0] >> 16;
147 #endif
148 #endif
149 }
150
151 // Fast floor restricted to 0..65535.0
152 cmsINLINE cmsUInt16Number _cmsQuickFloorWord(cmsFloat64Number d)
153 {
154     return (cmsUInt16Number) _cmsQuickFloor(d - 32767.0) + 32767U;
155 }
156
157 // Floor to word, taking care of saturation
158 cmsINLINE cmsUInt16Number _cmsQuickSaturateWord(cmsFloat64Number d)
159 {
160     d += 0.5;
161     if (d <= 0) return 0;
162     if (d >= 65535.0) return 0xffff;
163
164     return _cmsQuickFloorWord(d);
165 }
166
167 // Plug-In registering ---------------------------------------------------------------
168
169 // Specialized function for plug-in memory management. No pairing free() since whole pool is freed at once.
170 void* _cmsPluginMalloc(cmsUInt32Number size);
171
172 // Memory management
173 cmsBool   _cmsRegisterMemHandlerPlugin(cmsPluginBase* Plugin);
174
175 // Interpolation
176 cmsBool  _cmsRegisterInterpPlugin(cmsPluginBase* Plugin);
177
178 // Parametric curves
179 cmsBool  _cmsRegisterParametricCurvesPlugin(cmsPluginBase* Plugin);
180
181 // Formatters management
182 cmsBool  _cmsRegisterFormattersPlugin(cmsPluginBase* Plugin);
183
184 // Tag type management
185 cmsBool  _cmsRegisterTagTypePlugin(cmsPluginBase* Plugin);
186
187 // Tag management
188 cmsBool  _cmsRegisterTagPlugin(cmsPluginBase* Plugin);
189
190 // Intent management
191 cmsBool  _cmsRegisterRenderingIntentPlugin(cmsPluginBase* Plugin);
192
193 // Multi Process elements
194 cmsBool  _cmsRegisterMultiProcessElementPlugin(cmsPluginBase* Plugin);
195
196 // Optimization
197 cmsBool  _cmsRegisterOptimizationPlugin(cmsPluginBase* Plugin);
198
199 // Transform
200 cmsBool  _cmsRegisterTransformPlugin(cmsPluginBase* Plugin);
201
202 // ---------------------------------------------------------------------------------------------------------
203
204 // Suballocators. Those are blocks of memory that is freed at the end on whole block.
205 typedef struct _cmsSubAllocator_chunk_st {
206
207     cmsUInt8Number* Block;
208     cmsUInt32Number BlockSize;
209     cmsUInt32Number Used;
210
211     struct _cmsSubAllocator_chunk_st* next;
212
213 } _cmsSubAllocator_chunk;
214
215
216 typedef struct {
217
218     cmsContext ContextID;
219     _cmsSubAllocator_chunk* h;
220
221 } _cmsSubAllocator;
222
223
224 _cmsSubAllocator* _cmsCreateSubAlloc(cmsContext ContextID, cmsUInt32Number Initial);
225 void              _cmsSubAllocDestroy(_cmsSubAllocator* s);
226 void*             _cmsSubAlloc(_cmsSubAllocator* s, cmsUInt32Number size);
227
228 // ----------------------------------------------------------------------------------
229
230 // MLU internal representation
231 typedef struct {
232
233     cmsUInt16Number Language;
234     cmsUInt16Number Country;
235
236     cmsUInt32Number StrW;       // Offset to current unicode string
237     cmsUInt32Number Len;        // Lenght in bytes
238
239 } _cmsMLUentry;
240
241 struct _cms_MLU_struct {
242
243     cmsContext ContextID;
244
245     // The directory
246     int AllocatedEntries;
247     int UsedEntries;
248     _cmsMLUentry* Entries;     // Array of pointers to strings allocated in MemPool
249
250     // The Pool
251     cmsUInt32Number PoolSize;  // The maximum allocated size
252     cmsUInt32Number PoolUsed;  // The used size
253     void*  MemPool;            // Pointer to begin of memory pool
254 };
255
256 // Named color list internal representation
257 typedef struct {
258
259     char Name[cmsMAX_PATH];
260     cmsUInt16Number PCS[3];
261     cmsUInt16Number DeviceColorant[cmsMAXCHANNELS];
262
263 } _cmsNAMEDCOLOR;
264
265 struct _cms_NAMEDCOLORLIST_struct {
266
267     cmsUInt32Number nColors;
268     cmsUInt32Number Allocated;
269     cmsUInt32Number ColorantCount;
270
271     char Prefix[33];      // Prefix and suffix are defined to be 32 characters at most
272     char Suffix[33];
273
274     _cmsNAMEDCOLOR* List;
275
276     cmsContext ContextID;
277 };
278
279
280 // ----------------------------------------------------------------------------------
281
282 // This is the internal struct holding profile details.
283
284 // Maximum supported tags in a profile
285 #define MAX_TABLE_TAG       100
286
287 typedef struct _cms_iccprofile_struct {
288
289     // I/O handler
290     cmsIOHANDLER*            IOhandler;
291
292     // The thread ID
293     cmsContext               ContextID;
294
295     // Creation time
296     struct tm                Created;
297
298     // Only most important items found in ICC profiles
299     cmsUInt32Number          Version;
300     cmsProfileClassSignature DeviceClass;
301     cmsColorSpaceSignature   ColorSpace;
302     cmsColorSpaceSignature   PCS;
303     cmsUInt32Number          RenderingIntent;
304     cmsUInt32Number          flags;
305     cmsUInt32Number          manufacturer, model;
306     cmsUInt64Number          attributes;
307
308     cmsProfileID             ProfileID;
309
310     // Dictionary
311     cmsUInt32Number          TagCount;
312     cmsTagSignature          TagNames[MAX_TABLE_TAG];
313     cmsTagSignature          TagLinked[MAX_TABLE_TAG];           // The tag to wich is linked (0=none)
314     cmsUInt32Number          TagSizes[MAX_TABLE_TAG];            // Size on disk
315     cmsUInt32Number          TagOffsets[MAX_TABLE_TAG];
316     cmsBool                  TagSaveAsRaw[MAX_TABLE_TAG];        // True to write uncooked
317     void *                   TagPtrs[MAX_TABLE_TAG];
318     cmsTagTypeHandler*       TagTypeHandlers[MAX_TABLE_TAG];     // Same structure may be serialized on different types
319                                                                  // depending on profile version, so we keep track of the                                                             // type handler for each tag in the list.
320     // Special
321     cmsBool                  IsWrite;
322
323 } _cmsICCPROFILE;
324
325 // IO helpers for profiles
326 cmsBool              _cmsReadHeader(_cmsICCPROFILE* Icc);
327 cmsBool              _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace);
328 int                  _cmsSearchTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, cmsBool lFollowLinks);
329
330 // Tag types
331 cmsTagTypeHandler*   _cmsGetTagTypeHandler(cmsTagTypeSignature sig);
332 cmsTagTypeSignature  _cmsGetTagTrueType(cmsHPROFILE hProfile, cmsTagSignature sig);
333 cmsTagDescriptor*    _cmsGetTagDescriptor(cmsTagSignature sig);
334
335 // Error logging ---------------------------------------------------------------------------------------------------------
336
337 void                 _cmsTagSignature2String(char String[5], cmsTagSignature sig);
338
339 // Interpolation ---------------------------------------------------------------------------------------------------------
340
341 cmsInterpParams*     _cmsComputeInterpParams(cmsContext ContextID, int nSamples, int InputChan, int OutputChan, const void* Table, cmsUInt32Number dwFlags);
342 cmsInterpParams*     _cmsComputeInterpParamsEx(cmsContext ContextID, const cmsUInt32Number nSamples[], int InputChan, int OutputChan, const void* Table, cmsUInt32Number dwFlags);
343 void                 _cmsFreeInterpParams(cmsInterpParams* p);
344 cmsBool              _cmsSetInterpolationRoutine(cmsInterpParams* p);
345
346 // Curves ----------------------------------------------------------------------------------------------------------------
347
348 // This struct holds information about a segment, plus a pointer to the function that implements the evaluation.
349 // In the case of table-based, Eval pointer is set to NULL
350
351 // The gamma function main structure
352 struct _cms_curve_struct {
353
354     cmsInterpParams*  InterpParams;  // Private optimizations for interpolation
355
356     cmsUInt32Number   nSegments;     // Number of segments in the curve. Zero for a 16-bit based tables
357     cmsCurveSegment*  Segments;      // The segments
358     cmsInterpParams** SegInterp;     // Array of private optimizations for interpolation in table-based segments
359
360     cmsParametricCurveEvaluator* Evals;  // Evaluators (one per segment)
361
362     // 16 bit Table-based representation follows
363     cmsUInt32Number    nEntries;      // Number of table elements
364     cmsUInt16Number*   Table16;       // The table itself.
365 };
366
367
368 //  Pipelines & Stages ---------------------------------------------------------------------------------------------
369
370 // A single stage
371 struct _cmsStage_struct {
372
373     cmsContext          ContextID;
374
375     cmsStageSignature   Type;           // Identifies the stage
376     cmsStageSignature   Implements;     // Identifies the *function* of the stage (for optimizations)
377
378     cmsUInt32Number     InputChannels;  // Input channels -- for optimization purposes
379     cmsUInt32Number     OutputChannels; // Output channels -- for optimization purposes
380
381     _cmsStageEvalFn     EvalPtr;        // Points to fn that evaluates the stage (always in floating point)
382     _cmsStageDupElemFn  DupElemPtr;     // Points to a fn that duplicates the *data* of the stage
383     _cmsStageFreeElemFn FreePtr;        // Points to a fn that sets the *data* of the stage free
384
385     // A generic pointer to whatever memory needed by the stage
386     void*               Data;
387
388     // Maintains linked list (used internally)
389     struct _cmsStage_struct* Next;
390 };
391
392
393 // Special Stages (cannot be saved)
394 cmsStage*        _cmsStageAllocLab2XYZ(cmsContext ContextID);
395 cmsStage*        _cmsStageAllocXYZ2Lab(cmsContext ContextID);
396 cmsStage*        _cmsStageAllocLabPrelin(cmsContext ContextID);
397 cmsStage*        _cmsStageAllocLabV2ToV4(cmsContext ContextID);
398 cmsStage*        _cmsStageAllocLabV2ToV4curves(cmsContext ContextID);
399 cmsStage*        _cmsStageAllocLabV4ToV2(cmsContext ContextID);
400 cmsStage*        _cmsStageAllocNamedColor(cmsNAMEDCOLORLIST* NamedColorList, cmsBool UsePCS);
401 cmsStage*        _cmsStageAllocIdentityCurves(cmsContext ContextID, int nChannels);
402 cmsStage*        _cmsStageAllocIdentityCLut(cmsContext ContextID, int nChan);
403 cmsStage*        _cmsStageNormalizeFromLabFloat(cmsContext ContextID);
404 cmsStage*        _cmsStageNormalizeFromXyzFloat(cmsContext ContextID);
405 cmsStage*        _cmsStageNormalizeToLabFloat(cmsContext ContextID);
406 cmsStage*        _cmsStageNormalizeToXyzFloat(cmsContext ContextID);
407
408 // For curve set only
409 cmsToneCurve**     _cmsStageGetPtrToCurveSet(const cmsStage* mpe);
410
411
412 // Pipeline Evaluator (in floating point)
413 typedef void (* _cmsPipelineEvalFloatFn)(const cmsFloat32Number In[],
414                                          cmsFloat32Number Out[],
415                                          const void* Data);
416
417 struct _cmsPipeline_struct {
418
419     cmsStage* Elements;                                // Points to elements chain
420     cmsUInt32Number InputChannels, OutputChannels;
421
422     // Data & evaluators
423     void *Data;
424
425    _cmsOPTeval16Fn         Eval16Fn;
426    _cmsPipelineEvalFloatFn EvalFloatFn;
427    _cmsFreeUserDataFn      FreeDataFn;
428    _cmsDupUserDataFn       DupDataFn;
429
430     cmsContext ContextID;            // Environment
431
432     cmsBool  SaveAs8Bits;            // Implementation-specific: save as 8 bits if possible
433 };
434
435 // LUT reading & creation -------------------------------------------------------------------------------------------
436
437 // Read tags using low-level function, provide necessary glue code to adapt versions, etc. All those return a brand new copy
438 // of the LUTS, since ownership of original is up to the profile. The user should free allocated resources.
439
440 cmsPipeline*      _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent);
441 cmsPipeline*      _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent);
442 cmsPipeline*      _cmsReadDevicelinkLUT(cmsHPROFILE hProfile, int Intent);
443
444 // Special values
445 cmsBool           _cmsReadMediaWhitePoint(cmsCIEXYZ* Dest, cmsHPROFILE hProfile);
446 cmsBool           _cmsReadCHAD(cmsMAT3* Dest, cmsHPROFILE hProfile);
447
448 // Profile linker --------------------------------------------------------------------------------------------------
449
450 cmsPipeline* _cmsLinkProfiles(cmsContext         ContextID,
451                               cmsUInt32Number    nProfiles,
452                               cmsUInt32Number    TheIntents[],
453                               cmsHPROFILE        hProfiles[],
454                               cmsBool            BPC[],
455                               cmsFloat64Number   AdaptationStates[],
456                               cmsUInt32Number    dwFlags);
457
458 // Sequence --------------------------------------------------------------------------------------------------------
459
460 cmsSEQ* _cmsReadProfileSequence(cmsHPROFILE hProfile);
461 cmsBool _cmsWriteProfileSequence(cmsHPROFILE hProfile, const cmsSEQ* seq);
462 cmsSEQ* _cmsCompileProfileSequence(cmsContext ContextID, cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[]);
463
464
465 // LUT optimization ------------------------------------------------------------------------------------------------
466
467 cmsUInt16Number  _cmsQuantizeVal(cmsFloat64Number i, int MaxSamples);
468 int              _cmsReasonableGridpointsByColorspace(cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags);
469
470 cmsBool          _cmsEndPointsBySpace(cmsColorSpaceSignature Space,
471                                       cmsUInt16Number **White,
472                                       cmsUInt16Number **Black,
473                                       cmsUInt32Number *nOutputs);
474
475 cmsBool          _cmsOptimizePipeline(cmsPipeline**    Lut,
476                                       int              Intent,
477                                       cmsUInt32Number* InputFormat,
478                                       cmsUInt32Number* OutputFormat,
479                                       cmsUInt32Number* dwFlags );
480
481
482 // Hi level LUT building ----------------------------------------------------------------------------------------------
483
484 cmsPipeline*     _cmsCreateGamutCheckPipeline(cmsContext ContextID,
485                                               cmsHPROFILE hProfiles[],
486                                               cmsBool  BPC[],
487                                               cmsUInt32Number Intents[],
488                                               cmsFloat64Number AdaptationStates[],
489                                               cmsUInt32Number nGamutPCSposition,
490                                               cmsHPROFILE hGamut);
491
492
493 // Formatters ------------------------------------------------------------------------------------------------------------
494
495 #define cmsFLAGS_CAN_CHANGE_FORMATTER     0x02000000   // Allow change buffer format
496
497 cmsBool         _cmsFormatterIsFloat(cmsUInt32Number Type);
498 cmsBool         _cmsFormatterIs8bit(cmsUInt32Number Type);
499
500 cmsFormatter    _cmsGetFormatter(cmsUInt32Number Type,          // Specific type, i.e. TYPE_RGB_8
501                                  cmsFormatterDirection Dir,
502                                  cmsUInt32Number dwFlags);
503
504
505 #ifndef CMS_NO_HALF_SUPPORT 
506
507 // Half float
508 cmsFloat32Number _cmsHalf2Float(cmsUInt16Number h);
509 cmsUInt16Number  _cmsFloat2Half(cmsFloat32Number flt);
510
511 #endif
512
513 // Transform logic ------------------------------------------------------------------------------------------------------
514
515 struct _cmstransform_struct;
516
517 typedef struct {
518
519     // 1-pixel cache (16 bits only)
520     cmsUInt16Number CacheIn[cmsMAXCHANNELS];
521     cmsUInt16Number CacheOut[cmsMAXCHANNELS];
522
523 } _cmsCACHE;
524
525
526
527 // Transformation
528 typedef struct _cmstransform_struct {
529
530     cmsUInt32Number InputFormat, OutputFormat; // Keep formats for further reference
531
532     // Points to transform code
533     _cmsTransformFn xform;
534
535     // Formatters, cannot be embedded into LUT because cache
536     cmsFormatter16 FromInput;
537     cmsFormatter16 ToOutput;
538
539     cmsFormatterFloat FromInputFloat;
540     cmsFormatterFloat ToOutputFloat;
541
542     // 1-pixel cache seed for zero as input (16 bits, read only)
543     _cmsCACHE Cache;
544
545     // A Pipeline holding the full (optimized) transform
546     cmsPipeline* Lut;
547
548     // A Pipeline holding the gamut check. It goes from the input space to bilevel
549     cmsPipeline* GamutCheck;
550
551     // Colorant tables
552     cmsNAMEDCOLORLIST* InputColorant;       // Input Colorant table
553     cmsNAMEDCOLORLIST* OutputColorant;      // Colorant table (for n chans > CMYK)
554
555     // Informational only
556     cmsColorSpaceSignature EntryColorSpace;
557     cmsColorSpaceSignature ExitColorSpace;
558
559     // Profiles used to create the transform
560     cmsSEQ* Sequence;
561
562     cmsUInt32Number  dwOriginalFlags;
563     cmsFloat64Number AdaptationState;
564
565     // The intent of this transform. That is usually the last intent in the profilechain, but may differ
566     cmsUInt32Number RenderingIntent;
567
568     // An id that uniquely identifies the running context. May be null.
569     cmsContext ContextID;
570
571     // A user-defined pointer that can be used to store data for transform plug-ins
572     void* UserData;
573     _cmsFreeUserDataFn FreeUserData;
574
575 } _cmsTRANSFORM;
576
577 // --------------------------------------------------------------------------------------------------
578
579 cmsHTRANSFORM _cmsChain2Lab(cmsContext             ContextID,
580                             cmsUInt32Number        nProfiles,
581                             cmsUInt32Number        InputFormat,
582                             cmsUInt32Number        OutputFormat,
583                             const cmsUInt32Number  Intents[],
584                             const cmsHPROFILE      hProfiles[],
585                             const cmsBool          BPC[],
586                             const cmsFloat64Number AdaptationStates[],
587                             cmsUInt32Number        dwFlags);
588
589
590 cmsToneCurve* _cmsBuildKToneCurve(cmsContext       ContextID,
591                             cmsUInt32Number        nPoints,
592                             cmsUInt32Number        nProfiles,
593                             const cmsUInt32Number  Intents[],
594                             const cmsHPROFILE      hProfiles[],
595                             const cmsBool          BPC[],
596                             const cmsFloat64Number AdaptationStates[],
597                             cmsUInt32Number        dwFlags);
598
599 cmsBool   _cmsAdaptationMatrix(cmsMAT3* r, const cmsMAT3* ConeMatrix, const cmsCIEXYZ* FromIll, const cmsCIEXYZ* ToIll);
600
601 cmsBool   _cmsBuildRGB2XYZtransferMatrix(cmsMAT3* r, const cmsCIExyY* WhitePoint, const cmsCIExyYTRIPLE* Primaries);
602
603
604 #define _lcms_internal_H
605 #endif