diff options
author | Marti Maria <info@littlecms.com> | 2010-02-09 15:52:51 +0100 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2010-02-09 15:52:51 +0100 |
commit | 601fd07fd3d53d9c597302a7dc1a4c74a54c57bf (patch) | |
tree | 26d1087540921c7ef352c4fd587b10f6c54bfbe0 | |
parent | 3cefc4ee12fe7144a65a205f6645c14ec5be68ce (diff) | |
download | lcms2-601fd07fd3d53d9c597302a7dc1a4c74a54c57bf.tar.gz |
Several fixes as suggested by Richard Hughes
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | aclocal.m4 | 181 | ||||
-rwxr-xr-x | autogen.sh | 92 | ||||
-rwxr-xr-x[-rw-r--r--] | configure | 0 | ||||
-rw-r--r-- | include/lcms2.h | 410 | ||||
-rw-r--r-- | include/lcms2_plugin.h | 194 | ||||
-rwxr-xr-x[-rw-r--r--] | testbed/Makefile.am | 18 | ||||
-rw-r--r-- | testbed/Makefile.in | 23 | ||||
-rwxr-xr-x | testbed/sRGB_Color_Space_Profile.icm (renamed from testbed/sRGB Color Space Profile.icm) | bin | 3144 -> 3144 bytes | |||
-rwxr-xr-x[-rw-r--r--] | testbed/testcms2.c | 10 |
12 files changed, 422 insertions, 515 deletions
@@ -12,8 +12,9 @@ Bob Friesenhahn Kai-Uwe Behrmann Stuart Nixon Jordi Vilar +Richard Hughes Special Thanks -------------- -Jan Morovic
\ No newline at end of file +Jan Morovic diff --git a/Makefile.am b/Makefile.am index 03fe74d..3fe7946 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ SUBDIRS = src utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed # Additional files to distribute -EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin lib INSTALL NEWS README.1ST lcms2.pc.in +EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin Lib INSTALL NEWS README.1ST lcms2.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lcms2.pc @@ -28,4 +28,4 @@ clean-local: find Projects -name "*.sdf" | xargs rm -rf find Projects -name "*.opensdf" | xargs rm -rf find Projects -name "*.log" | xargs rm -rf - find Projects -name "ipch" | xargs rm -rf
\ No newline at end of file + find Projects -name "ipch" | xargs rm -rf diff --git a/Makefile.in b/Makefile.in index 8533d86..5522c93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -232,7 +232,7 @@ AUTOMAKE_OPTIONS = 1.7.2 dist-zip foreign SUBDIRS = src utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed # Additional files to distribute -EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin lib INSTALL NEWS README.1ST lcms2.pc.in +EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin Lib INSTALL NEWS README.1ST lcms2.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lcms2.pc all: all-recursive @@ -8834,187 +8834,6 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# --------------------------------------------------------------------------- -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. -# -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. -# -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). -# -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 1.5 are not - dnl supported because the default installation locations changed from - dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages - dnl in 1.5. - m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0 python1.6 python1.5]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST([PYTHON_PREFIX], ['${prefix}']) - AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) - - dnl At times (like when building shared libraries) you may want - dnl to know which OS platform Python thinks this is. - - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - - dnl Set up 4 directories: - - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON script directory], - [am_cv_python_pythondir], - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) - - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], - [am_cv_python_pyexecdir], - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || - echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) - - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) - - dnl Run any user-specified action. - $2 - fi - -]) - - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# hexversion has been introduced in Python 1.5.2; it's probably not -# worth to support older versions (1.5.1 was released on October 31, 1998). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys, string -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] -minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(sys.hexversion < minverhex)" - AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..5c62310 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,92 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +DIE=0 + +(test -f $srcdir/configure.ac) || { + echo -n "**Error**: Directory $srcdir does not look like the" + echo " top-level package directory" + exit 1 +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have autoconf installed." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +(grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have libtool installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + } +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have automake installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + NO_AUTOMAKE=yes +} + +# if no automake, don't bother testing for aclocal +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: Missing aclocal. The version of automake" + echo "installed doesn't appear recent enough." + echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +if test -z "$*"; then + echo "**Warning**: I am going to run configure with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo $0 " command line." + echo +fi + +case $CC in +xlc ) + am_opt=--include-deps;; +esac + + aclocalinclude="$ACLOCAL_FLAGS" + + if grep "^LT_INIT" configure.ac >/dev/null; then + if test -z "$NO_LIBTOOLIZE" ; then + echo "Running libtoolize..." + libtoolize --force --copy + fi + fi + echo "Running aclocal $aclocalinclude ..." + aclocal $aclocalinclude + if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then + echo "Running autoheader..." + autoheader + fi + echo "Running automake --add-missing --gnu -Wno-portability $am_opt ..." + automake --add-missing --gnu -Wno-portability $am_opt + echo "Running autoconf ..." + autoconf + +conf_flags="--enable-maintainer-mode" + +if test x$NOCONFIGURE = x; then + echo "Running $srcdir/configure $conf_flags $@ ..." + $srcdir/configure $conf_flags "$@" \ + && echo "Now type make to compile." || exit 1 +else + echo "Skipping configure process." +fi diff --git a/configure b/configure index 60ef181..60ef181 100644..100755 --- a/configure +++ b/configure diff --git a/include/lcms2.h b/include/lcms2.h index f7d06e4..3c600b8 100644 --- a/include/lcms2.h +++ b/include/lcms2.h @@ -3,22 +3,22 @@ // Little Color Management System // Copyright (c) 1998-2010 Marti Maria Saguer // -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the Software +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the Software // is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included in +// The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //--------------------------------------------------------------------------------- @@ -30,11 +30,11 @@ // ********** Configuration toggles **************************************** -// Uncomment this one if you are using big endian machines +// Uncomment this one if you are using big endian machines // #define CMS_USE_BIG_ENDIAN 1 // Uncomment this one if your compiler/machine does NOT support the -// "long long" type. +// "long long" type. // #define CMS_DONT_USE_INT64 1 // Uncomment this if your compiler doesn't work with fast floor function @@ -43,15 +43,15 @@ // Uncomment this line if your system does not support multithreading #define CMS_DONT_USE_PTHREADS 1 -// Uncomment this line if you want lcms to use the black point tag in profile, -// if commented, lcms will compute the black point by its own. +// Uncomment this line if you want lcms to use the black point tag in profile, +// if commented, lcms will compute the black point by its own. // It is safer to leve it commented out // #define CMS_USE_PROFILE_BLACK_POINT_TAG 1 // Uncomment this line if you are compiling as C++ and want a C++ API // #define CMS_USE_CPP_API -// Uncomment this line if you need strict CGATS syntax. Makes CGATS file to +// Uncomment this line if you need strict CGATS syntax. Makes CGATS file to // require "KEYWORD" on undefined identifiers, keep it comented out unless needed // #define CMS_STRICT_CGATS 1 @@ -66,8 +66,8 @@ #include <stddef.h> #ifndef CMS_USE_CPP_API -# ifdef __cplusplus -extern "C" { +# ifdef __cplusplus +extern "C" { # endif #endif @@ -77,15 +77,15 @@ extern "C" { // I will give the chance of redefining basic types for compilers that are not fully C99 compliant #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED -// Base types +// Base types typedef unsigned char cmsUInt8Number; // That is guaranteed by the C99 spec typedef signed char cmsInt8Number; // That is guaranteed by the C99 spec -// IEEE float storage numbers +// IEEE float storage numbers typedef float cmsFloat32Number; typedef double cmsFloat64Number; -// 16-bit base types +// 16-bit base types #if (USHRT_MAX == 65535U) typedef unsigned short cmsUInt16Number; #elif (UINT_MAX == 65535U) @@ -96,14 +96,14 @@ typedef double cmsFloat64Number; #if (SHRT_MAX == 32767) typedef short cmsInt16Number; -#elif (INT_MAX == 32767) - typedef int cmsInt16Number; +#elif (INT_MAX == 32767) + typedef int cmsInt16Number; #else # error "Unable to find 16 bits signed type, unsupported compiler" #endif // 32-bit base type -#if (UINT_MAX == 4294967295U) +#if (UINT_MAX == 4294967295U) typedef unsigned int cmsUInt32Number; #elif (ULONG_MAX == 4294967295U) typedef unsigned long cmsUInt32Number; @@ -111,7 +111,7 @@ typedef double cmsFloat64Number; # error "Unable to find 32 bit unsigned type, unsupported compiler" #endif -#if (INT_MAX == +2147483647) +#if (INT_MAX == +2147483647) typedef int cmsInt32Number; #elif (LONG_MAX == +2147483647) typedef long cmsInt32Number; @@ -173,7 +173,7 @@ typedef int cmsBool; # define CMS_USE_BIG_ENDIAN 1 #endif -#if defined(__sgi__) || defined(__sgi) || defined(__powerpc__) || defined(sparc) +#if defined(__sgi__) || defined(__sgi) || defined(__powerpc__) || defined(sparc) # define CMS_USE_BIG_ENDIAN 1 #endif @@ -206,11 +206,11 @@ typedef int cmsBool; # endif # endif # else -# define CMSEXPORT +# define CMSEXPORT # define CMSAPI # endif -#else -# define CMSEXPORT +#else +# define CMSEXPORT # define CMSAPI #endif @@ -235,20 +235,20 @@ typedef int cmsBool; #define cmsPERCEPTUAL_BLACK_Z 0.00287 // Definitions in ICC spec -#define cmsMagicNumber 0x61637370 // 'acsp' +#define cmsMagicNumber 0x61637370 // 'acsp' #define lcmsSignature 0x6c636d73 // 'lcms' -// Base ICC type definitions +// Base ICC type definitions typedef enum { cmsSigChromaticityType = 0x6368726D, // 'chrm' cmsSigColorantOrderType = 0x636C726F, // 'clro' cmsSigColorantTableType = 0x636C7274, // 'clrt' - cmsSigCrdInfoType = 0x63726469, // 'crdi' + cmsSigCrdInfoType = 0x63726469, // 'crdi' cmsSigCurveType = 0x63757276, // 'curv' cmsSigDataType = 0x64617461, // 'data' cmsSigDateTimeType = 0x6474696D, // 'dtim' - cmsSigDeviceSettingsType = 0x64657673, // 'devs' + cmsSigDeviceSettingsType = 0x64657673, // 'devs' cmsSigLut16Type = 0x6d667432, // 'mft2' cmsSigLut8Type = 0x6d667431, // 'mft1' cmsSigLutAtoBType = 0x6d414220, // 'mAB ' @@ -263,12 +263,12 @@ typedef enum { cmsSigProfileSequenceIdType = 0x70736964, // 'psid' cmsSigResponseCurveSet16Type = 0x72637332, // 'rcs2' cmsSigS15Fixed16ArrayType = 0x73663332, // 'sf32' - cmsSigScreeningType = 0x7363726E, // 'scrn' + cmsSigScreeningType = 0x7363726E, // 'scrn' cmsSigSignatureType = 0x73696720, // 'sig ' cmsSigTextType = 0x74657874, // 'text' - cmsSigTextDescriptionType = 0x64657363, // 'desc' + cmsSigTextDescriptionType = 0x64657363, // 'desc' cmsSigU16Fixed16ArrayType = 0x75663332, // 'uf32' - cmsSigUcrBgType = 0x62666420, // 'bfd ' + cmsSigUcrBgType = 0x62666420, // 'bfd ' cmsSigUInt16ArrayType = 0x75693136, // 'ui16' cmsSigUInt32ArrayType = 0x75693332, // 'ui32' cmsSigUInt64ArrayType = 0x75693634, // 'ui64' @@ -281,9 +281,9 @@ typedef enum { // Base ICC tag definitions typedef enum { - cmsSigAToB0Tag = 0x41324230, // 'A2B0' + cmsSigAToB0Tag = 0x41324230, // 'A2B0' cmsSigAToB1Tag = 0x41324231, // 'A2B1' - cmsSigAToB2Tag = 0x41324232, // 'A2B2' + cmsSigAToB2Tag = 0x41324232, // 'A2B2' cmsSigBlueColorantTag = 0x6258595A, // 'bXYZ' cmsSigBlueMatrixColumnTag = 0x6258595A, // 'bXYZ' cmsSigBlueTRCTag = 0x62545243, // 'bTRC' @@ -291,7 +291,7 @@ typedef enum { cmsSigBToA1Tag = 0x42324131, // 'B2A1' cmsSigBToA2Tag = 0x42324132, // 'B2A2' cmsSigCalibrationDateTimeTag = 0x63616C74, // 'calt' - cmsSigCharTargetTag = 0x74617267, // 'targ' + cmsSigCharTargetTag = 0x74617267, // 'targ' cmsSigChromaticAdaptationTag = 0x63686164, // 'chad' cmsSigChromaticityTag = 0x6368726D, // 'chrm' cmsSigColorantOrderTag = 0x636C726F, // 'clro' @@ -299,12 +299,12 @@ typedef enum { cmsSigColorantTableOutTag = 0x636C6F74, // 'clot' cmsSigColorimetricIntentImageStateTag = 0x63696973, // 'ciis' cmsSigCopyrightTag = 0x63707274, // 'cprt' - cmsSigCrdInfoTag = 0x63726469, // 'crdi' - cmsSigDataTag = 0x64617461, // 'data' - cmsSigDateTimeTag = 0x6474696D, // 'dtim' + cmsSigCrdInfoTag = 0x63726469, // 'crdi' + cmsSigDataTag = 0x64617461, // 'data' + cmsSigDateTimeTag = 0x6474696D, // 'dtim' cmsSigDeviceMfgDescTag = 0x646D6E64, // 'dmnd' cmsSigDeviceModelDescTag = 0x646D6464, // 'dmdd' - cmsSigDeviceSettingsTag = 0x64657673, // 'devs' + cmsSigDeviceSettingsTag = 0x64657673, // 'devs' cmsSigDToB0Tag = 0x44324230, // 'D2B0' cmsSigDToB1Tag = 0x44324231, // 'D2B1' cmsSigDToB2Tag = 0x44324232, // 'D2B2' @@ -332,20 +332,20 @@ typedef enum { cmsSigProfileDescriptionTag = 0x64657363, // 'desc' cmsSigProfileSequenceDescTag = 0x70736571, // 'pseq' cmsSigProfileSequenceIdTag = 0x70736964, // 'psid' - cmsSigPs2CRD0Tag = 0x70736430, // 'psd0' - cmsSigPs2CRD1Tag = 0x70736431, // 'psd1' - cmsSigPs2CRD2Tag = 0x70736432, // 'psd2' - cmsSigPs2CRD3Tag = 0x70736433, // 'psd3' - cmsSigPs2CSATag = 0x70733273, // 'ps2s' - cmsSigPs2RenderingIntentTag = 0x70733269, // 'ps2i' + cmsSigPs2CRD0Tag = 0x70736430, // 'psd0' + cmsSigPs2CRD1Tag = 0x70736431, // 'psd1' + cmsSigPs2CRD2Tag = 0x70736432, // 'psd2' + cmsSigPs2CRD3Tag = 0x70736433, // 'psd3' + cmsSigPs2CSATag = 0x70733273, // 'ps2s' + cmsSigPs2RenderingIntentTag = 0x70733269, // 'ps2i' cmsSigRedColorantTag = 0x7258595A, // 'rXYZ' cmsSigRedMatrixColumnTag = 0x7258595A, // 'rXYZ' cmsSigRedTRCTag = 0x72545243, // 'rTRC' cmsSigSaturationRenderingIntentGamutTag = 0x72696732, // 'rig2' - cmsSigScreeningDescTag = 0x73637264, // 'scrd' - cmsSigScreeningTag = 0x7363726E, // 'scrn' + cmsSigScreeningDescTag = 0x73637264, // 'scrd' + cmsSigScreeningTag = 0x7363726E, // 'scrn' cmsSigTechnologyTag = 0x74656368, // 'tech' - cmsSigUcrBgTag = 0x62666420, // 'bfd ' + cmsSigUcrBgTag = 0x62666420, // 'bfd ' cmsSigViewingCondDescTag = 0x76756564, // 'vued' cmsSigViewingConditionsTag = 0x76696577, // 'view' cmsSigVcgtTag = 0x76636774 // 'vcgt' @@ -354,11 +354,11 @@ typedef enum { // ICC Technology tag -typedef enum { +typedef enum { cmsSigDigitalCamera = 0x6463616D, // 'dcam' cmsSigFilmScanner = 0x6673636E, // 'fscn' cmsSigReflectiveScanner = 0x7273636E, // 'rscn' - cmsSigInkJetPrinter = 0x696A6574, // 'ijet' + cmsSigInkJetPrinter = 0x696A6574, // 'ijet' cmsSigThermalWaxPrinter = 0x74776178, // 'twax' cmsSigElectrophotographicPrinter = 0x6570686F, // 'epho' cmsSigElectrostaticPrinter = 0x65737461, // 'esta' @@ -381,12 +381,12 @@ typedef enum { cmsSigMotionPictureFilmRecorder = 0x6D706672, // 'mpfr' cmsSigDigitalMotionPictureCamera = 0x646D7063, // 'dmpc' cmsSigDigitalCinemaProjector = 0x64636A70, // 'dcpj' - -} cmsTechnologySignature; - - -// ICC Color spaces -typedef enum { + +} cmsTechnologySignature; + + +// ICC Color spaces +typedef enum { cmsSigXYZData = 0x58595A20, // 'XYZ ' cmsSigLabData = 0x4C616220, // 'Lab ' cmsSigLuvData = 0x4C757620, // 'Luv ' @@ -398,23 +398,23 @@ typedef enum { cmsSigHlsData = 0x484C5320, // 'HLS ' cmsSigCmykData = 0x434D594B, // 'CMYK' cmsSigCmyData = 0x434D5920, // 'CMY ' - cmsSigMCH1Data = 0x4D434831, // 'MCH1' - cmsSigMCH2Data = 0x4D434832, // 'MCH2' - cmsSigMCH3Data = 0x4D434833, // 'MCH3' - cmsSigMCH4Data = 0x4D434834, // 'MCH4' - cmsSigMCH5Data = 0x4D434835, // 'MCH5' - cmsSigMCH6Data = 0x4D434836, // 'MCH6' - cmsSigMCH7Data = 0x4D434837, // 'MCH7' - cmsSigMCH8Data = 0x4D434838, // 'MCH8' - cmsSigMCH9Data = 0x4D434839, // 'MCH9' - cmsSigMCHAData = 0x4D43483A, // 'MCHA' - cmsSigMCHBData = 0x4D43483B, // 'MCHB' - cmsSigMCHCData = 0x4D43483C, // 'MCHC' - cmsSigMCHDData = 0x4D43483D, // 'MCHD' - cmsSigMCHEData = 0x4D43483E, // 'MCHE' - cmsSigMCHFData = 0x4D43483F, // 'MCHF' + cmsSigMCH1Data = 0x4D434831, // 'MCH1' + cmsSigMCH2Data = 0x4D434832, // 'MCH2' + cmsSigMCH3Data = 0x4D434833, // 'MCH3' + cmsSigMCH4Data = 0x4D434834, // 'MCH4' + cmsSigMCH5Data = 0x4D434835, // 'MCH5' + cmsSigMCH6Data = 0x4D434836, // 'MCH6' + cmsSigMCH7Data = 0x4D434837, // 'MCH7' + cmsSigMCH8Data = 0x4D434838, // 'MCH8' + cmsSigMCH9Data = 0x4D434839, // 'MCH9' + cmsSigMCHAData = 0x4D43483A, // 'MCHA' + cmsSigMCHBData = 0x4D43483B, // 'MCHB' + cmsSigMCHCData = 0x4D43483C, // 'MCHC' + cmsSigMCHDData = 0x4D43483D, // 'MCHD' + cmsSigMCHEData = 0x4D43483E, // 'MCHE' + cmsSigMCHFData = 0x4D43483F, // 'MCHF' cmsSigNamedData = 0x6e6d636c, // 'nmcl' - cmsSig1colorData = 0x31434C52, // '1CLR' + cmsSig1colorData = 0x31434C52, // '1CLR' cmsSig2colorData = 0x32434C52, // '2CLR' cmsSig3colorData = 0x33434C52, // '3CLR' cmsSig4colorData = 0x34434C52, // '4CLR' @@ -430,18 +430,18 @@ typedef enum { cmsSig14colorData = 0x45434C52, // 'ECLR' cmsSig15colorData = 0x46434C52, // 'FCLR' cmsSigLuvKData = 0x4C75764B // 'LuvK' - -} cmsColorSpaceSignature; - -// ICC Profile Class -typedef enum { - cmsSigInputClass = 0x73636E72, // 'scnr' - cmsSigDisplayClass = 0x6D6E7472, // 'mntr' - cmsSigOutputClass = 0x70727472, // 'prtr' - cmsSigLinkClass = 0x6C696E6B, // 'link' - cmsSigAbstractClass = 0x61627374, // 'abst' - cmsSigColorSpaceClass = 0x73706163, // 'spac' - cmsSigNamedColorClass = 0x6e6d636c, // 'nmcl' + +} cmsColorSpaceSignature; + +// ICC Profile Class +typedef enum { + cmsSigInputClass = 0x73636E72, // 'scnr' + cmsSigDisplayClass = 0x6D6E7472, // 'mntr' + cmsSigOutputClass = 0x70727472, // 'prtr' + cmsSigLinkClass = 0x6C696E6B, // 'link' + cmsSigAbstractClass = 0x61627374, // 'abst' + cmsSigColorSpaceClass = 0x73706163, // 'spac' + cmsSigNamedColorClass = 0x6e6d636c, // 'nmcl' } cmsProfileClassSignature; @@ -457,26 +457,26 @@ typedef enum { } cmsPlatformSignature; // Reference gamut -#define cmsSigPerceptualReferenceMediumGamut 0x70726d67 //'prmg' +#define cmsSigPerceptualReferenceMediumGamut 0x70726d67 //'prmg' // For cmsSigColorimetricIntentImageStateTag -#define cmsSigSceneColorimetryEstimates 0x73636F65 //'scoe' -#define cmsSigSceneAppearanceEstimates 0x73617065 //'sape' -#define cmsSigFocalPlaneColorimetryEstimates 0x66706365 //'fpce' -#define cmsSigReflectionHardcopyOriginalColorimetry 0x72686F63 //'rhoc' -#define cmsSigReflectionPrintOutputColorimetry 0x72706F63 //'rpoc' +#define cmsSigSceneColorimetryEstimates 0x73636F65 //'scoe' +#define cmsSigSceneAppearanceEstimates 0x73617065 //'sape' +#define cmsSigFocalPlaneColorimetryEstimates 0x66706365 //'fpce' +#define cmsSigReflectionHardcopyOriginalColorimetry 0x72686F63 //'rhoc' +#define cmsSigReflectionPrintOutputColorimetry 0x72706F63 //'rpoc' // Multi process elements types typedef enum { - cmsSigCurveSetElemType = 0x63767374, //'cvst' - cmsSigMatrixElemType = 0x6D617466, //'matf' - cmsSigCLutElemType = 0x636C7574, //'clut' - - cmsSigBAcsElemType = 0x62414353, // 'bACS' - cmsSigEAcsElemType = 0x65414353, // 'eACS' - - // Custom from here, not in the ICC Spec - cmsSigXYZ2LabElemType = 0x6C327820, // 'l2x ' + cmsSigCurveSetElemType = 0x63767374, //'cvst' + cmsSigMatrixElemType = 0x6D617466, //'matf' + cmsSigCLutElemType = 0x636C7574, //'clut' + + cmsSigBAcsElemType = 0x62414353, // 'bACS' + cmsSigEAcsElemType = 0x65414353, // 'eACS' + + // Custom from here, not in the ICC Spec + cmsSigXYZ2LabElemType = 0x6C327820, // 'l2x ' cmsSigLab2XYZElemType = 0x78326C20, // 'x2l ' cmsSigNamedColorElemType = 0x6E636C20, // 'ncl ' cmsSigLabV2toV4 = 0x32203420, // '2 4 ' @@ -490,24 +490,24 @@ typedef enum { // Types of CurveElements typedef enum { - cmsSigFormulaCurveSeg = 0x70617266, // 'parf' - cmsSigSampledCurveSeg = 0x73616D66, // 'samf' - cmsSigSegmentedCurve = 0x63757266 // 'curf' + cmsSigFormulaCurveSeg = 0x70617266, // 'parf' + cmsSigSampledCurveSeg = 0x73616D66, // 'samf' + cmsSigSegmentedCurve = 0x63757266 // 'curf' } cmsCurveSegSignature; // Used in ResponseCurveType -#define cmsSigStatusA 0x53746141 //'StaA' -#define cmsSigStatusE 0x53746145 //'StaE' -#define cmsSigStatusI 0x53746149 //'StaI' -#define cmsSigStatusT 0x53746154 //'StaT' -#define cmsSigStatusM 0x5374614D //'StaM' -#define cmsSigDN 0x444E2020 //'DN ' -#define cmsSigDNP 0x444E2050 //'DN P' -#define cmsSigDNN 0x444E4E20 //'DNN ' -#define cmsSigDNNP 0x444E4E50 //'DNNP' - -// Device attributes, currently defined values correspond to the low 4 bytes +#define cmsSigStatusA 0x53746141 //'StaA' +#define cmsSigStatusE 0x53746145 //'StaE' +#define cmsSigStatusI 0x53746149 //'StaI' +#define cmsSigStatusT 0x53746154 //'StaT' +#define cmsSigStatusM 0x5374614D //'StaM' +#define cmsSigDN 0x444E2020 //'DN ' +#define cmsSigDNP 0x444E2050 //'DN P' +#define cmsSigDNN 0x444E4E20 //'DNN ' +#define cmsSigDNNP 0x444E4E50 //'DNNP' + +// Device attributes, currently defined values correspond to the low 4 bytes // of the 8 byte attribute quantity #define cmsReflective 0 #define cmsTransparency 1 @@ -580,16 +580,16 @@ typedef struct { // ICC base tag typedef struct { - cmsTagTypeSignature sig; - cmsInt8Number reserved[4]; + cmsTagTypeSignature sig; + cmsInt8Number reserved[4]; } cmsTagBase; // A tag entry in directory typedef struct { - cmsTagSignature sig; // The tag signature - cmsUInt32Number offset; // Start of tag - cmsUInt32Number size; // Size in bytes + cmsTagSignature sig; // The tag signature + cmsUInt32Number offset; // Start of tag + cmsUInt32Number size; // Size in bytes } cmsTagEntry; @@ -730,7 +730,7 @@ typedef void* cmsHTRANSFORM; #define TYPE_CMY_16_SE (COLORSPACE_SH(PT_CMY)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1)) #define TYPE_CMYK_8 (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)) -#define TYPE_CMYKA_8 (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1)) +#define TYPE_CMYKA_8 (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1)) #define TYPE_CMYK_8_REV (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1)) #define TYPE_YUVK_8 TYPE_CMYK_8_REV #define TYPE_CMYK_8_PLANAR (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|PLANAR_SH(1)) @@ -837,10 +837,10 @@ typedef void* cmsHTRANSFORM; #define TYPE_HSV_16_PLANAR (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|PLANAR_SH(1)) #define TYPE_HSV_16_SE (COLORSPACE_SH(PT_HSV)|CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1)) -// Named color index. Only 16 bits allowed (don't check colorspace) +// Named color index. Only 16 bits allowed (don't check colorspace) #define TYPE_NAMED_COLOR_INDEX (CHANNELS_SH(1)|BYTES_SH(2)) -// Float formatters. +// Float formatters. #define TYPE_XYZ_FLT (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(4)) #define TYPE_Lab_FLT (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(4)) #define TYPE_GRAY_FLT (COLORSPACE_SH(PT_GRAY)|CHANNELS_SH(1)|BYTES_SH(4)) @@ -862,30 +862,30 @@ typedef struct { cmsFloat64Number Y; cmsFloat64Number Z; - } cmsCIEXYZ; - -typedef struct { + } cmsCIEXYZ; + +typedef struct { cmsFloat64Number x; cmsFloat64Number y; cmsFloat64Number Y; } cmsCIExyY; -typedef struct { +typedef struct { cmsFloat64Number L; - cmsFloat64Number a; - cmsFloat64Number b; + cmsFloat64Number a; + cmsFloat64Number b; } cmsCIELab; -typedef struct { +typedef struct { cmsFloat64Number L; cmsFloat64Number C; cmsFloat64Number h; } cmsCIELCh; -typedef struct { +typedef struct { cmsFloat64Number J; cmsFloat64Number C; cmsFloat64Number h; @@ -899,7 +899,7 @@ typedef struct { } cmsCIEXYZTRIPLE; -typedef struct { +typedef struct { cmsCIExyY Red; cmsCIExyY Green; cmsCIExyY Blue; @@ -949,10 +949,10 @@ CMSAPI void CMSEXPORT cmsUnregisterPlugins(void); // For example, all create functions does return NULL on failure. Other may return FALSE. // It may be interesting, for the developer, to know why the function is failing. // for that reason, lcms2 does offer a logging function. This function will get -// an ENGLISH string with some clues on what is going wrong. You can show this +// an ENGLISH string with some clues on what is going wrong. You can show this // info to the end user if you wish, or just create some sort of log on disk. // The logging function should NOT terminate the program, as this obviously can leave -// unfreed resources. It is the programmer's responsability to check each function +// unfreed resources. It is the programmer's responsibility to check each function // return code to make sure it didn't fail. #define cmsERROR_UNDEFINED 0 @@ -970,10 +970,10 @@ CMSAPI void CMSEXPORT cmsUnregisterPlugins(void); #define cmsERROR_CORRUPTION_DETECTED 12 #define cmsERROR_NOT_SUITABLE 13 -// Error logger is called with the ContextID when a message is raised. This gives the -// chance to know which thread is responsible of the warning and any environment associated -// with it. Non-multithreading applications may safely ignore this parameter. -// Note that under certain special circunstances, ContextID may be NULL. +// Error logger is called with the ContextID when a message is raised. This gives the +// chance to know which thread is responsible of the warning and any environment associated +// with it. Non-multithreading applications may safely ignore this parameter. +// Note that under certain special circumstances, ContextID may be NULL. typedef void (* cmsLogErrorHandlerFunction)(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text); // Allows user to set any specific logger @@ -983,7 +983,7 @@ CMSAPI void CMSEXPORT cmsSetLogErrorHandler(cmsLogErrorHandlerFunct // Returns pointers to constant structs CMSAPI const cmsCIEXYZ* CMSEXPORT cmsD50_XYZ(void); -CMSAPI const cmsCIExyY* CMSEXPORT cmsD50_xyY(void); +CMSAPI const cmsCIExyY* CMSEXPORT cmsD50_xyY(void); // Colorimetric space conversions CMSAPI void CMSEXPORT cmsXYZ2xyY(cmsCIExyY* Dest, const cmsCIEXYZ* Source); @@ -1001,7 +1001,7 @@ CMSAPI void CMSEXPORT cmsFloat2LabEncodedV2(cmsUInt16Number wLab[3] CMSAPI void CMSEXPORT cmsXYZEncoded2Float(cmsCIEXYZ* fxyz, const cmsUInt16Number XYZ[3]); CMSAPI void CMSEXPORT cmsFloat2XYZEncoded(cmsUInt16Number XYZ[3], const cmsCIEXYZ* fXYZ); -// DeltaE metrics +// DeltaE metrics CMSAPI cmsFloat64Number CMSEXPORT cmsDeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2); CMSAPI cmsFloat64Number CMSEXPORT cmsCIE94DeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2); CMSAPI cmsFloat64Number CMSEXPORT cmsBFDdeltaE(const cmsCIELab* Lab1, const cmsCIELab* Lab2); @@ -1019,7 +1019,7 @@ CMSAPI cmsBool CMSEXPORT cmsAdaptToIlluminant(cmsCIEXYZ* Result, const // CIECAM02 --------------------------------------------------------------------------------------------------- -// Viewing conditions. Please note those are CAM model viewing conditions, and not the ICC tag viewing +// Viewing conditions. Please note those are CAM model viewing conditions, and not the ICC tag viewing // conditions, which I'm naming cmsICCViewingConditions to make differences evident. Unfortunately, the tag // cannot deal with surround La, Yb and D value so is basically useless to store CAM02 viewing conditions. @@ -1031,7 +1031,7 @@ CMSAPI cmsBool CMSEXPORT cmsAdaptToIlluminant(cmsCIEXYZ* Result, const #define D_CALCULATE (-1) -typedef struct { +typedef struct { cmsCIEXYZ whitePoint; cmsFloat64Number Yb; cmsFloat64Number La; @@ -1060,7 +1060,7 @@ typedef struct { } cmsCurveSegment; -// The internal respresentation is none of your business. +// The internal representation is none of your business. typedef struct _cms_curve_struct cmsToneCurve; CMSAPI cmsToneCurve* CMSEXPORT cmsBuildSegmentedToneCurve(cmsContext ContextID, cmsInt32Number nSegments, const cmsCurveSegment Segments[]); @@ -1085,13 +1085,13 @@ CMSAPI cmsInt32Number CMSEXPORT cmsGetToneCurveParametricType(const cmsToneCu CMSAPI cmsFloat64Number CMSEXPORT cmsEstimateGamma(const cmsToneCurve* t, cmsFloat64Number Precision); -// Implements pipelines of multi processing elements ------------------------------------------------------------- +// Implements pipelines of multi-processing elements ------------------------------------------------------------- // Nothing to see here, move along typedef struct _cmsPipeline_struct cmsPipeline; typedef struct _cmsStage_struct cmsStage; -// Those are hi-level pipelines +// Those are hi-level pipelines CMSAPI cmsPipeline* CMSEXPORT cmsPipelineAlloc(cmsContext ContextID, cmsUInt32Number InputChannels, cmsUInt32Number OutputChannels); CMSAPI void CMSEXPORT cmsPipelineFree(cmsPipeline* lut); CMSAPI cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* Orig); @@ -1167,7 +1167,7 @@ CMSAPI cmsBool CMSEXPORT cmsSliceSpace16(cmsUInt32Number nInputs, cons CMSAPI cmsBool CMSEXPORT cmsSliceSpaceFloat(cmsUInt32Number nInputs, const cmsUInt32Number clutPoints[], cmsSAMPLERFLOAT Sampler, void * Cargo); -// Multilocalized unicode management --------------------------------------------------------------------------------------- +// Multilocalized Unicode management --------------------------------------------------------------------------------------- typedef struct _cms_MLU_struct cmsMLU; @@ -1178,23 +1178,23 @@ CMSAPI cmsMLU* CMSEXPORT cmsMLUalloc(cmsContext ContextID, cmsUInt32Nu CMSAPI void CMSEXPORT cmsMLUfree(cmsMLU* mlu); CMSAPI cmsMLU* CMSEXPORT cmsMLUdup(const cmsMLU* mlu); -CMSAPI cmsBool CMSEXPORT cmsMLUsetASCII(cmsMLU* mlu, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsBool CMSEXPORT cmsMLUsetASCII(cmsMLU* mlu, + const char LanguageCode[3], const char CountryCode[3], const char* ASCIIString); -CMSAPI cmsBool CMSEXPORT cmsMLUsetWide(cmsMLU* mlu, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsBool CMSEXPORT cmsMLUsetWide(cmsMLU* mlu, + const char LanguageCode[3], const char CountryCode[3], const wchar_t* WideString); -CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetASCII(const cmsMLU* mlu, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetASCII(const cmsMLU* mlu, + const char LanguageCode[3], const char CountryCode[3], char* Buffer, cmsUInt32Number BufferSize); -CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetWide(const cmsMLU* mlu, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsUInt32Number CMSEXPORT cmsMLUgetWide(const cmsMLU* mlu, + const char LanguageCode[3], const char CountryCode[3], wchar_t* Buffer, cmsUInt32Number BufferSize); -CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(const cmsMLU* mlu, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(const cmsMLU* mlu, + const char LanguageCode[3], const char CountryCode[3], char ObtainedLanguage[3], char ObtainedCountry[3]); // Undercolorremoval & black generation ------------------------------------------------------------------------------------- @@ -1215,7 +1215,7 @@ typedef struct { #define cmsSPOT_UNKNOWN 0 #define cmsSPOT_PRINTER_DEFAULT 1 #define cmsSPOT_ROUND 2 -#define cmsSPOT_DIAMOND 3 +#define cmsSPOT_DIAMOND 3 #define cmsSPOT_ELLIPSE 4 #define cmsSPOT_LINE 5 #define cmsSPOT_SQUARE 6 @@ -1231,7 +1231,7 @@ typedef struct { typedef struct { cmsUInt32Number Flag; cmsUInt32Number nChannels; - cmsScreeningChannel Channels[MAXCHANNELS]; + cmsScreeningChannel Channels[MAXCHANNELS]; } cmsScreening; @@ -1240,25 +1240,25 @@ typedef struct { typedef struct _cms_NAMEDCOLORLIST_struct cmsNAMEDCOLORLIST; -CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID, - cmsUInt32Number n, - cmsUInt32Number ColorantCount, +CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID, + cmsUInt32Number n, + cmsUInt32Number ColorantCount, const char* Prefix, const char* Suffix); CMSAPI void CMSEXPORT cmsFreeNamedColorList(cmsNAMEDCOLORLIST* v); CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsDupNamedColorList(const cmsNAMEDCOLORLIST* v); -CMSAPI cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* v, const char* Name, - cmsUInt16Number PCS[3], +CMSAPI cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* v, const char* Name, + cmsUInt16Number PCS[3], cmsUInt16Number Colorant[MAXCHANNELS]); CMSAPI cmsUInt32Number CMSEXPORT cmsNamedColorCount(const cmsNAMEDCOLORLIST* v); CMSAPI cmsInt32Number CMSEXPORT cmsNamedColorIndex(const cmsNAMEDCOLORLIST* v, const char* Name); -CMSAPI cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cmsUInt32Number nColor, - char* Name, - char* Prefix, +CMSAPI cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cmsUInt32Number nColor, + char* Name, + char* Prefix, char* Suffix, - cmsUInt16Number* PCS, + cmsUInt16Number* PCS, cmsUInt16Number* Colorant); // Retrieve named color list from transform @@ -1266,23 +1266,23 @@ CMSAPI cmsNAMEDCOLORLIST* CMSEXPORT cmsGetNamedColorList(cmsHTRANSFORM xform); // Profile sequence ----------------------------------------------------------------------------------------------------- -// Profile sequence descriptor. Some fields come from profile sequence descriptor tag, others +// Profile sequence descriptor. Some fields come from profile sequence descriptor tag, others // come from Profile Sequence Identifier Tag typedef struct { - cmsSignature deviceMfg; - cmsSignature deviceModel; - cmsUInt64Number attributes; - cmsTechnologySignature technology; + cmsSignature deviceMfg; + cmsSignature deviceModel; + cmsUInt64Number attributes; + cmsTechnologySignature technology; cmsProfileID ProfileID; cmsMLU* Manufacturer; cmsMLU* Model; cmsMLU* Description; - + } cmsPSEQDESC; typedef struct { - cmsUInt32Number n; + cmsUInt32Number n; cmsContext ContextID; cmsPSEQDESC* seq; @@ -1324,14 +1324,14 @@ CMSAPI void CMSEXPORT cmsSetHeaderModel(cmsHPROFILE hProfile, cmsUI CMSAPI void CMSEXPORT cmsSetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number Flags); CMSAPI void CMSEXPORT cmsSetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID); CMSAPI void CMSEXPORT cmsSetHeaderRenderingIntent(cmsHPROFILE hProfile, cmsUInt32Number RenderingIntent); - + CMSAPI cmsColorSpaceSignature CMSEXPORT cmsGetPCS(cmsHPROFILE hProfile); CMSAPI void CMSEXPORT cmsSetPCS(cmsHPROFILE hProfile, cmsColorSpaceSignature pcs); -CMSAPI cmsColorSpaceSignature +CMSAPI cmsColorSpaceSignature CMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile); CMSAPI void CMSEXPORT cmsSetColorSpace(cmsHPROFILE hProfile, cmsColorSpaceSignature sig); -CMSAPI cmsProfileClassSignature +CMSAPI cmsProfileClassSignature CMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile); CMSAPI void CMSEXPORT cmsSetDeviceClass(cmsHPROFILE hProfile, cmsProfileClassSignature sig); CMSAPI void CMSEXPORT cmsSetProfileVersion(cmsHPROFILE hProfile, cmsFloat64Number Version); @@ -1349,7 +1349,7 @@ CMSAPI cmsBool CMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, cm CMSAPI cmsBool CMSEXPORT cmsIsMatrixShaper(cmsHPROFILE hProfile); CMSAPI cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, int UsedDirection); -// Translate form/to our notation to ICC +// Translate form/to our notation to ICC CMSAPI cmsColorSpaceSignature CMSEXPORT _cmsICCcolorSpace(int OurNotation); CMSAPI int CMSEXPORT _cmsLCMScolorSpace(cmsColorSpaceSignature ProfileSpace); @@ -1368,12 +1368,12 @@ typedef enum { cmsInfoCopyright = 3 } cmsInfoType; -CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info, + const char LanguageCode[3], const char CountryCode[3], wchar_t* Buffer, cmsUInt32Number BufferSize); -CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info, - const char LanguageCode[3], const char CountryCode[3], +CMSAPI cmsUInt32Number CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info, + const char LanguageCode[3], const char CountryCode[3], char* Buffer, cmsUInt32Number BufferSize); // IO handlers ---------------------------------------------------------------------------------------------------------- @@ -1450,19 +1450,19 @@ CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void); CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID, int nLUTPoints, - cmsFloat64Number Bright, + cmsFloat64Number Bright, cmsFloat64Number Contrast, cmsFloat64Number Hue, cmsFloat64Number Saturation, - int TempSrc, + int TempSrc, int TempDest); CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(int nLUTPoints, - cmsFloat64Number Bright, + cmsFloat64Number Bright, cmsFloat64Number Contrast, cmsFloat64Number Hue, cmsFloat64Number Saturation, - int TempSrc, + int TempSrc, int TempDest); CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID); @@ -1503,14 +1503,14 @@ CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsUInt32Number nMax, c // Misc #define cmsFLAGS_BLACKPOINTCOMPENSATION 0x2000 -#define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot +#define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot #define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accurancy #define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resouces // For devicelink creation #define cmsFLAGS_8BITS_DEVICELINK 0x0008 // Create 8 bits devicelinks #define cmsFLAGS_GUESSDEVICECLASS 0x0020 // Guess device class (for transform2devicelink) -#define cmsFLAGS_KEEP_SEQUENCE 0x0080 // Keep profile sequence for devicelink creation +#define cmsFLAGS_KEEP_SEQUENCE 0x0080 // Keep profile sequence for devicelink creation // Specific to a particular optimizations #define cmsFLAGS_FORCE_CLUT 0x0002 // Force CLUT optimization @@ -1577,12 +1577,12 @@ CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hPr CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, - cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[], - cmsBool BPC[], - cmsUInt32Number Intents[], + cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[], + cmsBool BPC[], + cmsUInt32Number Intents[], cmsFloat64Number AdaptationStates[], cmsHPROFILE hGamutProfile, - cmsUInt32Number nGamutPCSposition, + cmsUInt32Number nGamutPCSposition, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number dwFlags); @@ -1608,16 +1608,16 @@ CMSAPI cmsContext CMSEXPORT cmsGetTransformContextID(cmsHTRANSFORM hTransf typedef enum { cmsPS_RESOURCE_CSA, cmsPS_RESOURCE_CRD } cmsPSResourceType; // lcms2 unified method to access postscript color resources -CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptColorResource(cmsContext ContextID, +CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptColorResource(cmsContext ContextID, cmsPSResourceType Type, - cmsHPROFILE hProfile, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags, + cmsHPROFILE hProfile, + cmsUInt32Number Intent, + cmsUInt32Number dwFlags, cmsIOHANDLER* io); CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCSA(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen); CMSAPI cmsUInt32Number CMSEXPORT cmsGetPostScriptCRD(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen); - + // IT8.7 / CGATS.17-200x handling ----------------------------------------------------------------------------- @@ -1653,16 +1653,16 @@ CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsHANDLE hIT8, const cha CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumProperties(cmsHANDLE hIT8, char ***PropertyNames); // Datasets -CMSAPI const char* CMSEXPORT cmsIT8GetDataRowCol(cmsHANDLE hIT8, int row, int col); +CMSAPI const char* CMSEXPORT cmsIT8GetDataRowCol(cmsHANDLE hIT8, int row, int col); CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsHANDLE hIT8, int row, int col); -CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowCol(cmsHANDLE hIT8, int row, int col, +CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowCol(cmsHANDLE hIT8, int row, int col, const char* Val); -CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowColDbl(cmsHANDLE hIT8, int row, int col, +CMSAPI cmsBool CMSEXPORT cmsIT8SetDataRowColDbl(cmsHANDLE hIT8, int row, int col, cmsFloat64Number Val); -CMSAPI const char* CMSEXPORT cmsIT8GetData(cmsHANDLE hIT8, const char* cPatch, const char* cSample); +CMSAPI const char* CMSEXPORT cmsIT8GetData(cmsHANDLE hIT8, const char* cPatch, const char* cSample); CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetDataDbl(cmsHANDLE hIT8, const char* cPatch, const char* cSample); @@ -1705,7 +1705,7 @@ CMSAPI cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile); // Poor man's gamut mapping -CMSAPI cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab, +CMSAPI cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab, double amax, double amin, double bmax, double bmin); diff --git a/include/lcms2_plugin.h b/include/lcms2_plugin.h index 249be06..1969936 100644 --- a/include/lcms2_plugin.h +++ b/include/lcms2_plugin.h @@ -3,22 +3,22 @@ // Little Color Management System // Copyright (c) 1998-2010 Marti Maria Saguer // -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the Software +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the Software // is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included in +// The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //--------------------------------------------------------------------------------- @@ -30,14 +30,14 @@ #ifndef __lcms_plugin_H -// Deal with Microsoft's attempt at deprecating C standard runtime functions +// Deal with Microsoft's attempt at deprecating C standard runtime functions #ifdef _MSC_VER # if (_MSC_VER >= 1400) # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS # endif # endif #endif @@ -68,18 +68,18 @@ extern "C" { #define VZ 2 // Vectors -typedef struct { +typedef struct { cmsFloat64Number n[3]; } cmsVEC3; -// 3x3 Matrix -typedef struct { +// 3x3 Matrix +typedef struct { cmsVEC3 v[3]; - } cmsMAT3; + } cmsMAT3; -CMSAPI void CMSEXPORT _cmsVEC3init(cmsVEC3* r, cmsFloat64Number x, cmsFloat64Number y, cmsFloat64Number z); +CMSAPI void CMSEXPORT _cmsVEC3init(cmsVEC3* r, cmsFloat64Number x, cmsFloat64Number y, cmsFloat64Number z); CMSAPI void CMSEXPORT _cmsVEC3minus(cmsVEC3* r, const cmsVEC3* a, const cmsVEC3* b); CMSAPI void CMSEXPORT _cmsVEC3cross(cmsVEC3* r, const cmsVEC3* u, const cmsVEC3* v); CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3dot(const cmsVEC3* u, const cmsVEC3* v); @@ -102,7 +102,7 @@ CMSAPI void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUIn CMSAPI void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size); CMSAPI void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size); -CMSAPI void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); +CMSAPI void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); CMSAPI void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); CMSAPI void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr); CMSAPI void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size); @@ -112,19 +112,19 @@ CMSAPI void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* struct _cms_io_handler { void* stream; // Associated stream, which is implemented differently depending on media. - + cmsContext ContextID; - cmsUInt32Number UsedSpace; + cmsUInt32Number UsedSpace; char PhysicalFile[cmsMAX_PATH]; - - cmsUInt32Number (* Read)(struct _cms_io_handler* iohandler, void *Buffer, - cmsUInt32Number size, + + cmsUInt32Number (* Read)(struct _cms_io_handler* iohandler, void *Buffer, + cmsUInt32Number size, cmsUInt32Number count); cmsBool (* Seek)(struct _cms_io_handler* iohandler, cmsUInt32Number offset); cmsBool (* Close)(struct _cms_io_handler* iohandler); cmsUInt32Number (* Tell)(struct _cms_io_handler* iohandler); - cmsBool (* Write)(struct _cms_io_handler* iohandler, cmsUInt32Number size, - const void* Buffer); + cmsBool (* Write)(struct _cms_io_handler* iohandler, cmsUInt32Number size, + const void* Buffer); }; // Endianess adjust functions @@ -153,8 +153,8 @@ CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Array(cmsIOHANDLER* io, cmsUI // ICC base tag typedef struct { - cmsTagTypeSignature sig; - cmsInt8Number reserved[4]; + cmsTagTypeSignature sig; + cmsInt8Number reserved[4]; } _cmsTagBase; @@ -184,7 +184,7 @@ CMSAPI void CMSEXPORT _cmsDecodeDateTimeNumber(const cmsDateTimeN //---------------------------------------------------------------------------------------------------------- // Plug-in foundation -#define cmsPluginMagicNumber 0x61637070 // 'acpp' +#define cmsPluginMagicNumber 0x61637070 // 'acpp' #define cmsPluginMemHandlerSig 0x6D656D48 // 'memH' #define cmsPluginInterpolationSig 0x696E7048 // 'inpH' @@ -197,8 +197,8 @@ CMSAPI void CMSEXPORT _cmsDecodeDateTimeNumber(const cmsDateTimeN #define cmsPluginOptimizationSig 0x6F707448 // 'optH' typedef struct _cmsPluginBaseStruct { - - cmsUInt32Number Magic; // 'acpp' signature + + cmsUInt32Number Magic; // 'acpp' signature cmsUInt32Number ExpectedVersion; // Expected version of LittleCMS cmsUInt32Number Type; // Type of plug-in struct _cmsPluginBaseStruct* Next; // For multiple plugin definition. NULL for end of list. @@ -217,10 +217,10 @@ typedef struct { // Required void * (* MallocPtr)(cmsContext ContextID, cmsUInt32Number size); - void (* FreePtr)(cmsContext ContextID, void *Ptr); + void (* FreePtr)(cmsContext ContextID, void *Ptr); void * (* ReallocPtr)(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); - // Optional + // Optional void * (* MallocZeroPtr)(cmsContext ContextID, cmsUInt32Number size); void * (* CallocPtr)(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); void * (* DupPtr)(cmsContext ContextID, const void* Org, cmsUInt32Number size); @@ -239,14 +239,14 @@ struct _cms_interp_struc; // and is supposed to be quite fast. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedef void (* _cmsInterpFn16)(register const cmsUInt16Number Input[], - register cmsUInt16Number Output[], + register cmsUInt16Number Output[], register const struct _cms_interp_struc* p); -// Floating point forward interpolation. Full precision interpolation using floats. This is not a +// Floating point forward interpolation. Full precision interpolation using floats. This is not a // time critical function. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedef void (* _cmsInterpFnFloat)(cmsFloat32Number const Input[], - cmsFloat32Number Output[], + cmsFloat32Number Output[], const struct _cms_interp_struc* p); @@ -273,17 +273,17 @@ typedef struct _cms_interp_struc { // Used on all interpolations. Supplied by l cmsUInt32Number nInputs; // != 1 only in 3D interpolation cmsUInt32Number nOutputs; // != 1 only in 3D interpolation - cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables + cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables cmsUInt32Number Domain[MAX_INPUT_DIMENSIONS]; // Domain = nSamples - 1 cmsUInt32Number opta[MAX_INPUT_DIMENSIONS]; // Optimization for 3D CLUT. This is the number of nodes premultiplied for each - // dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular + // dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular // Samplings may vary according of the number of nodes for each dimension. - + const void *Table; // Points to the actual interpolation table cmsInterpFunction Interpolation; // Points to the function to do the interpolation - } cmsInterpParams; + } cmsInterpParams; // Interpolators factory typedef cmsInterpFunction (* cmsInterpFnFactory)(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags); @@ -299,7 +299,7 @@ typedef struct { //---------------------------------------------------------------------------------------------------------- -// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10 +// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10 // Evaluator callback for user-suplied parametric curves. May implement more than one type typedef cmsFloat64Number (* cmsParametricCurveEvaluator)(cmsInt32Number Type, const cmsFloat64Number Params[10], cmsFloat64Number R); @@ -318,18 +318,18 @@ typedef struct { //---------------------------------------------------------------------------------------------------------- // Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with -// cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across +// cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across // Formatter16 callback struct _cmstransform_struct; typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo, register cmsUInt16Number Values[], - register cmsUInt8Number* Buffer); + register cmsUInt8Number* Buffer); typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo, cmsFloat32Number Values[], - cmsUInt8Number* Buffer); + cmsUInt8Number* Buffer); // This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number typedef union { @@ -344,7 +344,7 @@ typedef union { typedef enum { cmsFormatterInput=0, cmsFormatterOutput=1 } cmsFormatterDirection; typedef cmsFormatter (* cmsFormatterFactory)(cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 - cmsFormatterDirection Dir, + cmsFormatterDirection Dir, cmsUInt32Number dwFlags); // precision // Plug-in may implement an arbitrary number of formatters @@ -356,31 +356,31 @@ typedef struct { //---------------------------------------------------------------------------------------------------------- -// Tag type handler. Each type is free to return anything it wants, and it is up to the caller to -// know in advance what is the type contained in the tag. +// Tag type handler. Each type is free to return anything it wants, and it is up to the caller to +// know in advance what is the type contained in the tag. typedef struct _cms_typehandler_struct { - + cmsTagTypeSignature Signature; // The signature of the type - + // Allocates and reads items void * (* ReadPtr)(struct _cms_typehandler_struct* self, - cmsIOHANDLER* io, - cmsUInt32Number* nItems, - cmsUInt32Number SizeOfTag); - + cmsIOHANDLER* io, + cmsUInt32Number* nItems, + cmsUInt32Number SizeOfTag); + // Writes n Items cmsBool (* WritePtr)(struct _cms_typehandler_struct* self, - cmsIOHANDLER* io, - void* Ptr, - cmsUInt32Number nItems); + cmsIOHANDLER* io, + void* Ptr, + cmsUInt32Number nItems); // Duplicate an item or array of items - void* (* DupPtr)(struct _cms_typehandler_struct* self, - const void *Ptr, + void* (* DupPtr)(struct _cms_typehandler_struct* self, + const void *Ptr, cmsUInt32Number n); - // Free all resources - void (* FreePtr)(struct _cms_typehandler_struct* self, + // Free all resources + void (* FreePtr)(struct _cms_typehandler_struct* self, void *Ptr); // The calling thread @@ -397,17 +397,17 @@ typedef struct { //---------------------------------------------------------------------------------------------------------- -// This is the tag plugin, which identifies tags. For writting, a pointer to function is provided. -// This function should return the desired type for this tag, given the version of profile +// This is the tag plugin, which identifies tags. For writing, a pointer to function is provided. +// This function should return the desired type for this tag, given the version of profile // and the data being serialized. typedef struct { - cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep + cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep // For reading. - cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum) - cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN]; - + cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum) + cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN]; + // For writting cmsTagTypeSignature (* DecideType)(cmsFloat64Number ICCVersion, const void *Data); @@ -424,24 +424,24 @@ typedef struct { //---------------------------------------------------------------------------------------------------------- -// Custom intents. This function should join all profiles specified in the array in +// Custom intents. This function should join all profiles specified in the array in // a single LUT. Any custom intent in the chain redirects to custom function. If more than // one custom intent is found, the one located first is invoked. Usually users should use only one // custom intent, so mixing custom intents in same multiprofile transform is not supported. -typedef cmsPipeline* (* cmsIntentFn)( cmsContext ContextID, +typedef cmsPipeline* (* cmsIntentFn)( cmsContext ContextID, cmsUInt32Number nProfiles, - cmsUInt32Number Intents[], - cmsHPROFILE hProfiles[], + cmsUInt32Number Intents[], + cmsHPROFILE hProfiles[], cmsBool BPC[], cmsFloat64Number AdaptationStates[], cmsUInt32Number dwFlags); -// Each plug-in defines a single intent number. +// Each plug-in defines a single intent number. typedef struct { cmsPluginBase base; - cmsUInt32Number Intent; + cmsUInt32Number Intent; cmsIntentFn Link; char Description[256]; @@ -449,10 +449,10 @@ typedef struct { // The default ICC intents (perceptual, saturation, rel.col and abs.col) -CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID, +CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID, cmsUInt32Number nProfiles, - cmsUInt32Number Intents[], - cmsHPROFILE hProfiles[], + cmsUInt32Number Intents[], + cmsHPROFILE hProfiles[], cmsBool BPC[], cmsFloat64Number AdaptationStates[], cmsUInt32Number dwFlags); @@ -460,63 +460,63 @@ CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID, //---------------------------------------------------------------------------------------------------------- -// Pipelines, Multi Process Elements. +// Pipelines, Multi Process Elements. -typedef void (* _cmsStageEvalFn) (const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage* mpe); +typedef void (* _cmsStageEvalFn) (const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage* mpe); typedef void*(* _cmsStageDupElemFn) (cmsStage* mpe); typedef void (* _cmsStageFreeElemFn) (cmsStage* mpe); // This function allocates a generic MPE -CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID, +CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID, cmsStageSignature Type, - cmsUInt32Number InputChannels, + cmsUInt32Number InputChannels, cmsUInt32Number OutputChannels, _cmsStageEvalFn EvalPtr, // Points to fn that evaluates the element (always in floating point) _cmsStageDupElemFn DupElemPtr, // Points to a fn that duplicates the stage _cmsStageFreeElemFn FreePtr, // Points to a fn that sets the element free void* Data); // A generic pointer to whatever memory needed by the element typedef struct { - cmsPluginBase base; - cmsTagTypeHandler Handler; + cmsPluginBase base; + cmsTagTypeHandler Handler; } cmsPluginMultiProcessElement; //---------------------------------------------------------------------------------------------------------- -// Optimization. Using this plug-in, additional optimization strategies may be implemented. -// The function should return TRUE if any optimization is done on the LUT, this terminates +// Optimization. Using this plug-in, additional optimization strategies may be implemented. +// The function should return TRUE if any optimization is done on the LUT, this terminates // the optimization search. Or FALSE if it is unable to optimize and want to give a chance // to the rest of optimizers. -typedef void (* _cmsOPTeval16Fn)(register const cmsUInt16Number In[], - register cmsUInt16Number Out[], +typedef void (* _cmsOPTeval16Fn)(register const cmsUInt16Number In[], + register cmsUInt16Number Out[], register const void* Data); typedef void (* _cmsOPTfreeDataFn)(cmsContext ContextID, void* Data); typedef void* (* _cmsOPTdupDataFn)(cmsContext ContextID, const void* Data); -typedef cmsBool (* _cmsOPToptimizeFn)(cmsPipeline** Lut, - cmsUInt32Number Intent, - cmsUInt32Number* InputFormat, - cmsUInt32Number* OutputFormat, +typedef cmsBool (* _cmsOPToptimizeFn)(cmsPipeline** Lut, + cmsUInt32Number Intent, + cmsUInt32Number* InputFormat, + cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags); // This function may be used to set the optional evaluator and a block of private data. If private data is being used, an optional // duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality. -CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut, - _cmsOPTeval16Fn Eval16, - void* PrivateData, - _cmsOPTfreeDataFn FreePrivateDataFn, +CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut, + _cmsOPTeval16Fn Eval16, + void* PrivateData, + _cmsOPTfreeDataFn FreePrivateDataFn, _cmsOPTdupDataFn DupPrivateDataFn); typedef struct { - cmsPluginBase base; - + cmsPluginBase base; + // Optimize entry point _cmsOPToptimizeFn OptimizePtr; - + } cmsPluginOptimization; //---------------------------------------------------------------------------------------------------------- diff --git a/testbed/Makefile.am b/testbed/Makefile.am index 37a4671..5fcbd38 100644..100755 --- a/testbed/Makefile.am +++ b/testbed/Makefile.am @@ -16,16 +16,16 @@ testcms_LDFLAGS = @LDFLAGS@ testcms_SOURCES = testcms2.c EXTRA_DIST = sRGBSpac.icm bad.icc toosmall.icc UncoatedFOGRA29.icc \ - USWebCoatedSWOP.icc sRGB_v4_ICC_preference.icc + USWebCoatedSWOP.icc sRGB_v4_ICC_preference.icc \ + sRGB_Color_Space_Profile.icm check: + if [ $(top_srcdir) != $(top_builddir) ]; then \ + cp $(top_srcdir)/testbed/*.ic? $(top_builddir)/testbed; \ + fi ./testcms + if [ $(top_srcdir) != $(top_builddir) ]; then \ + rm -f $(top_builddir)/testbed/*.ic?; \ + fi + -dist-hook: - cp -p $(srcdir)/"sRGB Color Space Profile.icm" $(distdir) - cp -p $(srcdir)/sRGBSpac.icm $(distdir) - cp -p $(srcdir)/bad.icc $(distdir) - cp -p $(srcdir)/toosmall.icc $(distdir) - cp -p $(srcdir)/UncoatedFOGRA29.icc $(distdir) - cp -p $(srcdir)/USWebCoatedSWOP.icc $(distdir) - cp -p $(srcdir)/sRGB_v4_ICC_preference.icc $(distdir) diff --git a/testbed/Makefile.in b/testbed/Makefile.in index f790607..8eb1aac 100644 --- a/testbed/Makefile.in +++ b/testbed/Makefile.in @@ -215,7 +215,8 @@ testcms_LDADD = $(top_builddir)/src/liblcms2.la testcms_LDFLAGS = @LDFLAGS@ testcms_SOURCES = testcms2.c EXTRA_DIST = sRGBSpac.icm bad.icc toosmall.icc UncoatedFOGRA29.icc \ - USWebCoatedSWOP.icc sRGB_v4_ICC_preference.icc + USWebCoatedSWOP.icc sRGB_v4_ICC_preference.icc \ + sRGB_Color_Space_Profile.icm all: all-am @@ -375,9 +376,6 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am @@ -460,7 +458,7 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool ctags \ - dist-hook distclean distclean-compile distclean-generic \ + distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ @@ -472,16 +470,13 @@ uninstall-am: uninstall-info-am check: + if [ $(top_srcdir) != $(top_builddir) ]; then \ + cp $(top_srcdir)/testbed/*.ic? $(top_builddir)/testbed; \ + fi ./testcms - -dist-hook: - cp -p $(srcdir)/"sRGB Color Space Profile.icm" $(distdir) - cp -p $(srcdir)/sRGBSpac.icm $(distdir) - cp -p $(srcdir)/bad.icc $(distdir) - cp -p $(srcdir)/toosmall.icc $(distdir) - cp -p $(srcdir)/UncoatedFOGRA29.icc $(distdir) - cp -p $(srcdir)/USWebCoatedSWOP.icc $(distdir) - cp -p $(srcdir)/sRGB_v4_ICC_preference.icc $(distdir) + if [ $(top_srcdir) != $(top_builddir) ]; then \ + rm -f $(top_builddir)/testbed/*.ic?; \ + fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/testbed/sRGB Color Space Profile.icm b/testbed/sRGB_Color_Space_Profile.icm Binary files differindex 7f9d18d..7f9d18d 100755 --- a/testbed/sRGB Color Space Profile.icm +++ b/testbed/sRGB_Color_Space_Profile.icm diff --git a/testbed/testcms2.c b/testbed/testcms2.c index 552965c..689b35a 100644..100755 --- a/testbed/testcms2.c +++ b/testbed/testcms2.c @@ -5492,7 +5492,7 @@ int CheckBlackPoint(void) cmsCIEXYZ Black; cmsCIELab Lab; - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "sRGB Color Space Profile.icm", "r"); + hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "sRGB_Color_Space_Profile.icm", "r"); cmsDetectBlackPoint(&Black, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(hProfile); @@ -5708,14 +5708,14 @@ void GenerateCRD(const char* cOutProf, const char* FileName) static int CheckPostScript(void) { - GenerateCSA("sRGB Color Space Profile.icm", "sRGB_CSA.ps"); + GenerateCSA("sRGB_Color_Space_Profile.icm", "sRGB_CSA.ps"); GenerateCSA("aRGBlcms2.icc", "aRGB_CSA.ps"); GenerateCSA("sRGB_v4_ICC_preference.icc", "sRGBV4_CSA.ps"); GenerateCSA("USWebCoatedSWOP.icc", "SWOP_CSA.ps"); GenerateCSA(NULL, "Lab_CSA.ps"); GenerateCSA("graylcms2.icc", "gray_CSA.ps"); - GenerateCRD("sRGB Color Space Profile.icm", "sRGB_CRD.ps"); + GenerateCRD("sRGB_Color_Space_Profile.icm", "sRGB_CRD.ps"); GenerateCRD("aRGBlcms2.icc", "aRGB_CRD.ps"); GenerateCRD(NULL, "Lab_CRD.ps"); GenerateCRD("USWebCoatedSWOP.icc", "SWOP_CRD.ps"); @@ -6033,11 +6033,11 @@ void SpeedTest(void) { SpeedTest16bits("16 bits on CLUT profiles", - cmsOpenProfileFromFileTHR(DbgThread(), "sRGB Color Space Profile.icm", "r"), + cmsOpenProfileFromFileTHR(DbgThread(), "sRGB_Color_Space_Profile.icm", "r"), cmsOpenProfileFromFileTHR(DbgThread(), "sRGBSpac.icm", "r")); SpeedTest8bits("8 bits on CLUT profiles", - cmsOpenProfileFromFileTHR(DbgThread(), "sRGB Color Space Profile.icm", "r"), + cmsOpenProfileFromFileTHR(DbgThread(), "sRGB_Color_Space_Profile.icm", "r"), cmsOpenProfileFromFileTHR(DbgThread(), "sRGBSpac.icm", "r"), INTENT_PERCEPTUAL); |