jdk/src/share/native/sun/java2d/cmm/lcms/lcms.h
author bae
Thu, 01 Jul 2010 12:04:14 +0400
changeset 6868 f9131565859e
parent 5506 202f599c92aa
permissions -rw-r--r--
6963489: ZDI-CAN-803: Sun JRE ICC Profile Device Information Tag Remote Code Execution Vulnerability Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    22
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
// This file is available under and governed by the GNU General Public
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
// License version 2 only, as published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
// However, the following notice accompanied the original version of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
// file:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
//  Little cms
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    32
//  Copyright (C) 1998-2007 Marti Maria
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
// Permission is hereby granted, free of charge, to any person obtaining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
// a copy of this software and associated documentation files (the "Software"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
// to deal in the Software without restriction, including without limitation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
// and/or sell copies of the Software, and to permit persons to whom the Software
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
// is furnished to do so, subject to the following conditions:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
// The above copyright notice and this permission notice shall be included in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
// all copies or substantial portions of the Software.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    52
// Version 1.18
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    53
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#ifndef __cms_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
// ********** Configuration toggles ****************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
//   Optimization mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
// Note that USE_ASSEMBLER Is fastest by far, but it is limited to Pentium.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
// USE_FLOAT are the generic floating-point routines. USE_C should work on
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
// virtually any machine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
//#define USE_FLOAT        1
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    65
// #define USE_C            1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#define USE_ASSEMBLER    1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
// Define this if you are using this package as a DLL (windows only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
// #define LCMS_DLL     1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
// #define LCMS_DLL_BUILD   1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
// Uncomment if you are trying the engine in a non-windows environment
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
// like linux, SGI, VAX, FreeBSD, BeOS, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define NON_WINDOWS  1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
// Uncomment this one if you are using big endian machines (only meaningful
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
// when NON_WINDOWS is used)
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    79
// #define USE_BIG_ENDIAN   1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
// Uncomment this one if your compiler/machine does support the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
// "long long" type This will speedup fixed point math. (USE_C only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#define USE_INT64        1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
// Some machines does not have a reliable 'swab' function. Usually
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
// leave commented unless the testbed diagnoses the contrary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
// #define USE_CUSTOM_SWAB   1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
// Uncomment this if your compiler supports inline
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define USE_INLINE  1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
// Uncomment this if your compiler doesn't work with fast floor function
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
// #define USE_DEFAULT_FLOOR_CONVERSION  1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
// Uncomment this line on multithreading environments
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
// #define USE_PTHREADS    1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    98
// Uncomment this line if you want lcms to use the black point tag in profile,
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
    99
// if commented, lcms will compute the black point by its own.
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   100
// It is safer to leve it commented out
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   101
// #define HONOR_BLACK_POINT_TAG    1
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   102
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
// ********** End of configuration toggles ******************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   105
#define LCMS_VERSION        118
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
// Microsoft VisualC++
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
// Deal with Microsoft's attempt at deprecating C standard runtime functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#ifdef _MSC_VER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#    undef NON_WINDOWS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#    if (_MSC_VER >= 1400)
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   113
#      ifndef _CRT_SECURE_NO_DEPRECATE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
#        define _CRT_SECURE_NO_DEPRECATE 1
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   115
#      endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
// Borland C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#ifdef __BORLANDC__
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#    undef NON_WINDOWS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#include <stdio.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#include <stdlib.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#include <math.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#include <assert.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#include <stdarg.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#include <time.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
// Metroworks CodeWarrior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#ifdef __MWERKS__
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#   define unlink remove
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#   if WIN32
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#       define USE_CUSTOM_SWAB 1
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   137
#       undef  NON_WINDOWS
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#   else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#       define NON_WINDOWS   1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#   endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
// Here comes the Non-Windows settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#ifdef NON_WINDOWS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
// Non windows environments. Also avoid indentation on includes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#ifdef USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
#   include <pthread.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
typedef    pthread_rwlock_t      LCMS_RWLOCK_T;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#   define LCMS_CREATE_LOCK(x)       pthread_rwlock_init((x), NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#   define LCMS_FREE_LOCK(x)         pthread_rwlock_destroy((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#   define LCMS_READ_LOCK(x)             pthread_rwlock_rdlock((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
#   define LCMS_WRITE_LOCK(x)        pthread_rwlock_wrlock((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#   define LCMS_UNLOCK(x)            pthread_rwlock_unlock((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#undef LCMS_DLL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#ifdef  USE_ASSEMBLER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
#  undef  USE_ASSEMBLER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#  define USE_C               1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
#ifdef _HOST_BIG_ENDIAN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
#   define USE_BIG_ENDIAN      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   171
#if defined(__sgi__) || defined(__sgi) || defined(__powerpc__) || defined(sparc) || defined(__ppc__) || defined(__s390__) || defined(__s390x__)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#   define USE_BIG_ENDIAN      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   175
#if TARGET_CPU_PPC
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#   define USE_BIG_ENDIAN   1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   179
#if macintosh
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   180
# ifndef __LITTLE_ENDIAN__
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   181
#   define USE_BIG_ENDIAN      1
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   182
# endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   183
#endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   184
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   185
#ifdef __BIG_ENDIAN__
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
#   define USE_BIG_ENDIAN      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
#ifdef WORDS_BIGENDIAN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
#   define USE_BIG_ENDIAN      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#  include <sys/types.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
#  define USE_INT64           1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
#  define LCMSSLONGLONG       int64_t
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
#  define LCMSULONGLONG       u_int64_t
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
#ifdef USE_INT64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
#   ifndef LCMSULONGLONG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
#       define LCMSULONGLONG unsigned long long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
#       define LCMSSLONGLONG long long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
#   endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#if !defined(__INTEGRITY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
#   include <memory.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
#include <string.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
#if defined(__GNUC__) || defined(__FreeBSD__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#   include <unistd.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
#ifndef LCMS_WIN_TYPES_ALREADY_DEFINED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
typedef unsigned char BYTE, *LPBYTE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
typedef unsigned short WORD, *LPWORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
typedef unsigned long DWORD, *LPDWORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
typedef char *LPSTR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
typedef void *LPVOID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
#define ZeroMemory(p,l)     memset((p),0,(l))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
#define CopyMemory(d,s,l)   memcpy((d),(s),(l))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
#define FAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
#ifndef stricmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
#   define stricmp strcasecmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
#ifndef FALSE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
#       define FALSE 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
#ifndef TRUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
#       define TRUE  1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
#define LOWORD(l)    ((WORD)(l))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#define HIWORD(l)    ((WORD)((DWORD)(l) >> 16))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
#ifndef MAX_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
#       define MAX_PATH     (256)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
#define cdecl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
// The specification for "inline" is section 6.7.4 of the C99 standard (ISO/IEC 9899:1999).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
#define LCMS_INLINE static inline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
// Win32 stuff
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
#ifndef WIN32_LEAN_AND_MEAN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
#  define WIN32_LEAN_AND_MEAN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
#include <windows.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   265
#ifdef _WIN64
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   266
# ifdef USE_ASSEMBLER
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   267
#    undef  USE_ASSEMBLER
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   268
#    define USE_C           1
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   269
# endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   270
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
#ifdef  USE_INT64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
#  ifndef LCMSULONGLONG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
#    define LCMSULONGLONG unsigned __int64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
#    define LCMSSLONGLONG __int64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
#  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
// This works for both VC & BorlandC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
#define LCMS_INLINE __inline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
#ifdef USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
typedef CRITICAL_SECTION LCMS_RWLOCK_T;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
#   define LCMS_CREATE_LOCK(x)       InitializeCriticalSection((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
#   define LCMS_FREE_LOCK(x)         DeleteCriticalSection((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
#   define LCMS_READ_LOCK(x)             EnterCriticalSection((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
#   define LCMS_WRITE_LOCK(x)        EnterCriticalSection((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
#   define LCMS_UNLOCK(x)            LeaveCriticalSection((x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
#ifndef USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
typedef int LCMS_RWLOCK_T;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
#   define LCMS_CREATE_LOCK(x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
#   define LCMS_FREE_LOCK(x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
#   define LCMS_READ_LOCK(x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
#   define LCMS_WRITE_LOCK(x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
#   define LCMS_UNLOCK(x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   302
// Base types
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   303
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   304
typedef int   LCMSBOOL;
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   305
typedef void* LCMSHANDLE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
#include "icc34.h"          // ICC header file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
// Some tag & type additions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
#define lcmsSignature                  ((icSignature)           0x6c636d73L)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
#define icSigLuvKData                  ((icColorSpaceSignature) 0x4C75764BL)  // 'LuvK'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
#define icSigHexachromeData            ((icColorSpaceSignature) 0x4d434836L)  // MCH6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
#define icSigHeptachromeData           ((icColorSpaceSignature) 0x4d434837L)  // MCH7
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
#define icSigOctachromeData            ((icColorSpaceSignature) 0x4d434838L)  // MCH8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
#define icSigMCH5Data                  ((icColorSpaceSignature) 0x4d434835L)  // MCH5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
#define icSigMCH6Data                  ((icColorSpaceSignature) 0x4d434836L)  // MCH6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
#define icSigMCH7Data                  ((icColorSpaceSignature) 0x4d434837L)  // MCH7
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
#define icSigMCH8Data                  ((icColorSpaceSignature) 0x4d434838L)  // MCH8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
#define icSigMCH9Data                  ((icColorSpaceSignature) 0x4d434839L)  // MCH9
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
#define icSigMCHAData                  ((icColorSpaceSignature) 0x4d434841L)  // MCHA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
#define icSigMCHBData                  ((icColorSpaceSignature) 0x4d434842L)  // MCHB
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
#define icSigMCHCData                  ((icColorSpaceSignature) 0x4d434843L)  // MCHC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
#define icSigMCHDData                  ((icColorSpaceSignature) 0x4d434844L)  // MCHD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
#define icSigMCHEData                  ((icColorSpaceSignature) 0x4d434845L)  // MCHE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
#define icSigMCHFData                  ((icColorSpaceSignature) 0x4d434846L)  // MCHF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
#define icSigChromaticityTag            ((icTagSignature) 0x6368726dL) // As per Addendum 2 to Spec. ICC.1:1998-09
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
#define icSigChromaticAdaptationTag     ((icTagSignature) 0x63686164L) // 'chad'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
#define icSigColorantTableTag           ((icTagSignature) 0x636c7274L) // 'clrt'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
#define icSigColorantTableOutTag        ((icTagSignature) 0x636c6f74L) // 'clot'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
#define icSigParametricCurveType        ((icTagTypeSignature) 0x70617261L)  // parametric (ICC 4.0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
#define icSigMultiLocalizedUnicodeType  ((icTagTypeSignature) 0x6D6C7563L)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
#define icSigS15Fixed16ArrayType        ((icTagTypeSignature) 0x73663332L)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
#define icSigChromaticityType           ((icTagTypeSignature) 0x6368726dL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
#define icSiglutAtoBType                ((icTagTypeSignature) 0x6d414220L)  // mAB
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
#define icSiglutBtoAType                ((icTagTypeSignature) 0x6d424120L)  // mBA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
#define icSigColorantTableType          ((icTagTypeSignature) 0x636c7274L)  // clrt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    icUInt8Number       gridPoints[16]; // Number of grid points in each dimension.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    icUInt8Number       prec;           // Precision of data elements in bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    icUInt8Number       pad1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    icUInt8Number       pad2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    icUInt8Number       pad3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    /*icUInt8Number     data[icAny];     Data follows see spec for size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
} icCLutStruct;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
// icLutAtoB
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    icUInt8Number       inputChan;      // Number of input channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    icUInt8Number       outputChan;     // Number of output channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    icUInt8Number       pad1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    icUInt8Number       pad2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    icUInt32Number      offsetB;        // Offset to first "B" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    icUInt32Number      offsetMat;      // Offset to matrix
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    icUInt32Number      offsetM;        // Offset to first "M" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    icUInt32Number      offsetC;        // Offset to CLUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    icUInt32Number      offsetA;        // Offset to first "A" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    /*icUInt8Number     data[icAny];     Data follows see spec for size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
} icLutAtoB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
// icLutBtoA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    icUInt8Number       inputChan;      // Number of input channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    icUInt8Number       outputChan;     // Number of output channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    icUInt8Number       pad1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    icUInt8Number       pad2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    icUInt32Number      offsetB;        // Offset to first "B" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    icUInt32Number      offsetMat;      // Offset to matrix
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    icUInt32Number      offsetM;        // Offset to first "M" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    icUInt32Number      offsetC;        // Offset to CLUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    icUInt32Number      offsetA;        // Offset to first "A" curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    /*icUInt8Number     data[icAny];     Data follows see spec for size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
} icLutBtoA;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
// Calling convention
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
#ifdef NON_WINDOWS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
#  define LCMSEXPORT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
#  define LCMSAPI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
# ifdef LCMS_DLL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
#   ifdef __BORLANDC__
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
#      define LCMSEXPORT __stdcall _export
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
#      define LCMSAPI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
#   else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
       // VC++
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
#       define LCMSEXPORT  _stdcall
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
#       ifdef LCMS_DLL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
#           define LCMSAPI     __declspec(dllexport)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
#       else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
#           define LCMSAPI     __declspec(dllimport)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
#       endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
#   endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
# else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
#       define LCMSEXPORT cdecl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
#       define LCMSAPI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
# endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
#ifdef  USE_ASSEMBLER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
#ifdef __BORLANDC__
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
#      define ASM     asm
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
#      define RET(v)  return(v)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
      // VC++
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
#      define ASM     __asm
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
#      define RET(v)  return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
#ifdef _MSC_VER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
#ifndef  stricmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
#      define stricmp _stricmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
#ifndef unlink
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
#      define unlink  _unlink
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
#ifndef swab
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
#      define swab    _swab
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
#ifndef itoa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
#       define itoa   _itoa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
#ifndef fileno
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
#       define fileno   _fileno
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
#ifndef strupr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
#       define strupr   _strupr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
#ifndef hypot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
#       define hypot    _hypot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
#endif
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   450
#ifndef snprintf
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   451
#       define snprintf  _snprintf
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   452
#endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   453
#ifndef vsnprintf
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   454
#       define vsnprintf  _vsnprintf
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   455
#endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   456
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   457
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
#ifndef M_PI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
#       define M_PI    3.14159265358979323846
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
#ifndef LOGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
#       define LOGE   0.4342944819
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
// ********** Little cms API ***************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
typedef LCMSHANDLE cmsHPROFILE;        // Opaque typedefs to hide internals
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
typedef LCMSHANDLE cmsHTRANSFORM;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
#define MAXCHANNELS  16                // Maximum number of channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
// Format of pixel is defined by one DWORD, using bit fields as follows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
//
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   478
//            D TTTTT U Y F P X S EEE CCCC BBB
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
//
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   480
//            D: Use dither (8 bits only)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
//            T: Pixeltype
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
//            F: Flavor  0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
//            P: Planar? 0=Chunky, 1=Planar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
//            X: swap 16 bps endianess?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
//            S: Do swap? ie, BGR, KYMC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
//            E: Extra samples
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
//            C: Channels (Samples per pixel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
//            B: Bytes per sample
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
//            Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   492
#define DITHER_SH(s)           ((s) << 22)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
#define COLORSPACE_SH(s)       ((s) << 16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
#define SWAPFIRST_SH(s)        ((s) << 14)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
#define FLAVOR_SH(s)           ((s) << 13)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
#define PLANAR_SH(p)           ((p) << 12)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
#define ENDIAN16_SH(e)         ((e) << 11)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
#define DOSWAP_SH(e)           ((e) << 10)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
#define EXTRA_SH(e)            ((e) << 7)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
#define CHANNELS_SH(c)         ((c) << 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
#define BYTES_SH(b)            (b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
// Pixel types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
#define PT_ANY       0    // Don't check colorspace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
                          // 1 & 2 are reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
#define PT_GRAY      3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
#define PT_RGB       4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
#define PT_CMY       5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
#define PT_CMYK      6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
#define PT_YCbCr     7
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
#define PT_YUV       8      // Lu'v'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
#define PT_XYZ       9
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
#define PT_Lab       10
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
#define PT_YUVK      11     // Lu'v'K
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
#define PT_HSV       12
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
#define PT_HLS       13
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
#define PT_Yxy       14
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
#define PT_HiFi      15
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
#define PT_HiFi7     16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
#define PT_HiFi8     17
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
#define PT_HiFi9     18
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
#define PT_HiFi10    19
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
#define PT_HiFi11    20
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
#define PT_HiFi12    21
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
#define PT_HiFi13    22
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
#define PT_HiFi14    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
#define PT_HiFi15    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
#define NOCOLORSPACECHECK(x)    ((x) & 0xFFFF)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
// Some (not all!) representations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
#ifndef TYPE_RGB_8      // TYPE_RGB_8 is a very common identifier, so don't include ours
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
                        // if user has it already defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
#define TYPE_GRAY_8            (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
#define TYPE_GRAY_8_REV        (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1)|FLAVOR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
#define TYPE_GRAY_16           (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
#define TYPE_GRAY_16_REV       (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|FLAVOR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
#define TYPE_GRAY_16_SE        (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
#define TYPE_GRAYA_8           (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
#define TYPE_GRAYA_16          (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
#define TYPE_GRAYA_16_SE       (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
#define TYPE_GRAYA_8_PLANAR    (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
#define TYPE_GRAYA_16_PLANAR   (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
#define TYPE_RGB_8             (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
#define TYPE_RGB_8_PLANAR      (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
#define TYPE_BGR_8             (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
#define TYPE_BGR_8_PLANAR      (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
#define TYPE_RGB_16            (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
#define TYPE_RGB_16_PLANAR     (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
#define TYPE_RGB_16_SE         (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
#define TYPE_BGR_16            (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
#define TYPE_BGR_16_PLANAR     (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
#define TYPE_BGR_16_SE         (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
#define TYPE_RGBA_8            (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
#define TYPE_RGBA_8_PLANAR     (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
#define TYPE_RGBA_16           (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
#define TYPE_RGBA_16_PLANAR    (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
#define TYPE_RGBA_16_SE        (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
#define TYPE_ARGB_8            (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
#define TYPE_ARGB_16           (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
#define TYPE_ABGR_8            (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
#define TYPE_ABGR_16           (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
#define TYPE_ABGR_16_PLANAR    (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
#define TYPE_ABGR_16_SE        (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
#define TYPE_BGRA_8            (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
#define TYPE_BGRA_16           (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
#define TYPE_BGRA_16_SE        (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
#define TYPE_CMY_8             (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
#define TYPE_CMY_8_PLANAR      (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
#define TYPE_CMY_16            (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
#define TYPE_CMY_16_PLANAR     (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
#define TYPE_CMY_16_SE         (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
#define TYPE_CMYK_8            (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
#define TYPE_CMYKA_8           (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
#define TYPE_CMYK_8_REV        (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
#define TYPE_YUVK_8            TYPE_CMYK_8_REV
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
#define TYPE_CMYK_8_PLANAR     (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
#define TYPE_CMYK_16           (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
#define TYPE_CMYK_16_REV       (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
#define TYPE_YUVK_16           TYPE_CMYK_16_REV
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
#define TYPE_CMYK_16_PLANAR    (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
#define TYPE_CMYK_16_SE        (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
#define TYPE_KYMC_8            (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
#define TYPE_KYMC_16           (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
#define TYPE_KYMC_16_SE        (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
#define TYPE_KCMY_8            (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
#define TYPE_KCMY_8_REV        (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
#define TYPE_KCMY_16           (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
#define TYPE_KCMY_16_REV       (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
#define TYPE_KCMY_16_SE        (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1)|SWAPFIRST_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
// HiFi separations, Thanks to Steven Greaves for providing the code,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
// the colorspace is not checked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
#define TYPE_CMYK5_8           (CHANNELS_SH(5)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
#define TYPE_CMYK5_16          (CHANNELS_SH(5)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
#define TYPE_CMYK5_16_SE       (CHANNELS_SH(5)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
#define TYPE_KYMC5_8           (CHANNELS_SH(5)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
#define TYPE_KYMC5_16          (CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
#define TYPE_KYMC5_16_SE       (CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
#define TYPE_CMYKcm_8          (CHANNELS_SH(6)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
#define TYPE_CMYKcm_8_PLANAR   (CHANNELS_SH(6)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
#define TYPE_CMYKcm_16         (CHANNELS_SH(6)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
#define TYPE_CMYKcm_16_PLANAR  (CHANNELS_SH(6)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
#define TYPE_CMYKcm_16_SE      (CHANNELS_SH(6)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
// Separations with more than 6 channels aren't very standarized,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
// Except most start with CMYK and add other colors, so I just used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
// then total number of channels after CMYK i.e CMYK8_8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
#define TYPE_CMYK7_8           (CHANNELS_SH(7)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
#define TYPE_CMYK7_16          (CHANNELS_SH(7)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
#define TYPE_CMYK7_16_SE       (CHANNELS_SH(7)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
#define TYPE_KYMC7_8           (CHANNELS_SH(7)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
#define TYPE_KYMC7_16          (CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
#define TYPE_KYMC7_16_SE       (CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
#define TYPE_CMYK8_8           (CHANNELS_SH(8)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
#define TYPE_CMYK8_16          (CHANNELS_SH(8)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
#define TYPE_CMYK8_16_SE       (CHANNELS_SH(8)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
#define TYPE_KYMC8_8           (CHANNELS_SH(8)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
#define TYPE_KYMC8_16          (CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
#define TYPE_KYMC8_16_SE       (CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
#define TYPE_CMYK9_8           (CHANNELS_SH(9)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
#define TYPE_CMYK9_16          (CHANNELS_SH(9)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
#define TYPE_CMYK9_16_SE       (CHANNELS_SH(9)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
#define TYPE_KYMC9_8           (CHANNELS_SH(9)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
#define TYPE_KYMC9_16          (CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
#define TYPE_KYMC9_16_SE       (CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
#define TYPE_CMYK10_8          (CHANNELS_SH(10)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
#define TYPE_CMYK10_16         (CHANNELS_SH(10)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
#define TYPE_CMYK10_16_SE      (CHANNELS_SH(10)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
#define TYPE_KYMC10_8          (CHANNELS_SH(10)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
#define TYPE_KYMC10_16         (CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
#define TYPE_KYMC10_16_SE      (CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
#define TYPE_CMYK11_8          (CHANNELS_SH(11)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
#define TYPE_CMYK11_16         (CHANNELS_SH(11)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
#define TYPE_CMYK11_16_SE      (CHANNELS_SH(11)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
#define TYPE_KYMC11_8          (CHANNELS_SH(11)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
#define TYPE_KYMC11_16         (CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
#define TYPE_KYMC11_16_SE      (CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
#define TYPE_CMYK12_8          (CHANNELS_SH(12)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
#define TYPE_CMYK12_16         (CHANNELS_SH(12)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
#define TYPE_CMYK12_16_SE      (CHANNELS_SH(12)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
#define TYPE_KYMC12_8          (CHANNELS_SH(12)|BYTES_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
#define TYPE_KYMC12_16         (CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
#define TYPE_KYMC12_16_SE      (CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
// Colorimetric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
#define TYPE_XYZ_16            (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
#define TYPE_Lab_8             (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
#define TYPE_ALab_8            (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|DOSWAP_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
#define TYPE_Lab_16            (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
#define TYPE_Yxy_16            (COLORSPACE_SH(PT_Yxy)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
// YCbCr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
#define TYPE_YCbCr_8           (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
#define TYPE_YCbCr_8_PLANAR    (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
#define TYPE_YCbCr_16          (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
#define TYPE_YCbCr_16_PLANAR   (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
#define TYPE_YCbCr_16_SE       (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
// YUV
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
#define TYPE_YUV_8           (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
#define TYPE_YUV_8_PLANAR    (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
#define TYPE_YUV_16          (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
#define TYPE_YUV_16_PLANAR   (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
#define TYPE_YUV_16_SE       (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
// HLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
#define TYPE_HLS_8           (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
#define TYPE_HLS_8_PLANAR    (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
#define TYPE_HLS_16          (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
#define TYPE_HLS_16_PLANAR   (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
#define TYPE_HLS_16_SE       (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
// HSV
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
#define TYPE_HSV_8           (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
#define TYPE_HSV_8_PLANAR    (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
#define TYPE_HSV_16          (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
#define TYPE_HSV_16_PLANAR   (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
#define TYPE_HSV_16_SE       (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
// Named color index. Only 16 bits allowed (don't check colorspace)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
#define TYPE_NAMED_COLOR_INDEX   (CHANNELS_SH(1)|BYTES_SH(2))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
// Double values. Painful slow, but sometimes helpful. NOTE THAT 'BYTES' FIELD IS SET TO ZERO!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
#define TYPE_XYZ_DBL        (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(0))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
#define TYPE_Lab_DBL        (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(0))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
#define TYPE_GRAY_DBL       (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(0))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
#define TYPE_RGB_DBL        (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
#define TYPE_CMYK_DBL       (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(0))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
// Gamma table parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   721
    unsigned int Crc32;  // Has my table been touched?
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   722
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   723
    // Keep initial parameters for further serialization
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
    int          Type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
    double       Params[10];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   728
    }  LCMSGAMMAPARAMS, FAR* LPLCMSGAMMAPARAMS;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
// Gamma tables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   734
    LCMSGAMMAPARAMS Seed;       // Parameters used for table creation
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
    // Table-based representation follows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
    int  nEntries;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
    WORD GammaTable[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
    } GAMMATABLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
typedef GAMMATABLE FAR* LPGAMMATABLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
// Sampled curves (1D)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    int     nItems;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
    double* Values;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
    } SAMPLEDCURVE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
typedef SAMPLEDCURVE FAR* LPSAMPLEDCURVE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
// Vectors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
typedef struct {                // Float Vector
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
    double n[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
    } VEC3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
typedef VEC3 FAR* LPVEC3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
typedef struct {                // Matrix
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
    VEC3 v[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
    } MAT3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
typedef MAT3 FAR* LPMAT3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
// Colorspace values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
        double X;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
        double Y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
        double Z;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
    } cmsCIEXYZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
typedef cmsCIEXYZ FAR* LPcmsCIEXYZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
        double x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
        double y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
        double Y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
    } cmsCIExyY;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
typedef cmsCIExyY FAR* LPcmsCIExyY;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
        double L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
        double a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
        double b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
    } cmsCIELab;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
typedef cmsCIELab FAR* LPcmsCIELab;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
        double L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
        double C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
        double h;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
    } cmsCIELCh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
typedef cmsCIELCh FAR* LPcmsCIELCh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
        double J;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
        double C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
        double h;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
    } cmsJCh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
typedef cmsJCh FAR* LPcmsJCh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
// Primaries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
        cmsCIEXYZ  Red;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
        cmsCIEXYZ  Green;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
        cmsCIEXYZ  Blue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
    } cmsCIEXYZTRIPLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
typedef cmsCIEXYZTRIPLE FAR* LPcmsCIEXYZTRIPLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
        cmsCIExyY  Red;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
        cmsCIExyY  Green;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
        cmsCIExyY  Blue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
    } cmsCIExyYTRIPLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
typedef cmsCIExyYTRIPLE FAR* LPcmsCIExyYTRIPLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
// Following ICC spec
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
#define D50X  (0.9642)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
#define D50Y  (1.0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
#define D50Z  (0.8249)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
#define PERCEPTUAL_BLACK_X  (0.00336)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
#define PERCEPTUAL_BLACK_Y  (0.0034731)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
#define PERCEPTUAL_BLACK_Z  (0.00287)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
// Does return pointers to constant structs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
LCMSAPI LPcmsCIEXYZ LCMSEXPORT cmsD50_XYZ(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
LCMSAPI LPcmsCIExyY LCMSEXPORT cmsD50_xyY(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
// Input/Output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   868
LCMSAPI LCMSBOOL      LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
// Predefined run-time profiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateRGBProfile(LPcmsCIExyY WhitePoint,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
                                        LPcmsCIExyYTRIPLE Primaries,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
                                        LPGAMMATABLE TransferFunction[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateGrayProfile(LPcmsCIExyY WhitePoint,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
                                              LPGAMMATABLE TransferFunction);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateLinearizationDeviceLink(icColorSpaceSignature ColorSpace,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
                                                        LPGAMMATABLE TransferFunctions[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateInkLimitingDeviceLink(icColorSpaceSignature ColorSpace,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
                                                      double Limit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateLabProfile(LPcmsCIExyY WhitePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateLab4Profile(LPcmsCIExyY WhitePoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateXYZProfile(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreate_sRGBProfile(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateBCHSWabstractProfile(int nLUTPoints,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
                                                     double Bright,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
                                                     double Contrast,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
                                                     double Hue,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
                                                     double Saturation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
                                                     int TempSrc,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
                                                     int TempDest);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
LCMSAPI cmsHPROFILE   LCMSEXPORT cmsCreateNULLProfile(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
// Colorimetric space conversions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
LCMSAPI void          LCMSEXPORT cmsXYZ2xyY(LPcmsCIExyY Dest, const cmsCIEXYZ* Source);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
LCMSAPI void          LCMSEXPORT cmsxyY2XYZ(LPcmsCIEXYZ Dest, const cmsCIExyY* Source);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
LCMSAPI void          LCMSEXPORT cmsXYZ2Lab(LPcmsCIEXYZ WhitePoint, LPcmsCIELab Lab, const cmsCIEXYZ* xyz);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
LCMSAPI void          LCMSEXPORT cmsLab2XYZ(LPcmsCIEXYZ WhitePoint, LPcmsCIEXYZ xyz, const cmsCIELab* Lab);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
LCMSAPI void          LCMSEXPORT cmsLab2LCh(LPcmsCIELCh LCh, const cmsCIELab* Lab);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
LCMSAPI void          LCMSEXPORT cmsLCh2Lab(LPcmsCIELab Lab, const cmsCIELCh* LCh);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
// CIELab handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
LCMSAPI double        LCMSEXPORT cmsDeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
LCMSAPI double        LCMSEXPORT cmsCIE94DeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
LCMSAPI double        LCMSEXPORT cmsBFDdeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
LCMSAPI double        LCMSEXPORT cmsCMCdeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
LCMSAPI double        LCMSEXPORT cmsCIE2000DeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2, double Kl, double Kc, double Kh);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
LCMSAPI void          LCMSEXPORT cmsClampLab(LPcmsCIELab Lab, double amax, double amin, double bmax, double bmin);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   925
LCMSAPI LCMSBOOL      LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   926
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   927
LCMSAPI LCMSBOOL      LCMSEXPORT cmsAdaptToIlluminant(LPcmsCIEXYZ Result,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
                                                        LPcmsCIEXYZ SourceWhitePt,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
                                                        LPcmsCIEXYZ Illuminant,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
                                                        LPcmsCIEXYZ Value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   932
LCMSAPI LCMSBOOL      LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
                                                        LPcmsCIExyY WhitePoint,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
                                                        LPcmsCIExyYTRIPLE Primaries);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
// Viewing conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
#define AVG_SURROUND_4     0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
#define AVG_SURROUND       1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
#define DIM_SURROUND       2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
#define DARK_SURROUND      3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
#define CUTSHEET_SURROUND  4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
#define D_CALCULATE             (-1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
#define D_CALCULATE_DISCOUNT    (-2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
              cmsCIEXYZ whitePoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
              double    Yb;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
              double    La;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
              int       surround;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
              double    D_value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
    } cmsViewingConditions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
typedef cmsViewingConditions FAR* LPcmsViewingConditions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
// CIECAM97s
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
LCMSAPI LCMSHANDLE    LCMSEXPORT cmsCIECAM97sInit(LPcmsViewingConditions pVC2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
LCMSAPI void          LCMSEXPORT cmsCIECAM97sDone(LCMSHANDLE hModel);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
LCMSAPI void          LCMSEXPORT cmsCIECAM97sForward(LCMSHANDLE hModel, LPcmsCIEXYZ pIn, LPcmsJCh pOut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
LCMSAPI void          LCMSEXPORT cmsCIECAM97sReverse(LCMSHANDLE hModel, LPcmsJCh pIn,    LPcmsCIEXYZ pOut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
// CIECAM02
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
LCMSAPI LCMSHANDLE    LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
LCMSAPI void          LCMSEXPORT cmsCIECAM02Done(LCMSHANDLE hModel);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
LCMSAPI void          LCMSEXPORT cmsCIECAM02Forward(LCMSHANDLE hModel, LPcmsCIEXYZ pIn, LPcmsJCh pOut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
LCMSAPI void          LCMSEXPORT cmsCIECAM02Reverse(LCMSHANDLE hModel, LPcmsJCh pIn,    LPcmsCIEXYZ pOut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
// Gamma
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsBuildGamma(int nEntries, double Gamma);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsBuildParametricGamma(int nEntries, int Type, double Params[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsAllocGamma(int nEntries);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
LCMSAPI void          LCMSEXPORT cmsFreeGamma(LPGAMMATABLE Gamma);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
LCMSAPI void          LCMSEXPORT cmsFreeGammaTriple(LPGAMMATABLE Gamma[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsDupGamma(LPGAMMATABLE Src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsReverseGamma(int nResultSamples, LPGAMMATABLE InGamma);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsJoinGamma(LPGAMMATABLE InGamma,  LPGAMMATABLE OutGamma);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsJoinGammaEx(LPGAMMATABLE InGamma,  LPGAMMATABLE OutGamma, int nPoints);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   986
LCMSAPI LCMSBOOL      LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
LCMSAPI double        LCMSEXPORT cmsEstimateGamma(LPGAMMATABLE t);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
LCMSAPI double        LCMSEXPORT cmsEstimateGammaEx(LPWORD Table, int nEntries, double Thereshold);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsReadICCGamma(cmsHPROFILE hProfile, icTagSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
LCMSAPI LPGAMMATABLE  LCMSEXPORT cmsReadICCGammaReversed(cmsHPROFILE hProfile, icTagSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
// Access to Profile data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   994
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   995
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   996
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
   997
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
LCMSAPI DWORD         LCMSEXPORT cmsTakeHeaderFlags(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
LCMSAPI DWORD         LCMSEXPORT cmsTakeHeaderAttributes(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1001
LCMSAPI void          LCMSEXPORT cmsSetLanguage(const char LanguageCode[4], const char CountryCode[4]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
LCMSAPI const char*   LCMSEXPORT cmsTakeProductName(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
LCMSAPI const char*   LCMSEXPORT cmsTakeProductDesc(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
LCMSAPI const char*   LCMSEXPORT cmsTakeProductInfo(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
LCMSAPI const char*   LCMSEXPORT cmsTakeManufacturer(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
LCMSAPI const char*   LCMSEXPORT cmsTakeModel(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
LCMSAPI const char*   LCMSEXPORT cmsTakeCopyright(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
LCMSAPI const BYTE*   LCMSEXPORT cmsTakeProfileID(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1010
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1011
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1012
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1013
LCMSAPI LCMSBOOL      LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
LCMSAPI int           LCMSEXPORT cmsTakeRenderingIntent(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1016
LCMSAPI LCMSBOOL      LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t* len);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
LCMSAPI int           LCMSEXPORT cmsReadICCTextEx(cmsHPROFILE hProfile, icTagSignature sig, char *Text, size_t size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
LCMSAPI int           LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
#define LCMS_DESC_MAX     512
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
            icSignature                 deviceMfg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
            icSignature                 deviceModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
            icUInt32Number              attributes[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
            icTechnologySignature       technology;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
            char Manufacturer[LCMS_DESC_MAX];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
            char Model[LCMS_DESC_MAX];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
    } cmsPSEQDESC, FAR *LPcmsPSEQDESC;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
            int n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
            cmsPSEQDESC seq[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
    } cmsSEQ, FAR *LPcmsSEQ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
LCMSAPI LPcmsSEQ      LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
LCMSAPI void          LCMSEXPORT cmsFreeProfileSequenceDescription(LPcmsSEQ pseq);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
// Translate form/to our notation to ICC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
LCMSAPI icColorSpaceSignature LCMSEXPORT _cmsICCcolorSpace(int OurNotation);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1050
LCMSAPI int                   LCMSEXPORT _cmsLCMScolorSpace(icColorSpaceSignature ProfileSpace);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1051
LCMSAPI int                   LCMSEXPORT _cmsChannelsOf(icColorSpaceSignature ColorSpace);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1052
LCMSAPI LCMSBOOL              LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1053
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1054
// How profiles may be used
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
#define LCMS_USED_AS_INPUT      0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
#define LCMS_USED_AS_OUTPUT     1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
#define LCMS_USED_AS_PROOF      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1059
LCMSAPI LCMSBOOL                LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, int Intent, int UsedDirection);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
LCMSAPI icColorSpaceSignature   LCMSEXPORT cmsGetPCS(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
LCMSAPI icColorSpaceSignature   LCMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
LCMSAPI icProfileClassSignature LCMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
LCMSAPI DWORD                   LCMSEXPORT cmsGetProfileICCversion(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
LCMSAPI void                    LCMSEXPORT cmsSetProfileICCversion(cmsHPROFILE hProfile, DWORD Version);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
LCMSAPI icInt32Number           LCMSEXPORT cmsGetTagCount(cmsHPROFILE hProfile);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
LCMSAPI icTagSignature          LCMSEXPORT cmsGetTagSignature(cmsHPROFILE hProfile, icInt32Number n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
LCMSAPI void          LCMSEXPORT cmsSetDeviceClass(cmsHPROFILE hProfile, icProfileClassSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
LCMSAPI void          LCMSEXPORT cmsSetColorSpace(cmsHPROFILE hProfile, icColorSpaceSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
LCMSAPI void          LCMSEXPORT cmsSetPCS(cmsHPROFILE hProfile, icColorSpaceSignature pcs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
LCMSAPI void          LCMSEXPORT cmsSetRenderingIntent(cmsHPROFILE hProfile, int RenderingIntent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
LCMSAPI void          LCMSEXPORT cmsSetHeaderFlags(cmsHPROFILE hProfile, DWORD Flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
LCMSAPI void          LCMSEXPORT cmsSetHeaderAttributes(cmsHPROFILE hProfile, DWORD Flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
LCMSAPI void          LCMSEXPORT cmsSetProfileID(cmsHPROFILE hProfile, LPBYTE ProfileID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
// Intents
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
#define INTENT_PERCEPTUAL                 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
#define INTENT_RELATIVE_COLORIMETRIC      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
#define INTENT_SATURATION                 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
#define INTENT_ABSOLUTE_COLORIMETRIC      3
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
// Flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
#define cmsFLAGS_MATRIXINPUT              0x0001
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
#define cmsFLAGS_MATRIXOUTPUT             0x0002
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
#define cmsFLAGS_MATRIXONLY               (cmsFLAGS_MATRIXINPUT|cmsFLAGS_MATRIXOUTPUT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
#define cmsFLAGS_NOWHITEONWHITEFIXUP      0x0004    // Don't hot fix scum dot
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
#define cmsFLAGS_NOPRELINEARIZATION       0x0010    // Don't create prelinearization tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
                                                    // on precalculated transforms (internal use)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
#define cmsFLAGS_GUESSDEVICECLASS         0x0020    // Guess device class (for transform2devicelink)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
#define cmsFLAGS_NOTCACHE                 0x0040    // Inhibit 1-pixel cache
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
#define cmsFLAGS_NOTPRECALC               0x0100
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
#define cmsFLAGS_NULLTRANSFORM            0x0200    // Don't transform anyway
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
#define cmsFLAGS_HIGHRESPRECALC           0x0400    // Use more memory to give better accurancy
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
#define cmsFLAGS_LOWRESPRECALC            0x0800    // Use less memory to minimize resouces
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
#define cmsFLAGS_WHITEBLACKCOMPENSATION   0x2000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
#define cmsFLAGS_BLACKPOINTCOMPENSATION   cmsFLAGS_WHITEBLACKCOMPENSATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
// Proofing flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
#define cmsFLAGS_GAMUTCHECK               0x1000    // Out of Gamut alarm
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
#define cmsFLAGS_SOFTPROOFING             0x4000    // Do softproofing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
// Black preservation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
#define cmsFLAGS_PRESERVEBLACK            0x8000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
// CRD special
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1119
#define cmsFLAGS_NODEFAULTRESOURCEDEF     0x01000000
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
// Gridpoints
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
#define cmsFLAGS_GRIDPOINTS(n)           (((n) & 0xFF) << 16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
// Transforms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
LCMSAPI cmsHTRANSFORM LCMSEXPORT cmsCreateTransform(cmsHPROFILE Input,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
                                               DWORD InputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
                                               cmsHPROFILE Output,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
                                               DWORD OutputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
                                               int Intent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
                                               DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
LCMSAPI cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE Input,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
                                               DWORD InputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
                                               cmsHPROFILE Output,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
                                               DWORD OutputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
                                               cmsHPROFILE Proofing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
                                               int Intent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
                                               int ProofingIntent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
                                               DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
LCMSAPI cmsHTRANSFORM LCMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
                                                                int nProfiles,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
                                                                DWORD InputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
                                                                DWORD OutputFormat,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
                                                                int Intent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
                                                                DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
LCMSAPI void         LCMSEXPORT cmsDeleteTransform(cmsHTRANSFORM hTransform);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
LCMSAPI void         LCMSEXPORT cmsDoTransform(cmsHTRANSFORM Transform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
                                                 LPVOID InputBuffer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
                                                 LPVOID OutputBuffer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
                                                 unsigned int Size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
LCMSAPI void         LCMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform, DWORD InputFormat, DWORD dwOutputFormat);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
LCMSAPI void         LCMSEXPORT cmsSetAlarmCodes(int r, int g, int b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
LCMSAPI void         LCMSEXPORT cmsGetAlarmCodes(int *r, int *g, int *b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
// Adaptation state for absolute colorimetric intent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
LCMSAPI double       LCMSEXPORT cmsSetAdaptationState(double d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
// Primary preservation strategy
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
#define LCMS_PRESERVE_PURE_K    0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
#define LCMS_PRESERVE_K_PLANE   1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
LCMSAPI int LCMSEXPORT cmsSetCMYKPreservationStrategy(int n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
// Named color support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
                char Name[MAX_PATH];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
                WORD PCS[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
                WORD DeviceColorant[MAXCHANNELS];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
        } cmsNAMEDCOLOR, FAR* LPcmsNAMEDCOLOR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
                int nColors;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
                int Allocated;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
                int ColorantCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
                char Prefix[33];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
                char Suffix[33];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
                cmsNAMEDCOLOR List[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
        } cmsNAMEDCOLORLIST, FAR* LPcmsNAMEDCOLORLIST;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
// Named color support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1198
LCMSAPI int      LCMSEXPORT cmsNamedColorCount(cmsHTRANSFORM xform);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1199
LCMSAPI LCMSBOOL LCMSEXPORT cmsNamedColorInfo(cmsHTRANSFORM xform, int nColor, char* Name, char* Prefix, char* Suffix);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1200
LCMSAPI int      LCMSEXPORT cmsNamedColorIndex(cmsHTRANSFORM xform, const char* Name);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
// Colorant tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
LCMSAPI LPcmsNAMEDCOLORLIST LCMSEXPORT cmsReadColorantTable(cmsHPROFILE hProfile, icTagSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
// Profile creation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1208
LCMSAPI LCMSBOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, const void* data);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
// Converts a transform to a devicelink profile
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
LCMSAPI cmsHPROFILE LCMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
// Set the 'save as 8-bit' flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
LCMSAPI void LCMSEXPORT _cmsSetLUTdepth(cmsHPROFILE hProfile, int depth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
// Save profile
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1218
LCMSAPI LCMSBOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1219
LCMSAPI LCMSBOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
                                                                size_t* BytesNeeded);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
// PostScript ColorRenderingDictionary and ColorSpaceArray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
LCMSAPI DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile, int Intent, LPVOID Buffer, DWORD dwBufferLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
LCMSAPI DWORD LCMSEXPORT cmsGetPostScriptCRD(cmsHPROFILE hProfile, int Intent, LPVOID Buffer, DWORD dwBufferLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
LCMSAPI DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile, int Intent, DWORD dwFlags, LPVOID Buffer, DWORD dwBufferLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
// Error handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
#define LCMS_ERROR_ABORT    0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
#define LCMS_ERROR_SHOW     1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
#define LCMS_ERROR_IGNORE   2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
LCMSAPI int LCMSEXPORT cmsErrorAction(int nAction);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
#define LCMS_ERRC_WARNING        0x1000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
#define LCMS_ERRC_RECOVERABLE    0x2000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
#define LCMS_ERRC_ABORTED        0x3000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
typedef int (* cmsErrorHandlerFunction)(int ErrorCode, const char *ErrorText);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
LCMSAPI void LCMSEXPORT cmsSetErrorHandler(cmsErrorHandlerFunction Fn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
// LUT manipulation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
typedef struct _lcms_LUT_struc LUT, FAR* LPLUT; // opaque pointer
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
LCMSAPI LPLUT  LCMSEXPORT cmsAllocLUT(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
LCMSAPI LPLUT  LCMSEXPORT cmsAllocLinearTable(LPLUT NewLUT, LPGAMMATABLE Tables[], int nTable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
LCMSAPI LPLUT  LCMSEXPORT cmsAlloc3DGrid(LPLUT Lut, int clutPoints, int inputChan, int outputChan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
LCMSAPI LPLUT  LCMSEXPORT cmsSetMatrixLUT(LPLUT Lut, LPMAT3 M);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
LCMSAPI LPLUT  LCMSEXPORT cmsSetMatrixLUT4(LPLUT Lut, LPMAT3 M, LPVEC3 off, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
LCMSAPI void   LCMSEXPORT cmsFreeLUT(LPLUT Lut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
LCMSAPI void   LCMSEXPORT cmsEvalLUT(LPLUT Lut, WORD In[], WORD Out[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Result[], LPWORD Hint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
LCMSAPI LPLUT  LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
LCMSAPI LPLUT  LCMSEXPORT cmsDupLUT(LPLUT Orig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1264
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
// LUT Sampling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
typedef int (* _cmsSAMPLER)(register WORD In[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
                            register WORD Out[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
                            register LPVOID Cargo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
#define SAMPLER_HASTL1      LUT_HASTL1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
#define SAMPLER_HASTL2      LUT_HASTL2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
#define SAMPLER_INSPECT     0x01000000
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
LCMSAPI int LCMSEXPORT cmsSample3DGrid(LPLUT Lut, _cmsSAMPLER Sampler, LPVOID Cargo, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
// Formatters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
typedef unsigned char* (* cmsFORMATTER)(register void* CMMcargo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
                                        register WORD ToUnroll[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
                                        register LPBYTE Buffer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
LCMSAPI void LCMSEXPORT cmsSetUserFormatters(cmsHTRANSFORM hTransform, DWORD dwInput,  cmsFORMATTER Input,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
                                                               DWORD dwOutput, cmsFORMATTER Output);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
LCMSAPI void LCMSEXPORT cmsGetUserFormatters(cmsHTRANSFORM hTransform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
                                                               LPDWORD InputFormat, cmsFORMATTER* Input,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
                                                               LPDWORD OutputFormat, cmsFORMATTER* Output);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
// IT8.7 / CGATS.17-200x handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
LCMSAPI LCMSHANDLE      LCMSEXPORT cmsIT8Alloc(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
LCMSAPI void            LCMSEXPORT cmsIT8Free(LCMSHANDLE IT8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
// Tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
LCMSAPI int             LCMSEXPORT cmsIT8TableCount(LCMSHANDLE IT8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
LCMSAPI int             LCMSEXPORT cmsIT8SetTable(LCMSHANDLE IT8, int nTable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
// Persistence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
LCMSAPI LCMSHANDLE      LCMSEXPORT cmsIT8LoadFromFile(const char* cFileName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
LCMSAPI LCMSHANDLE      LCMSEXPORT cmsIT8LoadFromMem(void *Ptr, size_t len);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1304
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE IT8, const char* cFileName);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1305
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeeded);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
// Properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
LCMSAPI const char*     LCMSEXPORT cmsIT8GetSheetType(LCMSHANDLE hIT8);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1309
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1310
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1311
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* cComment);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1312
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1313
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* cProp, const char *Str);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1314
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1315
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1316
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char* cSubProp, const char *Val);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1317
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
LCMSAPI const char*     LCMSEXPORT cmsIT8GetProperty(LCMSHANDLE hIT8, const char* cProp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
LCMSAPI double          LCMSEXPORT cmsIT8GetPropertyDbl(LCMSHANDLE hIT8, const char* cProp);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1322
LCMSAPI const char*     LCMSEXPORT cmsIT8GetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char *cSubProp);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1323
LCMSAPI int             LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, const char ***PropertyNames);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1324
LCMSAPI int             LCMSEXPORT cmsIT8EnumPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char*** SubpropertyNames);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
// Datasets
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
LCMSAPI const char*     LCMSEXPORT cmsIT8GetDataRowCol(LCMSHANDLE IT8, int row, int col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
LCMSAPI double          LCMSEXPORT cmsIT8GetDataRowColDbl(LCMSHANDLE IT8, int row, int col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1331
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
                                                const char* Val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1334
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
                                                double Val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
LCMSAPI const char*     LCMSEXPORT cmsIT8GetData(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
LCMSAPI double          LCMSEXPORT cmsIT8GetDataDbl(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1342
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetData(LCMSHANDLE IT8, const char* cPatch,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
                                                const char* cSample,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
                                                const char *Val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1346
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
                                                const char* cSample,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
                                                double Val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
LCMSAPI int             LCMSEXPORT cmsIT8GetDataFormat(LCMSHANDLE hIT8, const char* cSample);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1351
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE IT8, int n, const char *Sample);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
LCMSAPI int             LCMSEXPORT cmsIT8EnumDataFormat(LCMSHANDLE IT8, char ***SampleNames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
LCMSAPI const char*     LCMSEXPORT cmsIT8GetPatchName(LCMSHANDLE hIT8, int nPatch, char* buffer);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1356
LCMSAPI int             LCMSEXPORT cmsIT8GetPatchByName(LCMSHANDLE hIT8, const char *cSample);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
// The LABEL extension
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
LCMSAPI int             LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const char* cSet, const char* cField, const char* ExpectedType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1362
LCMSAPI LCMSBOOL        LCMSEXPORT cmsIT8SetIndexColumn(LCMSHANDLE hIT8, const char* cSample);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1363
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
// Formatter for double
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
LCMSAPI void            LCMSEXPORT cmsIT8DefineDblFormat(LCMSHANDLE IT8, const char* Formatter);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
// ***************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
// End of Little cms API From here functions are private
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
// You can use them only if using static libraries, and at your own risk of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
// be stripped or changed at futures releases.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
#ifndef LCMS_APIONLY
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
// Compatibility with anterior versions-- not needed anymore
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
//  -- Morge
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
LCMSAPI void          LCMSEXPORT cmsLabEncoded2Float(LPcmsCIELab Lab, const WORD wLab[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
LCMSAPI void          LCMSEXPORT cmsLabEncoded2Float4(LPcmsCIELab Lab, const WORD wLab[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
LCMSAPI void          LCMSEXPORT cmsFloat2LabEncoded(WORD wLab[3], const cmsCIELab* Lab);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
LCMSAPI void          LCMSEXPORT cmsFloat2LabEncoded4(WORD wLab[3], const cmsCIELab* Lab);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
LCMSAPI void          LCMSEXPORT cmsXYZEncoded2Float(LPcmsCIEXYZ fxyz, const WORD XYZ[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
LCMSAPI void          LCMSEXPORT cmsFloat2XYZEncoded(WORD XYZ[3], const cmsCIEXYZ* fXYZ);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
// Profiling Extensions --- Would be removed from API in future revisions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1389
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile,  icTagSignature sig, const char* Text);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1390
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile,   icTagSignature sig, const cmsCIEXYZ* XYZ);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1391
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile,   icTagSignature sig, const void* lut);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1392
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMMATABLE TransferFunction);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1393
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIExyYTRIPLE Chrm);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1394
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsSEQ PSeq);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1395
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddNamedColorTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1396
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddDateTimeTag(cmsHPROFILE hProfile, icTagSignature sig, struct tm *DateTime);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1397
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1398
LCMSAPI LCMSBOOL      LCMSEXPORT _cmsAddChromaticAdaptationTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* mat);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
// --------------------------------------------------------------------------------------------------- Inline functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
// Fast floor conversion logic. Thanks to Sree Kotay and Stuart Nixon
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
// note than this only works in the range ..-32767...+32767 because
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
// mantissa is interpreted as 15.16 fixed point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
// The union is to avoid pointer aliasing overoptimization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
LCMS_INLINE int _cmsQuickFloor(double val)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
#ifdef USE_DEFAULT_FLOOR_CONVERSION
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
    return (int) floor(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
    const double _lcms_double2fixmagic = 68719476736.0 * 1.5;  // 2^36 * 1.5, (52-16=36) uses limited precision to floor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
    union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
        double val;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
        int halves[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
    } temp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
    temp.val = val + _lcms_double2fixmagic;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
#ifdef USE_BIG_ENDIAN
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
    return temp.halves[1] >> 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
    return temp.halves[0] >> 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
// Clamp with saturation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
LCMS_INLINE WORD _cmsClampWord(int in)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
       if (in < 0) return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
       if (in > 0xFFFF) return 0xFFFFU;   // Including marker
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
       return (WORD) in;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1440
#ifndef LCMS_USER_ALLOC
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1441
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1442
// Low-level alloc hook
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1443
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1444
LCMS_INLINE void* _cmsMalloc(size_t size)
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1445
{
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1446
    if (size > ((size_t) 1024*1024*500)) return NULL;  // Never allow over 500Mb
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1447
    if (size < 0) return NULL;              // Prevent signed size_t exploits
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1448
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1449
    return (void*) malloc(size);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1450
}
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1451
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1452
LCMS_INLINE void* _cmsCalloc(size_t nmemb, size_t size)
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1453
{
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1454
    size_t alloc = nmemb * size;
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1455
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1456
        if (size == 0) {
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1457
                return _cmsMalloc(0);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1458
        }
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1459
        if (alloc / size != nmemb) {
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1460
        return NULL;
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1461
    }
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1462
    return _cmsMalloc(alloc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1463
}
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1464
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1465
LCMS_INLINE void _cmsFree(void *Ptr)
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1466
{
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1467
    if (Ptr) free(Ptr);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1468
}
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1469
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1470
#endif
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1471
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
// ------------------------------------------------------------------------------------------- end of inline functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
// Signal error from inside lcms code
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
void cdecl cmsSignalError(int ErrorCode, const char *ErrorText, ...);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
// Alignment handling (needed in ReadLUT16 and ReadLUT8)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
        icS15Fixed16Number a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
        icUInt16Number     b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
       } _cmsTestAlign16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
#define SIZEOF_UINT16_ALIGNED (sizeof(_cmsTestAlign16) - sizeof(icS15Fixed16Number))
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
        icS15Fixed16Number a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
        icUInt8Number      b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
       } _cmsTestAlign8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
#define SIZEOF_UINT8_ALIGNED (sizeof(_cmsTestAlign8) - sizeof(icS15Fixed16Number))
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
// Fixed point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
typedef icInt32Number Fixed32;       // Fixed 15.16 whith sign
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
#define INT_TO_FIXED(x)         ((x)<<16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
#define DOUBLE_TO_FIXED(x)      ((Fixed32) ((x)*65536.0+0.5))
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
#define FIXED_TO_INT(x)         ((x)>>16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
#define FIXED_REST_TO_INT(x)    ((x)& 0xFFFFU)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
#define FIXED_TO_DOUBLE(x)      (((double)x)/65536.0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
#define ROUND_FIXED_TO_INT(x)   (((x)+0x8000)>>16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
Fixed32 cdecl FixedMul(Fixed32 a, Fixed32 b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
Fixed32 cdecl FixedSquare(Fixed32 a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
#ifdef USE_INLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
LCMS_INLINE Fixed32 ToFixedDomain(int a)        { return a + ((a + 0x7fff) / 0xffff); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
LCMS_INLINE int     FromFixedDomain(Fixed32 a)  { return a - ((a + 0x7fff) >> 16); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
Fixed32 cdecl ToFixedDomain(int a);              // (a * 65536.0 / 65535.0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
int     cdecl FromFixedDomain(Fixed32 a);        // (a * 65535.0 + .5)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
Fixed32 cdecl FixedLERP(Fixed32 a, Fixed32 l, Fixed32 h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
WORD    cdecl FixedScale(WORD a, Fixed32 s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
// Vector & Matrix operations. I'm using the notation frequently found in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
// literature. Mostly 'Graphic Gems' samples. Not to be same routines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
// Vector members
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
#define VX      0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
#define VY      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
#define VZ      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
typedef struct {                // Fixed 15.16 bits vector
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
        Fixed32 n[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
        } WVEC3, FAR* LPWVEC3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
typedef struct {                // Matrix (Fixed 15.16)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
        WVEC3 v[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
        } WMAT3, FAR* LPWMAT3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1548
void      cdecl VEC3init(LPVEC3 r, double x, double y, double z);   // double version
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1549
void      cdecl VEC3initF(LPWVEC3 r, double x, double y, double z); // Fix32 version
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1550
void      cdecl VEC3toFix(LPWVEC3 r, LPVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1551
void      cdecl VEC3fromFix(LPVEC3 r, LPWVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1552
void      cdecl VEC3scaleFix(LPWORD r, LPWVEC3 Scale);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1553
void      cdecl VEC3swap(LPVEC3 a, LPVEC3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1554
void      cdecl VEC3divK(LPVEC3 r, LPVEC3 v, double d);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1555
void      cdecl VEC3perK(LPVEC3 r, LPVEC3 v, double d);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1556
void      cdecl VEC3minus(LPVEC3 r, LPVEC3 a, LPVEC3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1557
void      cdecl VEC3perComp(LPVEC3 r, LPVEC3 a, LPVEC3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1558
LCMSBOOL  cdecl VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1559
LCMSBOOL  cdecl VEC3equalF(LPVEC3 a, LPVEC3 b, double Tolerance);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1560
void      cdecl VEC3scaleAndCut(LPWVEC3 r, LPVEC3 v, double d);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1561
void      cdecl VEC3cross(LPVEC3 r, LPVEC3 u, LPVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1562
void      cdecl VEC3saturate(LPVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1563
double    cdecl VEC3distance(LPVEC3 a, LPVEC3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1564
double    cdecl VEC3length(LPVEC3 a);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1565
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1566
void      cdecl MAT3identity(LPMAT3 a);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1567
void      cdecl MAT3per(LPMAT3 r, LPMAT3 a, LPMAT3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1568
void      cdecl MAT3perK(LPMAT3 r, LPMAT3 v, double d);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1569
int       cdecl MAT3inverse(LPMAT3 a, LPMAT3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1570
LCMSBOOL  cdecl MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1571
double    cdecl MAT3det(LPMAT3 m);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1572
void      cdecl MAT3eval(LPVEC3 r, LPMAT3 a, LPVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1573
void      cdecl MAT3toFix(LPWMAT3 r, LPMAT3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1574
void      cdecl MAT3fromFix(LPMAT3 r, LPWMAT3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1575
void      cdecl MAT3evalW(LPWVEC3 r, LPWMAT3 a, LPWVEC3 v);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1576
LCMSBOOL  cdecl MAT3isIdentity(LPWMAT3 a, double Tolerance);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1577
void      cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
// Is a table linear?
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
int  cdecl cmsIsLinear(WORD Table[], int nEntries);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
// I hold this structures describing domain
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
// details mainly for optimization purposes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
struct _lcms_l16params_struc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
typedef void (* _cms3DLERP)(WORD Input[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
                            WORD Output[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
                            WORD LutTable[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
                            struct _lcms_l16params_struc* p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
typedef struct _lcms_l8opt_struc {      // Used on 8 bit interpolations
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
              unsigned int X0[256], Y0[256], Z0[256];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
              WORD rx[256], ry[256], rz[256];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
        } L8PARAMS, FAR* LPL8PARAMS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
typedef struct _lcms_l16params_struc {    // Used on 16 bits interpolations
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
               int nSamples;       // Valid on all kinds of tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
               int nInputs;        // != 1 only in 3D interpolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
               int nOutputs;       // != 1 only in 3D interpolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
               WORD Domain;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
               int opta1, opta2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
               int opta3, opta4;     // Optimization for 3D LUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
               int opta5, opta6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
               int opta7, opta8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
               _cms3DLERP Interp3D; // The interpolation routine
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
                LPL8PARAMS p8;      // Points to some tables for 8-bit speedup
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
               } L16PARAMS, *LPL16PARAMS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
void    cdecl cmsCalcL16Params(int nSamples, LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
void    cdecl cmsCalcCLUT16Params(int nSamples, int InputChan, int OutputChan, LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
void    cdecl cmsCalcCLUT16ParamsEx(int nSamples, int InputChan, int OutputChan,
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1625
                                            LCMSBOOL lUseTetrahedral, LPL16PARAMS p);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
WORD    cdecl cmsLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
Fixed32 cdecl cmsLinearInterpFixed(WORD Value1, WORD LutTable[], LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
WORD    cdecl cmsReverseLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
void cdecl cmsTrilinearInterp16(WORD Input[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
                                WORD Output[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
                                WORD LutTable[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
                                LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
void cdecl cmsTetrahedralInterp16(WORD Input[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
                                  WORD Output[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
                                  WORD LutTable[], LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
void cdecl cmsTetrahedralInterp8(WORD Input[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
                                 WORD Output[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
                                 WORD LutTable[],  LPL16PARAMS p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
// LUT handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
#define LUT_HASMATRIX       0x0001        // Do-op Flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
#define LUT_HASTL1          0x0002
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
#define LUT_HASTL2          0x0008
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
#define LUT_HAS3DGRID       0x0010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
// New in rev 4.0 of ICC spec
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
#define LUT_HASMATRIX3     0x0020   // Matrix + offset for LutAToB
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
#define LUT_HASMATRIX4     0x0040   // Matrix + offset for LutBToA
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
#define LUT_HASTL3         0x0100   // '3' curves for LutAToB
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
#define LUT_HASTL4         0x0200   // '4' curves for LutBToA
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
// V4 emulation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
#define LUT_V4_OUTPUT_EMULATE_V2    0x10000     // Is a V4 output LUT, emulating V2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
#define LUT_V4_INPUT_EMULATE_V2     0x20000     // Is a V4 input LUT, emulating V2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
#define LUT_V2_OUTPUT_EMULATE_V4    0x40000     // Is a V2 output LUT, emulating V4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
#define LUT_V2_INPUT_EMULATE_V4     0x80000     // Is a V2 input LUT, emulating V4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
struct _lcms_LUT_struc {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
               DWORD wFlags;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
               WMAT3 Matrix;                    // 15fixed16 matrix
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
               unsigned int InputChan;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
               unsigned int OutputChan;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
               unsigned int InputEntries;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
               unsigned int OutputEntries;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
               unsigned int cLutPoints;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
               LPWORD L1[MAXCHANNELS];          // First linearization
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
               LPWORD L2[MAXCHANNELS];          // Last linearization
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
               LPWORD T;                        // 3D CLUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
               unsigned int Tsize;              // CLUT size in bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
              // Parameters & Optimizations
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
               L16PARAMS In16params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
               L16PARAMS Out16params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
               L16PARAMS CLut16params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
               int Intent;                       // Accomplished intent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
               // New for Rev 4.0 of spec (reserved)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
               WMAT3 Mat3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
               WVEC3 Ofs3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
               LPWORD L3[MAXCHANNELS];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
               L16PARAMS L3params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
               unsigned int L3Entries;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
               WMAT3 Mat4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
               WVEC3 Ofs4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
               LPWORD L4[MAXCHANNELS];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
               L16PARAMS L4params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
               unsigned int L4Entries;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
               // Gray axes fixup. Only on v2 8-bit Lab LUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1709
               LCMSBOOL FixGrayAxes;
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1710
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1711
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1712
               // Parameters used for curve creation
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1713
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1714
               LCMSGAMMAPARAMS LCurvesSeed[4][MAXCHANNELS];
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
               }; // LUT, FAR* LPLUT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1720
LCMSBOOL         cdecl _cmsSmoothEndpoints(LPWORD Table, int nEntries);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
// CRC of gamma tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
unsigned int _cmsCrc32OfGammaTable(LPGAMMATABLE Table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
// Sampled curves
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
LPSAMPLEDCURVE cdecl cmsAllocSampledCurve(int nItems);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
void           cdecl cmsFreeSampledCurve(LPSAMPLEDCURVE p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
LPSAMPLEDCURVE cdecl cmsDupSampledCurve(LPSAMPLEDCURVE p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
LPSAMPLEDCURVE cdecl cmsConvertGammaToSampledCurve(LPGAMMATABLE Gamma, int nPoints);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
LPGAMMATABLE   cdecl cmsConvertSampledCurveToGamma(LPSAMPLEDCURVE Sampled, double Max);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
void           cdecl cmsEndpointsOfSampledCurve(LPSAMPLEDCURVE p, double* Min, double* Max);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
void           cdecl cmsClampSampledCurve(LPSAMPLEDCURVE p, double Min, double Max);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1738
LCMSBOOL       cdecl cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double SmoothingLambda);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
void           cdecl cmsRescaleSampledCurve(LPSAMPLEDCURVE p, double Min, double Max, int nPoints);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
LPSAMPLEDCURVE cdecl cmsJoinSampledCurves(LPSAMPLEDCURVE X, LPSAMPLEDCURVE Y, int nResultingPoints);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
// Shaper/Matrix handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
#define MATSHAPER_HASMATRIX        0x0001        // Do-ops flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
#define MATSHAPER_HASSHAPER        0x0002
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
#define MATSHAPER_INPUT            0x0004        // Behaviour
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
#define MATSHAPER_OUTPUT           0x0008
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
#define MATSHAPER_HASINPSHAPER     0x0010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
#define MATSHAPER_ALLSMELTED       (MATSHAPER_INPUT|MATSHAPER_OUTPUT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
               DWORD dwFlags;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
               WMAT3 Matrix;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
               L16PARAMS p16;       // Primary curve
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
               LPWORD L[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
               L16PARAMS p2_16;     // Secondary curve (used as input in smelted ones)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1762
               LPWORD L2[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
               } MATSHAPER, FAR* LPMATSHAPER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
LPMATSHAPER cdecl cmsAllocMatShaper(LPMAT3 matrix, LPGAMMATABLE Shaper[], DWORD Behaviour);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
LPMATSHAPER cdecl cmsAllocMatShaper2(LPMAT3 matrix, LPGAMMATABLE In[], LPGAMMATABLE Out[], DWORD Behaviour);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
void        cdecl cmsFreeMatShaper(LPMATSHAPER MatShaper);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
void        cdecl cmsEvalMatShaper(LPMATSHAPER MatShaper, WORD In[], WORD Out[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1772
LCMSBOOL    cdecl cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1773
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1774
LPMATSHAPER cdecl cmsBuildInputMatrixShaper(cmsHPROFILE InputProfile);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1775
LPMATSHAPER cdecl cmsBuildOutputMatrixShaper(cmsHPROFILE OutputProfile);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1776
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1777
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1778
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1779
// White Point & Primary chromas handling
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1780
LCMSBOOL cdecl cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcmsCIEXYZ ToIll);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1781
LCMSBOOL cdecl cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1782
LCMSBOOL cdecl cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1783
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1784
LCMSBOOL cdecl cmsReadChromaticAdaptationMatrix(LPMAT3 r, cmsHPROFILE hProfile);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1785
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1786
// Inter-PCS conversion routines. They assume D50 as white point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1787
void cdecl cmsXYZ2LabEncoded(WORD XYZ[3], WORD Lab[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1788
void cdecl cmsLab2XYZEncoded(WORD Lab[3], WORD XYZ[3]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1789
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1790
// Retrieve text representation of WP
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1791
void cdecl _cmsIdentifyWhitePoint(char *Buffer, LPcmsCIEXYZ WhitePt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1792
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1793
// Quantize to WORD in a (MaxSamples - 1) domain
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1794
WORD cdecl _cmsQuantizeVal(double i, int MaxSamples);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1795
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1796
LPcmsNAMEDCOLORLIST  cdecl cmsAllocNamedColorList(int n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1797
int                  cdecl cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSignature sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1798
void                 cdecl cmsFreeNamedColorList(LPcmsNAMEDCOLORLIST List);
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1799
LCMSBOOL             cdecl cmsAppendNamedColor(cmsHTRANSFORM xform, const char* Name, WORD PCS[3], WORD Colorant[MAXCHANNELS]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1800
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1801
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
// I/O
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
#define MAX_TABLE_TAG       100
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1805
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1806
// This is the internal struct holding profile details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1807
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1808
typedef struct _lcms_iccprofile_struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1809
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1810
              void* stream;   // Associated stream. If NULL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1811
                              // tags are supposed to be in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1812
                              // memory rather than in a file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1813
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
               // Only most important items found in ICC profile
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
               icProfileClassSignature DeviceClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1817
               icColorSpaceSignature   ColorSpace;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
               icColorSpaceSignature   PCS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
               icRenderingIntent       RenderingIntent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
               icUInt32Number          flags;
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1821
               icUInt32Number          attributes;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
               cmsCIEXYZ               Illuminant;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
               // Additions for V4 profiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1826
               icUInt32Number          Version;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
               MAT3                    ChromaticAdaptation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
               cmsCIEXYZ               MediaWhitePoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
               cmsCIEXYZ               MediaBlackPoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
               BYTE                    ProfileID[16];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
               // Dictionary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
               icInt32Number           TagCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
               icTagSignature          TagNames[MAX_TABLE_TAG];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
               size_t                  TagSizes[MAX_TABLE_TAG];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
               size_t                  TagOffsets[MAX_TABLE_TAG];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
               LPVOID                  TagPtrs[MAX_TABLE_TAG];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
               char                    PhysicalFile[MAX_PATH];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1843
               LCMSBOOL                IsWrite;
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1844
               LCMSBOOL                SaveAs8Bits;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
               struct tm               Created;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
               // I/O handlers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1849
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1850
               size_t   (* Read)(void *buffer, size_t size, size_t count, struct _lcms_iccprofile_struct* Icc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1851
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1852
               LCMSBOOL (* Seek)(struct _lcms_iccprofile_struct* Icc, size_t offset);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1853
               LCMSBOOL (* Close)(struct _lcms_iccprofile_struct* Icc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1854
               size_t   (* Tell)(struct _lcms_iccprofile_struct* Icc);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1855
               LCMSBOOL  (* Grow)(struct _lcms_iccprofile_struct* Icc, size_t amount);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1856
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1857
               // Writting
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1858
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1859
               LCMSBOOL (* Write)(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
               size_t UsedSpace;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1863
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
              } LCMSICCPROFILE, FAR* LPLCMSICCPROFILE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
// Create an empty template for virtual profiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
cmsHPROFILE cdecl _cmsCreateProfilePlaceholder(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
// Search into tag dictionary
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1871
icInt32Number cdecl _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, LCMSBOOL lSignalError);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
// Search for a particular tag, replace if found or add new one else
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
LPVOID _cmsInitTag(LPLCMSICCPROFILE Icc, icTagSignature sig, size_t size, const void* Init);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1875
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1877
LPLCMSICCPROFILE cdecl _cmsCreateProfileFromFilePlaceholder(const char* FileName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1878
LPLCMSICCPROFILE cdecl _cmsCreateProfileFromMemPlaceholder(LPVOID MemPtr, DWORD dwSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1879
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1880
void _cmsSetSaveToDisk(LPLCMSICCPROFILE Icc, const char* FileName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1881
void _cmsSetSaveToMemory(LPLCMSICCPROFILE Icc, LPVOID MemPtr, size_t dwSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1882
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1883
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1884
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1885
// These macros unpack format specifiers into integers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1887
#define T_DITHER(s)           (((s)>>22)&1)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
#define T_COLORSPACE(s)       (((s)>>16)&31)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1889
#define T_SWAPFIRST(s)        (((s)>>14)&1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1890
#define T_FLAVOR(s)           (((s)>>13)&1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1891
#define T_PLANAR(p)           (((p)>>12)&1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1892
#define T_ENDIAN16(e)         (((e)>>11)&1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
#define T_DOSWAP(e)           (((e)>>10)&1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1894
#define T_EXTRA(e)            (((e)>>7)&7)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1895
#define T_CHANNELS(c)         (((c)>>3)&15)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1896
#define T_BYTES(b)            ((b)&7)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1897
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1898
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1899
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1900
// Internal XFORM struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1901
struct _cmstransform_struct;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1902
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1903
// Full xform
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1904
typedef void (* _cmsCOLORCALLBACKFN)(struct _cmstransform_struct *Transform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
                               LPVOID InputBuffer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
                               LPVOID OutputBuffer, unsigned int Size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1908
// intermediate pass, from WORD[] to WORD[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1909
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1910
typedef void   (* _cmsADJFN)(WORD In[], WORD Out[], LPWMAT3 m, LPWVEC3 b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1911
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1912
typedef void   (* _cmsTRANSFN)(struct _cmstransform_struct *Transform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1913
                               WORD In[], WORD Out[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1914
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1915
typedef void   (* _cmsCNVRT)(WORD In[], WORD Out[]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1916
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1917
typedef LPBYTE (* _cmsFIXFN)(register struct _cmstransform_struct *info,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1918
                             register WORD ToUnroll[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1919
                             register LPBYTE Buffer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1920
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1921
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1922
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1923
// Transformation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1924
typedef struct _cmstransform_struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1925
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1926
                    // Keep formats for further reference
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1927
                    DWORD InputFormat, OutputFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1928
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1929
                    DWORD StrideIn, StrideOut;      // Planar support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1930
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
                    int Intent, ProofIntent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1932
                    int DoGamutCheck;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1933
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1934
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1935
                    cmsHPROFILE InputProfile;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1936
                    cmsHPROFILE OutputProfile;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1937
                    cmsHPROFILE PreviewProfile;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1938
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1939
                    icColorSpaceSignature EntryColorSpace;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1940
                    icColorSpaceSignature ExitColorSpace;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1941
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1942
                    DWORD dwOriginalFlags;      // Flags as specified by user
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1943
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1944
                    WMAT3 m1, m2;       // Matrix holding inter PCS operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1945
                    WVEC3 of1, of2;     // Offset terms
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1946
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1947
                    _cmsCOLORCALLBACKFN xform;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1948
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1949
                    // Steps in xFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1950
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1951
                    _cmsFIXFN   FromInput;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1952
                    _cmsTRANSFN FromDevice;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1953
                    _cmsADJFN   Stage1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1954
                    _cmsADJFN   Stage2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1955
                    _cmsTRANSFN ToDevice;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1956
                    _cmsFIXFN   ToOutput;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1957
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
                    // LUTs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
                    LPLUT Device2PCS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
                    LPLUT PCS2Device;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1962
                    LPLUT Gamut;         // Gamut check
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1963
                    LPLUT Preview;       // Preview (Proof)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1964
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1965
                    LPLUT DeviceLink;    // Precalculated grid - device link profile
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
                    LPLUT GamutCheck;    // Precalculated device -> gamut check
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1967
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1968
                    // Matrix/Shapers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1969
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1970
                    LPMATSHAPER InMatShaper;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1971
                    LPMATSHAPER OutMatShaper;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1972
                    LPMATSHAPER SmeltMatShaper;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1973
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1974
                    // Phase of Lab/XYZ, Abs/Rel
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1975
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
                    int Phase1, Phase2, Phase3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
                    // Named color table
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1979
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1980
                    LPcmsNAMEDCOLORLIST NamedColorList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1981
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1982
                    // Flag for transform involving v4 profiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1984
                    LCMSBOOL lInputV4Lab, lOutputV4Lab;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1985
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1986
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1987
                    // 1-pixel cache
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1988
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1989
                    WORD CacheIn[MAXCHANNELS];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1990
                    WORD CacheOut[MAXCHANNELS];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1991
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1992
                    double AdaptationState; // Figure for v4 incomplete state of adaptation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  1994
                    LCMS_RWLOCK_T rwlock;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1996
                   } _cmsTRANSFORM,FAR *_LPcmsTRANSFORM;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1997
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1998
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1999
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
// Packing & Unpacking
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2001
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2002
_cmsFIXFN cdecl _cmsIdentifyInputFormat(_LPcmsTRANSFORM xform,  DWORD dwInput);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2003
_cmsFIXFN cdecl _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2004
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2005
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2006
// Conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2007
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2008
#define XYZRel       0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2009
#define LabRel       1
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2011
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2012
int cdecl cmsChooseCnvrt(int Absolute,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2013
                 int Phase1, LPcmsCIEXYZ BlackPointIn,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2014
                             LPcmsCIEXYZ WhitePointIn,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2015
                             LPcmsCIEXYZ IlluminantIn,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2016
                             LPMAT3 ChromaticAdaptationMatrixIn,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2017
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2018
                 int Phase2, LPcmsCIEXYZ BlackPointOut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2019
                             LPcmsCIEXYZ WhitePointOut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2020
                             LPcmsCIEXYZ IlluminantOut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2021
                             LPMAT3 ChromaticAdaptationMatrixOut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2022
                 int DoBPC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2023
                 double AdaptationState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2024
                 _cmsADJFN *fn1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2025
                 LPWMAT3 wm, LPWVEC3 wof);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2026
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
// Clamping & Gamut handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2031
LCMSBOOL cdecl   _cmsEndPointsBySpace(icColorSpaceSignature Space,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2032
                            WORD **White, WORD **Black, int *nOutputs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2033
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
WORD * cdecl _cmsWhiteBySpace(icColorSpaceSignature Space);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2035
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2036
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2038
WORD cdecl Clamp_L(Fixed32 in);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2039
WORD cdecl Clamp_ab(Fixed32 in);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2040
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2041
// Detection of black point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2042
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2043
#define LCMS_BPFLAGS_D50_ADAPTED    0x0001
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2044
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2045
int cdecl cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2046
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2047
// choose reasonable resolution
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2048
int cdecl _cmsReasonableGridpointsByColorspace(icColorSpaceSignature Colorspace, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2049
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2050
// Precalculate device link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2051
LPLUT cdecl _cmsPrecalculateDeviceLink(cmsHTRANSFORM h, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2052
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2053
// Precalculate black preserving device link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2054
LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD dwFlags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2055
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2056
// Precalculate gamut check
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2057
LPLUT cdecl _cmsPrecalculateGamutCheck(cmsHTRANSFORM h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2058
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2059
// Hot fixes bad profiles
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2060
LCMSBOOL cdecl _cmsFixWhiteMisalignment(_LPcmsTRANSFORM p);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2061
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2062
// Marks LUT as 8 bit on input
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2063
LPLUT cdecl _cmsBlessLUT8(LPLUT Lut);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2064
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2065
// Compute gamut boundary
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2066
LPLUT cdecl _cmsComputeGamutLUT(cmsHPROFILE hProfile, int Intent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2067
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2068
// Compute softproof
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2069
LPLUT cdecl _cmsComputeSoftProofLUT(cmsHPROFILE hProfile, int nIntent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2070
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2071
// Find a suitable prelinearization tables, matching the given transform
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2072
void cdecl _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTransforms, LPLUT Grid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2073
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2074
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2075
// Build a tone curve for K->K' if possible (only works on CMYK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2076
LPGAMMATABLE _cmsBuildKToneCurve(cmsHTRANSFORM hCMYK2CMYK, int nPoints);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2077
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2078
// Validates a LUT
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2079
LCMSBOOL cdecl _cmsValidateLUT(LPLUT NewLUT);
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2080
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2081
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2082
// These are two VITAL macros, from converting between 8 and 16 bit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2083
// representation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2084
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2085
#define RGB_8_TO_16(rgb) (WORD) ((((WORD) (rgb)) << 8)|(rgb))
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2086
#define RGB_16_TO_8(rgb) (BYTE) ((((rgb) * 65281 + 8388608) >> 24) & 0xFF)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2087
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2088
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2089
#endif  // LCMS_APIONLY
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2090
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2091
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2092
#define __cms_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2093
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2094
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2095
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2096
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2097
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2098
#endif
2394
404cbe399601 6821031: Upgrade OpenJDK's LittleCMS version to 1.18
prr
parents: 2392
diff changeset
  2099