Path: blob/master/src/java.desktop/share/native/liblcms/lcms2.h
41149 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324// This file is available under and governed by the GNU General Public25// License version 2 only, as published by the Free Software Foundation.26// However, the following notice accompanied the original version of this27// file:28//29//---------------------------------------------------------------------------------30//31// Little Color Management System32// Copyright (c) 1998-2021 Marti Maria Saguer33//34// Permission is hereby granted, free of charge, to any person obtaining35// a copy of this software and associated documentation files (the "Software"),36// to deal in the Software without restriction, including without limitation37// the rights to use, copy, modify, merge, publish, distribute, sublicense,38// and/or sell copies of the Software, and to permit persons to whom the Software39// is furnished to do so, subject to the following conditions:40//41// The above copyright notice and this permission notice shall be included in42// all copies or substantial portions of the Software.43//44// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,45// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO46// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND47// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE48// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION49// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION50// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.51//52//---------------------------------------------------------------------------------53//54// Version 2.1255//5657#ifndef _lcms2_H5859// ********** Configuration toggles ****************************************6061// Uncomment this one if you are using big endian machines62// #define CMS_USE_BIG_ENDIAN 16364// Uncomment this one if your compiler/machine does NOT support the65// "long long" type.66// #define CMS_DONT_USE_INT64 16768// Uncomment this if your compiler doesn't work with fast floor function69// #define CMS_DONT_USE_FAST_FLOOR 17071// Uncomment this line if you want lcms to use the black point tag in profile,72// if commented, lcms will compute the black point by its own.73// It is safer to leave it commented out74// #define CMS_USE_PROFILE_BLACK_POINT_TAG 17576// Uncomment this line if you are compiling as C++ and want a C++ API77// #define CMS_USE_CPP_API7879// Uncomment this line if you need strict CGATS syntax. Makes CGATS files to80// require "KEYWORD" on undefined identifiers, keep it commented out unless needed81// #define CMS_STRICT_CGATS 18283// Uncomment to get rid of the tables for "half" float support84// #define CMS_NO_HALF_SUPPORT 18586// Uncomment to get rid of pthreads/windows dependency87// #define CMS_NO_PTHREADS 18889// Uncomment this for special windows mutex initialization (see lcms2_internal.h)90// #define CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT9192// Uncomment this to remove the "register" storage class93// #define CMS_NO_REGISTER_KEYWORD 19495// ********** End of configuration toggles ******************************9697// Needed for streams98#include <stdio.h>99100// Needed for portability (C99 per 7.1.2)101#include <limits.h>102#include <time.h>103#include <stddef.h>104105#ifndef CMS_USE_CPP_API106# ifdef __cplusplus107extern "C" {108# endif109#endif110111// Version/release112#define LCMS_VERSION 2120113114// I will give the chance of redefining basic types for compilers that are not fully C99 compliant115#ifndef CMS_BASIC_TYPES_ALREADY_DEFINED116117// Base types118typedef unsigned char cmsUInt8Number; // That is guaranteed by the C99 spec119typedef signed char cmsInt8Number; // That is guaranteed by the C99 spec120121#if CHAR_BIT != 8122# error "Unable to find 8 bit type, unsupported compiler"123#endif124125// IEEE float storage numbers126typedef float cmsFloat32Number;127typedef double cmsFloat64Number;128129// 16-bit base types130#if (USHRT_MAX == 65535U)131typedef unsigned short cmsUInt16Number;132#elif (UINT_MAX == 65535U)133typedef unsigned int cmsUInt16Number;134#else135# error "Unable to find 16 bits unsigned type, unsupported compiler"136#endif137138#if (SHRT_MAX == 32767)139typedef short cmsInt16Number;140#elif (INT_MAX == 32767)141typedef int cmsInt16Number;142#else143# error "Unable to find 16 bits signed type, unsupported compiler"144#endif145146// 32-bit base type147#if (UINT_MAX == 4294967295U)148typedef unsigned int cmsUInt32Number;149#elif (ULONG_MAX == 4294967295U)150typedef unsigned long cmsUInt32Number;151#else152# error "Unable to find 32 bit unsigned type, unsupported compiler"153#endif154155#if (INT_MAX == +2147483647)156typedef int cmsInt32Number;157#elif (LONG_MAX == +2147483647)158typedef long cmsInt32Number;159#else160# error "Unable to find 32 bit signed type, unsupported compiler"161#endif162163// 64-bit base types164#ifndef CMS_DONT_USE_INT64165# if (ULONG_MAX == 18446744073709551615U)166typedef unsigned long cmsUInt64Number;167# elif (ULLONG_MAX == 18446744073709551615U)168typedef unsigned long long cmsUInt64Number;169# else170# define CMS_DONT_USE_INT64 1171# endif172# if (LONG_MAX == +9223372036854775807)173typedef long cmsInt64Number;174# elif (LLONG_MAX == +9223372036854775807)175typedef long long cmsInt64Number;176# else177# define CMS_DONT_USE_INT64 1178# endif179#endif180#endif181182// Handle "register" keyword183#if defined(CMS_NO_REGISTER_KEYWORD) && !defined(CMS_DLL) && !defined(CMS_DLL_BUILD)184# define CMSREGISTER185#else186# define CMSREGISTER register187#endif188189// In the case 64 bit numbers are not supported by the compiler190#ifdef CMS_DONT_USE_INT64191typedef cmsUInt32Number cmsUInt64Number[2];192typedef cmsInt32Number cmsInt64Number[2];193#endif194195// Derivative types196typedef cmsUInt32Number cmsSignature;197typedef cmsUInt16Number cmsU8Fixed8Number;198typedef cmsInt32Number cmsS15Fixed16Number;199typedef cmsUInt32Number cmsU16Fixed16Number;200201// Boolean type, which will be using the native integer202typedef int cmsBool;203204// Try to detect windows205#if defined (_WIN32) || defined(_WIN64) || defined(WIN32) || defined(_WIN32_)206# define CMS_IS_WINDOWS_ 1207#endif208209#ifdef _MSC_VER210# define CMS_IS_WINDOWS_ 1211#endif212213#ifdef __BORLANDC__214# define CMS_IS_WINDOWS_ 1215#endif216217// Try to detect big endian platforms. This list can be endless, so primarily rely on the configure script218// on Unix-like systems, and allow it to be set on the compiler command line using219// -DCMS_USE_BIG_ENDIAN or something similar220#ifdef CMS_USE_BIG_ENDIAN // set at compiler command line takes overall precedence221222# if CMS_USE_BIG_ENDIAN == 0223# undef CMS_USE_BIG_ENDIAN224# endif225226#else // CMS_USE_BIG_ENDIAN227228# ifdef WORDS_BIGENDIAN // set by configure (or explicitly on compiler command line)229# define CMS_USE_BIG_ENDIAN 1230# else // WORDS_BIGENDIAN231// Fall back to platform/compiler specific tests232# if defined(__sgi__) || defined(__sgi) || defined(sparc)233# define CMS_USE_BIG_ENDIAN 1234# endif235236# if defined(__s390__) || defined(__s390x__)237# define CMS_USE_BIG_ENDIAN 1238# endif239240# ifdef macintosh241# ifdef __BIG_ENDIAN__242# define CMS_USE_BIG_ENDIAN 1243# endif244# ifdef __LITTLE_ENDIAN__245# undef CMS_USE_BIG_ENDIAN246# endif247# endif248# endif // WORDS_BIGENDIAN249250# if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__)251# define CMS_USE_BIG_ENDIAN 1252# endif253254#endif // CMS_USE_BIG_ENDIAN255256257// Calling convention -- this is hardly platform and compiler dependent258#ifdef CMS_IS_WINDOWS_259# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)260# ifdef __BORLANDC__261# define CMSEXPORT __stdcall _export262# define CMSAPI263# else264# define CMSEXPORT __stdcall265# ifdef CMS_DLL_BUILD266# define CMSAPI __declspec(dllexport)267# else268# define CMSAPI __declspec(dllimport)269# endif270# endif271# else272# define CMSEXPORT273# define CMSAPI274# endif275#else // not Windows276# ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY277# define CMSEXPORT278# define CMSAPI __attribute__((visibility("default")))279# else280# define CMSEXPORT281# define CMSAPI282# endif283#endif // CMS_IS_WINDOWS_284285#ifdef HasTHREADS286# if HasTHREADS == 1287# undef CMS_NO_PTHREADS288# else289# define CMS_NO_PTHREADS 1290# endif291#endif292293// Some common definitions294#define cmsMAX_PATH 256295296#ifndef FALSE297# define FALSE 0298#endif299#ifndef TRUE300# define TRUE 1301#endif302303// D50 XYZ normalized to Y=1.0304#define cmsD50X 0.9642305#define cmsD50Y 1.0306#define cmsD50Z 0.8249307308// V4 perceptual black309#define cmsPERCEPTUAL_BLACK_X 0.00336310#define cmsPERCEPTUAL_BLACK_Y 0.0034731311#define cmsPERCEPTUAL_BLACK_Z 0.00287312313// Definitions in ICC spec314#define cmsMagicNumber 0x61637370 // 'acsp'315#define lcmsSignature 0x6c636d73 // 'lcms'316317318// Base ICC type definitions319typedef enum {320cmsSigChromaticityType = 0x6368726D, // 'chrm'321cmsSigColorantOrderType = 0x636C726F, // 'clro'322cmsSigColorantTableType = 0x636C7274, // 'clrt'323cmsSigCrdInfoType = 0x63726469, // 'crdi'324cmsSigCurveType = 0x63757276, // 'curv'325cmsSigDataType = 0x64617461, // 'data'326cmsSigDictType = 0x64696374, // 'dict'327cmsSigDateTimeType = 0x6474696D, // 'dtim'328cmsSigDeviceSettingsType = 0x64657673, // 'devs'329cmsSigLut16Type = 0x6d667432, // 'mft2'330cmsSigLut8Type = 0x6d667431, // 'mft1'331cmsSigLutAtoBType = 0x6d414220, // 'mAB '332cmsSigLutBtoAType = 0x6d424120, // 'mBA '333cmsSigMeasurementType = 0x6D656173, // 'meas'334cmsSigMultiLocalizedUnicodeType = 0x6D6C7563, // 'mluc'335cmsSigMultiProcessElementType = 0x6D706574, // 'mpet'336cmsSigNamedColorType = 0x6E636f6C, // 'ncol' -- DEPRECATED!337cmsSigNamedColor2Type = 0x6E636C32, // 'ncl2'338cmsSigParametricCurveType = 0x70617261, // 'para'339cmsSigProfileSequenceDescType = 0x70736571, // 'pseq'340cmsSigProfileSequenceIdType = 0x70736964, // 'psid'341cmsSigResponseCurveSet16Type = 0x72637332, // 'rcs2'342cmsSigS15Fixed16ArrayType = 0x73663332, // 'sf32'343cmsSigScreeningType = 0x7363726E, // 'scrn'344cmsSigSignatureType = 0x73696720, // 'sig '345cmsSigTextType = 0x74657874, // 'text'346cmsSigTextDescriptionType = 0x64657363, // 'desc'347cmsSigU16Fixed16ArrayType = 0x75663332, // 'uf32'348cmsSigUcrBgType = 0x62666420, // 'bfd '349cmsSigUInt16ArrayType = 0x75693136, // 'ui16'350cmsSigUInt32ArrayType = 0x75693332, // 'ui32'351cmsSigUInt64ArrayType = 0x75693634, // 'ui64'352cmsSigUInt8ArrayType = 0x75693038, // 'ui08'353cmsSigVcgtType = 0x76636774, // 'vcgt'354cmsSigViewingConditionsType = 0x76696577, // 'view'355cmsSigXYZType = 0x58595A20 // 'XYZ '356357358} cmsTagTypeSignature;359360// Base ICC tag definitions361typedef enum {362cmsSigAToB0Tag = 0x41324230, // 'A2B0'363cmsSigAToB1Tag = 0x41324231, // 'A2B1'364cmsSigAToB2Tag = 0x41324232, // 'A2B2'365cmsSigBlueColorantTag = 0x6258595A, // 'bXYZ'366cmsSigBlueMatrixColumnTag = 0x6258595A, // 'bXYZ'367cmsSigBlueTRCTag = 0x62545243, // 'bTRC'368cmsSigBToA0Tag = 0x42324130, // 'B2A0'369cmsSigBToA1Tag = 0x42324131, // 'B2A1'370cmsSigBToA2Tag = 0x42324132, // 'B2A2'371cmsSigCalibrationDateTimeTag = 0x63616C74, // 'calt'372cmsSigCharTargetTag = 0x74617267, // 'targ'373cmsSigChromaticAdaptationTag = 0x63686164, // 'chad'374cmsSigChromaticityTag = 0x6368726D, // 'chrm'375cmsSigColorantOrderTag = 0x636C726F, // 'clro'376cmsSigColorantTableTag = 0x636C7274, // 'clrt'377cmsSigColorantTableOutTag = 0x636C6F74, // 'clot'378cmsSigColorimetricIntentImageStateTag = 0x63696973, // 'ciis'379cmsSigCopyrightTag = 0x63707274, // 'cprt'380cmsSigCrdInfoTag = 0x63726469, // 'crdi'381cmsSigDataTag = 0x64617461, // 'data'382cmsSigDateTimeTag = 0x6474696D, // 'dtim'383cmsSigDeviceMfgDescTag = 0x646D6E64, // 'dmnd'384cmsSigDeviceModelDescTag = 0x646D6464, // 'dmdd'385cmsSigDeviceSettingsTag = 0x64657673, // 'devs'386cmsSigDToB0Tag = 0x44324230, // 'D2B0'387cmsSigDToB1Tag = 0x44324231, // 'D2B1'388cmsSigDToB2Tag = 0x44324232, // 'D2B2'389cmsSigDToB3Tag = 0x44324233, // 'D2B3'390cmsSigBToD0Tag = 0x42324430, // 'B2D0'391cmsSigBToD1Tag = 0x42324431, // 'B2D1'392cmsSigBToD2Tag = 0x42324432, // 'B2D2'393cmsSigBToD3Tag = 0x42324433, // 'B2D3'394cmsSigGamutTag = 0x67616D74, // 'gamt'395cmsSigGrayTRCTag = 0x6b545243, // 'kTRC'396cmsSigGreenColorantTag = 0x6758595A, // 'gXYZ'397cmsSigGreenMatrixColumnTag = 0x6758595A, // 'gXYZ'398cmsSigGreenTRCTag = 0x67545243, // 'gTRC'399cmsSigLuminanceTag = 0x6C756d69, // 'lumi'400cmsSigMeasurementTag = 0x6D656173, // 'meas'401cmsSigMediaBlackPointTag = 0x626B7074, // 'bkpt'402cmsSigMediaWhitePointTag = 0x77747074, // 'wtpt'403cmsSigNamedColorTag = 0x6E636f6C, // 'ncol' // Deprecated by the ICC404cmsSigNamedColor2Tag = 0x6E636C32, // 'ncl2'405cmsSigOutputResponseTag = 0x72657370, // 'resp'406cmsSigPerceptualRenderingIntentGamutTag = 0x72696730, // 'rig0'407cmsSigPreview0Tag = 0x70726530, // 'pre0'408cmsSigPreview1Tag = 0x70726531, // 'pre1'409cmsSigPreview2Tag = 0x70726532, // 'pre2'410cmsSigProfileDescriptionTag = 0x64657363, // 'desc'411cmsSigProfileDescriptionMLTag = 0x6473636d, // 'dscm'412cmsSigProfileSequenceDescTag = 0x70736571, // 'pseq'413cmsSigProfileSequenceIdTag = 0x70736964, // 'psid'414cmsSigPs2CRD0Tag = 0x70736430, // 'psd0'415cmsSigPs2CRD1Tag = 0x70736431, // 'psd1'416cmsSigPs2CRD2Tag = 0x70736432, // 'psd2'417cmsSigPs2CRD3Tag = 0x70736433, // 'psd3'418cmsSigPs2CSATag = 0x70733273, // 'ps2s'419cmsSigPs2RenderingIntentTag = 0x70733269, // 'ps2i'420cmsSigRedColorantTag = 0x7258595A, // 'rXYZ'421cmsSigRedMatrixColumnTag = 0x7258595A, // 'rXYZ'422cmsSigRedTRCTag = 0x72545243, // 'rTRC'423cmsSigSaturationRenderingIntentGamutTag = 0x72696732, // 'rig2'424cmsSigScreeningDescTag = 0x73637264, // 'scrd'425cmsSigScreeningTag = 0x7363726E, // 'scrn'426cmsSigTechnologyTag = 0x74656368, // 'tech'427cmsSigUcrBgTag = 0x62666420, // 'bfd '428cmsSigViewingCondDescTag = 0x76756564, // 'vued'429cmsSigViewingConditionsTag = 0x76696577, // 'view'430cmsSigVcgtTag = 0x76636774, // 'vcgt'431cmsSigMetaTag = 0x6D657461, // 'meta'432cmsSigArgyllArtsTag = 0x61727473 // 'arts'433434} cmsTagSignature;435436437// ICC Technology tag438typedef enum {439cmsSigDigitalCamera = 0x6463616D, // 'dcam'440cmsSigFilmScanner = 0x6673636E, // 'fscn'441cmsSigReflectiveScanner = 0x7273636E, // 'rscn'442cmsSigInkJetPrinter = 0x696A6574, // 'ijet'443cmsSigThermalWaxPrinter = 0x74776178, // 'twax'444cmsSigElectrophotographicPrinter = 0x6570686F, // 'epho'445cmsSigElectrostaticPrinter = 0x65737461, // 'esta'446cmsSigDyeSublimationPrinter = 0x64737562, // 'dsub'447cmsSigPhotographicPaperPrinter = 0x7270686F, // 'rpho'448cmsSigFilmWriter = 0x6670726E, // 'fprn'449cmsSigVideoMonitor = 0x7669646D, // 'vidm'450cmsSigVideoCamera = 0x76696463, // 'vidc'451cmsSigProjectionTelevision = 0x706A7476, // 'pjtv'452cmsSigCRTDisplay = 0x43525420, // 'CRT '453cmsSigPMDisplay = 0x504D4420, // 'PMD '454cmsSigAMDisplay = 0x414D4420, // 'AMD '455cmsSigPhotoCD = 0x4B504344, // 'KPCD'456cmsSigPhotoImageSetter = 0x696D6773, // 'imgs'457cmsSigGravure = 0x67726176, // 'grav'458cmsSigOffsetLithography = 0x6F666673, // 'offs'459cmsSigSilkscreen = 0x73696C6B, // 'silk'460cmsSigFlexography = 0x666C6578, // 'flex'461cmsSigMotionPictureFilmScanner = 0x6D706673, // 'mpfs'462cmsSigMotionPictureFilmRecorder = 0x6D706672, // 'mpfr'463cmsSigDigitalMotionPictureCamera = 0x646D7063, // 'dmpc'464cmsSigDigitalCinemaProjector = 0x64636A70 // 'dcpj'465466} cmsTechnologySignature;467468469// ICC Color spaces470typedef enum {471cmsSigXYZData = 0x58595A20, // 'XYZ '472cmsSigLabData = 0x4C616220, // 'Lab '473cmsSigLuvData = 0x4C757620, // 'Luv '474cmsSigYCbCrData = 0x59436272, // 'YCbr'475cmsSigYxyData = 0x59787920, // 'Yxy '476cmsSigRgbData = 0x52474220, // 'RGB '477cmsSigGrayData = 0x47524159, // 'GRAY'478cmsSigHsvData = 0x48535620, // 'HSV '479cmsSigHlsData = 0x484C5320, // 'HLS '480cmsSigCmykData = 0x434D594B, // 'CMYK'481cmsSigCmyData = 0x434D5920, // 'CMY '482cmsSigMCH1Data = 0x4D434831, // 'MCH1'483cmsSigMCH2Data = 0x4D434832, // 'MCH2'484cmsSigMCH3Data = 0x4D434833, // 'MCH3'485cmsSigMCH4Data = 0x4D434834, // 'MCH4'486cmsSigMCH5Data = 0x4D434835, // 'MCH5'487cmsSigMCH6Data = 0x4D434836, // 'MCH6'488cmsSigMCH7Data = 0x4D434837, // 'MCH7'489cmsSigMCH8Data = 0x4D434838, // 'MCH8'490cmsSigMCH9Data = 0x4D434839, // 'MCH9'491cmsSigMCHAData = 0x4D434841, // 'MCHA'492cmsSigMCHBData = 0x4D434842, // 'MCHB'493cmsSigMCHCData = 0x4D434843, // 'MCHC'494cmsSigMCHDData = 0x4D434844, // 'MCHD'495cmsSigMCHEData = 0x4D434845, // 'MCHE'496cmsSigMCHFData = 0x4D434846, // 'MCHF'497cmsSigNamedData = 0x6e6d636c, // 'nmcl'498cmsSig1colorData = 0x31434C52, // '1CLR'499cmsSig2colorData = 0x32434C52, // '2CLR'500cmsSig3colorData = 0x33434C52, // '3CLR'501cmsSig4colorData = 0x34434C52, // '4CLR'502cmsSig5colorData = 0x35434C52, // '5CLR'503cmsSig6colorData = 0x36434C52, // '6CLR'504cmsSig7colorData = 0x37434C52, // '7CLR'505cmsSig8colorData = 0x38434C52, // '8CLR'506cmsSig9colorData = 0x39434C52, // '9CLR'507cmsSig10colorData = 0x41434C52, // 'ACLR'508cmsSig11colorData = 0x42434C52, // 'BCLR'509cmsSig12colorData = 0x43434C52, // 'CCLR'510cmsSig13colorData = 0x44434C52, // 'DCLR'511cmsSig14colorData = 0x45434C52, // 'ECLR'512cmsSig15colorData = 0x46434C52, // 'FCLR'513cmsSigLuvKData = 0x4C75764B // 'LuvK'514515} cmsColorSpaceSignature;516517// ICC Profile Class518typedef enum {519cmsSigInputClass = 0x73636E72, // 'scnr'520cmsSigDisplayClass = 0x6D6E7472, // 'mntr'521cmsSigOutputClass = 0x70727472, // 'prtr'522cmsSigLinkClass = 0x6C696E6B, // 'link'523cmsSigAbstractClass = 0x61627374, // 'abst'524cmsSigColorSpaceClass = 0x73706163, // 'spac'525cmsSigNamedColorClass = 0x6e6d636c // 'nmcl'526527} cmsProfileClassSignature;528529// ICC Platforms530typedef enum {531cmsSigMacintosh = 0x4150504C, // 'APPL'532cmsSigMicrosoft = 0x4D534654, // 'MSFT'533cmsSigSolaris = 0x53554E57, // 'SUNW'534cmsSigSGI = 0x53474920, // 'SGI '535cmsSigTaligent = 0x54474E54, // 'TGNT'536cmsSigUnices = 0x2A6E6978 // '*nix' // From argyll -- Not official537538} cmsPlatformSignature;539540// Reference gamut541#define cmsSigPerceptualReferenceMediumGamut 0x70726d67 //'prmg'542543// For cmsSigColorimetricIntentImageStateTag544#define cmsSigSceneColorimetryEstimates 0x73636F65 //'scoe'545#define cmsSigSceneAppearanceEstimates 0x73617065 //'sape'546#define cmsSigFocalPlaneColorimetryEstimates 0x66706365 //'fpce'547#define cmsSigReflectionHardcopyOriginalColorimetry 0x72686F63 //'rhoc'548#define cmsSigReflectionPrintOutputColorimetry 0x72706F63 //'rpoc'549550// Multi process elements types551typedef enum {552cmsSigCurveSetElemType = 0x63767374, //'cvst'553cmsSigMatrixElemType = 0x6D617466, //'matf'554cmsSigCLutElemType = 0x636C7574, //'clut'555556cmsSigBAcsElemType = 0x62414353, // 'bACS'557cmsSigEAcsElemType = 0x65414353, // 'eACS'558559// Custom from here, not in the ICC Spec560cmsSigXYZ2LabElemType = 0x6C327820, // 'l2x '561cmsSigLab2XYZElemType = 0x78326C20, // 'x2l '562cmsSigNamedColorElemType = 0x6E636C20, // 'ncl '563cmsSigLabV2toV4 = 0x32203420, // '2 4 '564cmsSigLabV4toV2 = 0x34203220, // '4 2 '565566// Identities567cmsSigIdentityElemType = 0x69646E20, // 'idn '568569// Float to floatPCS570cmsSigLab2FloatPCS = 0x64326C20, // 'd2l '571cmsSigFloatPCS2Lab = 0x6C326420, // 'l2d '572cmsSigXYZ2FloatPCS = 0x64327820, // 'd2x '573cmsSigFloatPCS2XYZ = 0x78326420, // 'x2d '574cmsSigClipNegativesElemType = 0x636c7020 // 'clp '575576} cmsStageSignature;577578// Types of CurveElements579typedef enum {580581cmsSigFormulaCurveSeg = 0x70617266, // 'parf'582cmsSigSampledCurveSeg = 0x73616D66, // 'samf'583cmsSigSegmentedCurve = 0x63757266 // 'curf'584585} cmsCurveSegSignature;586587// Used in ResponseCurveType588#define cmsSigStatusA 0x53746141 //'StaA'589#define cmsSigStatusE 0x53746145 //'StaE'590#define cmsSigStatusI 0x53746149 //'StaI'591#define cmsSigStatusT 0x53746154 //'StaT'592#define cmsSigStatusM 0x5374614D //'StaM'593#define cmsSigDN 0x444E2020 //'DN '594#define cmsSigDNP 0x444E2050 //'DN P'595#define cmsSigDNN 0x444E4E20 //'DNN '596#define cmsSigDNNP 0x444E4E50 //'DNNP'597598// Device attributes, currently defined values correspond to the low 4 bytes599// of the 8 byte attribute quantity600#define cmsReflective 0601#define cmsTransparency 1602#define cmsGlossy 0603#define cmsMatte 2604605// Common structures in ICC tags606typedef struct {607cmsUInt32Number len;608cmsUInt32Number flag;609cmsUInt8Number data[1];610611} cmsICCData;612613// ICC date time614typedef struct {615cmsUInt16Number year;616cmsUInt16Number month;617cmsUInt16Number day;618cmsUInt16Number hours;619cmsUInt16Number minutes;620cmsUInt16Number seconds;621622} cmsDateTimeNumber;623624// ICC XYZ625typedef struct {626cmsS15Fixed16Number X;627cmsS15Fixed16Number Y;628cmsS15Fixed16Number Z;629630} cmsEncodedXYZNumber;631632633// Profile ID as computed by MD5 algorithm634typedef union {635cmsUInt8Number ID8[16];636cmsUInt16Number ID16[8];637cmsUInt32Number ID32[4];638639} cmsProfileID;640641642// ----------------------------------------------------------------------------------------------643// ICC profile internal base types. Strictly, shouldn't be declared in this header, but maybe644// somebody want to use this info for accessing profile header directly, so here it is.645646// Profile header -- it is 32-bit aligned, so no issues are expected on alignment647typedef struct {648cmsUInt32Number size; // Profile size in bytes649cmsSignature cmmId; // CMM for this profile650cmsUInt32Number version; // Format version number651cmsProfileClassSignature deviceClass; // Type of profile652cmsColorSpaceSignature colorSpace; // Color space of data653cmsColorSpaceSignature pcs; // PCS, XYZ or Lab only654cmsDateTimeNumber date; // Date profile was created655cmsSignature magic; // Magic Number to identify an ICC profile656cmsPlatformSignature platform; // Primary Platform657cmsUInt32Number flags; // Various bit settings658cmsSignature manufacturer; // Device manufacturer659cmsUInt32Number model; // Device model number660cmsUInt64Number attributes; // Device attributes661cmsUInt32Number renderingIntent;// Rendering intent662cmsEncodedXYZNumber illuminant; // Profile illuminant663cmsSignature creator; // Profile creator664cmsProfileID profileID; // Profile ID using MD5665cmsInt8Number reserved[28]; // Reserved for future use666667} cmsICCHeader;668669// ICC base tag670typedef struct {671cmsTagTypeSignature sig;672cmsInt8Number reserved[4];673674} cmsTagBase;675676// A tag entry in directory677typedef struct {678cmsTagSignature sig; // The tag signature679cmsUInt32Number offset; // Start of tag680cmsUInt32Number size; // Size in bytes681682} cmsTagEntry;683684// ----------------------------------------------------------------------------------------------685686// Little CMS specific typedefs687688typedef void* cmsHANDLE ; // Generic handle689typedef void* cmsHPROFILE; // Opaque typedefs to hide internals690typedef void* cmsHTRANSFORM;691692#define cmsMAXCHANNELS 16 // Maximum number of channels in ICC profiles693694// Format of pixel is defined by one cmsUInt32Number, using bit fields as follows695//696// 2 1 0697// 3 2 10987 6 5 4 3 2 1 098 7654 321698// A O TTTTT U Y F P X S EEE CCCC BBB699//700// A: Floating point -- With this flag we can differentiate 16 bits as float and as int701// O: Optimized -- previous optimization already returns the final 8-bit value702// T: Pixeltype703// F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)704// P: Planar? 0=Chunky, 1=Planar705// X: swap 16 bps endianness?706// S: Do swap? ie, BGR, KYMC707// E: Extra samples708// C: Channels (Samples per pixel)709// B: bytes per sample710// Y: Swap first - changes ABGR to BGRA and KCMY to CMYK711712#define FLOAT_SH(a) ((a) << 22)713#define OPTIMIZED_SH(s) ((s) << 21)714#define COLORSPACE_SH(s) ((s) << 16)715#define SWAPFIRST_SH(s) ((s) << 14)716#define FLAVOR_SH(s) ((s) << 13)717#define PLANAR_SH(p) ((p) << 12)718#define ENDIAN16_SH(e) ((e) << 11)719#define DOSWAP_SH(e) ((e) << 10)720#define EXTRA_SH(e) ((e) << 7)721#define CHANNELS_SH(c) ((c) << 3)722#define BYTES_SH(b) (b)723724// These macros unpack format specifiers into integers725#define T_FLOAT(a) (((a)>>22)&1)726#define T_OPTIMIZED(o) (((o)>>21)&1)727#define T_COLORSPACE(s) (((s)>>16)&31)728#define T_SWAPFIRST(s) (((s)>>14)&1)729#define T_FLAVOR(s) (((s)>>13)&1)730#define T_PLANAR(p) (((p)>>12)&1)731#define T_ENDIAN16(e) (((e)>>11)&1)732#define T_DOSWAP(e) (((e)>>10)&1)733#define T_EXTRA(e) (((e)>>7)&7)734#define T_CHANNELS(c) (((c)>>3)&15)735#define T_BYTES(b) ((b)&7)736737738// Pixel types739#define PT_ANY 0 // Don't check colorspace740// 1 & 2 are reserved741#define PT_GRAY 3742#define PT_RGB 4743#define PT_CMY 5744#define PT_CMYK 6745#define PT_YCbCr 7746#define PT_YUV 8 // Lu'v'747#define PT_XYZ 9748#define PT_Lab 10749#define PT_YUVK 11 // Lu'v'K750#define PT_HSV 12751#define PT_HLS 13752#define PT_Yxy 14753754#define PT_MCH1 15755#define PT_MCH2 16756#define PT_MCH3 17757#define PT_MCH4 18758#define PT_MCH5 19759#define PT_MCH6 20760#define PT_MCH7 21761#define PT_MCH8 22762#define PT_MCH9 23763#define PT_MCH10 24764#define PT_MCH11 25765#define PT_MCH12 26766#define PT_MCH13 27767#define PT_MCH14 28768#define PT_MCH15 29769770#define PT_LabV2 30 // Identical to PT_Lab, but using the V2 old encoding771772// Some (not all!) representations773774#ifndef TYPE_RGB_8 // TYPE_RGB_8 is a very common identifier, so don't include ours775// if user has it already defined.776777#define TYPE_GRAY_8 (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1))778#define TYPE_GRAY_8_REV (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(1)|FLAVOR_SH(1))779#define TYPE_GRAY_16 (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2))780#define TYPE_GRAY_16_REV (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|FLAVOR_SH(1))781#define TYPE_GRAY_16_SE (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))782#define TYPE_GRAYA_8 (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1))783#define TYPE_GRAYA_16 (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2))784#define TYPE_GRAYA_16_SE (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1))785#define TYPE_GRAYA_8_PLANAR (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(1)|PLANAR_SH(1))786#define TYPE_GRAYA_16_PLANAR (COLORSPACE_SH(PT_GRAY)|EXTRA_SH(1)|CHANNELS_SH(1)|BYTES_SH(2)|PLANAR_SH(1))787788#define TYPE_RGB_8 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1))789#define TYPE_RGB_8_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))790#define TYPE_BGR_8 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))791#define TYPE_BGR_8_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|PLANAR_SH(1))792#define TYPE_RGB_16 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2))793#define TYPE_RGB_16_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))794#define TYPE_RGB_16_SE (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))795#define TYPE_BGR_16 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))796#define TYPE_BGR_16_PLANAR (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))797#define TYPE_BGR_16_SE (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))798799#define TYPE_RGBA_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1))800#define TYPE_RGBA_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))801#define TYPE_RGBA_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))802#define TYPE_RGBA_16_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))803#define TYPE_RGBA_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))804805#define TYPE_ARGB_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|SWAPFIRST_SH(1))806#define TYPE_ARGB_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|SWAPFIRST_SH(1)|PLANAR_SH(1))807#define TYPE_ARGB_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|SWAPFIRST_SH(1))808809#define TYPE_ABGR_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1))810#define TYPE_ABGR_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|PLANAR_SH(1))811#define TYPE_ABGR_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))812#define TYPE_ABGR_16_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|PLANAR_SH(1))813#define TYPE_ABGR_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))814815#define TYPE_BGRA_8 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1))816#define TYPE_BGRA_8_PLANAR (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1)|PLANAR_SH(1))817#define TYPE_BGRA_16 (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1))818#define TYPE_BGRA_16_SE (COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1))819820#define TYPE_CMY_8 (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1))821#define TYPE_CMY_8_PLANAR (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))822#define TYPE_CMY_16 (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2))823#define TYPE_CMY_16_PLANAR (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))824#define TYPE_CMY_16_SE (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))825826#define TYPE_CMYK_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1))827#define TYPE_CMYKA_8 (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1))828#define TYPE_CMYK_8_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1))829#define TYPE_YUVK_8 TYPE_CMYK_8_REV830#define TYPE_CMYK_8_PLANAR (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|PLANAR_SH(1))831#define TYPE_CMYK_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2))832#define TYPE_CMYK_16_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1))833#define TYPE_YUVK_16 TYPE_CMYK_16_REV834#define TYPE_CMYK_16_PLANAR (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|PLANAR_SH(1))835#define TYPE_CMYK_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1))836837#define TYPE_KYMC_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1))838#define TYPE_KYMC_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1))839#define TYPE_KYMC_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))840841#define TYPE_KCMY_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|SWAPFIRST_SH(1))842#define TYPE_KCMY_8_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1)|SWAPFIRST_SH(1))843#define TYPE_KCMY_16 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|SWAPFIRST_SH(1))844#define TYPE_KCMY_16_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1)|SWAPFIRST_SH(1))845#define TYPE_KCMY_16_SE (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1)|SWAPFIRST_SH(1))846847#define TYPE_CMYK5_8 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(1))848#define TYPE_CMYK5_16 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2))849#define TYPE_CMYK5_16_SE (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|ENDIAN16_SH(1))850#define TYPE_KYMC5_8 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(1)|DOSWAP_SH(1))851#define TYPE_KYMC5_16 (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1))852#define TYPE_KYMC5_16_SE (COLORSPACE_SH(PT_MCH5)|CHANNELS_SH(5)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))853#define TYPE_CMYK6_8 (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(1))854#define TYPE_CMYK6_8_PLANAR (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(1)|PLANAR_SH(1))855#define TYPE_CMYK6_16 (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2))856#define TYPE_CMYK6_16_PLANAR (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2)|PLANAR_SH(1))857#define TYPE_CMYK6_16_SE (COLORSPACE_SH(PT_MCH6)|CHANNELS_SH(6)|BYTES_SH(2)|ENDIAN16_SH(1))858#define TYPE_CMYK7_8 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(1))859#define TYPE_CMYK7_16 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2))860#define TYPE_CMYK7_16_SE (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|ENDIAN16_SH(1))861#define TYPE_KYMC7_8 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(1)|DOSWAP_SH(1))862#define TYPE_KYMC7_16 (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1))863#define TYPE_KYMC7_16_SE (COLORSPACE_SH(PT_MCH7)|CHANNELS_SH(7)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))864#define TYPE_CMYK8_8 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(1))865#define TYPE_CMYK8_16 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2))866#define TYPE_CMYK8_16_SE (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|ENDIAN16_SH(1))867#define TYPE_KYMC8_8 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(1)|DOSWAP_SH(1))868#define TYPE_KYMC8_16 (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1))869#define TYPE_KYMC8_16_SE (COLORSPACE_SH(PT_MCH8)|CHANNELS_SH(8)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))870#define TYPE_CMYK9_8 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(1))871#define TYPE_CMYK9_16 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2))872#define TYPE_CMYK9_16_SE (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|ENDIAN16_SH(1))873#define TYPE_KYMC9_8 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(1)|DOSWAP_SH(1))874#define TYPE_KYMC9_16 (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1))875#define TYPE_KYMC9_16_SE (COLORSPACE_SH(PT_MCH9)|CHANNELS_SH(9)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))876#define TYPE_CMYK10_8 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(1))877#define TYPE_CMYK10_16 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2))878#define TYPE_CMYK10_16_SE (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|ENDIAN16_SH(1))879#define TYPE_KYMC10_8 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(1)|DOSWAP_SH(1))880#define TYPE_KYMC10_16 (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1))881#define TYPE_KYMC10_16_SE (COLORSPACE_SH(PT_MCH10)|CHANNELS_SH(10)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))882#define TYPE_CMYK11_8 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(1))883#define TYPE_CMYK11_16 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2))884#define TYPE_CMYK11_16_SE (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|ENDIAN16_SH(1))885#define TYPE_KYMC11_8 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(1)|DOSWAP_SH(1))886#define TYPE_KYMC11_16 (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1))887#define TYPE_KYMC11_16_SE (COLORSPACE_SH(PT_MCH11)|CHANNELS_SH(11)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))888#define TYPE_CMYK12_8 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(1))889#define TYPE_CMYK12_16 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2))890#define TYPE_CMYK12_16_SE (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|ENDIAN16_SH(1))891#define TYPE_KYMC12_8 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(1)|DOSWAP_SH(1))892#define TYPE_KYMC12_16 (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1))893#define TYPE_KYMC12_16_SE (COLORSPACE_SH(PT_MCH12)|CHANNELS_SH(12)|BYTES_SH(2)|DOSWAP_SH(1)|ENDIAN16_SH(1))894895// Colorimetric896#define TYPE_XYZ_16 (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(2))897#define TYPE_Lab_8 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1))898#define TYPE_LabV2_8 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(1))899900#define TYPE_ALab_8 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1))901#define TYPE_ALabV2_8 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1))902#define TYPE_Lab_16 (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2))903#define TYPE_LabV2_16 (COLORSPACE_SH(PT_LabV2)|CHANNELS_SH(3)|BYTES_SH(2))904#define TYPE_Yxy_16 (COLORSPACE_SH(PT_Yxy)|CHANNELS_SH(3)|BYTES_SH(2))905906// YCbCr907#define TYPE_YCbCr_8 (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1))908#define TYPE_YCbCr_8_PLANAR (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))909#define TYPE_YCbCr_16 (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2))910#define TYPE_YCbCr_16_PLANAR (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))911#define TYPE_YCbCr_16_SE (COLORSPACE_SH(PT_YCbCr)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))912913// YUV914#define TYPE_YUV_8 (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1))915#define TYPE_YUV_8_PLANAR (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))916#define TYPE_YUV_16 (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2))917#define TYPE_YUV_16_PLANAR (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))918#define TYPE_YUV_16_SE (COLORSPACE_SH(PT_YUV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))919920// HLS921#define TYPE_HLS_8 (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1))922#define TYPE_HLS_8_PLANAR (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))923#define TYPE_HLS_16 (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2))924#define TYPE_HLS_16_PLANAR (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))925#define TYPE_HLS_16_SE (COLORSPACE_SH(PT_HLS)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))926927// HSV928#define TYPE_HSV_8 (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1))929#define TYPE_HSV_8_PLANAR (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(1)|PLANAR_SH(1))930#define TYPE_HSV_16 (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2))931#define TYPE_HSV_16_PLANAR (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1))932#define TYPE_HSV_16_SE (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1))933934// Named color index. Only 16 bits allowed (don't check colorspace)935#define TYPE_NAMED_COLOR_INDEX (CHANNELS_SH(1)|BYTES_SH(2))936937// Float formatters.938#define TYPE_XYZ_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(4))939#define TYPE_Lab_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(4))940#define TYPE_LabA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))941#define TYPE_GRAY_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(4))942#define TYPE_RGB_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4))943944#define TYPE_RGBA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))945#define TYPE_ARGB_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|SWAPFIRST_SH(1))946#define TYPE_BGR_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))947#define TYPE_BGRA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1)|SWAPFIRST_SH(1))948#define TYPE_ABGR_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)|DOSWAP_SH(1))949950#define TYPE_CMYK_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(4))951952// Floating point formatters.953// NOTE THAT 'BYTES' FIELD IS SET TO ZERO ON DLB because 8 bytes overflows the bitfield954#define TYPE_XYZ_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(0))955#define TYPE_Lab_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(0))956#define TYPE_GRAY_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(0))957#define TYPE_RGB_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0))958#define TYPE_BGR_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0)|DOSWAP_SH(1))959#define TYPE_CMYK_DBL (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(0))960961// IEEE 754-2008 "half"962#define TYPE_GRAY_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(2))963#define TYPE_RGB_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2))964#define TYPE_RGBA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))965#define TYPE_CMYK_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(2))966967#define TYPE_RGBA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2))968#define TYPE_ARGB_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|SWAPFIRST_SH(1))969#define TYPE_BGR_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))970#define TYPE_BGRA_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1))971#define TYPE_ABGR_HALF_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1))972973#endif974975// Colorspaces976typedef struct {977cmsFloat64Number X;978cmsFloat64Number Y;979cmsFloat64Number Z;980981} cmsCIEXYZ;982983typedef struct {984cmsFloat64Number x;985cmsFloat64Number y;986cmsFloat64Number Y;987988} cmsCIExyY;989990typedef struct {991cmsFloat64Number L;992cmsFloat64Number a;993cmsFloat64Number b;994995} cmsCIELab;996997typedef struct {998cmsFloat64Number L;999cmsFloat64Number C;1000cmsFloat64Number h;10011002} cmsCIELCh;10031004typedef struct {1005cmsFloat64Number J;1006cmsFloat64Number C;1007cmsFloat64Number h;10081009} cmsJCh;10101011typedef struct {1012cmsCIEXYZ Red;1013cmsCIEXYZ Green;1014cmsCIEXYZ Blue;10151016} cmsCIEXYZTRIPLE;10171018typedef struct {1019cmsCIExyY Red;1020cmsCIExyY Green;1021cmsCIExyY Blue;10221023} cmsCIExyYTRIPLE;10241025// Illuminant types for structs below1026#define cmsILLUMINANT_TYPE_UNKNOWN 0x00000001027#define cmsILLUMINANT_TYPE_D50 0x00000011028#define cmsILLUMINANT_TYPE_D65 0x00000021029#define cmsILLUMINANT_TYPE_D93 0x00000031030#define cmsILLUMINANT_TYPE_F2 0x00000041031#define cmsILLUMINANT_TYPE_D55 0x00000051032#define cmsILLUMINANT_TYPE_A 0x00000061033#define cmsILLUMINANT_TYPE_E 0x00000071034#define cmsILLUMINANT_TYPE_F8 0x000000810351036typedef struct {1037cmsUInt32Number Observer; // 0 = unknown, 1=CIE 1931, 2=CIE 19641038cmsCIEXYZ Backing; // Value of backing1039cmsUInt32Number Geometry; // 0=unknown, 1=45/0, 0/45 2=0d, d/01040cmsFloat64Number Flare; // 0..1.01041cmsUInt32Number IlluminantType;10421043} cmsICCMeasurementConditions;10441045typedef struct {1046cmsCIEXYZ IlluminantXYZ; // Not the same struct as CAM02,1047cmsCIEXYZ SurroundXYZ; // This is for storing the tag1048cmsUInt32Number IlluminantType; // viewing condition10491050} cmsICCViewingConditions;10511052// Get LittleCMS version (for shared objects) -----------------------------------------------------------------------------10531054CMSAPI int CMSEXPORT cmsGetEncodedCMMversion(void);10551056// Support of non-standard functions --------------------------------------------------------------------------------------10571058CMSAPI int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2);1059CMSAPI long int CMSEXPORT cmsfilelength(FILE* f);106010611062// Context handling --------------------------------------------------------------------------------------------------------10631064// Each context holds its owns globals and its own plug-ins. There is a global context with the id = 0 for lecacy compatibility1065// though using the global context is not recommended. Proper context handling makes lcms more thread-safe.10661067typedef struct _cmsContext_struct* cmsContext;10681069CMSAPI cmsContext CMSEXPORT cmsCreateContext(void* Plugin, void* UserData);1070CMSAPI void CMSEXPORT cmsDeleteContext(cmsContext ContextID);1071CMSAPI cmsContext CMSEXPORT cmsDupContext(cmsContext ContextID, void* NewUserData);1072CMSAPI void* CMSEXPORT cmsGetContextUserData(cmsContext ContextID);10731074// Plug-In registering --------------------------------------------------------------------------------------------------10751076CMSAPI cmsBool CMSEXPORT cmsPlugin(void* Plugin);1077CMSAPI cmsBool CMSEXPORT cmsPluginTHR(cmsContext ContextID, void* Plugin);1078CMSAPI void CMSEXPORT cmsUnregisterPlugins(void);1079CMSAPI void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID);10801081// Error logging ----------------------------------------------------------------------------------------------------------10821083// There is no error handling at all. When a function fails, it returns proper value.1084// For example, all create functions does return NULL on failure. Other may return FALSE.1085// It may be interesting, for the developer, to know why the function is failing.1086// for that reason, lcms2 does offer a logging function. This function will get1087// an ENGLISH string with some clues on what is going wrong. You can show this1088// info to the end user if you wish, or just create some sort of log on disk.1089// The logging function should NOT terminate the program, as this obviously can leave1090// unfreed resources. It is the programmer's responsibility to check each function1091// return code to make sure it didn't fail.10921093#define cmsERROR_UNDEFINED 01094#define cmsERROR_FILE 11095#define cmsERROR_RANGE 21096#define cmsERROR_INTERNAL 31097#define cmsERROR_NULL 41098#define cmsERROR_READ 51099#define cmsERROR_SEEK 61100#define cmsERROR_WRITE 71101#define cmsERROR_UNKNOWN_EXTENSION 81102#define cmsERROR_COLORSPACE_CHECK 91103#define cmsERROR_ALREADY_DEFINED 101104#define cmsERROR_BAD_SIGNATURE 111105#define cmsERROR_CORRUPTION_DETECTED 121106#define cmsERROR_NOT_SUITABLE 1311071108// Error logger is called with the ContextID when a message is raised. This gives the1109// chance to know which thread is responsible of the warning and any environment associated1110// with it. Non-multithreading applications may safely ignore this parameter.1111// Note that under certain special circumstances, ContextID may be NULL.1112typedef void (* cmsLogErrorHandlerFunction)(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text);11131114// Allows user to set any specific logger1115CMSAPI void CMSEXPORT cmsSetLogErrorHandler(cmsLogErrorHandlerFunction Fn);1116CMSAPI void CMSEXPORT cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandlerFunction Fn);11171118// Conversions --------------------------------------------------------------------------------------------------------------11191120// Returns pointers to constant structs1121CMSAPI const cmsCIEXYZ* CMSEXPORT cmsD50_XYZ(void);1122CMSAPI const cmsCIExyY* CMSEXPORT cmsD50_xyY(void);11231124// Colorimetric space conversions1125CMSAPI void CMSEXPORT cmsXYZ2xyY(cmsCIExyY* Dest, const cmsCIEXYZ* Source);1126CMSAPI void CMSEXPORT cmsxyY2XYZ(cmsCIEXYZ* Dest, const cmsCIExyY* Source);1127CMSAPI void CMSEXPORT cmsXYZ2Lab(const cmsCIEXYZ* WhitePoint, cmsCIELab* Lab, const cmsCIEXYZ* xyz);1128CMSAPI void CMSEXPORT cmsLab2XYZ(const cmsCIEXYZ* WhitePoint, cmsCIEXYZ* xyz, const cmsCIELab* Lab);1129CMSAPI void CMSEXPORT cmsLab2LCh(cmsCIELCh*LCh, const cmsCIELab* Lab);1130CMSAPI void CMSEXPORT cmsLCh2Lab(cmsCIELab* Lab, const cmsCIELCh* LCh);11311132// Encoding /Decoding on PCS1133CMSAPI void CMSEXPORT cmsLabEncoded2Float(cmsCIELab* Lab, const cmsUInt16Number wLab[3]);1134CMSAPI void CMSEXPORT cmsLabEncoded2FloatV2(cmsCIELab* Lab, const cmsUInt16Number wLab[3]);1135CMSAPI void CMSEXPORT cmsFloat2LabEncoded(cmsUInt16Number wLab[3], const cmsCIELab* Lab);1136CMSAPI void CMSEXPORT cmsFloat2LabEncodedV2(cmsUInt16Number wLab[3], const cmsCIELab* Lab);1137CMSAPI void CMSEXPORT cmsXYZEncoded2Float(cmsCIEXYZ* fxyz, const cmsUInt16Number XYZ[3]);1138CMSAPI void CMSEXPORT cmsFloat2XYZEncoded(cmsUInt16Number XYZ[3], const cmsCIEXYZ* fXYZ);11391140// DeltaE metrics1141CMSAPI cmsFloat64Number CMSEXPORT cmsDeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);1142CMSAPI cmsFloat64Number CMSEXPORT cmsCIE94DeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);1143CMSAPI cmsFloat64Number CMSEXPORT cmsBFDdeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2);1144CMSAPI cmsFloat64Number CMSEXPORT cmsCMCdeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2, cmsFloat64Number l, cmsFloat64Number c);1145CMSAPI cmsFloat64Number CMSEXPORT cmsCIE2000DeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2, cmsFloat64Number Kl, cmsFloat64Number Kc, cmsFloat64Number Kh);11461147// Temperature <-> Chromaticity (Black body)1148CMSAPI cmsBool CMSEXPORT cmsWhitePointFromTemp(cmsCIExyY* WhitePoint, cmsFloat64Number TempK);1149CMSAPI cmsBool CMSEXPORT cmsTempFromWhitePoint(cmsFloat64Number* TempK, const cmsCIExyY* WhitePoint);11501151// Chromatic adaptation1152CMSAPI cmsBool CMSEXPORT cmsAdaptToIlluminant(cmsCIEXYZ* Result, const cmsCIEXYZ* SourceWhitePt,1153const cmsCIEXYZ* Illuminant,1154const cmsCIEXYZ* Value);11551156// CIECAM02 ---------------------------------------------------------------------------------------------------11571158// Viewing conditions. Please note those are CAM model viewing conditions, and not the ICC tag viewing1159// conditions, which I'm naming cmsICCViewingConditions to make differences evident. Unfortunately, the tag1160// cannot deal with surround La, Yb and D value so is basically useless to store CAM02 viewing conditions.116111621163#define AVG_SURROUND 11164#define DIM_SURROUND 21165#define DARK_SURROUND 31166#define CUTSHEET_SURROUND 411671168#define D_CALCULATE (-1)11691170typedef struct {1171cmsCIEXYZ whitePoint;1172cmsFloat64Number Yb;1173cmsFloat64Number La;1174cmsUInt32Number surround;1175cmsFloat64Number D_value;11761177} cmsViewingConditions;11781179CMSAPI cmsHANDLE CMSEXPORT cmsCIECAM02Init(cmsContext ContextID, const cmsViewingConditions* pVC);1180CMSAPI void CMSEXPORT cmsCIECAM02Done(cmsHANDLE hModel);1181CMSAPI void CMSEXPORT cmsCIECAM02Forward(cmsHANDLE hModel, const cmsCIEXYZ* pIn, cmsJCh* pOut);1182CMSAPI void CMSEXPORT cmsCIECAM02Reverse(cmsHANDLE hModel, const cmsJCh* pIn, cmsCIEXYZ* pOut);118311841185// Tone curves -----------------------------------------------------------------------------------------11861187// This describes a curve segment. For a table of supported types, see the manual. User can increase the number of1188// available types by using a proper plug-in. Parametric segments allow 10 parameters at most11891190typedef struct {1191cmsFloat32Number x0, x1; // Domain; for x0 < x <= x11192cmsInt32Number Type; // Parametric type, Type == 0 means sampled segment. Negative values are reserved1193cmsFloat64Number Params[10]; // Parameters if Type != 01194cmsUInt32Number nGridPoints; // Number of grid points if Type == 01195cmsFloat32Number* SampledPoints; // Points to an array of floats if Type == 011961197} cmsCurveSegment;11981199// The internal representation is none of your business.1200typedef struct _cms_curve_struct cmsToneCurve;12011202CMSAPI cmsToneCurve* CMSEXPORT cmsBuildSegmentedToneCurve(cmsContext ContextID, cmsUInt32Number nSegments, const cmsCurveSegment Segments[]);1203CMSAPI cmsToneCurve* CMSEXPORT cmsBuildParametricToneCurve(cmsContext ContextID, cmsInt32Number Type, const cmsFloat64Number Params[]);1204CMSAPI cmsToneCurve* CMSEXPORT cmsBuildGamma(cmsContext ContextID, cmsFloat64Number Gamma);1205CMSAPI cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurve16(cmsContext ContextID, cmsUInt32Number nEntries, const cmsUInt16Number values[]);1206CMSAPI cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cmsUInt32Number nEntries, const cmsFloat32Number values[]);1207CMSAPI void CMSEXPORT cmsFreeToneCurve(cmsToneCurve* Curve);1208CMSAPI void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3]);1209CMSAPI cmsToneCurve* CMSEXPORT cmsDupToneCurve(const cmsToneCurve* Src);1210CMSAPI cmsToneCurve* CMSEXPORT cmsReverseToneCurve(const cmsToneCurve* InGamma);1211CMSAPI cmsToneCurve* CMSEXPORT cmsReverseToneCurveEx(cmsUInt32Number nResultSamples, const cmsToneCurve* InGamma);1212CMSAPI cmsToneCurve* CMSEXPORT cmsJoinToneCurve(cmsContext ContextID, const cmsToneCurve* X, const cmsToneCurve* Y, cmsUInt32Number nPoints);1213CMSAPI cmsBool CMSEXPORT cmsSmoothToneCurve(cmsToneCurve* Tab, cmsFloat64Number lambda);1214CMSAPI cmsFloat32Number CMSEXPORT cmsEvalToneCurveFloat(const cmsToneCurve* Curve, cmsFloat32Number v);1215CMSAPI cmsUInt16Number CMSEXPORT cmsEvalToneCurve16(const cmsToneCurve* Curve, cmsUInt16Number v);1216CMSAPI cmsBool CMSEXPORT cmsIsToneCurveMultisegment(const cmsToneCurve* InGamma);1217CMSAPI cmsBool CMSEXPORT cmsIsToneCurveLinear(const cmsToneCurve* Curve);1218CMSAPI cmsBool CMSEXPORT cmsIsToneCurveMonotonic(const cmsToneCurve* t);1219CMSAPI cmsBool CMSEXPORT cmsIsToneCurveDescending(const cmsToneCurve* t);1220CMSAPI cmsInt32Number CMSEXPORT cmsGetToneCurveParametricType(const cmsToneCurve* t);1221CMSAPI cmsFloat64Number CMSEXPORT cmsEstimateGamma(const cmsToneCurve* t, cmsFloat64Number Precision);1222CMSAPI cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(const cmsToneCurve* t);12231224// Tone curve tabular estimation1225CMSAPI cmsUInt32Number CMSEXPORT cmsGetToneCurveEstimatedTableEntries(const cmsToneCurve* t);1226CMSAPI const cmsUInt16Number* CMSEXPORT cmsGetToneCurveEstimatedTable(const cmsToneCurve* t);122712281229// Implements pipelines of multi-processing elements -------------------------------------------------------------12301231// Nothing to see here, move along1232typedef struct _cmsPipeline_struct cmsPipeline;1233typedef struct _cmsStage_struct cmsStage;12341235// Those are hi-level pipelines1236CMSAPI cmsPipeline* CMSEXPORT cmsPipelineAlloc(cmsContext ContextID, cmsUInt32Number InputChannels, cmsUInt32Number OutputChannels);1237CMSAPI void CMSEXPORT cmsPipelineFree(cmsPipeline* lut);1238CMSAPI cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* Orig);12391240CMSAPI cmsContext CMSEXPORT cmsGetPipelineContextID(const cmsPipeline* lut);1241CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineInputChannels(const cmsPipeline* lut);1242CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineOutputChannels(const cmsPipeline* lut);12431244CMSAPI cmsUInt32Number CMSEXPORT cmsPipelineStageCount(const cmsPipeline* lut);1245CMSAPI cmsStage* CMSEXPORT cmsPipelineGetPtrToFirstStage(const cmsPipeline* lut);1246CMSAPI cmsStage* CMSEXPORT cmsPipelineGetPtrToLastStage(const cmsPipeline* lut);12471248CMSAPI void CMSEXPORT cmsPipelineEval16(const cmsUInt16Number In[], cmsUInt16Number Out[], const cmsPipeline* lut);1249CMSAPI void CMSEXPORT cmsPipelineEvalFloat(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsPipeline* lut);1250CMSAPI cmsBool CMSEXPORT cmsPipelineEvalReverseFloat(cmsFloat32Number Target[], cmsFloat32Number Result[], cmsFloat32Number Hint[], const cmsPipeline* lut);1251CMSAPI cmsBool CMSEXPORT cmsPipelineCat(cmsPipeline* l1, const cmsPipeline* l2);1252CMSAPI cmsBool CMSEXPORT cmsPipelineSetSaveAs8bitsFlag(cmsPipeline* lut, cmsBool On);12531254// Where to place/locate the stages in the pipeline chain1255typedef enum { cmsAT_BEGIN, cmsAT_END } cmsStageLoc;12561257CMSAPI cmsBool CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe);1258CMSAPI void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage** mpe);12591260// This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements1261// that conform the Pipeline. It should be called with the Pipeline, the number of expected elements and1262// then a list of expected types followed with a list of double pointers to Stage elements. If1263// the function founds a match with current pipeline, it fills the pointers and returns TRUE1264// if not, returns FALSE without touching anything.1265CMSAPI cmsBool CMSEXPORT cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, cmsUInt32Number n, ...);12661267// Matrix has double precision and CLUT has only float precision. That is because an ICC profile can encode1268// matrices with far more precision that CLUTS1269CMSAPI cmsStage* CMSEXPORT cmsStageAllocIdentity(cmsContext ContextID, cmsUInt32Number nChannels);1270CMSAPI cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Number nChannels, cmsToneCurve* const Curves[]);1271CMSAPI cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number Rows, cmsUInt32Number Cols, const cmsFloat64Number* Matrix, const cmsFloat64Number* Offset);12721273CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLut16bit(cmsContext ContextID, cmsUInt32Number nGridPoints, cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsUInt16Number* Table);1274CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLutFloat(cmsContext ContextID, cmsUInt32Number nGridPoints, cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsFloat32Number* Table);12751276CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID, const cmsUInt32Number clutPoints[], cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsUInt16Number* Table);1277CMSAPI cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const cmsUInt32Number clutPoints[], cmsUInt32Number inputChan, cmsUInt32Number outputChan, const cmsFloat32Number* Table);12781279CMSAPI cmsStage* CMSEXPORT cmsStageDup(cmsStage* mpe);1280CMSAPI void CMSEXPORT cmsStageFree(cmsStage* mpe);1281CMSAPI cmsStage* CMSEXPORT cmsStageNext(const cmsStage* mpe);12821283CMSAPI cmsUInt32Number CMSEXPORT cmsStageInputChannels(const cmsStage* mpe);1284CMSAPI cmsUInt32Number CMSEXPORT cmsStageOutputChannels(const cmsStage* mpe);1285CMSAPI cmsStageSignature CMSEXPORT cmsStageType(const cmsStage* mpe);1286CMSAPI void* CMSEXPORT cmsStageData(const cmsStage* mpe);12871288// Sampling1289typedef cmsInt32Number (* cmsSAMPLER16) (CMSREGISTER const cmsUInt16Number In[],1290CMSREGISTER cmsUInt16Number Out[],1291CMSREGISTER void * Cargo);12921293typedef cmsInt32Number (* cmsSAMPLERFLOAT)(CMSREGISTER const cmsFloat32Number In[],1294CMSREGISTER cmsFloat32Number Out[],1295CMSREGISTER void * Cargo);12961297// Use this flag to prevent changes being written to destination1298#define SAMPLER_INSPECT 0x0100000012991300// For CLUT only1301CMSAPI cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, void* Cargo, cmsUInt32Number dwFlags);1302CMSAPI cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler, void* Cargo, cmsUInt32Number dwFlags);13031304// Slicers1305CMSAPI cmsBool CMSEXPORT cmsSliceSpace16(cmsUInt32Number nInputs, const cmsUInt32Number clutPoints[],1306cmsSAMPLER16 Sampler, void * Cargo);13071308CMSAPI cmsBool CMSEXPORT cmsSliceSpaceFloat(cmsUInt32Number nInputs, const cmsUInt32Number clutPoints[],1309cmsSAMPLERFLOAT Sampler, void * Cargo);13101311// Multilocalized Unicode management ---------------------------------------------------------------------------------------13121313typedef struct _cms_MLU_struct cmsMLU;13141315#define cmsNoLanguage "\0\0"1316#define cmsNoCountry "\0\0"13171318CMSAPI cmsMLU* CMSEXPORT cmsMLUalloc(cmsContext ContextID, cmsUInt32Number nItems);1319CMSAPI void CMSEXPORT cmsMLUfree(cmsMLU* mlu);1320CMSAPI cmsMLU* CMSEXPORT cmsMLUdup(const cmsMLU* mlu);13211322CMSAPI cmsBool CMSEXPORT cmsMLUsetASCII(cmsMLU* mlu,1323const char LanguageCode[3], const char CountryCode[3],1324const char* ASCIIString);1325CMSAPI cmsBool CMSEXPORT cmsMLUsetWide(cmsMLU* mlu,1326const char LanguageCode[3], const char CountryCode[3],1327const wchar_t* WideString);13281329CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetASCII(const cmsMLU* mlu,1330const char LanguageCode[3], const char CountryCode[3],1331char* Buffer, cmsUInt32Number BufferSize);13321333CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetWide(const cmsMLU* mlu,1334const char LanguageCode[3], const char CountryCode[3],1335wchar_t* Buffer, cmsUInt32Number BufferSize);13361337CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(const cmsMLU* mlu,1338const char LanguageCode[3], const char CountryCode[3],1339char ObtainedLanguage[3], char ObtainedCountry[3]);13401341CMSAPI cmsUInt32Number CMSEXPORT cmsMLUtranslationsCount(const cmsMLU* mlu);13421343CMSAPI cmsBool CMSEXPORT cmsMLUtranslationsCodes(const cmsMLU* mlu,1344cmsUInt32Number idx,1345char LanguageCode[3],1346char CountryCode[3]);13471348// Undercolorremoval & black generation -------------------------------------------------------------------------------------13491350typedef struct {1351cmsToneCurve* Ucr;1352cmsToneCurve* Bg;1353cmsMLU* Desc;13541355} cmsUcrBg;13561357// Screening ----------------------------------------------------------------------------------------------------------------13581359#define cmsPRINTER_DEFAULT_SCREENS 0x00011360#define cmsFREQUENCE_UNITS_LINES_CM 0x00001361#define cmsFREQUENCE_UNITS_LINES_INCH 0x000213621363#define cmsSPOT_UNKNOWN 01364#define cmsSPOT_PRINTER_DEFAULT 11365#define cmsSPOT_ROUND 21366#define cmsSPOT_DIAMOND 31367#define cmsSPOT_ELLIPSE 41368#define cmsSPOT_LINE 51369#define cmsSPOT_SQUARE 61370#define cmsSPOT_CROSS 713711372typedef struct {1373cmsFloat64Number Frequency;1374cmsFloat64Number ScreenAngle;1375cmsUInt32Number SpotShape;13761377} cmsScreeningChannel;13781379typedef struct {1380cmsUInt32Number Flag;1381cmsUInt32Number nChannels;1382cmsScreeningChannel Channels[cmsMAXCHANNELS];13831384} cmsScreening;138513861387// Named color -----------------------------------------------------------------------------------------------------------------13881389typedef struct _cms_NAMEDCOLORLIST_struct cmsNAMEDCOLORLIST;13901391CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID,1392cmsUInt32Number n,1393cmsUInt32Number ColorantCount,1394const char* Prefix, const char* Suffix);13951396CMSAPI void CMSEXPORT cmsFreeNamedColorList(cmsNAMEDCOLORLIST* v);1397CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsDupNamedColorList(const cmsNAMEDCOLORLIST* v);1398CMSAPI cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* v, const char* Name,1399cmsUInt16Number PCS[3],1400cmsUInt16Number Colorant[cmsMAXCHANNELS]);14011402CMSAPI cmsUInt32Number CMSEXPORT cmsNamedColorCount(const cmsNAMEDCOLORLIST* v);1403CMSAPI cmsInt32Number CMSEXPORT cmsNamedColorIndex(const cmsNAMEDCOLORLIST* v, const char* Name);14041405CMSAPI cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cmsUInt32Number nColor,1406char* Name,1407char* Prefix,1408char* Suffix,1409cmsUInt16Number* PCS,1410cmsUInt16Number* Colorant);14111412// Retrieve named color list from transform1413CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsGetNamedColorList(cmsHTRANSFORM xform);14141415// Profile sequence -----------------------------------------------------------------------------------------------------14161417// Profile sequence descriptor. Some fields come from profile sequence descriptor tag, others1418// come from Profile Sequence Identifier Tag1419typedef struct {14201421cmsSignature deviceMfg;1422cmsSignature deviceModel;1423cmsUInt64Number attributes;1424cmsTechnologySignature technology;1425cmsProfileID ProfileID;1426cmsMLU* Manufacturer;1427cmsMLU* Model;1428cmsMLU* Description;14291430} cmsPSEQDESC;14311432typedef struct {14331434cmsUInt32Number n;1435cmsContext ContextID;1436cmsPSEQDESC* seq;14371438} cmsSEQ;14391440CMSAPI cmsSEQ* CMSEXPORT cmsAllocProfileSequenceDescription(cmsContext ContextID, cmsUInt32Number n);1441CMSAPI cmsSEQ* CMSEXPORT cmsDupProfileSequenceDescription(const cmsSEQ* pseq);1442CMSAPI void CMSEXPORT cmsFreeProfileSequenceDescription(cmsSEQ* pseq);14431444// Dictionaries --------------------------------------------------------------------------------------------------------14451446typedef struct _cmsDICTentry_struct {14471448struct _cmsDICTentry_struct* Next;14491450cmsMLU *DisplayName;1451cmsMLU *DisplayValue;1452wchar_t* Name;1453wchar_t* Value;14541455} cmsDICTentry;14561457CMSAPI cmsHANDLE CMSEXPORT cmsDictAlloc(cmsContext ContextID);1458CMSAPI void CMSEXPORT cmsDictFree(cmsHANDLE hDict);1459CMSAPI cmsHANDLE CMSEXPORT cmsDictDup(cmsHANDLE hDict);14601461CMSAPI cmsBool CMSEXPORT cmsDictAddEntry(cmsHANDLE hDict, const wchar_t* Name, const wchar_t* Value, const cmsMLU *DisplayName, const cmsMLU *DisplayValue);1462CMSAPI const cmsDICTentry* CMSEXPORT cmsDictGetEntryList(cmsHANDLE hDict);1463CMSAPI const cmsDICTentry* CMSEXPORT cmsDictNextEntry(const cmsDICTentry* e);14641465// Access to Profile data ----------------------------------------------------------------------------------------------1466CMSAPI cmsHPROFILE CMSEXPORT cmsCreateProfilePlaceholder(cmsContext ContextID);14671468CMSAPI cmsContext CMSEXPORT cmsGetProfileContextID(cmsHPROFILE hProfile);1469CMSAPI cmsInt32Number CMSEXPORT cmsGetTagCount(cmsHPROFILE hProfile);1470CMSAPI cmsTagSignature CMSEXPORT cmsGetTagSignature(cmsHPROFILE hProfile, cmsUInt32Number n);1471CMSAPI cmsBool CMSEXPORT cmsIsTag(cmsHPROFILE hProfile, cmsTagSignature sig);14721473// Read and write pre-formatted data1474CMSAPI void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig);1475CMSAPI cmsBool CMSEXPORT cmsWriteTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data);1476CMSAPI cmsBool CMSEXPORT cmsLinkTag(cmsHPROFILE hProfile, cmsTagSignature sig, cmsTagSignature dest);1477CMSAPI cmsTagSignature CMSEXPORT cmsTagLinkedTo(cmsHPROFILE hProfile, cmsTagSignature sig);14781479// Read and write raw data1480CMSAPI cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, void* Buffer, cmsUInt32Number BufferSize);1481CMSAPI cmsBool CMSEXPORT cmsWriteRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data, cmsUInt32Number Size);14821483// Access header data1484#define cmsEmbeddedProfileFalse 0x000000001485#define cmsEmbeddedProfileTrue 0x000000011486#define cmsUseAnywhere 0x000000001487#define cmsUseWithEmbeddedDataOnly 0x0000000214881489CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderFlags(cmsHPROFILE hProfile);1490CMSAPI void CMSEXPORT cmsGetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number* Flags);1491CMSAPI void CMSEXPORT cmsGetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID);1492CMSAPI cmsBool CMSEXPORT cmsGetHeaderCreationDateTime(cmsHPROFILE hProfile, struct tm *Dest);1493CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderRenderingIntent(cmsHPROFILE hProfile);14941495CMSAPI void CMSEXPORT cmsSetHeaderFlags(cmsHPROFILE hProfile, cmsUInt32Number Flags);1496CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderManufacturer(cmsHPROFILE hProfile);1497CMSAPI void CMSEXPORT cmsSetHeaderManufacturer(cmsHPROFILE hProfile, cmsUInt32Number manufacturer);1498CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderCreator(cmsHPROFILE hProfile);1499CMSAPI cmsUInt32Number CMSEXPORT cmsGetHeaderModel(cmsHPROFILE hProfile);1500CMSAPI void CMSEXPORT cmsSetHeaderModel(cmsHPROFILE hProfile, cmsUInt32Number model);1501CMSAPI void CMSEXPORT cmsSetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number Flags);1502CMSAPI void CMSEXPORT cmsSetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID);1503CMSAPI void CMSEXPORT cmsSetHeaderRenderingIntent(cmsHPROFILE hProfile, cmsUInt32Number RenderingIntent);15041505CMSAPI cmsColorSpaceSignature1506CMSEXPORT cmsGetPCS(cmsHPROFILE hProfile);1507CMSAPI void CMSEXPORT cmsSetPCS(cmsHPROFILE hProfile, cmsColorSpaceSignature pcs);1508CMSAPI cmsColorSpaceSignature1509CMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile);1510CMSAPI void CMSEXPORT cmsSetColorSpace(cmsHPROFILE hProfile, cmsColorSpaceSignature sig);1511CMSAPI cmsProfileClassSignature1512CMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile);1513CMSAPI void CMSEXPORT cmsSetDeviceClass(cmsHPROFILE hProfile, cmsProfileClassSignature sig);1514CMSAPI void CMSEXPORT cmsSetProfileVersion(cmsHPROFILE hProfile, cmsFloat64Number Version);1515CMSAPI cmsFloat64Number CMSEXPORT cmsGetProfileVersion(cmsHPROFILE hProfile);15161517CMSAPI cmsUInt32Number CMSEXPORT cmsGetEncodedICCversion(cmsHPROFILE hProfile);1518CMSAPI void CMSEXPORT cmsSetEncodedICCversion(cmsHPROFILE hProfile, cmsUInt32Number Version);15191520// How profiles may be used1521#define LCMS_USED_AS_INPUT 01522#define LCMS_USED_AS_OUTPUT 11523#define LCMS_USED_AS_PROOF 215241525CMSAPI cmsBool CMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number UsedDirection);1526CMSAPI cmsBool CMSEXPORT cmsIsMatrixShaper(cmsHPROFILE hProfile);1527CMSAPI cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number UsedDirection);15281529// Translate form/to our notation to ICC1530CMSAPI cmsColorSpaceSignature CMSEXPORT _cmsICCcolorSpace(int OurNotation);1531CMSAPI int CMSEXPORT _cmsLCMScolorSpace(cmsColorSpaceSignature ProfileSpace);15321533CMSAPI cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace);15341535// Build a suitable formatter for the colorspace of this profile. nBytes=1 means 8 bits, nBytes=2 means 16 bits.1536CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);1537CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);153815391540// Localized info1541typedef enum {1542cmsInfoDescription = 0,1543cmsInfoManufacturer = 1,1544cmsInfoModel = 2,1545cmsInfoCopyright = 31546} cmsInfoType;15471548CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info,1549const char LanguageCode[3], const char CountryCode[3],1550wchar_t* Buffer, cmsUInt32Number BufferSize);15511552CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info,1553const char LanguageCode[3], const char CountryCode[3],1554char* Buffer, cmsUInt32Number BufferSize);15551556// IO handlers ----------------------------------------------------------------------------------------------------------15571558typedef struct _cms_io_handler cmsIOHANDLER;15591560CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromFile(cmsContext ContextID, const char* FileName, const char* AccessMode);1561CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream);1562CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode);1563CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromNULL(cmsContext ContextID);1564CMSAPI cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile);1565CMSAPI cmsBool CMSEXPORT cmsCloseIOhandler(cmsIOHANDLER* io);15661567// MD5 message digest --------------------------------------------------------------------------------------------------15681569CMSAPI cmsBool CMSEXPORT cmsMD5computeID(cmsHPROFILE hProfile);15701571// Profile high level functions ------------------------------------------------------------------------------------------15721573CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess);1574CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFileTHR(cmsContext ContextID, const char *ICCProfile, const char *sAccess);1575CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char* sAccess);1576CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStreamTHR(cmsContext ContextID, FILE* ICCProfile, const char* sAccess);1577CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(const void * MemPtr, cmsUInt32Number dwSize);1578CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void * MemPtr, cmsUInt32Number dwSize);1579CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandlerTHR(cmsContext ContextID, cmsIOHANDLER* io);1580CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2THR(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write);1581CMSAPI cmsBool CMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);15821583CMSAPI cmsBool CMSEXPORT cmsSaveProfileToFile(cmsHPROFILE hProfile, const char* FileName);1584CMSAPI cmsBool CMSEXPORT cmsSaveProfileToStream(cmsHPROFILE hProfile, FILE* Stream);1585CMSAPI cmsBool CMSEXPORT cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr, cmsUInt32Number* BytesNeeded);1586CMSAPI cmsUInt32Number CMSEXPORT cmsSaveProfileToIOhandler(cmsHPROFILE hProfile, cmsIOHANDLER* io);15871588// Predefined virtual profiles ------------------------------------------------------------------------------------------15891590CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfileTHR(cmsContext ContextID,1591const cmsCIExyY* WhitePoint,1592const cmsCIExyYTRIPLE* Primaries,1593cmsToneCurve* const TransferFunction[3]);15941595CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(const cmsCIExyY* WhitePoint,1596const cmsCIExyYTRIPLE* Primaries,1597cmsToneCurve* const TransferFunction[3]);15981599CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfileTHR(cmsContext ContextID,1600const cmsCIExyY* WhitePoint,1601const cmsToneCurve* TransferFunction);16021603CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(const cmsCIExyY* WhitePoint,1604const cmsToneCurve* TransferFunction);16051606CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID,1607cmsColorSpaceSignature ColorSpace,1608cmsToneCurve* const TransferFunctions[]);16091610CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsColorSpaceSignature ColorSpace,1611cmsToneCurve* const TransferFunctions[]);16121613CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID,1614cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit);16151616CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit);161716181619CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint);1620CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(const cmsCIExyY* WhitePoint);1621CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint);1622CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(const cmsCIExyY* WhitePoint);16231624CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfileTHR(cmsContext ContextID);1625CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void);16261627CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID);1628CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void);16291630CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID,1631cmsUInt32Number nLUTPoints,1632cmsFloat64Number Bright,1633cmsFloat64Number Contrast,1634cmsFloat64Number Hue,1635cmsFloat64Number Saturation,1636cmsUInt32Number TempSrc,1637cmsUInt32Number TempDest);16381639CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(cmsUInt32Number nLUTPoints,1640cmsFloat64Number Bright,1641cmsFloat64Number Contrast,1642cmsFloat64Number Hue,1643cmsFloat64Number Saturation,1644cmsUInt32Number TempSrc,1645cmsUInt32Number TempDest);16461647CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID);1648CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(void);16491650// Converts a transform to a devicelink profile1651CMSAPI cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat64Number Version, cmsUInt32Number dwFlags);16521653// Intents ----------------------------------------------------------------------------------------------16541655// ICC Intents1656#define INTENT_PERCEPTUAL 01657#define INTENT_RELATIVE_COLORIMETRIC 11658#define INTENT_SATURATION 21659#define INTENT_ABSOLUTE_COLORIMETRIC 316601661// Non-ICC intents1662#define INTENT_PRESERVE_K_ONLY_PERCEPTUAL 101663#define INTENT_PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC 111664#define INTENT_PRESERVE_K_ONLY_SATURATION 121665#define INTENT_PRESERVE_K_PLANE_PERCEPTUAL 131666#define INTENT_PRESERVE_K_PLANE_RELATIVE_COLORIMETRIC 141667#define INTENT_PRESERVE_K_PLANE_SATURATION 1516681669// Call with NULL as parameters to get the intent count1670CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions);1671CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID, cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions);16721673// Flags16741675#define cmsFLAGS_NOCACHE 0x0040 // Inhibit 1-pixel cache1676#define cmsFLAGS_NOOPTIMIZE 0x0100 // Inhibit optimizations1677#define cmsFLAGS_NULLTRANSFORM 0x0200 // Don't transform anyway16781679// Proofing flags1680#define cmsFLAGS_GAMUTCHECK 0x1000 // Out of Gamut alarm1681#define cmsFLAGS_SOFTPROOFING 0x4000 // Do softproofing16821683// Misc1684#define cmsFLAGS_BLACKPOINTCOMPENSATION 0x20001685#define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot1686#define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accuracy1687#define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resources16881689// For devicelink creation1690#define cmsFLAGS_8BITS_DEVICELINK 0x0008 // Create 8 bits devicelinks1691#define cmsFLAGS_GUESSDEVICECLASS 0x0020 // Guess device class (for transform2devicelink)1692#define cmsFLAGS_KEEP_SEQUENCE 0x0080 // Keep profile sequence for devicelink creation16931694// Specific to a particular optimizations1695#define cmsFLAGS_FORCE_CLUT 0x0002 // Force CLUT optimization1696#define cmsFLAGS_CLUT_POST_LINEARIZATION 0x0001 // create postlinearization tables if possible1697#define cmsFLAGS_CLUT_PRE_LINEARIZATION 0x0010 // create prelinearization tables if possible16981699// Specific to unbounded mode1700#define cmsFLAGS_NONEGATIVES 0x8000 // Prevent negative numbers in floating point transforms17011702// Copy alpha channels when transforming1703#define cmsFLAGS_COPY_ALPHA 0x04000000 // Alpha channels are copied on cmsDoTransform()17041705// Fine-tune control over number of gridpoints1706#define cmsFLAGS_GRIDPOINTS(n) (((n) & 0xFF) << 16)17071708// CRD special1709#define cmsFLAGS_NODEFAULTRESOURCEDEF 0x0100000017101711// Transforms ---------------------------------------------------------------------------------------------------17121713CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID,1714cmsHPROFILE Input,1715cmsUInt32Number InputFormat,1716cmsHPROFILE Output,1717cmsUInt32Number OutputFormat,1718cmsUInt32Number Intent,1719cmsUInt32Number dwFlags);17201721CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsHPROFILE Input,1722cmsUInt32Number InputFormat,1723cmsHPROFILE Output,1724cmsUInt32Number OutputFormat,1725cmsUInt32Number Intent,1726cmsUInt32Number dwFlags);17271728CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID,1729cmsHPROFILE Input,1730cmsUInt32Number InputFormat,1731cmsHPROFILE Output,1732cmsUInt32Number OutputFormat,1733cmsHPROFILE Proofing,1734cmsUInt32Number Intent,1735cmsUInt32Number ProofingIntent,1736cmsUInt32Number dwFlags);17371738CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsHPROFILE Input,1739cmsUInt32Number InputFormat,1740cmsHPROFILE Output,1741cmsUInt32Number OutputFormat,1742cmsHPROFILE Proofing,1743cmsUInt32Number Intent,1744cmsUInt32Number ProofingIntent,1745cmsUInt32Number dwFlags);17461747CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID,1748cmsHPROFILE hProfiles[],1749cmsUInt32Number nProfiles,1750cmsUInt32Number InputFormat,1751cmsUInt32Number OutputFormat,1752cmsUInt32Number Intent,1753cmsUInt32Number dwFlags);175417551756CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],1757cmsUInt32Number nProfiles,1758cmsUInt32Number InputFormat,1759cmsUInt32Number OutputFormat,1760cmsUInt32Number Intent,1761cmsUInt32Number dwFlags);176217631764CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID,1765cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[],1766cmsBool BPC[],1767cmsUInt32Number Intents[],1768cmsFloat64Number AdaptationStates[],1769cmsHPROFILE hGamutProfile,1770cmsUInt32Number nGamutPCSposition,1771cmsUInt32Number InputFormat,1772cmsUInt32Number OutputFormat,1773cmsUInt32Number dwFlags);17741775CMSAPI void CMSEXPORT cmsDeleteTransform(cmsHTRANSFORM hTransform);17761777CMSAPI void CMSEXPORT cmsDoTransform(cmsHTRANSFORM Transform,1778const void * InputBuffer,1779void * OutputBuffer,1780cmsUInt32Number Size);17811782CMSAPI void CMSEXPORT cmsDoTransformStride(cmsHTRANSFORM Transform, // Deprecated1783const void * InputBuffer,1784void * OutputBuffer,1785cmsUInt32Number Size,1786cmsUInt32Number Stride);17871788CMSAPI void CMSEXPORT cmsDoTransformLineStride(cmsHTRANSFORM Transform,1789const void* InputBuffer,1790void* OutputBuffer,1791cmsUInt32Number PixelsPerLine,1792cmsUInt32Number LineCount,1793cmsUInt32Number BytesPerLineIn,1794cmsUInt32Number BytesPerLineOut,1795cmsUInt32Number BytesPerPlaneIn,1796cmsUInt32Number BytesPerPlaneOut);179717981799CMSAPI void CMSEXPORT cmsSetAlarmCodes(const cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);1800CMSAPI void CMSEXPORT cmsGetAlarmCodes(cmsUInt16Number NewAlarm[cmsMAXCHANNELS]);180118021803CMSAPI void CMSEXPORT cmsSetAlarmCodesTHR(cmsContext ContextID,1804const cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]);1805CMSAPI void CMSEXPORT cmsGetAlarmCodesTHR(cmsContext ContextID,1806cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]);1807180818091810// Adaptation state for absolute colorimetric intent1811CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsFloat64Number d);1812CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationStateTHR(cmsContext ContextID, cmsFloat64Number d);1813181418151816// Grab the ContextID from an open transform. Returns NULL if a NULL transform is passed1817CMSAPI cmsContext CMSEXPORT cmsGetTransformContextID(cmsHTRANSFORM hTransform);18181819// Grab the input/output formats1820CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformInputFormat(cmsHTRANSFORM hTransform);1821CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformOutputFormat(cmsHTRANSFORM hTransform);18221823// For backwards compatibility1824CMSAPI cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform,1825cmsUInt32Number InputFormat,1826cmsUInt32Number OutputFormat);1827182818291830// PostScript ColorRenderingDictionary and ColorSpaceArray ----------------------------------------------------18311832typedef enum { cmsPS_RESOURCE_CSA, cmsPS_RESOURCE_CRD } cmsPSResourceType;18331834// lcms2 unified method to access postscript color resources1835CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptColorResource(cmsContext ContextID,1836cmsPSResourceType Type,1837cmsHPROFILE hProfile,1838cmsUInt32Number Intent,1839cmsUInt32Number dwFlags,1840cmsIOHANDLER* io);18411842CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCSA(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen);1843CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCRD(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen);184418451846// IT8.7 / CGATS.17-200x handling -----------------------------------------------------------------------------18471848CMSAPI cmsHANDLE CMSEXPORT cmsIT8Alloc(cmsContext ContextID);1849CMSAPI void CMSEXPORT cmsIT8Free(cmsHANDLE hIT8);18501851// Tables1852CMSAPI cmsUInt32Number CMSEXPORT cmsIT8TableCount(cmsHANDLE hIT8);1853CMSAPI cmsInt32Number CMSEXPORT cmsIT8SetTable(cmsHANDLE hIT8, cmsUInt32Number nTable);18541855// Persistence1856CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromFile(cmsContext ContextID, const char* cFileName);1857CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromMem(cmsContext ContextID, const void *Ptr, cmsUInt32Number len);1858// CMSAPI cmsHANDLE CMSEXPORT cmsIT8LoadFromIOhandler(cmsContext ContextID, cmsIOHANDLER* io);18591860CMSAPI cmsBool CMSEXPORT cmsIT8SaveToFile(cmsHANDLE hIT8, const char* cFileName);1861CMSAPI cmsBool CMSEXPORT cmsIT8SaveToMem(cmsHANDLE hIT8, void *MemPtr, cmsUInt32Number* BytesNeeded);18621863// Properties1864CMSAPI const char* CMSEXPORT cmsIT8GetSheetType(cmsHANDLE hIT8);1865CMSAPI cmsBool CMSEXPORT cmsIT8SetSheetType(cmsHANDLE hIT8, const char* Type);18661867CMSAPI cmsBool CMSEXPORT cmsIT8SetComment(cmsHANDLE hIT8, const char* cComment);18681869CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyStr(cmsHANDLE hIT8, const char* cProp, const char *Str);1870CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyDbl(cmsHANDLE hIT8, const char* cProp, cmsFloat64Number Val);1871CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyHex(cmsHANDLE hIT8, const char* cProp, cmsUInt32Number Val);1872CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char* SubKey, const char *Buffer);1873CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyUncooked(cmsHANDLE hIT8, const char* Key, const char* Buffer);187418751876CMSAPI const char* CMSEXPORT cmsIT8GetProperty(cmsHANDLE hIT8, const char* cProp);1877CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsHANDLE hIT8, const char* cProp);1878CMSAPI const char* CMSEXPORT cmsIT8GetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char *SubKey);1879CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumProperties(cmsHANDLE hIT8, char ***PropertyNames);1880CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumPropertyMulti(cmsHANDLE hIT8, const char* cProp, const char ***SubpropertyNames);18811882// Datasets1883CMSAPI const char* CMSEXPORT cmsIT8GetDataRowCol(cmsHANDLE hIT8, int row, int col);1884CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsHANDLE hIT8, int row, int col);18851886CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowCol(cmsHANDLE hIT8, int row, int col,1887const char* Val);18881889CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowColDbl(cmsHANDLE hIT8, int row, int col,1890cmsFloat64Number Val);18911892CMSAPI const char* CMSEXPORT cmsIT8GetData(cmsHANDLE hIT8, const char* cPatch, const char* cSample);189318941895CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataDbl(cmsHANDLE hIT8, const char* cPatch, const char* cSample);18961897CMSAPI cmsBool CMSEXPORT cmsIT8SetData(cmsHANDLE hIT8, const char* cPatch,1898const char* cSample,1899const char *Val);19001901CMSAPI cmsBool CMSEXPORT cmsIT8SetDataDbl(cmsHANDLE hIT8, const char* cPatch,1902const char* cSample,1903cmsFloat64Number Val);19041905CMSAPI int CMSEXPORT cmsIT8FindDataFormat(cmsHANDLE hIT8, const char* cSample);1906CMSAPI cmsBool CMSEXPORT cmsIT8SetDataFormat(cmsHANDLE hIT8, int n, const char *Sample);1907CMSAPI int CMSEXPORT cmsIT8EnumDataFormat(cmsHANDLE hIT8, char ***SampleNames);19081909CMSAPI const char* CMSEXPORT cmsIT8GetPatchName(cmsHANDLE hIT8, int nPatch, char* buffer);1910CMSAPI int CMSEXPORT cmsIT8GetPatchByName(cmsHANDLE hIT8, const char *cPatch);19111912// The LABEL extension1913CMSAPI int CMSEXPORT cmsIT8SetTableByLabel(cmsHANDLE hIT8, const char* cSet, const char* cField, const char* ExpectedType);19141915CMSAPI cmsBool CMSEXPORT cmsIT8SetIndexColumn(cmsHANDLE hIT8, const char* cSample);19161917// Formatter for double1918CMSAPI void CMSEXPORT cmsIT8DefineDblFormat(cmsHANDLE hIT8, const char* Formatter);19191920// Gamut boundary description routines ------------------------------------------------------------------------------19211922CMSAPI cmsHANDLE CMSEXPORT cmsGBDAlloc(cmsContext ContextID);1923CMSAPI void CMSEXPORT cmsGBDFree(cmsHANDLE hGBD);1924CMSAPI cmsBool CMSEXPORT cmsGDBAddPoint(cmsHANDLE hGBD, const cmsCIELab* Lab);1925CMSAPI cmsBool CMSEXPORT cmsGDBCompute(cmsHANDLE hGDB, cmsUInt32Number dwFlags);1926CMSAPI cmsBool CMSEXPORT cmsGDBCheckPoint(cmsHANDLE hGBD, const cmsCIELab* Lab);19271928// Feature detection ----------------------------------------------------------------------------------------------19291930// Estimate the black point1931CMSAPI cmsBool CMSEXPORT cmsDetectBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags);1932CMSAPI cmsBool CMSEXPORT cmsDetectDestinationBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags);19331934// Estimate total area coverage1935CMSAPI cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile);193619371938// Poor man's gamut mapping1939CMSAPI cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab,1940double amax, double amin,1941double bmax, double bmin);19421943#ifndef CMS_USE_CPP_API1944# ifdef __cplusplus1945}1946# endif1947#endif19481949#define _lcms2_H1950#endif195119521953