/hg/icedtea6: PR1502: Allow use of system LCMS 2
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Dec 19 18:51:29 PST 2013
changeset 97ed56b5fc9e in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=97ed56b5fc9e
author: Andrew John Hughes <gnu.andrew at redhat.com>
date: Fri Dec 20 02:51:08 2013 +0000
PR1502: Allow use of system LCMS 2
2013-12-19 Andrew John Hughes <gnu.andrew at redhat.com>
PR1502: Allow use of system LCMS 2
* patches/openjdk/lcms2/8007925-improve_cmsstagealloclabv2tov4curves.patch,
* patches/openjdk/lcms2/8007927-improve_cmsallocprofilesequencedescription.patch,
* patches/openjdk/lcms2/8007929-improve_curvesalloc.patch,
* patches/openjdk/lcms2/8009654-cmsnamed_stability.patch:
Moved to...
* patches/openjdk/lcms2/bundled/8007925-improve_cmsstagealloclabv2tov4curves.patch,
* patches/openjdk/lcms2/bundled/8007927-improve_cmsallocprofilesequencedescription.patch,
* patches/openjdk/lcms2/bundled/8007929-improve_curvesalloc.patch,
* patches/openjdk/lcms2/bundled/8009654-cmsnamed_stability.patch:
...here.
* Makefile.am:
(ICEDTEA_PATCHES): Apply certain LCMS patches only when
not building using the system library.
* patches/ecj/icedtea.patch: Only rename header if it
exists.
* patches/openjdk/lcms2/6523398-writing_tags.patch,
* patches/openjdk/lcms2/7042594-tck_failure.patch,
* patches/openjdk/lcms2/7053526-lcms_2.4.patch:
Move patches to bundled LCMS 2 into...
* patches/openjdk/lcms2/bundled/6523398-writing_tags.patch,
* patches/openjdk/lcms2/bundled/7042594-tck_failure.patch,
* patches/openjdk/lcms2/bundled/7053526-lcms_2.4.patch:
...these files.
* NEWS: Updated.
2011-05-04 Andrew John Hughes <ahughes at redhat.com>
* remove-intree-libraries.sh: Renamed.
* INSTALL: Updated with new option.
* Makefile.am:
(ICEDTEA_ENV): Set USE_SYSTEM_LCMS, LCMS_LIBS
and LCMS_CFLAGS if building with system LCMS.
* acinclude.m4:
(IT_CHECK_FOR_LCMS): Provide the --enable-system-lcms
option, enabled by default.
* configure.ac:
Call IT_CHECK_FOR_LCMS.
* remove-intree-libraries.sh.in:
Delete LCMS source code only if system version is
being used.
diffstat:
ChangeLog | 44 +
INSTALL | 2 +
Makefile.am | 23 +-
NEWS | 1 +
acinclude.m4 | 26 +-
configure.ac | 3 +
patches/ecj/icedtea.patch | 4 +-
patches/openjdk/lcms2/6523398-writing_tags.patch | 50131 ----------
patches/openjdk/lcms2/7042594-tck_failure.patch | 15 -
patches/openjdk/lcms2/7053526-lcms_2.4.patch | 10081 --
patches/openjdk/lcms2/8007925-improve_cmsstagealloclabv2tov4curves.patch | 30 -
patches/openjdk/lcms2/8007927-improve_cmsallocprofilesequencedescription.patch | 23 -
patches/openjdk/lcms2/8007929-improve_curvesalloc.patch | 28 -
patches/openjdk/lcms2/8009654-cmsnamed_stability.patch | 38 -
patches/openjdk/lcms2/bundled/6523398-writing_tags.patch | 48703 +++++++++
patches/openjdk/lcms2/bundled/7042594-tck_failure.patch | 15 +
patches/openjdk/lcms2/bundled/7053526-lcms_2.4.patch | 10043 ++
patches/openjdk/lcms2/bundled/8007925-improve_cmsstagealloclabv2tov4curves.patch | 30 +
patches/openjdk/lcms2/bundled/8007927-improve_cmsallocprofilesequencedescription.patch | 23 +
patches/openjdk/lcms2/bundled/8007929-improve_curvesalloc.patch | 28 +
patches/openjdk/lcms2/bundled/8009654-cmsnamed_stability.patch | 38 +
remove-intree-libraries.sh | 71 -
remove-intree-libraries.sh.in | 111 +
23 files changed, 59086 insertions(+), 60425 deletions(-)
diffs (truncated from 119671 to 500 lines):
diff -r 3d60006909d8 -r 97ed56b5fc9e ChangeLog
--- a/ChangeLog Wed Dec 18 18:27:02 2013 +0000
+++ b/ChangeLog Fri Dec 20 02:51:08 2013 +0000
@@ -1,3 +1,47 @@
+2013-12-19 Andrew John Hughes <gnu.andrew at redhat.com>
+
+ PR1502: Allow use of system LCMS 2
+ * patches/openjdk/lcms2/8007925-improve_cmsstagealloclabv2tov4curves.patch,
+ * patches/openjdk/lcms2/8007927-improve_cmsallocprofilesequencedescription.patch,
+ * patches/openjdk/lcms2/8007929-improve_curvesalloc.patch,
+ * patches/openjdk/lcms2/8009654-cmsnamed_stability.patch:
+ Moved to...
+ * patches/openjdk/lcms2/bundled/8007925-improve_cmsstagealloclabv2tov4curves.patch,
+ * patches/openjdk/lcms2/bundled/8007927-improve_cmsallocprofilesequencedescription.patch,
+ * patches/openjdk/lcms2/bundled/8007929-improve_curvesalloc.patch,
+ * patches/openjdk/lcms2/bundled/8009654-cmsnamed_stability.patch:
+ ...here.
+ * Makefile.am:
+ (ICEDTEA_PATCHES): Apply certain LCMS patches only when
+ not building using the system library.
+ * patches/ecj/icedtea.patch: Only rename header if it
+ exists.
+ * patches/openjdk/lcms2/6523398-writing_tags.patch,
+ * patches/openjdk/lcms2/7042594-tck_failure.patch,
+ * patches/openjdk/lcms2/7053526-lcms_2.4.patch:
+ Move patches to bundled LCMS 2 into...
+ * patches/openjdk/lcms2/bundled/6523398-writing_tags.patch,
+ * patches/openjdk/lcms2/bundled/7042594-tck_failure.patch,
+ * patches/openjdk/lcms2/bundled/7053526-lcms_2.4.patch:
+ ...these files.
+ * NEWS: Updated.
+
+2011-05-04 Andrew John Hughes <ahughes at redhat.com>
+
+ * remove-intree-libraries.sh: Renamed.
+ * INSTALL: Updated with new option.
+ * Makefile.am:
+ (ICEDTEA_ENV): Set USE_SYSTEM_LCMS, LCMS_LIBS
+ and LCMS_CFLAGS if building with system LCMS.
+ * acinclude.m4:
+ (IT_CHECK_FOR_LCMS): Provide the --enable-system-lcms
+ option, enabled by default.
+ * configure.ac:
+ Call IT_CHECK_FOR_LCMS.
+ * remove-intree-libraries.sh.in:
+ Delete LCMS source code only if system version is
+ being used.
+
2013-12-18 Andrew John Hughes <gnu.andrew at member.fsf.org>
* NEWS: Include changes new to b29.
diff -r 3d60006909d8 -r 97ed56b5fc9e INSTALL
--- a/INSTALL Wed Dec 18 18:27:02 2013 +0000
+++ b/INSTALL Fri Dec 20 02:51:08 2013 +0000
@@ -88,6 +88,8 @@
* --disable-optimizations: Build with -O0.
* --enable-hg: Checkout the OpenJDK tree from Mercurial, rather than
downloading and extracting a tarball.
+* --enable-system-lcms: Build using the system installation of LCMS2, not
+ the version in-tree.
* --with-gcj: Compile ecj to native code with gcj prior to building.
* --disable-bootstrap: Perform a quick build using an installed
copy of IcedTea6. If a directory is not specified, a check against
diff -r 3d60006909d8 -r 97ed56b5fc9e Makefile.am
--- a/Makefile.am Wed Dec 18 18:27:02 2013 +0000
+++ b/Makefile.am Fri Dec 20 02:51:08 2013 +0000
@@ -295,13 +295,19 @@
patches/openjdk/lcms2/6988213-windows_build_failure.patch \
patches/openjdk/lcms2/system_lcms2.patch \
patches/openjdk/lcms2/7053526-lcms_2.4.patch \
- patches/openjdk/lcms2/8007929-improve_curvesalloc.patch \
- patches/openjdk/lcms2/8007925-improve_cmsstagealloclabv2tov4curves.patch \
- patches/openjdk/lcms2/8009654-cmsnamed_stability.patch \
patches/openjdk/lcms2/7002766-parfait.patch \
patches/openjdk/lcms2/7042594-tck_failure.patch \
- patches/openjdk/lcms2/8007927-improve_cmsallocprofilesequencedescription.patch \
patches/lcms2-emulate_old_settagdata.patch
+if !USE_SYSTEM_LCMS
+LCMS_PATCHES += \
+ patches/openjdk/lcms2/bundled/6523398-writing_tags.patch \
+ patches/openjdk/lcms2/bundled/7053526-lcms_2.4.patch \
+ patches/openjdk/lcms2/bundled/8007929-improve_curvesalloc.patch \
+ patches/openjdk/lcms2/bundled/8007925-improve_cmsstagealloclabv2tov4curves.patch \
+ patches/openjdk/lcms2/bundled/8009654-cmsnamed_stability.patch \
+ patches/openjdk/lcms2/bundled/7042594-tck_failure.patch \
+ patches/openjdk/lcms2/bundled/8007927-improve_cmsallocprofilesequencedescription.patch
+endif
else
LCMS_PATCHES = \
patches/lcms.patch
@@ -832,6 +838,13 @@
RHINO_JAR="$(abs_top_builddir)/rhino/rhino.jar"
endif
+if USE_SYSTEM_LCMS
+ICEDTEA_ENV += \
+ USE_SYSTEM_LCMS="true" \
+ LCMS_LIBS="${LCMS2_LIBS}" \
+ LCMS_CFLAGS="${LCMS2_CFLAGS}"
+endif
+
if USE_SYSTEM_KERBEROS
ICEDTEA_ENV += \
SYSTEM_KRB5="true" \
@@ -1259,7 +1272,7 @@
rm -f stamps/ports.stamp
stamps/remove-intree-libraries.stamp: stamps/extract-openjdk.stamp
- sh $(srcdir)/remove-intree-libraries.sh
+ sh $(abs_top_builddir)/remove-intree-libraries.sh
touch stamps/remove-intree-librares.stamp
clean-remove-intree-libraries:
diff -r 3d60006909d8 -r 97ed56b5fc9e NEWS
--- a/NEWS Wed Dec 18 18:27:02 2013 +0000
+++ b/NEWS Fri Dec 20 02:51:08 2013 +0000
@@ -21,6 +21,7 @@
- PR1376: Backport javac detection / usability test from IcedTea 2.x
- PR1501: Backport IcedTea 2.x library removal script
- PR1290: Ensure unlimited crypto policy is in place.
+ - PR1502: Allow use of system LCMS 2
* Import of OpenJDK6 b28
- OJ1: Confirm that community members can commit to hotspot in OpenJDK6
- OJ2: Revert unnecessary file added to hotspot repo
diff -r 3d60006909d8 -r 97ed56b5fc9e acinclude.m4
--- a/acinclude.m4 Wed Dec 18 18:27:02 2013 +0000
+++ b/acinclude.m4 Fri Dec 20 02:51:08 2013 +0000
@@ -1535,7 +1535,31 @@
AM_CONDITIONAL([DISABLE_JDK_TESTS], test x"${disable_jdk_tests}" = "xyes")
])
-
+AC_DEFUN_ONCE([IT_CHECK_FOR_LCMS],
+[
+ AC_MSG_CHECKING([whether to use the system LCMS install])
+ AC_ARG_ENABLE([system-lcms],
+ [AS_HELP_STRING(--enable-system-lcms,use the system LCMS [[default=yes]])],
+ [
+ ENABLE_SYSTEM_LCMS="${enableval}"
+ ],
+ [
+ ENABLE_SYSTEM_LCMS="yes"
+ ])
+ AC_MSG_RESULT(${ENABLE_SYSTEM_LCMS})
+ if test x"${ENABLE_SYSTEM_LCMS}" = "xyes"; then
+ dnl Check for LCMS2 headers and libraries.
+ PKG_CHECK_MODULES(LCMS2, lcms2,[LCMS2_FOUND=yes],[LCMS2_FOUND=no])
+ if test "x${LCMS2_FOUND}" = xno
+ then
+ AC_MSG_ERROR([Could not find LCMS2; install LCMS2 or build with --disable-system-lcms to use the in-tree copy.])
+ fi
+ AC_SUBST(LCMS2_CFLAGS)
+ AC_SUBST(LCMS2_LIBS)
+ fi
+ AM_CONDITIONAL(USE_SYSTEM_LCMS, test x"${ENABLE_SYSTEM_LCMS}" = "xyes")
+ AC_SUBST(ENABLE_SYSTEM_LCMS)
+])
AC_DEFUN_ONCE([IT_GET_PKGVERSION],
[
AC_MSG_CHECKING([for distribution package version])
diff -r 3d60006909d8 -r 97ed56b5fc9e configure.ac
--- a/configure.ac Wed Dec 18 18:27:02 2013 +0000
+++ b/configure.ac Fri Dec 20 02:51:08 2013 +0000
@@ -575,6 +575,9 @@
AC_SUBST(LLVM_LDFLAGS)
AC_SUBST(LLVM_LIBS)
+IT_CHECK_FOR_LCMS
+AC_CONFIG_FILES([remove-intree-libraries.sh])
+
# Arguments passed to configure.
AC_SUBST(CONFIGURE_ARGS)
CONFIGURE_ARGS="$ac_configure_args"
diff -r 3d60006909d8 -r 97ed56b5fc9e patches/ecj/icedtea.patch
--- a/patches/ecj/icedtea.patch Wed Dec 18 18:27:02 2013 +0000
+++ b/patches/ecj/icedtea.patch Fri Dec 20 02:51:08 2013 +0000
@@ -549,8 +549,8 @@
$(JAVAH_CMD) -d $(CLASSHDRDIR)/ \
$(CLASSES.export) $(subst $$,\$$,$(EXPORTED_inner))
@$(java-vm-cleanup)
-+ -mv $(CLASSHDRDIR)/java_lang_ClassLoader\$$NativeLibrary.h \
-+ $(CLASSHDRDIR)/java_lang_ClassLoader_NativeLibrary.h
++ if [ -e $(CLASSHDRDIR)/java_lang_ClassLoader\$$NativeLibrary.h ] ; then mv $(CLASSHDRDIR)/java_lang_ClassLoader\$$NativeLibrary.h \
++ $(CLASSHDRDIR)/java_lang_ClassLoader_NativeLibrary.h ; fi
@$(TOUCH) $@
classheaders.clean:
diff -r 3d60006909d8 -r 97ed56b5fc9e patches/openjdk/lcms2/6523398-writing_tags.patch
--- a/patches/openjdk/lcms2/6523398-writing_tags.patch Wed Dec 18 18:27:02 2013 +0000
+++ b/patches/openjdk/lcms2/6523398-writing_tags.patch Fri Dec 20 02:51:08 2013 +0000
@@ -1074,50134 +1074,3 @@
- return TRUE;
+ return TRUE;
}
-diff --git a/src/share/native/sun/java2d/cmm/lcms/cmscam02.c b/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
-+++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
-@@ -27,9 +27,10 @@
- // However, the following notice accompanied the original version of this
- // file:
- //
-+//---------------------------------------------------------------------------------
- //
--// Little cms
--// Copyright (C) 1998-2007 Marti Maria
-+// 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"),
-@@ -48,69 +49,65 @@
- // 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.
-+//
-+//---------------------------------------------------------------------------------
-+//
-
--
-+#include "lcms2_internal.h"
-
- // CIECAM 02 appearance model. Many thanks to Jordi Vilar for the debugging.
-
--#include "lcms.h"
--
--
--LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC);
--LCMSAPI void LCMSEXPORT cmsCIECAM02Done(LCMSHANDLE hModel);
--LCMSAPI void LCMSEXPORT cmsCIECAM02Forward(LCMSHANDLE hModel, LPcmsCIEXYZ pIn, LPcmsJCh pOut);
--LCMSAPI void LCMSEXPORT cmsCIECAM02Reverse(LCMSHANDLE hModel, LPcmsJCh pIn, LPcmsCIEXYZ pOut);
--
--
- // ---------- Implementation --------------------------------------------
-
- typedef struct {
-
-- double XYZ[3];
-- double RGB[3];
-- double RGBc[3];
-- double RGBp[3];
-- double RGBpa[3];
-- double a, b, h, e, H, A, J, Q, s, t, C, M;
-- double abC[2];
-- double abs[2];
-- double abM[2];
-+ cmsFloat64Number XYZ[3];
-+ cmsFloat64Number RGB[3];
-+ cmsFloat64Number RGBc[3];
-+ cmsFloat64Number RGBp[3];
-+ cmsFloat64Number RGBpa[3];
-+ cmsFloat64Number a, b, h, e, H, A, J, Q, s, t, C, M;
-+ cmsFloat64Number abC[2];
-+ cmsFloat64Number abs[2];
-+ cmsFloat64Number abM[2];
-
--} CAM02COLOR, *LPCAM02COLOR;
-+} CAM02COLOR;
-
- typedef struct {
-
- CAM02COLOR adoptedWhite;
-- double LA, Yb;
-- double F, c, Nc;
-- int surround;
-- double n, Nbb, Ncb, z, FL, D;
-+ cmsFloat64Number LA, Yb;
-+ cmsFloat64Number F, c, Nc;
-+ cmsUInt32Number surround;
-+ cmsFloat64Number n, Nbb, Ncb, z, FL, D;
-
--} cmsCIECAM02, *LPcmsCIECAM02;
-+ cmsContext ContextID;
-+
-+} cmsCIECAM02;
-
-
- static
--double compute_n(LPcmsCIECAM02 pMod)
-+cmsFloat64Number compute_n(cmsCIECAM02* pMod)
- {
-- return(pMod -> Yb / pMod -> adoptedWhite.XYZ[1]);
-+ return (pMod -> Yb / pMod -> adoptedWhite.XYZ[1]);
- }
-
- static
--double compute_z(LPcmsCIECAM02 pMod)
-+cmsFloat64Number compute_z(cmsCIECAM02* pMod)
- {
-- return(1.48 + pow(pMod -> n, 0.5));
-+ return (1.48 + pow(pMod -> n, 0.5));
- }
-
- static
--double computeNbb(LPcmsCIECAM02 pMod)
-+cmsFloat64Number computeNbb(cmsCIECAM02* pMod)
- {
-- return(0.725 * pow((1.0 / pMod -> n), 0.2));
-+ return (0.725 * pow((1.0 / pMod -> n), 0.2));
- }
-
- static
--double computeFL(LPcmsCIECAM02 pMod)
-+cmsFloat64Number computeFL(cmsCIECAM02* pMod)
- {
-- double k, FL;
-+ cmsFloat64Number k, FL;
-
- k = 1.0 / ((5.0 * pMod->LA) + 1.0);
- FL = 0.2 * pow(k, 4.0) * (5.0 * pMod->LA) + 0.1 *
-@@ -121,9 +118,9 @@
- }
-
- static
--double computeD(LPcmsCIECAM02 pMod)
-+cmsFloat64Number computeD(cmsCIECAM02* pMod)
- {
-- double D;
-+ cmsFloat64Number D;
-
- D = pMod->F - (1.0/3.6)*(exp(((-pMod ->LA-42) / 92.0)));
-
-@@ -142,9 +139,10 @@
- }
-
- static
--CAM02COLOR ChromaticAdaptation(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR ChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-- int i;
-+ cmsUInt32Number i;
-+
- for (i = 0; i < 3; i++) {
- clr.RGBc[i] = ((pMod -> adoptedWhite.XYZ[1] *
- (pMod->D / pMod -> adoptedWhite.RGB[i])) +
-@@ -156,11 +154,9 @@
-
-
- static
--CAM02COLOR CAT02toHPE (CAM02COLOR clr)
-+CAM02COLOR CAT02toHPE(CAM02COLOR clr)
- {
--
-- double M[9];
--
-+ cmsFloat64Number M[9];
-
- M[0] =(( 0.38971 * 1.096124) + (0.68898 * 0.454369) + (-0.07868 * -0.009628));
- M[1] =(( 0.38971 * -0.278869) + (0.68898 * 0.473533) + (-0.07868 * -0.005698));
-@@ -180,10 +176,10 @@
- }
-
- static
--CAM02COLOR NonlinearCompression(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR NonlinearCompression(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-- int i;
-- double temp;
-+ cmsUInt32Number i;
-+ cmsFloat64Number temp;
-
- for (i = 0; i < 3; i++) {
- if (clr.RGBp[i] < 0) {
-@@ -204,9 +200,9 @@
- }
-
- static
--CAM02COLOR ComputeCorrelates(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR ComputeCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-- double a, b, temp, e, t, r2d, d2r;
-+ cmsFloat64Number a, b, temp, e, t, r2d, d2r;
-
- a = clr.RGBpa[0] - (12.0 * clr.RGBpa[1] / 11.0) + (clr.RGBpa[2] / 11.0);
- b = (clr.RGBpa[0] + clr.RGBpa[1] - (2.0 * clr.RGBpa[2])) / 9.0;
-@@ -274,10 +270,10 @@
-
-
- static
--CAM02COLOR InverseCorrelates(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR InverseCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-
-- double t, e, p1, p2, p3, p4, p5, hr, d2r;
-+ cmsFloat64Number t, e, p1, p2, p3, p4, p5, hr, d2r;
- d2r = 3.141592654 / 180.0;
-
- t = pow( (clr.C / (pow((clr.J / 100.0), 0.5) *
-@@ -327,10 +323,10 @@
- }
-
- static
--CAM02COLOR InverseNonlinearity(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR InverseNonlinearity(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-- int i;
-- double c1;
-+ cmsUInt32Number i;
-+ cmsFloat64Number c1;
-
- for (i = 0; i < 3; i++) {
- if ((clr.RGBpa[i] - 0.1) < 0) c1 = -1;
-@@ -347,7 +343,7 @@
- static
- CAM02COLOR HPEtoCAT02(CAM02COLOR clr)
- {
-- double M[9];
-+ cmsFloat64Number M[9];
-
- M[0] = (( 0.7328 * 1.910197) + (0.4296 * 0.370950));
- M[1] = (( 0.7328 * -1.112124) + (0.4296 * 0.629054));
-@@ -362,19 +358,19 @@
- clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]);
- clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]);
- clr.RGBc[2] = (clr.RGBp[0] * M[6]) + (clr.RGBp[1] * M[7]) + (clr.RGBp[2] * M[8]);
-- return (clr);
-+ return clr;
- }
-
-
- static
--CAM02COLOR InverseChromaticAdaptation(CAM02COLOR clr, LPcmsCIECAM02 pMod)
-+CAM02COLOR InverseChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod)
- {
-- int i;
-+ cmsUInt32Number i;
- for (i = 0; i < 3; i++) {
- clr.RGB[i] = clr.RGBc[i] /
- ((pMod->adoptedWhite.XYZ[1] * pMod->D / pMod->adoptedWhite.RGB[i]) + 1.0 - pMod->D);
- }
-- return(clr);
-+ return clr;
- }
-
-
-@@ -385,23 +381,21 @@
- clr.XYZ[1] = (clr.RGB[0] * 0.454369) + (clr.RGB[1] * 0.473533) + (clr.RGB[2] * 0.072098);
- clr.XYZ[2] = (clr.RGB[0] * -0.009628) + (clr.RGB[1] * -0.005698) + (clr.RGB[2] * 1.015326);
-
-- return(clr);
-+ return clr;
- }
-
-
-+cmsHANDLE CMSEXPORT cmsCIECAM02Init(cmsContext ContextID, const cmsViewingConditions* pVC)
-+{
-+ cmsCIECAM02* lpMod;
-
-+ _cmsAssert(pVC != NULL);
-
--LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC)
--{
-- LPcmsCIECAM02 lpMod;
--
--
-- if((lpMod = (LPcmsCIECAM02) _cmsMalloc(sizeof(cmsCIECAM02))) == NULL) {
-- return (LCMSHANDLE) NULL;
-+ if((lpMod = (cmsCIECAM02*) _cmsMallocZero(ContextID, sizeof(cmsCIECAM02))) == NULL) {
-+ return NULL;
- }
-
--
-- ZeroMemory(lpMod, sizeof(cmsCIECAM02));
-+ lpMod ->ContextID = ContextID;
-
- lpMod ->adoptedWhite.XYZ[0] = pVC ->whitePoint.X;
- lpMod ->adoptedWhite.XYZ[1] = pVC ->whitePoint.Y;
-@@ -414,36 +408,30 @@
-
- switch (lpMod -> surround) {
-
-- case AVG_SURROUND_4:
-- lpMod->F = 1.0; // Not included in CAM02
-- lpMod->c = 0.69;
-- lpMod->Nc = 1.0;
-- break;
-
-- case CUTSHEET_SURROUND:
-- lpMod->F = 0.8;
-- lpMod->c = 0.41;
-- lpMod->Nc = 0.8;
-- break;
-+ case CUTSHEET_SURROUND:
-+ lpMod->F = 0.8;
-+ lpMod->c = 0.41;
-+ lpMod->Nc = 0.8;
-+ break;
-
-- case DARK_SURROUND:
-- lpMod -> F = 0.8;
-- lpMod -> c = 0.525;
-- lpMod -> Nc = 0.8;
-- break;
-+ case DARK_SURROUND:
-+ lpMod -> F = 0.8;
-+ lpMod -> c = 0.525;
-+ lpMod -> Nc = 0.8;
-+ break;
-
-+ case DIM_SURROUND:
-+ lpMod -> F = 0.9;
More information about the distro-pkg-dev
mailing list