author | adinn |
Fri, 26 Jan 2018 16:38:21 +0000 | |
changeset 48682 | 34e45260c040 |
parent 47216 | 71c04702a3d5 |
child 49775 | 8fa5bb0cb937 |
permissions | -rw-r--r-- |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
1 |
/* |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
3 |
* |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
4 |
* This code is free software; you can redistribute it and/or modify it |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
5 |
* under the terms of the GNU General Public License version 2 only, as |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
6 |
* published by the Free Software Foundation. Oracle designates this |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
7 |
* particular file as subject to the "Classpath" exception as provided |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
8 |
* by Oracle in the LICENSE file that accompanied this code. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
9 |
* |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
14 |
* accompanied this code). |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
15 |
* |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
19 |
* |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
22 |
* questions. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
23 |
*/ |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
24 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
25 |
// This file is available under and governed by the GNU General Public |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
26 |
// License version 2 only, as published by the Free Software Foundation. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
27 |
// However, the following notice accompanied the original version of this |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
28 |
// file: |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
29 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
30 |
//--------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
31 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
32 |
// Little Color Management System |
40152 | 33 |
// Copyright (c) 1998-2016 Marti Maria Saguer |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
34 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
35 |
// Permission is hereby granted, free of charge, to any person obtaining |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
36 |
// a copy of this software and associated documentation files (the "Software"), |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
37 |
// to deal in the Software without restriction, including without limitation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
38 |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
39 |
// and/or sell copies of the Software, and to permit persons to whom the Software |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
40 |
// is furnished to do so, subject to the following conditions: |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
41 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
42 |
// The above copyright notice and this permission notice shall be included in |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
43 |
// all copies or substantial portions of the Software. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
44 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
45 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
46 |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
47 |
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
48 |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
49 |
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
50 |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
51 |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
52 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
53 |
//--------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
54 |
// |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
55 |
// This is the plug-in header file. Normal LittleCMS clients should not use it. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
56 |
// It is provided for plug-in writters that may want to access the support |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
57 |
// functions to do low level operations. All plug-in related structures |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
58 |
// are defined here. Including this file forces to include the standard API too. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
59 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
60 |
#ifndef _lcms_plugin_H |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
61 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
62 |
// Deal with Microsoft's attempt at deprecating C standard runtime functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
63 |
#ifdef _MSC_VER |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
64 |
# if (_MSC_VER >= 1400) |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
65 |
# ifndef _CRT_SECURE_NO_DEPRECATE |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
66 |
# define _CRT_SECURE_NO_DEPRECATE |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
67 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
68 |
# ifndef _CRT_SECURE_NO_WARNINGS |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
69 |
# define _CRT_SECURE_NO_WARNINGS |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
70 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
71 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
72 |
#endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
73 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
74 |
#ifndef _lcms2_H |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
75 |
#include "lcms2.h" |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
76 |
#endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
77 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
78 |
// We need some standard C functions. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
79 |
#include <stdlib.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
80 |
#include <math.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
81 |
#include <stdarg.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
82 |
#include <memory.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
83 |
#include <string.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
84 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
85 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
86 |
#ifndef CMS_USE_CPP_API |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
87 |
# ifdef __cplusplus |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
88 |
extern "C" { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
89 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
90 |
#endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
91 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
92 |
// Vector & Matrix operations ----------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
93 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
94 |
// Axis of the matrix/array. No specific meaning at all. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
95 |
#define VX 0 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
96 |
#define VY 1 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
97 |
#define VZ 2 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
98 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
99 |
// Vectors |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
100 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
101 |
cmsFloat64Number n[3]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
102 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
103 |
} cmsVEC3; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
104 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
105 |
// 3x3 Matrix |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
106 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
107 |
cmsVEC3 v[3]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
108 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
109 |
} cmsMAT3; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
110 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
111 |
CMSAPI void CMSEXPORT _cmsVEC3init(cmsVEC3* r, cmsFloat64Number x, cmsFloat64Number y, cmsFloat64Number z); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
112 |
CMSAPI void CMSEXPORT _cmsVEC3minus(cmsVEC3* r, const cmsVEC3* a, const cmsVEC3* b); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
113 |
CMSAPI void CMSEXPORT _cmsVEC3cross(cmsVEC3* r, const cmsVEC3* u, const cmsVEC3* v); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
114 |
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3dot(const cmsVEC3* u, const cmsVEC3* v); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
115 |
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3length(const cmsVEC3* a); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
116 |
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3distance(const cmsVEC3* a, const cmsVEC3* b); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
117 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
118 |
CMSAPI void CMSEXPORT _cmsMAT3identity(cmsMAT3* a); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
119 |
CMSAPI cmsBool CMSEXPORT _cmsMAT3isIdentity(const cmsMAT3* a); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
120 |
CMSAPI void CMSEXPORT _cmsMAT3per(cmsMAT3* r, const cmsMAT3* a, const cmsMAT3* b); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
121 |
CMSAPI cmsBool CMSEXPORT _cmsMAT3inverse(const cmsMAT3* a, cmsMAT3* b); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
122 |
CMSAPI cmsBool CMSEXPORT _cmsMAT3solve(cmsVEC3* x, cmsMAT3* a, cmsVEC3* b); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
123 |
CMSAPI void CMSEXPORT _cmsMAT3eval(cmsVEC3* r, const cmsMAT3* a, const cmsVEC3* v); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
124 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
125 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
126 |
// Error logging ------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
127 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
128 |
CMSAPI void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText, ...); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
129 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
130 |
// Memory management ---------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
131 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
132 |
CMSAPI void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
133 |
CMSAPI void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
134 |
CMSAPI void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
135 |
CMSAPI void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
136 |
CMSAPI void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
137 |
CMSAPI void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
138 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
139 |
// I/O handler ---------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
140 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
141 |
struct _cms_io_handler { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
142 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
143 |
void* stream; // Associated stream, which is implemented differently depending on media. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
144 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
145 |
cmsContext ContextID; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
146 |
cmsUInt32Number UsedSpace; |
14300 | 147 |
cmsUInt32Number ReportedSize; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
148 |
char PhysicalFile[cmsMAX_PATH]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
149 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
150 |
cmsUInt32Number (* Read)(struct _cms_io_handler* iohandler, void *Buffer, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
151 |
cmsUInt32Number size, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
152 |
cmsUInt32Number count); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
153 |
cmsBool (* Seek)(struct _cms_io_handler* iohandler, cmsUInt32Number offset); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
154 |
cmsBool (* Close)(struct _cms_io_handler* iohandler); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
155 |
cmsUInt32Number (* Tell)(struct _cms_io_handler* iohandler); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
156 |
cmsBool (* Write)(struct _cms_io_handler* iohandler, cmsUInt32Number size, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
157 |
const void* Buffer); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
158 |
}; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
159 |
|
40152 | 160 |
// Endianness adjust functions |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
161 |
CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
162 |
CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number Value); |
14300 | 163 |
CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
164 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
165 |
// Helper IO functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
166 |
CMSAPI cmsBool CMSEXPORT _cmsReadUInt8Number(cmsIOHANDLER* io, cmsUInt8Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
167 |
CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Number(cmsIOHANDLER* io, cmsUInt16Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
168 |
CMSAPI cmsBool CMSEXPORT _cmsReadUInt32Number(cmsIOHANDLER* io, cmsUInt32Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
169 |
CMSAPI cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
170 |
CMSAPI cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
171 |
CMSAPI cmsBool CMSEXPORT _cmsRead15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number* n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
172 |
CMSAPI cmsBool CMSEXPORT _cmsReadXYZNumber(cmsIOHANDLER* io, cmsCIEXYZ* XYZ); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
173 |
CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, cmsUInt16Number* Array); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
174 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
175 |
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt8Number(cmsIOHANDLER* io, cmsUInt8Number n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
176 |
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Number(cmsIOHANDLER* io, cmsUInt16Number n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
177 |
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt32Number(cmsIOHANDLER* io, cmsUInt32Number n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
178 |
CMSAPI cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n); |
14300 | 179 |
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
180 |
CMSAPI cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
181 |
CMSAPI cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsIOHANDLER* io, const cmsCIEXYZ* XYZ); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
182 |
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, const cmsUInt16Number* Array); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
183 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
184 |
// ICC base tag |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
185 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
186 |
cmsTagTypeSignature sig; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
187 |
cmsInt8Number reserved[4]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
188 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
189 |
} _cmsTagBase; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
190 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
191 |
// Type base helper functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
192 |
CMSAPI cmsTagTypeSignature CMSEXPORT _cmsReadTypeBase(cmsIOHANDLER* io); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
193 |
CMSAPI cmsBool CMSEXPORT _cmsWriteTypeBase(cmsIOHANDLER* io, cmsTagTypeSignature sig); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
194 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
195 |
// Alignment functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
196 |
CMSAPI cmsBool CMSEXPORT _cmsReadAlignment(cmsIOHANDLER* io); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
197 |
CMSAPI cmsBool CMSEXPORT _cmsWriteAlignment(cmsIOHANDLER* io); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
198 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
199 |
// To deal with text streams. 2K at most |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
200 |
CMSAPI cmsBool CMSEXPORT _cmsIOPrintf(cmsIOHANDLER* io, const char* frm, ...); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
201 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
202 |
// Fixed point helper functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
203 |
CMSAPI cmsFloat64Number CMSEXPORT _cms8Fixed8toDouble(cmsUInt16Number fixed8); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
204 |
CMSAPI cmsUInt16Number CMSEXPORT _cmsDoubleTo8Fixed8(cmsFloat64Number val); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
205 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
206 |
CMSAPI cmsFloat64Number CMSEXPORT _cms15Fixed16toDouble(cmsS15Fixed16Number fix32); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
207 |
CMSAPI cmsS15Fixed16Number CMSEXPORT _cmsDoubleTo15Fixed16(cmsFloat64Number v); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
208 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
209 |
// Date/time helper functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
210 |
CMSAPI void CMSEXPORT _cmsEncodeDateTimeNumber(cmsDateTimeNumber *Dest, const struct tm *Source); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
211 |
CMSAPI void CMSEXPORT _cmsDecodeDateTimeNumber(const cmsDateTimeNumber *Source, struct tm *Dest); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
212 |
|
14300 | 213 |
//---------------------------------------------------------------------------------------------------------- |
214 |
||
215 |
// Shared callbacks for user data |
|
216 |
typedef void (* _cmsFreeUserDataFn)(cmsContext ContextID, void* Data); |
|
217 |
typedef void* (* _cmsDupUserDataFn)(cmsContext ContextID, const void* Data); |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
218 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
219 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
220 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
221 |
// Plug-in foundation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
222 |
#define cmsPluginMagicNumber 0x61637070 // 'acpp' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
223 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
224 |
#define cmsPluginMemHandlerSig 0x6D656D48 // 'memH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
225 |
#define cmsPluginInterpolationSig 0x696E7048 // 'inpH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
226 |
#define cmsPluginParametricCurveSig 0x70617248 // 'parH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
227 |
#define cmsPluginFormattersSig 0x66726D48 // 'frmH |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
228 |
#define cmsPluginTagTypeSig 0x74797048 // 'typH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
229 |
#define cmsPluginTagSig 0x74616748 // 'tagH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
230 |
#define cmsPluginRenderingIntentSig 0x696E7448 // 'intH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
231 |
#define cmsPluginMultiProcessElementSig 0x6D706548 // 'mpeH' |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
232 |
#define cmsPluginOptimizationSig 0x6F707448 // 'optH' |
14300 | 233 |
#define cmsPluginTransformSig 0x7A666D48 // 'xfmH' |
26609 | 234 |
#define cmsPluginMutexSig 0x6D747A48 // 'mtxH' |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
235 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
236 |
typedef struct _cmsPluginBaseStruct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
237 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
238 |
cmsUInt32Number Magic; // 'acpp' signature |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
239 |
cmsUInt32Number ExpectedVersion; // Expected version of LittleCMS |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
240 |
cmsUInt32Number Type; // Type of plug-in |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
241 |
struct _cmsPluginBaseStruct* Next; // For multiple plugin definition. NULL for end of list. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
242 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
243 |
} cmsPluginBase; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
244 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
245 |
// Maximum number of types in a plugin array |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
246 |
#define MAX_TYPES_IN_LCMS_PLUGIN 20 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
247 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
248 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
249 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
250 |
// Memory handler. Each new plug-in type replaces current behaviour |
26609 | 251 |
|
252 |
typedef void* (* _cmsMallocFnPtrType)(cmsContext ContextID, cmsUInt32Number size); |
|
253 |
typedef void (* _cmsFreeFnPtrType)(cmsContext ContextID, void *Ptr); |
|
254 |
typedef void* (* _cmsReallocFnPtrType)(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); |
|
255 |
||
256 |
typedef void* (* _cmsMalloZerocFnPtrType)(cmsContext ContextID, cmsUInt32Number size); |
|
257 |
typedef void* (* _cmsCallocFnPtrType)(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); |
|
258 |
typedef void* (* _cmsDupFnPtrType)(cmsContext ContextID, const void* Org, cmsUInt32Number size); |
|
259 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
260 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
261 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
262 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
263 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
264 |
// Required |
26609 | 265 |
_cmsMallocFnPtrType MallocPtr; |
266 |
_cmsFreeFnPtrType FreePtr; |
|
267 |
_cmsReallocFnPtrType ReallocPtr; |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
268 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
269 |
// Optional |
26609 | 270 |
_cmsMalloZerocFnPtrType MallocZeroPtr; |
271 |
_cmsCallocFnPtrType CallocPtr; |
|
272 |
_cmsDupFnPtrType DupPtr; |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
273 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
274 |
} cmsPluginMemHandler; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
275 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
276 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
277 |
// ------------------------------------------------------------------------------------------------------------------ |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
278 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
279 |
// Interpolation. 16 bits and floating point versions. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
280 |
struct _cms_interp_struc; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
281 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
282 |
// Interpolation callbacks |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
283 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
284 |
// 16 bits forward interpolation. This function performs precision-limited linear interpolation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
285 |
// and is supposed to be quite fast. Implementation may be tetrahedral or trilinear, and plug-ins may |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
286 |
// choose to implement any other interpolation algorithm. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
287 |
typedef void (* _cmsInterpFn16)(register const cmsUInt16Number Input[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
288 |
register cmsUInt16Number Output[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
289 |
register const struct _cms_interp_struc* p); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
290 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
291 |
// Floating point forward interpolation. Full precision interpolation using floats. This is not a |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
292 |
// time critical function. Implementation may be tetrahedral or trilinear, and plug-ins may |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
293 |
// choose to implement any other interpolation algorithm. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
294 |
typedef void (* _cmsInterpFnFloat)(cmsFloat32Number const Input[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
295 |
cmsFloat32Number Output[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
296 |
const struct _cms_interp_struc* p); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
297 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
298 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
299 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
300 |
// This type holds a pointer to an interpolator that can be either 16 bits or float |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
301 |
typedef union { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
302 |
_cmsInterpFn16 Lerp16; // Forward interpolation in 16 bits |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
303 |
_cmsInterpFnFloat LerpFloat; // Forward interpolation in floating point |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
304 |
} cmsInterpFunction; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
305 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
306 |
// Flags for interpolator selection |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
307 |
#define CMS_LERP_FLAGS_16BITS 0x0000 // The default |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
308 |
#define CMS_LERP_FLAGS_FLOAT 0x0001 // Requires different implementation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
309 |
#define CMS_LERP_FLAGS_TRILINEAR 0x0100 // Hint only |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
310 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
311 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
312 |
#define MAX_INPUT_DIMENSIONS 8 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
313 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
314 |
typedef struct _cms_interp_struc { // Used on all interpolations. Supplied by lcms2 when calling the interpolation function |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
315 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
316 |
cmsContext ContextID; // The calling thread |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
317 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
318 |
cmsUInt32Number dwFlags; // Keep original flags |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
319 |
cmsUInt32Number nInputs; // != 1 only in 3D interpolation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
320 |
cmsUInt32Number nOutputs; // != 1 only in 3D interpolation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
321 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
322 |
cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
323 |
cmsUInt32Number Domain[MAX_INPUT_DIMENSIONS]; // Domain = nSamples - 1 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
324 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
325 |
cmsUInt32Number opta[MAX_INPUT_DIMENSIONS]; // Optimization for 3D CLUT. This is the number of nodes premultiplied for each |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
326 |
// dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
327 |
// Samplings may vary according of the number of nodes for each dimension. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
328 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
329 |
const void *Table; // Points to the actual interpolation table |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
330 |
cmsInterpFunction Interpolation; // Points to the function to do the interpolation |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
331 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
332 |
} cmsInterpParams; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
333 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
334 |
// Interpolators factory |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
335 |
typedef cmsInterpFunction (* cmsInterpFnFactory)(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
336 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
337 |
// The plug-in |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
338 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
339 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
340 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
341 |
// Points to a user-supplied function which implements the factory |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
342 |
cmsInterpFnFactory InterpolatorsFactory; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
343 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
344 |
} cmsPluginInterpolation; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
345 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
346 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
347 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
348 |
// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
349 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
350 |
// Evaluator callback for user-suplied parametric curves. May implement more than one type |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
351 |
typedef cmsFloat64Number (* cmsParametricCurveEvaluator)(cmsInt32Number Type, const cmsFloat64Number Params[10], cmsFloat64Number R); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
352 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
353 |
// Plug-in may implement an arbitrary number of parametric curves |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
354 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
355 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
356 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
357 |
cmsUInt32Number nFunctions; // Number of supported functions |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
358 |
cmsUInt32Number FunctionTypes[MAX_TYPES_IN_LCMS_PLUGIN]; // The identification types |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
359 |
cmsUInt32Number ParameterCount[MAX_TYPES_IN_LCMS_PLUGIN]; // Number of parameters for each function |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
360 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
361 |
cmsParametricCurveEvaluator Evaluator; // The evaluator |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
362 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
363 |
} cmsPluginParametricCurves; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
364 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
365 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
366 |
// Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
367 |
// cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
368 |
// Formatter16 callback |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
369 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
370 |
struct _cmstransform_struct; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
371 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
372 |
typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
373 |
register cmsUInt16Number Values[], |
40152 | 374 |
register cmsUInt8Number* Buffer, |
375 |
register cmsUInt32Number Stride); |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
376 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
377 |
typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
378 |
cmsFloat32Number Values[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
379 |
cmsUInt8Number* Buffer, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
380 |
cmsUInt32Number Stride); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
381 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
382 |
// This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
383 |
typedef union { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
384 |
cmsFormatter16 Fmt16; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
385 |
cmsFormatterFloat FmtFloat; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
386 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
387 |
} cmsFormatter; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
388 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
389 |
#define CMS_PACK_FLAGS_16BITS 0x0000 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
390 |
#define CMS_PACK_FLAGS_FLOAT 0x0001 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
391 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
392 |
typedef enum { cmsFormatterInput=0, cmsFormatterOutput=1 } cmsFormatterDirection; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
393 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
394 |
typedef cmsFormatter (* cmsFormatterFactory)(cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
395 |
cmsFormatterDirection Dir, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
396 |
cmsUInt32Number dwFlags); // precision |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
397 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
398 |
// Plug-in may implement an arbitrary number of formatters |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
399 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
400 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
401 |
cmsFormatterFactory FormattersFactory; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
402 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
403 |
} cmsPluginFormatters; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
404 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
405 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
406 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
407 |
// Tag type handler. Each type is free to return anything it wants, and it is up to the caller to |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
408 |
// know in advance what is the type contained in the tag. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
409 |
typedef struct _cms_typehandler_struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
410 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
411 |
cmsTagTypeSignature Signature; // The signature of the type |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
412 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
413 |
// Allocates and reads items |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
414 |
void * (* ReadPtr)(struct _cms_typehandler_struct* self, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
415 |
cmsIOHANDLER* io, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
416 |
cmsUInt32Number* nItems, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
417 |
cmsUInt32Number SizeOfTag); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
418 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
419 |
// Writes n Items |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
420 |
cmsBool (* WritePtr)(struct _cms_typehandler_struct* self, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
421 |
cmsIOHANDLER* io, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
422 |
void* Ptr, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
423 |
cmsUInt32Number nItems); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
424 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
425 |
// Duplicate an item or array of items |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
426 |
void* (* DupPtr)(struct _cms_typehandler_struct* self, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
427 |
const void *Ptr, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
428 |
cmsUInt32Number n); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
429 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
430 |
// Free all resources |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
431 |
void (* FreePtr)(struct _cms_typehandler_struct* self, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
432 |
void *Ptr); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
433 |
|
14300 | 434 |
// Additional parameters used by the calling thread |
435 |
cmsContext ContextID; |
|
436 |
cmsUInt32Number ICCVersion; |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
437 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
438 |
} cmsTagTypeHandler; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
439 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
440 |
// Each plug-in implements a single type |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
441 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
442 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
443 |
cmsTagTypeHandler Handler; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
444 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
445 |
} cmsPluginTagType; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
446 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
447 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
448 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
449 |
// This is the tag plugin, which identifies tags. For writing, a pointer to function is provided. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
450 |
// This function should return the desired type for this tag, given the version of profile |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
451 |
// and the data being serialized. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
452 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
453 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
454 |
cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
455 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
456 |
// For reading. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
457 |
cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum) |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
458 |
cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
459 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
460 |
// For writting |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
461 |
cmsTagTypeSignature (* DecideType)(cmsFloat64Number ICCVersion, const void *Data); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
462 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
463 |
} cmsTagDescriptor; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
464 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
465 |
// Plug-in implements a single tag |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
466 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
467 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
468 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
469 |
cmsTagSignature Signature; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
470 |
cmsTagDescriptor Descriptor; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
471 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
472 |
} cmsPluginTag; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
473 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
474 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
475 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
476 |
// Custom intents. This function should join all profiles specified in the array in |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
477 |
// a single LUT. Any custom intent in the chain redirects to custom function. If more than |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
478 |
// one custom intent is found, the one located first is invoked. Usually users should use only one |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
479 |
// custom intent, so mixing custom intents in same multiprofile transform is not supported. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
480 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
481 |
typedef cmsPipeline* (* cmsIntentFn)( cmsContext ContextID, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
482 |
cmsUInt32Number nProfiles, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
483 |
cmsUInt32Number Intents[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
484 |
cmsHPROFILE hProfiles[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
485 |
cmsBool BPC[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
486 |
cmsFloat64Number AdaptationStates[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
487 |
cmsUInt32Number dwFlags); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
488 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
489 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
490 |
// Each plug-in defines a single intent number. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
491 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
492 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
493 |
cmsUInt32Number Intent; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
494 |
cmsIntentFn Link; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
495 |
char Description[256]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
496 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
497 |
} cmsPluginRenderingIntent; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
498 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
499 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
500 |
// The default ICC intents (perceptual, saturation, rel.col and abs.col) |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
501 |
CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
502 |
cmsUInt32Number nProfiles, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
503 |
cmsUInt32Number Intents[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
504 |
cmsHPROFILE hProfiles[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
505 |
cmsBool BPC[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
506 |
cmsFloat64Number AdaptationStates[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
507 |
cmsUInt32Number dwFlags); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
508 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
509 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
510 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
511 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
512 |
// Pipelines, Multi Process Elements. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
513 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
514 |
typedef void (* _cmsStageEvalFn) (const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage* mpe); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
515 |
typedef void*(* _cmsStageDupElemFn) (cmsStage* mpe); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
516 |
typedef void (* _cmsStageFreeElemFn) (cmsStage* mpe); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
517 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
518 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
519 |
// This function allocates a generic MPE |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
520 |
CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
521 |
cmsStageSignature Type, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
522 |
cmsUInt32Number InputChannels, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
523 |
cmsUInt32Number OutputChannels, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
524 |
_cmsStageEvalFn EvalPtr, // Points to fn that evaluates the element (always in floating point) |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
525 |
_cmsStageDupElemFn DupElemPtr, // Points to a fn that duplicates the stage |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
526 |
_cmsStageFreeElemFn FreePtr, // Points to a fn that sets the element free |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
527 |
void* Data); // A generic pointer to whatever memory needed by the element |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
528 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
529 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
530 |
cmsTagTypeHandler Handler; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
531 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
532 |
} cmsPluginMultiProcessElement; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
533 |
|
14300 | 534 |
|
535 |
// Data kept in "Element" member of cmsStage |
|
536 |
||
537 |
// Curves |
|
538 |
typedef struct { |
|
539 |
cmsUInt32Number nCurves; |
|
540 |
cmsToneCurve** TheCurves; |
|
541 |
||
542 |
} _cmsStageToneCurvesData; |
|
543 |
||
544 |
// Matrix |
|
545 |
typedef struct { |
|
546 |
cmsFloat64Number* Double; // floating point for the matrix |
|
547 |
cmsFloat64Number* Offset; // The offset |
|
548 |
||
549 |
} _cmsStageMatrixData; |
|
550 |
||
551 |
// CLUT |
|
552 |
typedef struct { |
|
553 |
||
554 |
union { // Can have only one of both representations at same time |
|
555 |
cmsUInt16Number* T; // Points to the table 16 bits table |
|
556 |
cmsFloat32Number* TFloat; // Points to the cmsFloat32Number table |
|
557 |
||
558 |
} Tab; |
|
559 |
||
560 |
cmsInterpParams* Params; |
|
561 |
cmsUInt32Number nEntries; |
|
562 |
cmsBool HasFloatValues; |
|
563 |
||
564 |
} _cmsStageCLutData; |
|
565 |
||
566 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
567 |
//---------------------------------------------------------------------------------------------------------- |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
568 |
// Optimization. Using this plug-in, additional optimization strategies may be implemented. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
569 |
// The function should return TRUE if any optimization is done on the LUT, this terminates |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
570 |
// the optimization search. Or FALSE if it is unable to optimize and want to give a chance |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
571 |
// to the rest of optimizers. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
572 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
573 |
typedef void (* _cmsOPTeval16Fn)(register const cmsUInt16Number In[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
574 |
register cmsUInt16Number Out[], |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
575 |
register const void* Data); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
576 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
577 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
578 |
typedef cmsBool (* _cmsOPToptimizeFn)(cmsPipeline** Lut, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
579 |
cmsUInt32Number Intent, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
580 |
cmsUInt32Number* InputFormat, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
581 |
cmsUInt32Number* OutputFormat, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
582 |
cmsUInt32Number* dwFlags); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
583 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
584 |
// This function may be used to set the optional evaluator and a block of private data. If private data is being used, an optional |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
585 |
// duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality. |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
586 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
587 |
CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
588 |
_cmsOPTeval16Fn Eval16, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
589 |
void* PrivateData, |
14300 | 590 |
_cmsFreeUserDataFn FreePrivateDataFn, |
591 |
_cmsDupUserDataFn DupPrivateDataFn); |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
592 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
593 |
typedef struct { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
594 |
cmsPluginBase base; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
595 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
596 |
// Optimize entry point |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
597 |
_cmsOPToptimizeFn OptimizePtr; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
598 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
599 |
} cmsPluginOptimization; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
600 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
601 |
//---------------------------------------------------------------------------------------------------------- |
14300 | 602 |
// Full xform |
40152 | 603 |
|
604 |
typedef struct { |
|
605 |
cmsUInt32Number BytesPerLineIn; |
|
606 |
cmsUInt32Number BytesPerLineOut; |
|
607 |
cmsUInt32Number BytesPerPlaneIn; |
|
608 |
cmsUInt32Number BytesPerPlaneOut; |
|
609 |
||
610 |
} cmsStride; |
|
611 |
||
612 |
typedef void (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo, // Legacy function, handles just ONE scanline. |
|
14300 | 613 |
const void* InputBuffer, |
614 |
void* OutputBuffer, |
|
615 |
cmsUInt32Number Size, |
|
40152 | 616 |
cmsUInt32Number Stride); // Stride in bytes to the next plana in planar formats |
617 |
||
618 |
||
619 |
typedef void (*_cmsTransform2Fn)(struct _cmstransform_struct *CMMcargo, |
|
620 |
const void* InputBuffer, |
|
621 |
void* OutputBuffer, |
|
622 |
cmsUInt32Number PixelsPerLine, |
|
623 |
cmsUInt32Number LineCount, |
|
624 |
const cmsStride* Stride); |
|
14300 | 625 |
|
626 |
typedef cmsBool (* _cmsTransformFactory)(_cmsTransformFn* xform, |
|
627 |
void** UserData, |
|
628 |
_cmsFreeUserDataFn* FreePrivateDataFn, |
|
629 |
cmsPipeline** Lut, |
|
630 |
cmsUInt32Number* InputFormat, |
|
631 |
cmsUInt32Number* OutputFormat, |
|
632 |
cmsUInt32Number* dwFlags); |
|
633 |
||
40152 | 634 |
typedef cmsBool (* _cmsTransform2Factory)(_cmsTransform2Fn* xform, |
635 |
void** UserData, |
|
636 |
_cmsFreeUserDataFn* FreePrivateDataFn, |
|
637 |
cmsPipeline** Lut, |
|
638 |
cmsUInt32Number* InputFormat, |
|
639 |
cmsUInt32Number* OutputFormat, |
|
640 |
cmsUInt32Number* dwFlags); |
|
641 |
||
14300 | 642 |
|
643 |
// Retrieve user data as specified by the factory |
|
644 |
CMSAPI void CMSEXPORT _cmsSetTransformUserData(struct _cmstransform_struct *CMMcargo, void* ptr, _cmsFreeUserDataFn FreePrivateDataFn); |
|
645 |
CMSAPI void * CMSEXPORT _cmsGetTransformUserData(struct _cmstransform_struct *CMMcargo); |
|
646 |
||
647 |
||
648 |
// Retrieve formatters |
|
649 |
CMSAPI void CMSEXPORT _cmsGetTransformFormatters16 (struct _cmstransform_struct *CMMcargo, cmsFormatter16* FromInput, cmsFormatter16* ToOutput); |
|
650 |
CMSAPI void CMSEXPORT _cmsGetTransformFormattersFloat(struct _cmstransform_struct *CMMcargo, cmsFormatterFloat* FromInput, cmsFormatterFloat* ToOutput); |
|
651 |
||
652 |
typedef struct { |
|
653 |
cmsPluginBase base; |
|
654 |
||
655 |
// Transform entry point |
|
40152 | 656 |
union { |
657 |
_cmsTransformFactory legacy_xform; |
|
658 |
_cmsTransform2Factory xform; |
|
659 |
} factories; |
|
14300 | 660 |
|
661 |
} cmsPluginTransform; |
|
662 |
||
26609 | 663 |
//---------------------------------------------------------------------------------------------------------- |
664 |
// Mutex |
|
665 |
||
666 |
typedef void* (* _cmsCreateMutexFnPtrType)(cmsContext ContextID); |
|
667 |
typedef void (* _cmsDestroyMutexFnPtrType)(cmsContext ContextID, void* mtx); |
|
668 |
typedef cmsBool (* _cmsLockMutexFnPtrType)(cmsContext ContextID, void* mtx); |
|
669 |
typedef void (* _cmsUnlockMutexFnPtrType)(cmsContext ContextID, void* mtx); |
|
670 |
||
671 |
typedef struct { |
|
672 |
cmsPluginBase base; |
|
673 |
||
674 |
_cmsCreateMutexFnPtrType CreateMutexPtr; |
|
675 |
_cmsDestroyMutexFnPtrType DestroyMutexPtr; |
|
676 |
_cmsLockMutexFnPtrType LockMutexPtr; |
|
677 |
_cmsUnlockMutexFnPtrType UnlockMutexPtr; |
|
678 |
||
679 |
} cmsPluginMutex; |
|
680 |
||
681 |
CMSAPI void* CMSEXPORT _cmsCreateMutex(cmsContext ContextID); |
|
682 |
CMSAPI void CMSEXPORT _cmsDestroyMutex(cmsContext ContextID, void* mtx); |
|
683 |
CMSAPI cmsBool CMSEXPORT _cmsLockMutex(cmsContext ContextID, void* mtx); |
|
684 |
CMSAPI void CMSEXPORT _cmsUnlockMutex(cmsContext ContextID, void* mtx); |
|
685 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
686 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
687 |
#ifndef CMS_USE_CPP_API |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
688 |
# ifdef __cplusplus |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
689 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
690 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
691 |
#endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
692 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
693 |
#define _lcms_plugin_H |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
diff
changeset
|
694 |
#endif |