summaryrefslogtreecommitdiff
path: root/lcms2mt
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-02-17 16:04:27 +0000
committerRobin Watts <Robin.Watts@artifex.com>2021-02-17 16:55:05 +0000
commit82dce7f8f6b5218f7943eadff0f01d0e278850fa (patch)
tree7cd334c4ce1fb378ba535dc172c9957d5a5c3982 /lcms2mt
parent5882f2d765a9348c6f6e2cc45353a06924930c88 (diff)
downloadghostpdl-82dce7f8f6b5218f7943eadff0f01d0e278850fa.tar.gz
Update lcms2mt to lcms2 2.12.
Diffstat (limited to 'lcms2mt')
-rw-r--r--lcms2mt/COPYING19
-rw-r--r--lcms2mt/ChangeLog26
-rw-r--r--lcms2mt/Makefile.am24
-rw-r--r--lcms2mt/Makefile.in75
-rw-r--r--lcms2mt/Projects/.gitignore5
-rw-r--r--lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc12
-rw-r--r--lcms2mt/Projects/VC2013/lcms2mt.rc4
-rw-r--r--lcms2mt/Projects/VC2015/lcms2mt.rc10
-rw-r--r--lcms2mt/Projects/VC2017/lcms2mt.rc10
-rw-r--r--lcms2mt/Projects/VC2019/lcms2mt.rc10
-rw-r--r--lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj2
-rw-r--r--lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj4
-rw-r--r--lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj16
-rw-r--r--lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj16
-rw-r--r--lcms2mt/README.1ST8
-rw-r--r--lcms2mt/aclocal.m4191
-rw-r--r--lcms2mt/configure404
-rw-r--r--lcms2mt/configure.ac51
-rw-r--r--lcms2mt/include/Makefile.in14
-rw-r--r--lcms2mt/include/lcms2mt.h11
-rw-r--r--lcms2mt/include/lcms2mt_plugin.h33
-rw-r--r--lcms2mt/lcms2mt.pc.in2
-rw-r--r--lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj2
-rw-r--r--lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters12
-rw-r--r--lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h15
-rw-r--r--lcms2mt/plugins/fast_float/src/Makefile.am9
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_16_tethra.c20
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_8_curves.c16
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_8_matsh.c58
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_8_tethra.c15
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_15bits.c11
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_15mats.c3
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_cmyk.c297
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_curves.c265
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_internal.h91
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_matsh.c98
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_separate.c2
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_sup.c50
-rw-r--r--lcms2mt/plugins/fast_float/src/fast_float_tethra.c224
-rw-r--r--lcms2mt/plugins/fast_float/testbed/Makefile.am12
-rw-r--r--lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c524
-rw-r--r--lcms2mt/plugins/fast_float/testbed/test0.iccbin560 -> 568 bytes
-rw-r--r--lcms2mt/src/Makefile.in148
-rw-r--r--lcms2mt/src/cmsalpha.c27
-rw-r--r--lcms2mt/src/cmscgats.c21
-rw-r--r--lcms2mt/src/cmscnvrt.c93
-rw-r--r--lcms2mt/src/cmsgamma.c76
-rw-r--r--lcms2mt/src/cmsintrp.c534
-rw-r--r--lcms2mt/src/cmsio0.c31
-rw-r--r--lcms2mt/src/cmslut.c12
-rw-r--r--lcms2mt/src/cmsnamed.c20
-rw-r--r--lcms2mt/src/cmsopt.c28
-rw-r--r--lcms2mt/src/cmspack.c2
-rw-r--r--lcms2mt/src/cmspcs.c2
-rw-r--r--lcms2mt/src/cmsplugin.c39
-rw-r--r--lcms2mt/src/cmsps2.c11
-rw-r--r--lcms2mt/src/cmssamp.c4
-rw-r--r--lcms2mt/src/cmstypes.c20
-rw-r--r--lcms2mt/src/cmsxform.c89
-rw-r--r--lcms2mt/src/extra_xform.h4
-rw-r--r--lcms2mt/src/lcms2_internal.h28
-rw-r--r--lcms2mt/src/lcms2mt.def1
-rw-r--r--lcms2mt/testbed/Makefile.am4
-rw-r--r--lcms2mt/testbed/Makefile.in42
-rw-r--r--lcms2mt/testbed/testcms2.c172
-rwxr-xr-xlcms2mt/testbed/testcms2.h4
-rwxr-xr-xlcms2mt/testbed/testplugin.c35
-rwxr-xr-xlcms2mt/testbed/zoo_icc.c2
-rw-r--r--lcms2mt/utils/common/utils.h2
-rw-r--r--lcms2mt/utils/common/vprf.c6
-rw-r--r--lcms2mt/utils/common/xgetopt.c121
-rw-r--r--lcms2mt/utils/jpgicc/Makefile.in16
-rw-r--r--lcms2mt/utils/jpgicc/jpgicc.c133
-rw-r--r--lcms2mt/utils/linkicc/Makefile.in16
-rw-r--r--lcms2mt/utils/linkicc/linkicc.c318
-rw-r--r--lcms2mt/utils/matlab/lcms_rsp53
-rw-r--r--lcms2mt/utils/psicc/Makefile.in16
-rw-r--r--lcms2mt/utils/psicc/psicc.c77
-rw-r--r--lcms2mt/utils/tificc/Makefile.in16
-rw-r--r--lcms2mt/utils/tificc/tifdiff.c12
-rw-r--r--lcms2mt/utils/tificc/tificc.c130
-rw-r--r--lcms2mt/utils/transicc/Makefile.in16
-rw-r--r--lcms2mt/utils/transicc/transicc.c65
83 files changed, 2954 insertions, 2163 deletions
diff --git a/lcms2mt/COPYING b/lcms2mt/COPYING
index 21ed6fb86..99a9ea58f 100644
--- a/lcms2mt/COPYING
+++ b/lcms2mt/COPYING
@@ -1,8 +1,21 @@
Little CMS
Copyright (c) 1998-2020 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 is furnished to do so, subject to the following conditions:
+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 all copies or substantial portions of the Software.
+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 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 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 WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/lcms2mt/ChangeLog b/lcms2mt/ChangeLog
index 81a38b9d7..be424f475 100644
--- a/lcms2mt/ChangeLog
+++ b/lcms2mt/ChangeLog
@@ -34,6 +34,32 @@ Extend T_EXTRA etc to allow for 63 extra channels.
No changelog provided.
-----------------------
+2.12 Maintenance release
+-----------------------
+Added new build-in sigmoidal tone curve
+Added XCode 12 project
+Added support for multichannel input up to 15 channels
+Fix LUT8 write matrix
+Fix version mess on 10/11
+Fix tools & samples xgetopt
+Fix warnings on different function pointers
+Fix matlab MEX compilation
+plugin: cleanup and better SSE detection
+plugin: add lab to any on float
+plugin: it can now be compiled as C++
+recover PDF documentation, but try to keep it under a resonable size.
+Prevent a rare but possible out-of-bounds read in postscript generator
+Remove unused variables
+
+-----------------------
+2.11 Maintenance release
+-----------------------
+Fixed __cpuid() on fast float plugin to allow gnu gcc
+Fixed copy alpha bounds check
+Fixed data race condition on contexts pool
+Fixed LUT16 write matrix on multichannel V2 profiles
+
+-----------------------
2.10 Featured release
-----------------------
Added a compilation toggle to remove "register" keyword in API.
diff --git a/lcms2mt/Makefile.am b/lcms2mt/Makefile.am
index 4c25794d5..e0ade0821 100644
--- a/lcms2mt/Makefile.am
+++ b/lcms2mt/Makefile.am
@@ -10,8 +10,12 @@ ACLOCAL_AMFLAGS = -I m4
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
+if COND_FASTFLOAT
+ USER_PLUGINS = plugins
+endif
+
# Directories containing Makefiles to 'make'
-SUBDIRS = src include utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed
+SUBDIRS = src include utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed $(USER_PLUGINS)
# Additional files to distribute
EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin Lib INSTALL README.1ST autogen.sh lcms2.pc.in plugins
@@ -19,11 +23,10 @@ EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin Lib INSTALL READ
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lcms2mt.pc
-# Get names of plug-ins in the source package
-PLUGIN_DIRECTORIES = $(sort $(dir $(wildcard plugins/*/)))
# Make sure get rid of VC stuff...
clean-local:
+ rm -rf autom4te.cache
find Projects -name "*.user" | xargs rm -rf
find Projects -name "Release" | xargs rm -rf
find Projects -name "Debug" | xargs rm -rf
@@ -32,19 +35,4 @@ clean-local:
find Projects -name "*.log" | xargs rm -rf
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
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) clean ); done
-
-# Handle plug-ins
-all-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) all ); done
-
-check-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) check ); done
-
-install-exec-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) install-exec ); done
-
-uninstall-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) uninstall ); done
diff --git a/lcms2mt/Makefile.in b/lcms2mt/Makefile.in
index 9bc160492..fa2b69082 100644
--- a/lcms2mt/Makefile.in
+++ b/lcms2mt/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -175,7 +175,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir distdir-am dist dist-all distcheck
+ cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -196,7 +196,8 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = src include utils/tificc utils/transicc utils/linkicc \
+ utils/jpgicc utils/psicc testbed plugins
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/lcms2mt.pc.in \
AUTHORS COPYING ChangeLog INSTALL compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
@@ -291,6 +292,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -386,17 +388,15 @@ top_srcdir = @top_srcdir@
# Don't require all the GNU mandated files
AUTOMAKE_OPTIONS = 1.7.2 dist-zip foreign
ACLOCAL_AMFLAGS = -I m4
+@COND_FASTFLOAT_TRUE@USER_PLUGINS = plugins
# Directories containing Makefiles to 'make'
-SUBDIRS = src include utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed
+SUBDIRS = src include utils/tificc utils/transicc utils/linkicc utils/jpgicc utils/psicc testbed $(USER_PLUGINS)
# Additional files to distribute
EXTRA_DIST = AUTHORS COPYING ChangeLog doc Projects include bin Lib INSTALL README.1ST autogen.sh lcms2.pc.in plugins
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lcms2mt.pc
-
-# Get names of plug-ins in the source package
-PLUGIN_DIRECTORIES = $(sort $(dir $(wildcard plugins/*/)))
all: all-recursive
.SUFFIXES:
@@ -421,8 +421,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -572,10 +572,7 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -763,9 +760,8 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
-all-am: Makefile $(DATA) all-local
+all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
@@ -829,7 +825,7 @@ install-dvi: install-dvi-recursive
install-dvi-am:
-install-exec-am: install-exec-local
+install-exec-am:
install-html: install-html-recursive
@@ -869,33 +865,33 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-local uninstall-pkgconfigDATA
+uninstall-am: uninstall-pkgconfigDATA
-.MAKE: $(am__recursive_targets) check-am install-am install-strip
+.MAKE: $(am__recursive_targets) install-am install-strip
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
- am--refresh check check-am check-local clean clean-cscope \
- clean-generic clean-libtool clean-local cscope cscopelist-am \
- ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
- dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ clean-libtool clean-local cscope cscopelist-am ctags ctags-am \
+ dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-exec-local install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgconfigDATA install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-local uninstall-pkgconfigDATA
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgconfigDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA
.PRECIOUS: Makefile
# Make sure get rid of VC stuff...
clean-local:
+ rm -rf autom4te.cache
find Projects -name "*.user" | xargs rm -rf
find Projects -name "Release" | xargs rm -rf
find Projects -name "Debug" | xargs rm -rf
@@ -904,22 +900,7 @@ clean-local:
find Projects -name "*.log" | xargs rm -rf
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
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) clean ); done
-
-# Handle plug-ins
-all-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) all ); done
-
-check-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) check ); done
-
-install-exec-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) install-exec ); done
-
-uninstall-local:
- @for d in $(PLUGIN_DIRECTORIES); do (cd $$d; $(MAKE) $(AM_MAKEFLAGS) uninstall ); done
# 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.
diff --git a/lcms2mt/Projects/.gitignore b/lcms2mt/Projects/.gitignore
index d684b5c0f..03da67f99 100644
--- a/lcms2mt/Projects/.gitignore
+++ b/lcms2mt/Projects/.gitignore
@@ -1,6 +1,11 @@
+# Visual Studio
**.opensdf
**.sdf
**.suo
**.user
Debug/
Release/
+# Xcode & macOS
+xcuserdata/
+.DS_Store
+._*
diff --git a/lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc b/lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc
index 4446318cf..ccc32a39e 100644
--- a/lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc
+++ b/lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc
@@ -1,8 +1,8 @@
1 VERSIONINFO
-FILEVERSION 2, 8, 0, 0
-PRODUCTVERSION 2, 8, 0, 0
+FILEVERSION 2, 12, 0, 0
+PRODUCTVERSION 2, 12, 0, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
{
@@ -12,9 +12,9 @@ FILETYPE VFT_DLL
{
VALUE "CompanyName", "Marti Maria\000\000"
VALUE "FileDescription", "lcms color engine\000"
- VALUE "FileVersion", "2.10\000\000"
- VALUE "InternalName", "lcms2\000"
- VALUE "LegalCopyright", "Copyright © Marti Maria 2020\000\000"
+ VALUE "FileVersion", "2.12\000\000"
+ VALUE "InternalName", "lcms2mt\000"
+ VALUE "LegalCopyright", "Copyright © Marti Maria 2021\000\000"
VALUE "OriginalFilename", "lcms2mt.dll\000"
}
@@ -26,5 +26,3 @@ FILETYPE VFT_DLL
}
}
-
-
diff --git a/lcms2mt/Projects/VC2013/lcms2mt.rc b/lcms2mt/Projects/VC2013/lcms2mt.rc
index 9f7e813c8..0f9eec323 100644
--- a/lcms2mt/Projects/VC2013/lcms2mt.rc
+++ b/lcms2mt/Projects/VC2013/lcms2mt.rc
@@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Marti Maria"
VALUE "FileDescription", "lcms color engine"
- VALUE "FileVersion", "2.10.0.0"
+ VALUE "FileVersion", "2.11.0.0"
VALUE "InternalName", "lcms"
VALUE "LegalCopyright", "Copyright © Marti Maria 2020"
VALUE "OriginalFilename", "lcms2.dll"
VALUE "ProductName", "LittleCMS color engine"
- VALUE "ProductVersion", "2.10.0.0"
+ VALUE "ProductVersion", "2.11.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/lcms2mt/Projects/VC2015/lcms2mt.rc b/lcms2mt/Projects/VC2015/lcms2mt.rc
index 9f7e813c8..b7ca58565 100644
--- a/lcms2mt/Projects/VC2015/lcms2mt.rc
+++ b/lcms2mt/Projects/VC2015/lcms2mt.rc
@@ -27,8 +27,8 @@ LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
//
1 VERSIONINFO
- FILEVERSION 2,10,0,0
- PRODUCTVERSION 2,10,0,0
+ FILEVERSION 2,12,0,0
+ PRODUCTVERSION 2,12,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Marti Maria"
VALUE "FileDescription", "lcms color engine"
- VALUE "FileVersion", "2.10.0.0"
+ VALUE "FileVersion", "2.12.0.0"
VALUE "InternalName", "lcms"
- VALUE "LegalCopyright", "Copyright © Marti Maria 2020"
+ VALUE "LegalCopyright", "Copyright � Marti Maria 2021"
VALUE "OriginalFilename", "lcms2.dll"
VALUE "ProductName", "LittleCMS color engine"
- VALUE "ProductVersion", "2.10.0.0"
+ VALUE "ProductVersion", "2.12.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/lcms2mt/Projects/VC2017/lcms2mt.rc b/lcms2mt/Projects/VC2017/lcms2mt.rc
index 9f7e813c8..b7ca58565 100644
--- a/lcms2mt/Projects/VC2017/lcms2mt.rc
+++ b/lcms2mt/Projects/VC2017/lcms2mt.rc
@@ -27,8 +27,8 @@ LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
//
1 VERSIONINFO
- FILEVERSION 2,10,0,0
- PRODUCTVERSION 2,10,0,0
+ FILEVERSION 2,12,0,0
+ PRODUCTVERSION 2,12,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Marti Maria"
VALUE "FileDescription", "lcms color engine"
- VALUE "FileVersion", "2.10.0.0"
+ VALUE "FileVersion", "2.12.0.0"
VALUE "InternalName", "lcms"
- VALUE "LegalCopyright", "Copyright © Marti Maria 2020"
+ VALUE "LegalCopyright", "Copyright � Marti Maria 2021"
VALUE "OriginalFilename", "lcms2.dll"
VALUE "ProductName", "LittleCMS color engine"
- VALUE "ProductVersion", "2.10.0.0"
+ VALUE "ProductVersion", "2.12.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/lcms2mt/Projects/VC2019/lcms2mt.rc b/lcms2mt/Projects/VC2019/lcms2mt.rc
index 9f7e813c8..b7ca58565 100644
--- a/lcms2mt/Projects/VC2019/lcms2mt.rc
+++ b/lcms2mt/Projects/VC2019/lcms2mt.rc
@@ -27,8 +27,8 @@ LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
//
1 VERSIONINFO
- FILEVERSION 2,10,0,0
- PRODUCTVERSION 2,10,0,0
+ FILEVERSION 2,12,0,0
+ PRODUCTVERSION 2,12,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Marti Maria"
VALUE "FileDescription", "lcms color engine"
- VALUE "FileVersion", "2.10.0.0"
+ VALUE "FileVersion", "2.12.0.0"
VALUE "InternalName", "lcms"
- VALUE "LegalCopyright", "Copyright © Marti Maria 2020"
+ VALUE "LegalCopyright", "Copyright � Marti Maria 2021"
VALUE "OriginalFilename", "lcms2.dll"
VALUE "ProductName", "LittleCMS color engine"
- VALUE "ProductVersion", "2.10.0.0"
+ VALUE "ProductVersion", "2.12.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj b/lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj
index cc7b9fe65..52394a689 100644
--- a/lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj
+++ b/lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj
@@ -126,7 +126,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
diff --git a/lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj
index 4ec2dd7d3..0b481efa1 100644
--- a/lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj
+++ b/lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj
@@ -134,7 +134,6 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -142,6 +141,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BrowseInformation>false</BrowseInformation>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -160,13 +160,13 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../include;../../../utils/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
diff --git a/lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj
index 5126c64c2..d4f529a5c 100644
--- a/lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj
+++ b/lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj
@@ -89,14 +89,14 @@
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;c:\tiff-4.0.2\libtiff;$(IncludePath)</IncludePath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;C:\tiff-4.0.2\libtiff;$(LibraryPath)</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\jpeg-8d;$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\jpeg-8d;$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\jpeg-8d;$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\jpeg-8d;$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj
index d6af7049d..22fc3ce2b 100644
--- a/lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj
+++ b/lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj
@@ -89,14 +89,14 @@
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath>
- <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IncludePath);C:\tiff-4.0.2\libtiff</IncludePath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath>
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);C:\tiff-4.0.2\libtiff</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IncludePath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);E:\liteCommons\3rdparty\tiff-4.1.0\libtiff</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/lcms2mt/README.1ST b/lcms2mt/README.1ST
index 431b2c9dd..7653abead 100644
--- a/lcms2mt/README.1ST
+++ b/lcms2mt/README.1ST
@@ -1,12 +1,12 @@
-This is lcms2mt, version 2.10. This is a forked, binary incompatible
-version of lcms2.10. For details of the differences from vanilla
-lcms2.10 see doc/WhyThisFork.txt
+This is lcms2mt, version 2.12. This is a forked, binary incompatible
+version of lcms2.12. For details of the differences from vanilla
+lcms2.12 see doc/WhyThisFork.txt
About Little CMS
Little CMS intends to be an OPEN SOURCE small-footprint color management engine, with special focus on accuracy and performance. It uses the International Color Consortium standard (ICC), which is the modern standard when regarding to color management. The ICC specification is widely used and is referred to in many International and other de-facto standards. It was approved as an International Standard, ISO 15076-1, in 2005.
Conformance
-Little CMS 2.10 is a FULL IMPLEMENTATION of ICC specification 4.3, it fully supports all kind of V2 and V4 profiles, including abstract, devicelink and named color profiles. Check the tutorial for a exhaustive list of features.
+Little CMS 2.12 is a FULL IMPLEMENTATION of ICC specification 4.3, it fully supports all kind of V2 and V4 profiles, including abstract, devicelink and named color profiles. Check the tutorial for a exhaustive list of features.
A bit of story
diff --git a/lcms2mt/aclocal.m4 b/lcms2mt/aclocal.m4
index ed6a6af8b..adc39617f 100644
--- a/lcms2mt/aclocal.m4
+++ b/lcms2mt/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.16'
+[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.1], [],
+m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.1])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,12 +332,13 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 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_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -345,41 +346,49 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- # TODO: see whether this extra hack can be removed once we start
- # requiring Autoconf 2.70 or later.
- AS_CASE([$CONFIG_FILES],
- [*\'*], [eval set x "$CONFIG_FILES"],
- [*], [set x $CONFIG_FILES])
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
shift
- # Used to flag and report bootstrapping failures.
- am_rc=0
- for am_mf
+ for mf
do
# Strip MF so we end up with the name of the file.
- am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile which includes
- # dependency-tracking related rules and includes.
- # Grep'ing the whole file directly is not great: AIX grep has a line
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
- || continue
- am_dirpart=`AS_DIRNAME(["$am_mf"])`
- am_filepart=`AS_BASENAME(["$am_mf"])`
- AM_RUN_LOG([cd "$am_dirpart" \
- && sed -e '/# am--include-marker/d' "$am_filepart" \
- | $MAKE -f - am--depfiles]) || am_rc=$?
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
done
- if test $am_rc -ne 0; then
- AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
- '--disable-dependency-tracking' option to at least be able to build
- the package (albeit without support for automatic dependency tracking).])
- fi
- AS_UNSET([am_dirpart])
- AS_UNSET([am_filepart])
- AS_UNSET([am_mf])
- AS_UNSET([am_rc])
- rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -388,17 +397,18 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking is enabled.
-# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
-# order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -485,8 +495,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@@ -553,7 +563,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <https://www.gnu.org/software/coreutils/>.
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -595,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -616,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -638,7 +648,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -673,7 +683,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -681,42 +691,49 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
-# Check whether make has an 'include' directive that can support all
-# the idioms we need for our automatic dependency tracking code.
+# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
-[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
-cat > confinc.mk << 'END'
+[am_make=${MAKE-make}
+cat > confinc << 'END'
am__doit:
- @echo this is the am__doit target >confinc.out
+ @echo this is the am__doit target
.PHONY: am__doit
END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-# BSD make does it like this.
-echo '.include "confinc.mk" # ignored' > confmf.BSD
-# Other make implementations (GNU, Solaris 10, AIX) do it like this.
-echo 'include confinc.mk # ignored' > confmf.GNU
-_am_result=no
-for s in GNU BSD; do
- AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
- AS_CASE([$?:`cat confinc.out 2>/dev/null`],
- ['0:this is the am__doit target'],
- [AS_CASE([$s],
- [BSD], [am__include='.include' am__quote='"'],
- [am__include='include' am__quote=''])])
- if test "$am__include" != "#"; then
- _am_result="yes ($s style)"
- break
- fi
-done
-rm -f confinc.* confmf.*
-AC_MSG_RESULT([${_am_result}])
-AC_SUBST([am__include])])
-AC_SUBST([am__quote])])
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -755,7 +772,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -784,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -831,7 +848,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -850,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -931,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -991,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1019,7 +1036,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1038,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/lcms2mt/configure b/lcms2mt/configure
index 32ba181b1..2a6501284 100644
--- a/lcms2mt/configure
+++ b/lcms2mt/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for lcms2mt 2.10.
+# Generated by GNU Autoconf 2.69 for lcms2mt 2.12.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='lcms2mt'
PACKAGE_TARNAME='lcms2mt'
-PACKAGE_VERSION='2.10'
-PACKAGE_STRING='lcms2mt 2.10'
+PACKAGE_VERSION='2.12'
+PACKAGE_STRING='lcms2mt 2.12'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -632,8 +632,11 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+COND_FASTFLOAT_FALSE
+COND_FASTFLOAT_TRUE
TIFFICC_DEPLIBS
JPEGICC_DEPLIBS
+LIB_PLUGINS
LCMS_LIB_DEPLIBS
LIB_TIFF
HasTIFF_FALSE
@@ -693,6 +696,7 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
+am__quote
am__include
DEPDIR
OBJEXT
@@ -778,8 +782,7 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL
-am__quote'
+SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -796,6 +799,7 @@ enable_maintainer_mode
with_jpeg
with_tiff
with_zlib
+with_fastfloat
with_threads
'
ac_precious_vars='build_alias
@@ -1361,7 +1365,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures lcms2mt 2.10 to adapt to many kinds of systems.
+\`configure' configures lcms2mt 2.12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1432,7 +1436,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of lcms2mt 2.10:";;
+ short | recursive ) echo "Configuration of lcms2mt 2.12:";;
esac
cat <<\_ACEOF
@@ -1466,6 +1470,8 @@ Optional Packages:
--with-jpeg=DIR use jpeg installed in DIR
--with-tiff=DIR use tiff installed in DIR
--without-zlib disable ZLIB support
+ --with-fastfloat build and install fast_float plugin, use only if GPL
+ 3.0 is acceptable
--without-threads disable POSIX threads API support
Some influential environment variables:
@@ -1547,7 +1553,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-lcms2mt configure 2.10
+lcms2mt configure 2.12
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2033,7 +2039,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by lcms2mt $as_me 2.10, which was
+It was created by lcms2mt $as_me 2.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2387,27 +2393,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# Libtool library revision control info
-# See the libtool documentation under the heading "Libtool's versioning
-# system" in order to understand the meaning of these fields
-#
-# Here are a set of rules to help you update your library version
-# information:
-#
-# 1. Start with version information of `0:0:0' for each libtool library.
-# 2. Update the version information only immediately before a public
-# release of your software. More frequent updates are unnecessary, and
-# only guarantee that the current interface number gets larger faster.
-# 3. If the library source code has changed at all since the last update,
-# then increment revision (`c:r:a' becomes `c:r+1:a').
-# 4. If any interfaces have been added, removed, or changed since the last
-# update, increment current, and set revision to 0.
-# 5. If any interfaces have been added since the last public release, then
-# increment age.
-# 6. If any interfaces have been removed since the last public release,
-# then set age to 0.
#
LIBRARY_CURRENT=2
-LIBRARY_REVISION=10
+LIBRARY_REVISION=12
LIBRARY_AGE=0
@@ -2513,7 +2501,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-am__api_version='1.16'
+am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2999,7 +2987,7 @@ fi
# Define the identity of the package.
PACKAGE='lcms2mt'
- VERSION='2.10'
+ VERSION='2.12'
# Some tools Automake needs.
@@ -3020,8 +3008,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@@ -3032,9 +3020,125 @@ AMTAR='$${TAR-tar}'
# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar pax cpio none'
+_am_tools='gnutar plaintar pax cpio none'
+
+# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
+$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
+ if test $am_uid -le $am_max_uid; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ _am_tools=none
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
+$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
+ if test $am_gid -le $am_max_gid; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ _am_tools=none
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x ustar -w "$$tardir"'
+ am__tar_='pax -L -x ustar -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+ am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+ am__untar='cpio -i -H ustar -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_ustar}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+ ($am__untar <conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
+ (cat conftest.dir/file) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ if ${am_cv_prog_tar_ustar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_prog_tar_ustar=$_am_tool
+fi
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
+$as_echo "$am_cv_prog_tar_ustar" >&6; }
@@ -3072,7 +3176,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <https://www.gnu.org/software/coreutils/>.
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3090,45 +3194,45 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
-cat > confinc.mk << 'END'
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
am__doit:
- @echo this is the am__doit target >confinc.out
+ @echo this is the am__doit target
.PHONY: am__doit
END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
-# BSD make does it like this.
-echo '.include "confinc.mk" # ignored' > confmf.BSD
-# Other make implementations (GNU, Solaris 10, AIX) do it like this.
-echo 'include confinc.mk # ignored' > confmf.GNU
-_am_result=no
-for s in GNU BSD; do
- { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
- (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- case $?:`cat confinc.out 2>/dev/null` in #(
- '0:this is the am__doit target') :
- case $s in #(
- BSD) :
- am__include='.include' am__quote='"' ;; #(
- *) :
- am__include='include' am__quote='' ;;
-esac ;; #(
- *) :
- ;;
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
esac
- if test "$am__include" != "#"; then
- _am_result="yes ($s style)"
- break
- fi
-done
-rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
@@ -15826,6 +15930,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+LIB_PLUGINS = ''
+
# Add configure option --enable-maintainer-mode which enables dependency
# checking and generation useful to package maintainers. This is made an
# option to avoid confusing end users.
@@ -16314,6 +16420,21 @@ else
fi
+#fast_float plugin:
+
+# Check whether --with-fastfloat was given.
+if test "${with_fastfloat+set}" = set; then :
+ withval=$with_fastfloat;
+ with_fastfloat='yes'
+ LIB_PLUGINS="$LIB_PLUGINS -llcms2_fast_float"
+
+else
+
+ with_fastfloat='no'
+
+fi
+
+
#
# Determine POSIX threads settings
#
@@ -17599,6 +17720,9 @@ LCMS_LIB_DEPLIBS="$LIB_MATH $LIB_THREAD"
LCMS_LIB_DEPLIBS=`echo $LCMS_LIB_DEPLIBS | sed -e 's/ */ /g'`
+echo "LIB_PLUGINS: $LIB_PLUGINS"
+
+
# Libraries that the jpegicc program depends on
JPEGICC_DEPLIBS="$LIB_JPEG $LIB_MATH $LIB_THREAD"
JPEGICC_DEPLIBS=`echo $JPEGICC_DEPLIBS | sed -e 's/ */ /g'`
@@ -17634,6 +17758,24 @@ ac_config_files="$ac_config_files utils/psicc/Makefile"
ac_config_files="$ac_config_files testbed/Makefile"
+ if test "x$with_fastfloat" = "xyes" ; then
+ COND_FASTFLOAT_TRUE=
+ COND_FASTFLOAT_FALSE='#'
+else
+ COND_FASTFLOAT_TRUE='#'
+ COND_FASTFLOAT_FALSE=
+fi
+
+ac_config_files="$ac_config_files plugins/Makefile"
+
+ac_config_files="$ac_config_files plugins/fast_float/Makefile"
+
+ac_config_files="$ac_config_files plugins/fast_float/src/Makefile"
+
+ac_config_files="$ac_config_files plugins/fast_float/include/Makefile"
+
+ac_config_files="$ac_config_files plugins/fast_float/testbed/Makefile"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -17824,6 +17966,10 @@ if test -z "${HasTIFF_TRUE}" && test -z "${HasTIFF_FALSE}"; then
as_fn_error $? "conditional \"HasTIFF\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${COND_FASTFLOAT_TRUE}" && test -z "${COND_FASTFLOAT_FALSE}"; then
+ as_fn_error $? "conditional \"COND_FASTFLOAT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -18221,7 +18367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by lcms2mt $as_me 2.10, which was
+This file was extended by lcms2mt $as_me 2.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18278,7 +18424,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-lcms2mt config.status 2.10
+lcms2mt config.status 2.12
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -18386,7 +18532,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -18785,6 +18931,11 @@ do
"utils/jpgicc/Makefile") CONFIG_FILES="$CONFIG_FILES utils/jpgicc/Makefile" ;;
"utils/psicc/Makefile") CONFIG_FILES="$CONFIG_FILES utils/psicc/Makefile" ;;
"testbed/Makefile") CONFIG_FILES="$CONFIG_FILES testbed/Makefile" ;;
+ "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;;
+ "plugins/fast_float/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/fast_float/Makefile" ;;
+ "plugins/fast_float/src/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/fast_float/src/Makefile" ;;
+ "plugins/fast_float/include/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/fast_float/include/Makefile" ;;
+ "plugins/fast_float/testbed/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/fast_float/testbed/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -19218,35 +19369,29 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- # TODO: see whether this extra hack can be removed once we start
- # requiring Autoconf 2.70 or later.
- case $CONFIG_FILES in #(
- *\'*) :
- eval set x "$CONFIG_FILES" ;; #(
- *) :
- set x $CONFIG_FILES ;; #(
- *) :
- ;;
-esac
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
shift
- # Used to flag and report bootstrapping failures.
- am_rc=0
- for am_mf
+ for mf
do
# Strip MF so we end up with the name of the file.
- am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile which includes
- # dependency-tracking related rules and includes.
- # Grep'ing the whole file directly is not great: AIX grep has a line
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
- || continue
- am_dirpart=`$as_dirname -- "$am_mf" ||
-$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$am_mf" : 'X\(//\)[^/]' \| \
- X"$am_mf" : 'X\(//\)$' \| \
- X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$am_mf" |
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -19264,48 +19409,53 @@ $as_echo X"$am_mf" |
q
}
s/.*/./; q'`
- am_filepart=`$as_basename -- "$am_mf" ||
-$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
- X"$am_mf" : 'X\(//\)$' \| \
- X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$am_mf" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
- /^X\/\(\/\/\)$/{
+ /^X\(\/\/\)[^/].*/{
s//\1/
q
}
- /^X\/\(\/\).*/{
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
- { echo "$as_me:$LINENO: cd "$am_dirpart" \
- && sed -e '/# am--include-marker/d' "$am_filepart" \
- | $MAKE -f - am--depfiles" >&5
- (cd "$am_dirpart" \
- && sed -e '/# am--include-marker/d' "$am_filepart" \
- | $MAKE -f - am--depfiles) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } || am_rc=$?
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
done
- if test $am_rc -ne 0; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
- '--disable-dependency-tracking' option to at least be able to build
- the package (albeit without support for automatic dependency tracking).
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- { am_dirpart=; unset am_dirpart;}
- { am_filepart=; unset am_filepart;}
- { am_mf=; unset am_mf;}
- { am_rc=; unset am_rc;}
- rm -f conftest-deps.mk
}
;;
"libtool":C)
diff --git a/lcms2mt/configure.ac b/lcms2mt/configure.ac
index e347750f1..439ca550a 100644
--- a/lcms2mt/configure.ac
+++ b/lcms2mt/configure.ac
@@ -7,34 +7,16 @@ AC_PREREQ(2.60)
#
# Set the package name and version
#
-AC_INIT(lcms2mt,2.10)
+AC_INIT(lcms2mt,2.12)
# Specify directory where m4 macros may be found.
AC_CONFIG_MACRO_DIR([m4])
#
# Libtool library revision control info
-# See the libtool documentation under the heading "Libtool's versioning
-# system" in order to understand the meaning of these fields
-#
-# Here are a set of rules to help you update your library version
-# information:
-#
-# 1. Start with version information of `0:0:0' for each libtool library.
-# 2. Update the version information only immediately before a public
-# release of your software. More frequent updates are unnecessary, and
-# only guarantee that the current interface number gets larger faster.
-# 3. If the library source code has changed at all since the last update,
-# then increment revision (`c:r:a' becomes `c:r+1:a').
-# 4. If any interfaces have been added, removed, or changed since the last
-# update, increment current, and set revision to 0.
-# 5. If any interfaces have been added since the last public release, then
-# increment age.
-# 6. If any interfaces have been removed since the last public release,
-# then set age to 0.
#
LIBRARY_CURRENT=2
-LIBRARY_REVISION=10
+LIBRARY_REVISION=12
LIBRARY_AGE=0
AC_SUBST(LIBRARY_CURRENT)dnl
@@ -44,7 +26,7 @@ AC_SUBST(LIBRARY_AGE)dnl
# Obtain system type by running config.guess
AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE([foreign 1.7.2 no-define dist-zip subdir-objects])
+AM_INIT_AUTOMAKE([foreign 1.9 tar-ustar no-define dist-zip subdir-objects])
# Check for programs
@@ -72,6 +54,8 @@ AC_LIBTOOL_SETUP
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
+LIB_PLUGINS = ''
+
# Add configure option --enable-maintainer-mode which enables dependency
# checking and generation useful to package maintainers. This is made an
# option to avoid confusing end users.
@@ -98,7 +82,7 @@ AC_C_BIGENDIAN
# Point to JPEG installed in DIR or disable JPEG with --without-jpeg.
AC_ARG_WITH(jpeg,
- [ --with-jpeg=DIR use jpeg installed in DIR],
+ AS_HELP_STRING([--with-jpeg=DIR],[use jpeg installed in DIR]),
[
if [ test "x$withval" = "xno" ]; then
[with_jpeg='no']
@@ -116,7 +100,7 @@ AC_ARG_WITH(jpeg,
# Point to TIFF installed in DIR or disable TIFF with --without-tiff.
AC_ARG_WITH(tiff,
- [ --with-tiff=DIR use tiff installed in DIR],
+ AS_HELP_STRING([--with-tiff=DIR], [use tiff installed in DIR]),
[
if [ test "x$withval" = "xno" ]; then
[with_tiff='no']
@@ -138,6 +122,18 @@ AC_ARG_WITH(zlib,
[with_zlib=$withval],
[with_zlib='yes'])
+#fast_float plugin:
+AC_ARG_WITH(fastfloat,
+ AS_HELP_STRING([--with-fastfloat],
+ [build and install fast_float plugin, use only if GPL 3.0 is acceptable]),
+ [
+ with_fastfloat='yes'
+ LIB_PLUGINS="$LIB_PLUGINS -llcms2_fast_float"
+ ],
+ [
+ with_fastfloat='no'
+ ])
+
#
# Determine POSIX threads settings
#
@@ -354,6 +350,9 @@ LCMS_LIB_DEPLIBS="$LIB_MATH $LIB_THREAD"
LCMS_LIB_DEPLIBS=`echo $LCMS_LIB_DEPLIBS | sed -e 's/ */ /g'`
AC_SUBST(LCMS_LIB_DEPLIBS)
+echo "LIB_PLUGINS: $LIB_PLUGINS"
+AC_SUBST(LIB_PLUGINS)
+
# Libraries that the jpegicc program depends on
JPEGICC_DEPLIBS="$LIB_JPEG $LIB_MATH $LIB_THREAD"
JPEGICC_DEPLIBS=`echo $JPEGICC_DEPLIBS | sed -e 's/ */ /g'`
@@ -379,4 +378,10 @@ AC_CONFIG_FILES([utils/linkicc/Makefile])
AC_CONFIG_FILES([utils/jpgicc/Makefile])
AC_CONFIG_FILES([utils/psicc/Makefile])
AC_CONFIG_FILES([testbed/Makefile])
+AM_CONDITIONAL([COND_FASTFLOAT], [test "x$with_fastfloat" = "xyes" ])
+AC_CONFIG_FILES([plugins/Makefile])
+AC_CONFIG_FILES([plugins/fast_float/Makefile])
+AC_CONFIG_FILES([plugins/fast_float/src/Makefile])
+AC_CONFIG_FILES([plugins/fast_float/include/Makefile])
+AC_CONFIG_FILES([plugins/fast_float/testbed/Makefile])
AC_OUTPUT
diff --git a/lcms2mt/include/Makefile.in b/lcms2mt/include/Makefile.in
index be55841cc..40c86b7c0 100644
--- a/lcms2mt/include/Makefile.in
+++ b/lcms2mt/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -228,6 +228,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -341,8 +342,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -433,10 +434,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/include/lcms2mt.h b/lcms2mt/include/lcms2mt.h
index 1acd806f2..a1652c34e 100644
--- a/lcms2mt/include/lcms2mt.h
+++ b/lcms2mt/include/lcms2mt.h
@@ -1,7 +1,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2020 Marti Maria Saguer
+// Copyright (c) 1998-2021 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"),
@@ -23,7 +23,7 @@
//
//---------------------------------------------------------------------------------
//
-// Version 2.10
+// Version 2.12
//
#ifndef _lcms2mt_H
@@ -81,12 +81,12 @@ extern "C" {
#endif
// Version/release
-// Vanilla LCMS2 uses values from 2000-2100. This is
+// Vanilla LCMS2 uses values from 2000-2120. This is
// used as an unsigned number. We want any attempt to
// use OUR numbers with a mainline LCMS to fail, so
// we have to go under 2000-2100. Let's subtract
// 2000 from the mainline release.
-#define LCMS_VERSION (2100 - 2000)
+#define LCMS_VERSION (2120 - 2000)
// We expect any LCMS2MT release to fall within the
// following range.
@@ -1199,6 +1199,7 @@ CMSAPI cmsBool CMSEXPORT cmsIsToneCurveMonotonic(cmsContext ContextID,
CMSAPI cmsBool CMSEXPORT cmsIsToneCurveDescending(cmsContext ContextID, const cmsToneCurve* t);
CMSAPI cmsInt32Number CMSEXPORT cmsGetToneCurveParametricType(cmsContext ContextID, const cmsToneCurve* t);
CMSAPI cmsFloat64Number CMSEXPORT cmsEstimateGamma(cmsContext ContextID, const cmsToneCurve* t, cmsFloat64Number Precision);
+CMSAPI cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(cmsContext ContextID, const cmsToneCurve* t);
// Tone curve tabular estimation
CMSAPI cmsUInt32Number CMSEXPORT cmsGetToneCurveEstimatedTableEntries(cmsContext ContextID, const cmsToneCurve* t);
@@ -1748,7 +1749,7 @@ CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsContext ContextID, cm
CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformInputFormat(cmsContext ContextID, cmsHTRANSFORM hTransform);
CMSAPI cmsUInt32Number CMSEXPORT cmsGetTransformOutputFormat(cmsContext ContextID, cmsHTRANSFORM hTransform);
-CMSAPI cmsHTRANSFORM CMSEXPORT cmsCloneTransformChangingFormats(cmsContext ContextID,
+cmsHTRANSFORM cmsCloneTransformChangingFormats(cmsContext ContextID,
const cmsHTRANSFORM hTransform,
cmsUInt32Number InputFormat,
cmsUInt32Number OutputFormat);
diff --git a/lcms2mt/include/lcms2mt_plugin.h b/lcms2mt/include/lcms2mt_plugin.h
index fad172470..91e0c2034 100644
--- a/lcms2mt/include/lcms2mt_plugin.h
+++ b/lcms2mt/include/lcms2mt_plugin.h
@@ -286,7 +286,7 @@ typedef union {
#define CMS_LERP_FLAGS_TRILINEAR 0x0100 // Hint only
-#define MAX_INPUT_DIMENSIONS 8
+#define MAX_INPUT_DIMENSIONS 15
typedef struct _cms_interp_struc { // Used on all interpolations. Supplied by lcms2 when calling the interpolation function
@@ -545,23 +545,33 @@ typedef struct {
// 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)(cmsContext ContextID,
- CMSREGISTER const cmsUInt16Number In[],
- CMSREGISTER cmsUInt16Number Out[],
- CMSREGISTER const void* Data);
-
-
-typedef cmsBool (* _cmsOPToptimizeFn)(cmsContext ContextID, cmsPipeline** Lut,
+typedef cmsBool (* _cmsOPToptimizeFn)(cmsContext ContextID,
+ cmsPipeline** Lut,
cmsUInt32Number Intent,
cmsUInt32Number* InputFormat,
cmsUInt32Number* OutputFormat,
cmsUInt32Number* dwFlags);
+// Pipeline Evaluator (in 16 bits)
+typedef void (* _cmsPipelineEval16Fn)(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ const void* Data);
+
+// Pipeline Evaluator (in floating point)
+typedef void (* _cmsPipelineEvalFloatFn)(cmsContext ContextID,
+ const cmsFloat32Number In[],
+ cmsFloat32Number Out[],
+ const void* Data);
+
+
// 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(cmsContext ContextID, cmsPipeline* Lut,
- _cmsOPTeval16Fn Eval16,
+CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(
+ cmsContext ContextID,
+ cmsPipeline* Lut,
+ _cmsPipelineEval16Fn Eval16,
void* PrivateData,
_cmsFreeUserDataFn FreePrivateDataFn,
_cmsDupUserDataFn DupPrivateDataFn);
@@ -625,6 +635,9 @@ CMSAPI void * CMSEXPORT _cmsGetTransformUserData(struct _cmstransform_struct *CM
CMSAPI void CMSEXPORT _cmsGetTransformFormatters16 (struct _cmstransform_struct *CMMcargo, cmsFormatter16* FromInput, cmsFormatter16* ToOutput);
CMSAPI void CMSEXPORT _cmsGetTransformFormattersFloat(struct _cmstransform_struct *CMMcargo, cmsFormatterFloat* FromInput, cmsFormatterFloat* ToOutput);
+// Retrieve original flags
+CMSAPI cmsUInt32Number CMSEXPORT _cmsGetTransformFlags(struct _cmstransform_struct* CMMcargo);
+
typedef struct {
cmsPluginBase base;
diff --git a/lcms2mt/lcms2mt.pc.in b/lcms2mt/lcms2mt.pc.in
index 5b4213c36..a2839830c 100644
--- a/lcms2mt/lcms2mt.pc.in
+++ b/lcms2mt/lcms2mt.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: @PACKAGE@
Description: LCMS Color Management Library
Version: @VERSION@
-Libs: -L${libdir} -llcms2
+Libs: -L${libdir} -llcms2 @LIB_PLUGINS@
Libs.private: @LIB_MATH@ @LIB_THREAD@
Cflags: -I${includedir}
diff --git a/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj b/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj
index 4c45cd6a9..c35d6d61c 100644
--- a/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj
+++ b/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj
@@ -26,11 +26,13 @@
<ClCompile Include="..\..\src\fast_16_tethra.c" />
<ClCompile Include="..\..\src\fast_8_curves.c" />
<ClCompile Include="..\..\src\fast_8_matsh.c" />
+ <ClCompile Include="..\..\src\fast_8_matsh_sse.c" />
<ClCompile Include="..\..\src\fast_8_tethra.c" />
<ClCompile Include="..\..\src\fast_float_15bits.c" />
<ClCompile Include="..\..\src\fast_float_15mats.c" />
<ClCompile Include="..\..\src\fast_float_cmyk.c" />
<ClCompile Include="..\..\src\fast_float_curves.c" />
+ <ClCompile Include="..\..\src\fast_float_lab.c" />
<ClCompile Include="..\..\src\fast_float_matsh.c" />
<ClCompile Include="..\..\src\fast_float_separate.c" />
<ClCompile Include="..\..\src\fast_float_sup.c" />
diff --git a/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters b/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters
index f78d01cdd..ae32e7e18 100644
--- a/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters
+++ b/lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters
@@ -45,9 +45,6 @@
<ClCompile Include="..\..\src\fast_float_cmyk.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\fast_8_matsh.c">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\fast_8_curves.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -57,6 +54,15 @@
<ClCompile Include="..\..\src\fast_16_tethra.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\fast_8_matsh_sse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\fast_8_matsh.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\fast_float_lab.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\COPYING.GPL3">
diff --git a/lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h b/lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h
index 572d82d11..6637d1c50 100644
--- a/lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h
+++ b/lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h
@@ -30,7 +30,18 @@ extern "C" {
# endif
#endif
-#define LCMS2_FAST_FLOAT_VERSION 1200
+#define LCMS2_FAST_FLOAT_VERSION 1400
+
+// Configuration toggles
+
+// Uncomment this if you want to avoid SSE2 entirely.
+// Default is commented out. There are two kernels, one is vectorized and the other is not.
+// On inizialization, there is a SSE2 detection. If the SSE2 detection succeeds, then the vectorized code is selected.
+// If the CPU is old and does not support SSE2, then the non-vectorized code is used.
+// If you define the toggle, there is no detection and the non-vectorized kernel is always used.
+
+// #define CMS_DONT_USE_SSE2 1
+
// The one and only plug-in entry point. To install this plugin in your code
// you need to place this in some initialization place:
@@ -38,7 +49,7 @@ extern "C" {
// cmsPlugin(cmsFastFloatExtensions());
//
-void* cmsFastFloatExtensions(void);
+CMSAPI void* CMSEXPORT cmsFastFloatExtensions(void);
// New encodings that the plug-in implements
diff --git a/lcms2mt/plugins/fast_float/src/Makefile.am b/lcms2mt/plugins/fast_float/src/Makefile.am
index a7d1af38e..d9d33fcad 100644
--- a/lcms2mt/plugins/fast_float/src/Makefile.am
+++ b/lcms2mt/plugins/fast_float/src/Makefile.am
@@ -14,14 +14,13 @@ LIBRARY_CURRENT = 1
LIBRARY_REVISION = 1
LIBRARY_AGE = 0
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/../include -I$(builddir)/../include
+AM_CPPFLAGS = -Ofast -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/../include -I$(builddir)/../include
liblcms2mt_fast_float_la_LDFLAGS = -no-undefined \
-version-info $(LIBRARY_CURRENT):$(LIBRARY_REVISION):$(LIBRARY_AGE)
liblcms2mt_fast_float_la_LIBADD = $(LCMS_LIB_DEPLIBS) $(top_builddir)/src/liblcms2mt.la
-liblcms2mt_fast_float_la_SOURCES = \
- fast_float_15bits.c fast_float_15mats.c fast_float_curves.c fast_float_matsh.c fast_float_separate.c \
- fast_float_sup.c fast_float_tethra.c fast_float_cmyk.c fast_float_internal.h \
- fast_8_curves.c fast_8_matsh.c fast_8_tethra.c
+liblcms2mt_fast_float_la_SOURCES = fast_8_curves.c fast_8_matsh_sse.c fast_8_matsh.c fast_8_tethra.c \
+ fast_16_tethra.c fast_float_15bits.c fast_float_15mats.c fast_float_cmyk.c fast_float_curves.c fast_float_matsh.c \
+ fast_float_separate.c fast_float_sup.c fast_float_tethra.c fast_float_lab.c fast_float_internal.h
diff --git a/lcms2mt/plugins/fast_float/src/fast_16_tethra.c b/lcms2mt/plugins/fast_float/src/fast_16_tethra.c
index a67340d5f..6b3110aec 100644
--- a/lcms2mt/plugins/fast_float/src/fast_16_tethra.c
+++ b/lcms2mt/plugins/fast_float/src/fast_16_tethra.c
@@ -22,7 +22,7 @@
#include "fast_float_internal.h"
// lcms internal
-cmsBool _cmsOptimizePipeline(cmsContext ContextID,
+CMSAPI cmsBool CMSEXPORT _cmsOptimizePipeline(cmsContext ContextID,
cmsPipeline** Lut,
cmsUInt32Number Intent,
cmsUInt32Number* InputFormat,
@@ -121,6 +121,9 @@ void PerformanceEval16(cmsContext ContextID,
in16 = (T_BYTES(dwInFormat) == 2);
out16 = (T_BYTES(dwOutFormat) == 2);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -332,9 +335,22 @@ cmsBool Optimize16BitRGBTransform(cmsContext ContextID,
// Only real 16 bits
if (T_BIT15(*InputFormat) != 0 || T_BIT15(*OutputFormat) != 0) return FALSE;
+ // Swap endian is not supported
+ if (T_ENDIAN16(*InputFormat) != 0 || T_ENDIAN16(*OutputFormat) != 0) return FALSE;
+
// Only on input RGB
if (T_COLORSPACE(*InputFormat) != PT_RGB) return FALSE;
+
+ // If this is a matrix-shaper, the default does already a good job
+ if (cmsPipelineCheckAndRetreiveStages(ContextID, *Lut, 4,
+ cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
+ NULL, NULL, NULL, NULL)) return FALSE;
+
+ if (cmsPipelineCheckAndRetreiveStages(ContextID, *Lut, 2,
+ cmsSigCurveSetElemType, cmsSigCurveSetElemType,
+ NULL, NULL)) return FALSE;
+
// Named color pipelines cannot be optimized either
for (mpe = cmsPipelineGetPtrToFirstStage(ContextID, *Lut);
mpe != NULL;
@@ -359,7 +375,7 @@ cmsBool Optimize16BitRGBTransform(cmsContext ContextID,
p16 = Performance16alloc(ContextID, data->Params);
if (p16 == NULL) return FALSE;
- *TransformFn = (_cmsTransformFn) PerformanceEval16;
+ *TransformFn = (_cmsTransformFn)PerformanceEval16;
*UserData = p16;
*FreeDataFn = Performance16free;
*InputFormat |= 0x02000000;
diff --git a/lcms2mt/plugins/fast_float/src/fast_8_curves.c b/lcms2mt/plugins/fast_float/src/fast_8_curves.c
index cb8e5df6e..5eca77c06 100644
--- a/lcms2mt/plugins/fast_float/src/fast_8_curves.c
+++ b/lcms2mt/plugins/fast_float/src/fast_8_curves.c
@@ -63,6 +63,9 @@ static void FastEvaluateRGBCurves8(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -138,6 +141,9 @@ static void FastRGBIdentity8(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -212,6 +218,9 @@ static void FastEvaluateGrayCurves8(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -273,6 +282,9 @@ static void FastGrayIdentity8(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -400,9 +412,9 @@ cmsBool Optimize8ByJoiningCurves(cmsContext ContextID,
// Maybe the curves are linear at the end
if (nChans == 1)
- *TransformFn = (_cmsTransformFn) (AllCurvesAreLinear(Data) ? FastGrayIdentity8 : FastEvaluateGrayCurves8);
+ *TransformFn = (_cmsTransformFn)(AllCurvesAreLinear(Data) ? FastGrayIdentity8 : FastEvaluateGrayCurves8);
else
- *TransformFn = (_cmsTransformFn) (AllCurvesAreLinear(Data) ? FastRGBIdentity8 : FastEvaluateRGBCurves8);
+ *TransformFn = (_cmsTransformFn)(AllCurvesAreLinear(Data) ? FastRGBIdentity8 : FastEvaluateRGBCurves8);
return TRUE;
diff --git a/lcms2mt/plugins/fast_float/src/fast_8_matsh.c b/lcms2mt/plugins/fast_float/src/fast_8_matsh.c
index 26dc12a15..706abdc96 100644
--- a/lcms2mt/plugins/fast_float/src/fast_8_matsh.c
+++ b/lcms2mt/plugins/fast_float/src/fast_8_matsh.c
@@ -30,10 +30,9 @@ typedef cmsInt32Number cmsS1Fixed14Number; // Note that this may hold more tha
// This is the private data container used by this optimization
typedef struct {
- // This is for SSE2, MUST be aligned at 16 bit boundary
+ // Alignment makes it faster
- cmsFloat32Number fMatrix[4][4];
- cmsFloat32Number fShaper1[256 * 3];
+ cmsS1Fixed14Number Mat[4][4]; // n.14 to n.14 (needs a saturation after that)
void * real_ptr;
@@ -41,9 +40,6 @@ typedef struct {
cmsS1Fixed14Number Shaper1G[256];
cmsS1Fixed14Number Shaper1B[256];
- cmsS1Fixed14Number Mat[3][3]; // n.14 to n.14 (needs a saturation after that)
- cmsS1Fixed14Number Off[3];
-
cmsUInt8Number Shaper2R[0x4001]; // 1.14 to 0..255
cmsUInt8Number Shaper2G[0x4001];
cmsUInt8Number Shaper2B[0x4001];
@@ -95,20 +91,6 @@ void FillFirstShaper(cmsContext ContextID, cmsS1Fixed14Number* Table, cmsToneCur
}
}
-static
-void FillFirstShaperFloat(cmsContext ContextID, cmsFloat32Number* Table, cmsToneCurve* Curve)
-{
- int i;
- cmsFloat32Number R;
-
- for (i=0; i < 256; i++) {
-
- R = (cmsFloat32Number) (i / 255.0);
-
- Table[i] = cmsEvalToneCurveFloat(ContextID, Curve, R);
- }
-}
-
// This table converts form 1.14 (being 0x4000 the last entry) to 8 bits after applying the curve
static
@@ -116,15 +98,17 @@ void FillSecondShaper(cmsContext ContextID, cmsUInt8Number* Table, cmsToneCurve*
{
int i;
cmsFloat32Number R, Val;
- cmsUInt16Number w;
+ cmsInt32Number w;
for (i=0; i < 0x4001; i++) {
- R = (cmsFloat32Number) (i / 16384.0);
+ R = (cmsFloat32Number) (i / 16384.0f);
Val = cmsEvalToneCurveFloat(ContextID, Curve, R);
- w = _cmsSaturateWord(Val * 65535.0 + 0.5);
+ w = (cmsInt32Number) (Val * 255.0f + 0.5f);
+ if (w < 0) w = 0;
+ if (w > 255) w = 255;
- Table[i] = FROM_16_TO_8(w);
+ Table[i] = (cmsInt8Number) w;
}
}
@@ -150,29 +134,21 @@ XMatShaper8Data* SetMatShaper(cmsContext ContextID, cmsToneCurve* Curve1[3], cms
FillSecondShaper(ContextID, p ->Shaper2B, Curve2[2]);
- FillFirstShaperFloat(ContextID, p ->fShaper1, Curve1[0]);
- FillFirstShaperFloat(ContextID, p ->fShaper1 + 256, Curve1[1]);
- FillFirstShaperFloat(ContextID, p ->fShaper1 + 256*2, Curve1[2]);
-
// Convert matrix to nFixed14. Note that those values may take more than 16 bits as
for (i=0; i < 3; i++) {
for (j=0; j < 3; j++) {
- p ->Mat[i][j] = DOUBLE_TO_1FIXED14(Mat->v[i].n[j]);
- p ->fMatrix[j][i] = (cmsFloat32Number) Mat ->v[i].n[j];
+ p ->Mat[j][i] = DOUBLE_TO_1FIXED14(Mat->v[i].n[j]);
}
}
-
for (i=0; i < 3; i++) {
if (Off == NULL) {
- p ->Off[i] = 0x2000;
- p ->fMatrix[3][i] = 0.0f;
+ p->Mat[3][i] = DOUBLE_TO_1FIXED14(0.5);
}
else {
- p ->Off[i] = DOUBLE_TO_1FIXED14(Off->n[i]) + 0x2000;
- p ->fMatrix[3][i] = (cmsFloat32Number) Off->n[i];
+ p->Mat[3][i] = DOUBLE_TO_1FIXED14(Off->n[i] + 0.5);
}
}
@@ -195,7 +171,7 @@ void MatShaperXform8(cmsContext ContextID,
{
XMatShaper8Data* p = (XMatShaper8Data*) _cmsGetTransformUserData(CMMcargo);
- register cmsS1Fixed14Number l1, l2, l3;
+ cmsS1Fixed14Number l1, l2, l3;
cmsS1Fixed14Number r, g, b;
cmsUInt32Number ri, gi, bi;
cmsUInt32Number i, ii;
@@ -220,6 +196,9 @@ void MatShaperXform8(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -236,7 +215,6 @@ void MatShaperXform8(cmsContext ContextID,
if (nalpha)
aout = (cmsUInt8Number*)Output + DestStartingOrder[3] + strideOut;
-
for (ii = 0; ii < PixelsPerLine; ii++) {
// Across first shaper, which also converts to 1.14 fixed point. 16 bits guaranteed.
@@ -245,9 +223,9 @@ void MatShaperXform8(cmsContext ContextID,
b = p->Shaper1B[*bin];
// Evaluate the matrix in 1.14 fixed point
- l1 = (p->Mat[0][0] * r + p->Mat[0][1] * g + p->Mat[0][2] * b + p->Off[0]) >> 14;
- l2 = (p->Mat[1][0] * r + p->Mat[1][1] * g + p->Mat[1][2] * b + p->Off[1]) >> 14;
- l3 = (p->Mat[2][0] * r + p->Mat[2][1] * g + p->Mat[2][2] * b + p->Off[2]) >> 14;
+ l1 = (p->Mat[0][0] * r + p->Mat[1][0] * g + p->Mat[2][0] * b + p->Mat[3][0]) >> 14;
+ l2 = (p->Mat[0][1] * r + p->Mat[1][1] * g + p->Mat[2][1] * b + p->Mat[3][1]) >> 14;
+ l3 = (p->Mat[0][2] * r + p->Mat[1][2] * g + p->Mat[2][2] * b + p->Mat[3][2]) >> 14;
// Now we have to clip to 0..1.0 range
diff --git a/lcms2mt/plugins/fast_float/src/fast_8_tethra.c b/lcms2mt/plugins/fast_float/src/fast_8_tethra.c
index bde4649d2..a43a337b4 100644
--- a/lcms2mt/plugins/fast_float/src/fast_8_tethra.c
+++ b/lcms2mt/plugins/fast_float/src/fast_8_tethra.c
@@ -146,10 +146,12 @@ void PerformanceEval8(cmsContext ContextID,
cmsUInt32Number nalpha, strideIn, strideOut;
-
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
@@ -338,10 +340,9 @@ cmsBool Optimize8BitRGBTransform( cmsContext ContextID,
cmsToneCurve *Trans[cmsMAXCHANNELS], *TransReverse[cmsMAXCHANNELS];
cmsUInt32Number t, i, j;
cmsFloat32Number v, In[cmsMAXCHANNELS], Out[cmsMAXCHANNELS];
- cmsBool lIsSuitable, lIsLinear;
+ cmsBool lIsSuitable;
cmsPipeline* OptimizedLUT = NULL, *LutPlusCurves = NULL;
cmsStage* OptimizedCLUTmpe;
- cmsColorSpaceSignature OutputColorSpace;
cmsStage* OptimizedPrelinMpe;
cmsStage* mpe;
Performance8Data* p8;
@@ -369,7 +370,6 @@ cmsBool Optimize8BitRGBTransform( cmsContext ContextID,
if (cmsStageType(ContextID, mpe) == cmsSigNamedColorElemType) return FALSE;
}
- OutputColorSpace = _cmsICCcolorSpace(ContextID, T_COLORSPACE(*OutputFormat));
nGridPoints = _cmsReasonableGridpointsByColorspace(cmsSigRgbData, *dwFlags);
// Empty gamma containers
@@ -412,13 +412,8 @@ cmsBool Optimize8BitRGBTransform( cmsContext ContextID,
// Check for validity
lIsSuitable = TRUE;
- lIsLinear = TRUE;
for (t=0; (lIsSuitable && (t < 3)); t++) {
- // Exclude if already linear
- if (!cmsIsToneCurveLinear(ContextID, Trans[t]))
- lIsLinear = FALSE;
-
// Exclude if non-monotonic
if (!cmsIsToneCurveMonotonic(ContextID, Trans[t]))
lIsSuitable = FALSE;
@@ -480,7 +475,7 @@ cmsBool Optimize8BitRGBTransform( cmsContext ContextID,
*dwFlags &= ~cmsFLAGS_CAN_CHANGE_FORMATTER;
*Lut = OptimizedLUT;
- *TransformFn = (_cmsTransformFn) PerformanceEval8;
+ *TransformFn = (_cmsTransformFn)PerformanceEval8;
*UserData = p8;
*FreeDataFn = Performance8free;
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_15bits.c b/lcms2mt/plugins/fast_float/src/fast_float_15bits.c
index 3dbfe0369..1056d3dfc 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_15bits.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_15bits.c
@@ -502,10 +502,10 @@ cmsUInt8Number* PackNBytesSwapDither(cmsContext ContextID,
// The factory for 15 bits. This function returns a pointer to specialized function
// that would deal with the asked format. It return a pointer to NULL if the format
// is not supported. This is tha basis of formatter plug-in for 15 bit formats.
-cmsFormatter Formatter_15Bit_Factory(cmsContext ContextID,
- cmsUInt32Number Type,
- cmsFormatterDirection Dir,
- cmsUInt32Number dwFlags)
+CMSCHECKPOINT cmsFormatter CMSEXPORT Formatter_15Bit_Factory(cmsContext ContextID,
+ cmsUInt32Number Type,
+ cmsFormatterDirection Dir,
+ cmsUInt32Number dwFlags)
{
cmsFormatter Result = { NULL };
@@ -598,6 +598,3 @@ cmsFormatter Formatter_15Bit_Factory(cmsContext ContextID,
return Result;
}
-
-
-
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_15mats.c b/lcms2mt/plugins/fast_float/src/fast_float_15mats.c
index e2a7da684..9737abc97 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_15mats.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_15mats.c
@@ -181,6 +181,9 @@ void MatShaperXform(cmsContext ContextID,
_cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, NULL, &nalpha, SourceStartingOrder, SourceIncrements);
_cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, NULL, &nalpha, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
+
strideIn = strideOut = 0;
for (i = 0; i < LineCount; i++) {
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_cmyk.c b/lcms2mt/plugins/fast_float/src/fast_float_cmyk.c
index 1886b9667..5c463631f 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_cmyk.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_cmyk.c
@@ -72,10 +72,11 @@ cmsINLINE cmsFloat32Number fclamp100(cmsFloat32Number v)
static
void FloatCMYKCLUTEval(cmsContext ContextID,
struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
cmsFloat32Number c, m, y, k;
@@ -86,16 +87,18 @@ void FloatCMYKCLUTEval(cmsContext ContextID,
cmsFloat32Number c0, c1 = 0, c2 = 0, c3 = 0;
cmsUInt32Number OutChan;
- FloatCMYKData* p8 = (FloatCMYKData*) _cmsGetTransformUserData(CMMcargo);
+ FloatCMYKData* pcmyk = (FloatCMYKData*) _cmsGetTransformUserData(CMMcargo);
- const cmsInterpParams* p = p8 ->p;
+ const cmsInterpParams* p = pcmyk ->p;
cmsUInt32Number TotalOut = p -> nOutputs;
+ cmsUInt32Number TotalPlusAlpha;
const cmsFloat32Number* LutTable = (const cmsFloat32Number*)p->Table;
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
const cmsUInt8Number* cin;
const cmsUInt8Number* min;
const cmsUInt8Number* yin;
const cmsUInt8Number* kin;
+ const cmsUInt8Number* ain = NULL;
cmsFloat32Number Tmp1[cmsMAXCHANNELS], Tmp2[cmsMAXCHANNELS];
@@ -109,187 +112,203 @@ void FloatCMYKCLUTEval(cmsContext ContextID,
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- // SeparateCMYK(InputFormat, Stride, SourceStartingOrder, SourceIncrements);
- // SeparateCMYK(OutputFormat, Stride, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- cin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- min = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
- yin = (const cmsUInt8Number*)Input + SourceStartingOrder[2];
- kin = (const cmsUInt8Number*)Input + SourceStartingOrder[3];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- for (ii=0; ii < TotalOut; ii++)
- out[ii] = (cmsUInt8Number*)Output + DestStartingOrder[ii];
+ cin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ min = (const cmsUInt8Number*)Input + SourceStartingOrder[1] + strideIn;
+ yin = (const cmsUInt8Number*)Input + SourceStartingOrder[2] + strideIn;
+ kin = (const cmsUInt8Number*)Input + SourceStartingOrder[3] + strideIn;
- for (ii=0; ii < len; ii++) {
+ if (nalpha)
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[4] + strideIn;
- c = fclamp100(*(cmsFloat32Number*)cin) / 100.0f;
- m = fclamp100(*(cmsFloat32Number*)min) / 100.0f;
- y = fclamp100(*(cmsFloat32Number*)yin) / 100.0f;
- k = fclamp100(*(cmsFloat32Number*)kin) / 100.0f;
+ TotalPlusAlpha = TotalOut;
+ if (ain) TotalPlusAlpha++;
- cin += SourceIncrements[0];
- min += SourceIncrements[1];
- yin += SourceIncrements[2];
- kin += SourceIncrements[3];
+ for (ii = 0; ii < TotalPlusAlpha; ii++)
+ out[ii] = (cmsUInt8Number*)Output + DestStartingOrder[ii] + strideOut;
- pk = c * p->Domain[0]; // C
- px = m * p->Domain[1]; // M
- py = y * p->Domain[2]; // Y
- pz = k * p->Domain[3]; // K
+ for (ii = 0; ii < PixelsPerLine; ii++) {
+ c = fclamp100(*(cmsFloat32Number*)cin) / 100.0f;
+ m = fclamp100(*(cmsFloat32Number*)min) / 100.0f;
+ y = fclamp100(*(cmsFloat32Number*)yin) / 100.0f;
+ k = fclamp100(*(cmsFloat32Number*)kin) / 100.0f;
- k0 = (int)_cmsQuickFloor(pk); rk = (pk - (cmsFloat32Number)k0);
- x0 = (int)_cmsQuickFloor(px); rx = (px - (cmsFloat32Number)x0);
- y0 = (int)_cmsQuickFloor(py); ry = (py - (cmsFloat32Number)y0);
- z0 = (int)_cmsQuickFloor(pz); rz = (pz - (cmsFloat32Number)z0);
+ cin += SourceIncrements[0];
+ min += SourceIncrements[1];
+ yin += SourceIncrements[2];
+ kin += SourceIncrements[3];
+ pk = c * p->Domain[0]; // C
+ px = m * p->Domain[1]; // M
+ py = y * p->Domain[2]; // Y
+ pz = k * p->Domain[3]; // K
- K0 = p->opta[3] * k0;
- K1 = K0 + (c >= 1.0 ? 0 : p->opta[3]);
- X0 = p->opta[2] * x0;
- X1 = X0 + (m >= 1.0 ? 0 : p->opta[2]);
+ k0 = (int)_cmsQuickFloor(pk); rk = (pk - (cmsFloat32Number)k0);
+ x0 = (int)_cmsQuickFloor(px); rx = (px - (cmsFloat32Number)x0);
+ y0 = (int)_cmsQuickFloor(py); ry = (py - (cmsFloat32Number)y0);
+ z0 = (int)_cmsQuickFloor(pz); rz = (pz - (cmsFloat32Number)z0);
- Y0 = p->opta[1] * y0;
- Y1 = Y0 + (y >= 1.0 ? 0 : p->opta[1]);
- Z0 = p->opta[0] * z0;
- Z1 = Z0 + (k >= 1.0 ? 0 : p->opta[0]);
+ K0 = p->opta[3] * k0;
+ K1 = K0 + (c >= 1.0 ? 0 : p->opta[3]);
- for (OutChan = 0; OutChan < TotalOut; OutChan++) {
+ X0 = p->opta[2] * x0;
+ X1 = X0 + (m >= 1.0 ? 0 : p->opta[2]);
- c0 = DENS(X0, Y0, Z0);
+ Y0 = p->opta[1] * y0;
+ Y1 = Y0 + (y >= 1.0 ? 0 : p->opta[1]);
- if (rx >= ry && ry >= rz) {
+ Z0 = p->opta[0] * z0;
+ Z1 = Z0 + (k >= 1.0 ? 0 : p->opta[0]);
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ for (OutChan = 0; OutChan < TotalOut; OutChan++) {
- }
- else
- if (rx >= rz && rz >= ry) {
+ c0 = DENS(X0, Y0, Z0);
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
+ if (rx >= ry && ry >= rz) {
- }
- else
- if (rz >= rx && rx >= ry) {
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ }
+ else
+ if (rx >= rz && rz >= ry) {
- }
- else
- if (ry >= rx && rx >= rz) {
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
- c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ }
+ else
+ if (rz >= rx && rx >= ry) {
- }
- else
- if (ry >= rz && rz >= rx) {
+ c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
+ }
+ else
+ if (ry >= rx && rx >= rz) {
- }
- else
- if (rz >= ry && ry >= rx) {
+ c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ }
+ else
+ if (ry >= rz && rz >= rx) {
- }
- else {
- c1 = c2 = c3 = 0;
- }
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
+ }
+ else
+ if (rz >= ry && ry >= rx) {
- Tmp1[OutChan] = c0 + c1 * rx + c2 * ry + c3 * rz;
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
- }
+ }
+ else {
+ c1 = c2 = c3 = 0;
+ }
- LutTable = (cmsFloat32Number*)p->Table;
- LutTable += K1;
+ Tmp1[OutChan] = c0 + c1 * rx + c2 * ry + c3 * rz;
- for (OutChan = 0; OutChan < p->nOutputs; OutChan++) {
+ }
- c0 = DENS(X0, Y0, Z0);
- if (rx >= ry && ry >= rz) {
+ LutTable = (cmsFloat32Number*)p->Table;
+ LutTable += K1;
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ for (OutChan = 0; OutChan < p->nOutputs; OutChan++) {
- }
- else
- if (rx >= rz && rz >= ry) {
+ c0 = DENS(X0, Y0, Z0);
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
+ if (rx >= ry && ry >= rz) {
- }
- else
- if (rz >= rx && rx >= ry) {
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ }
+ else
+ if (rx >= rz && rz >= ry) {
- }
- else
- if (ry >= rx && rx >= rz) {
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
- c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ }
+ else
+ if (rz >= rx && rx >= ry) {
- }
- else
- if (ry >= rz && rz >= rx) {
+ c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
+ }
+ else
+ if (ry >= rx && rx >= rz) {
- }
- else
- if (rz >= ry && ry >= rx) {
+ c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ }
+ else
+ if (ry >= rz && rz >= rx) {
- }
- else {
- c1 = c2 = c3 = 0;
- }
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
- Tmp2[OutChan] = c0 + c1 * rx + c2 * ry + c3 * rz;
- }
+ }
+ else
+ if (rz >= ry && ry >= rx) {
+
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
+ }
+ else {
+ c1 = c2 = c3 = 0;
+ }
- for (OutChan = 0; OutChan < p->nOutputs; OutChan++) {
+ Tmp2[OutChan] = c0 + c1 * rx + c2 * ry + c3 * rz;
+ }
- *(cmsFloat32Number*)(out[OutChan]) = LinearInterpInt(rk, Tmp1[OutChan], Tmp2[OutChan]);
- out[OutChan] += DestIncrements[OutChan];
- }
+ for (OutChan = 0; OutChan < p->nOutputs; OutChan++) {
+
+ *(cmsFloat32Number*)(out[OutChan]) = LinearInterpInt(rk, Tmp1[OutChan], Tmp2[OutChan]);
+ out[OutChan] += DestIncrements[OutChan];
+ }
+
+ if (ain)
+ *out[TotalOut] = *ain;
+
+ }
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
@@ -312,9 +331,8 @@ cmsBool OptimizeCLUTCMYKTransform(cmsContext ContextID,
int nGridPoints;
cmsPipeline* OptimizedLUT = NULL;
cmsStage* OptimizedCLUTmpe;
- cmsColorSpaceSignature OutputColorSpace;
cmsStage* mpe;
- FloatCMYKData* p8;
+ FloatCMYKData* pcmyk;
_cmsStageCLutData* data;
// For empty transforms, do nothing
@@ -338,8 +356,7 @@ cmsBool OptimizeCLUTCMYKTransform(cmsContext ContextID,
if (cmsStageType(ContextID, mpe) == cmsSigNamedColorElemType) return FALSE;
}
- OutputColorSpace = _cmsICCcolorSpace(ContextID, T_COLORSPACE(*OutputFormat));
- nGridPoints = _cmsReasonableGridpointsByColorspace(cmsSigRgbData, *dwFlags);
+ nGridPoints = _cmsReasonableGridpointsByColorspace(cmsSigRgbData, *dwFlags);
// Create the result LUT
OptimizedLUT = cmsPipelineAlloc(ContextID, 4, cmsPipelineOutputChannels(ContextID, OriginalLut));
@@ -358,15 +375,15 @@ cmsBool OptimizeCLUTCMYKTransform(cmsContext ContextID,
// Set the evaluator, copy parameters
data = (_cmsStageCLutData*) cmsStageData(ContextID, OptimizedCLUTmpe);
- p8 = FloatCMYKAlloc(ContextID, data ->Params);
- if (p8 == NULL) return FALSE;
+ pcmyk = FloatCMYKAlloc(ContextID, data ->Params);
+ if (pcmyk == NULL) return FALSE;
// And return the obtained LUT
cmsPipelineFree(ContextID, OriginalLut);
*Lut = OptimizedLUT;
- *TransformFn = (_cmsTransformFn) FloatCMYKCLUTEval;
- *UserData = p8;
+ *TransformFn = (_cmsTransformFn)FloatCMYKCLUTEval;
+ *UserData = pcmyk;
*FreeDataFn = _cmsFree;
*dwFlags &= ~cmsFLAGS_CAN_CHANGE_FORMATTER;
return TRUE;
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_curves.c b/lcms2mt/plugins/fast_float/src/fast_float_curves.c
index e6e42fb62..43d991650 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_curves.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_curves.c
@@ -58,13 +58,14 @@ static void free_aligned(cmsContext ContextID, void* Data)
// Evaluator for float curves. This are just 1D tables
static void FastEvaluateFloatRGBCurves(cmsContext ContextID,
- struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ struct _cmstransform_struct *CMMcargo,
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
@@ -73,10 +74,12 @@ static void FastEvaluateFloatRGBCurves(cmsContext ContextID,
const cmsUInt8Number* rin;
const cmsUInt8Number* gin;
const cmsUInt8Number* bin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* rout;
cmsUInt8Number* gout;
cmsUInt8Number* bout;
+ cmsUInt8Number* aout = NULL;
cmsUInt32Number InputFormat = cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
@@ -84,46 +87,70 @@ static void FastEvaluateFloatRGBCurves(cmsContext ContextID,
CurvesFloatData* Data = (CurvesFloatData*) _cmsGetTransformUserData(CMMcargo);
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- // SeparateRGB(InputFormat, Stride, SourceStartingOrder, SourceIncrements);
- // SeparateRGB(OutputFormat, Stride, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
- bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2];
- rout = (cmsUInt8Number*)Output + DestStartingOrder[0];
- gout = (cmsUInt8Number*)Output + DestStartingOrder[1];
- bout = (cmsUInt8Number*)Output + DestStartingOrder[2];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- for (ii = 0; ii < len; ii++) {
+ rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1] + strideIn;
+ bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2] + strideIn;
- *(cmsFloat32Number*)rout = flerp(Data->CurveR, *(cmsFloat32Number*)rin);
- *(cmsFloat32Number*)gout = flerp(Data->CurveG, *(cmsFloat32Number*)gin);
- *(cmsFloat32Number*)bout = flerp(Data->CurveB, *(cmsFloat32Number*)bin);
+ if (nalpha)
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[3] + strideIn;
- rin += SourceIncrements[0];
- gin += SourceIncrements[1];
- bin += SourceIncrements[2];
+ rout = (cmsUInt8Number*)Output + DestStartingOrder[0] + strideOut;
+ gout = (cmsUInt8Number*)Output + DestStartingOrder[1] + strideOut;
+ bout = (cmsUInt8Number*)Output + DestStartingOrder[2] + strideOut;
- rout += DestIncrements[0];
- gout += DestIncrements[1];
- bout += DestIncrements[2];
+ if (nalpha)
+ aout = (cmsUInt8Number*)Output + DestStartingOrder[3] + strideOut;
+
+
+ for (ii = 0; ii < PixelsPerLine; ii++) {
+
+ *(cmsFloat32Number*)rout = flerp(Data->CurveR, *(cmsFloat32Number*)rin);
+ *(cmsFloat32Number*)gout = flerp(Data->CurveG, *(cmsFloat32Number*)gin);
+ *(cmsFloat32Number*)bout = flerp(Data->CurveB, *(cmsFloat32Number*)bin);
+
+ rin += SourceIncrements[0];
+ gin += SourceIncrements[1];
+ bin += SourceIncrements[2];
+
+ rout += DestIncrements[0];
+ gout += DestIncrements[1];
+ bout += DestIncrements[2];
+
+ if (ain)
+ {
+ *(cmsFloat32Number*)aout = *(cmsFloat32Number*)ain;
+ ain += SourceIncrements[3];
+ aout += DestIncrements[3];
+ }
+ }
+
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
// Do nothing but arrange the RGB format.
static void FastFloatRGBIdentity(cmsContext ContextID,
struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
@@ -131,36 +158,48 @@ static void FastFloatRGBIdentity(cmsContext ContextID,
const cmsUInt8Number* rin;
const cmsUInt8Number* gin;
const cmsUInt8Number* bin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* rout;
cmsUInt8Number* gout;
cmsUInt8Number* bout;
-
+ cmsUInt8Number* aout = NULL;
cmsUInt32Number InputFormat = cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
-
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- // SeparateRGB(InputFormat, Stride, SourceStartingOrder, SourceIncrements);
- // SeparateRGB(OutputFormat, Stride, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
- bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- rout = (cmsUInt8Number*)Output + DestStartingOrder[0];
- gout = (cmsUInt8Number*)Output + DestStartingOrder[1];
- bout = (cmsUInt8Number*)Output + DestStartingOrder[2];
+ rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1] + strideIn;
+ bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2] + strideIn;
- for (ii=0; ii < len; ii++) {
+ if (nalpha)
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[3] + strideIn;
- memmove(rout, rin, 4);
- memmove(gout, gin, 4);
- memmove(bout, bin, 4);
+
+ rout = (cmsUInt8Number*)Output + DestStartingOrder[0] + strideOut;
+ gout = (cmsUInt8Number*)Output + DestStartingOrder[1] + strideOut;
+ bout = (cmsUInt8Number*)Output + DestStartingOrder[2] + strideOut;
+
+ if (nalpha)
+ aout = (cmsUInt8Number*)Output + DestStartingOrder[3] + strideOut;
+
+
+ for (ii=0; ii < PixelsPerLine; ii++) {
+
+ *(cmsFloat32Number*)rout = *(cmsFloat32Number*)rin;
+ *(cmsFloat32Number*)gout = *(cmsFloat32Number*)gin;
+ *(cmsFloat32Number*)bout = *(cmsFloat32Number*)bin;
rin += SourceIncrements[0];
gin += SourceIncrements[1];
@@ -169,86 +208,147 @@ static void FastFloatRGBIdentity(cmsContext ContextID,
rout += DestIncrements[0];
gout += DestIncrements[1];
bout += DestIncrements[2];
+
+
+ if (ain)
+ {
+ *(cmsFloat32Number*)aout = *(cmsFloat32Number*)ain;
+ ain += SourceIncrements[3];
+ aout += DestIncrements[3];
+ }
+ }
+
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
// Evaluate 1 channel only
static void FastEvaluateFloatGrayCurves(cmsContext ContextID,
- struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ struct _cmstransform_struct *CMMcargo,
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number DestIncrements[cmsMAXCHANNELS];
const cmsUInt8Number* kin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* kout;
-
+ cmsUInt8Number* aout = NULL;
cmsUInt32Number InputFormat = cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
- CurvesFloatData* Data = (CurvesFloatData*) _cmsGetTransformUserData(CMMcargo);
+ CurvesFloatData* Data = (CurvesFloatData*)_cmsGetTransformUserData(CMMcargo);
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- // SeparateGray(InputFormat, Stride, &SourceStartingOrder, &SourceIncrement);
- // SeparateGray(OutputFormat, Stride, &DestStartingOrder, &DestIncrement);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- kin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- kout = (cmsUInt8Number*)Output + DestStartingOrder[0];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- for (ii = 0; ii < len; ii++) {
+ kin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ kout = (cmsUInt8Number*)Output + DestStartingOrder[0] + strideOut;
+
+ if (nalpha)
+ {
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
+ aout = (cmsUInt8Number*)Output + DestStartingOrder[1];
+ }
- *(cmsFloat32Number*)kout = flerp(Data->CurveR, *(cmsFloat32Number*)kin);
+ for (ii = 0; ii < PixelsPerLine; ii++) {
+
+ *(cmsFloat32Number*)kout = flerp(Data->CurveR, *(cmsFloat32Number*)kin);
+
+ kin += SourceIncrements[0];
+ kout += DestIncrements[0];
+
+ if (ain)
+ {
+ *(cmsFloat32Number*)aout = *(cmsFloat32Number*)ain;
+ ain += SourceIncrements[1];
+ aout += DestIncrements[1];
+ }
+ }
- kin += SourceIncrements[0];
- kout += DestIncrements[0];
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
static void FastFloatGrayIdentity(cmsContext ContextID,
struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number DestIncrements[cmsMAXCHANNELS];
+
const cmsUInt8Number* kin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* kout;
+ cmsUInt8Number* aout = NULL;
cmsUInt32Number InputFormat = cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
+
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- // SeparateGray(InputFormat, Stride, &SourceStartingOrder, &SourceIncrement);
- // SeparateGray(OutputFormat, Stride, &DestStartingOrder, &DestIncrement);
- kin = (const cmsUInt8Number*) Input + SourceStartingOrder[0];
- kout = (cmsUInt8Number*)Output + DestStartingOrder[0];
+ kin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ kout = (cmsUInt8Number*)Output + DestStartingOrder[0] + strideOut;
+
+ if (nalpha)
+ {
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
+ aout = (cmsUInt8Number*)Output + DestStartingOrder[1];
+ }
- for (ii=0; ii < len; ii++) {
- memmove(kout, kin, 4);
+ for (ii = 0; ii < PixelsPerLine; ii++) {
- kin += SourceIncrements[0];
- kout += DestIncrements[0];
+ *(cmsFloat32Number*)kout = *(cmsFloat32Number*)kin;
+
+ kin += SourceIncrements[0];
+ kout += DestIncrements[0];
+
+ if (ain)
+ {
+ *(cmsFloat32Number*)aout = *(cmsFloat32Number*)ain;
+ ain += SourceIncrements[1];
+ aout += DestIncrements[1];
+ }
+ }
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
@@ -374,11 +474,10 @@ cmsBool OptimizeFloatByJoiningCurves(cmsContext ContextID,
// Maybe the curves are linear at the end
if (nChans == 1)
- *TransformFn = (_cmsTransformFn) (KCurveIsLinear(Data) ? FastFloatGrayIdentity : FastEvaluateFloatGrayCurves);
+ *TransformFn = (_cmsTransformFn)(KCurveIsLinear(Data) ? FastFloatGrayIdentity : FastEvaluateFloatGrayCurves);
else
- *TransformFn = (_cmsTransformFn) (AllRGBCurvesAreLinear(Data) ? FastFloatRGBIdentity : FastEvaluateFloatRGBCurves);
+ *TransformFn = (_cmsTransformFn)(AllRGBCurvesAreLinear(Data) ? FastFloatRGBIdentity : FastEvaluateFloatRGBCurves);
return TRUE;
}
-
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_internal.h b/lcms2mt/plugins/fast_float/src/fast_float_internal.h
index 0f153cb86..27415a8f5 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_internal.h
+++ b/lcms2mt/plugins/fast_float/src/fast_float_internal.h
@@ -25,11 +25,14 @@
#include "lcms2mt_fast_float.h"
#include <stdint.h>
-#define REQUIRED_LCMS_VERSION (2100-2000)
+#define REQUIRED_LCMS_VERSION (2120-2000)
// Unused parameter warning supression
#define UNUSED_PARAMETER(x) ((void)x)
+// For testbed
+#define CMSCHECKPOINT CMSAPI
+
// The specification for "inline" is section 6.7.4 of the C99 standard (ISO/IEC 9899:1999).
// unfortunately VisualC++ does not conform that
#if defined(_MSC_VER) || defined(__BORLANDC__)
@@ -141,25 +144,24 @@ cmsINLINE cmsFloat32Number flerp(const cmsFloat32Number LutTable[], cmsFloat32Nu
-
// Some secret sauce from lcms
-int _cmsReasonableGridpointsByColorspace(cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags);
+CMSAPI cmsUInt32Number CMSEXPORT _cmsReasonableGridpointsByColorspace(cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags);
// Compute the increments to be used by the transform functions
-void _cmsComputeComponentIncrements(cmsUInt32Number Format,
- cmsUInt32Number BytesPerPlane,
- cmsUInt32Number* nChannels,
- cmsUInt32Number* nAlpha,
- cmsUInt32Number ComponentStartingOrder[],
- cmsUInt32Number ComponentPointerIncrements[]);
+CMSCHECKPOINT void CMSEXPORT _cmsComputeComponentIncrements(cmsUInt32Number Format,
+ cmsUInt32Number BytesPerPlane,
+ cmsUInt32Number* nChannels,
+ cmsUInt32Number* nAlpha,
+ cmsUInt32Number ComponentStartingOrder[],
+ cmsUInt32Number ComponentPointerIncrements[]);
// 15 bits formatters
-cmsFormatter Formatter_15Bit_Factory(cmsContext ContextID,
- cmsUInt32Number Type,
- cmsFormatterDirection Dir,
- cmsUInt32Number dwFlags);
+CMSCHECKPOINT cmsFormatter CMSEXPORT Formatter_15Bit_Factory(cmsContext ContextID,
+ cmsUInt32Number Type,
+ cmsFormatterDirection Dir,
+ cmsUInt32Number dwFlags);
// Optimizers
@@ -173,6 +175,16 @@ cmsBool Optimize8MatrixShaper(cmsContext ContextID,
cmsUInt32Number* OutputFormat,
cmsUInt32Number* dwFlags);
+// 8 bits using SSE
+cmsBool Optimize8MatrixShaperSSE(cmsContext ContextID,
+ _cmsTransformFn* TransformFn,
+ void** UserData,
+ _cmsFreeUserDataFn* FreeUserData,
+ cmsPipeline** Lut,
+ cmsUInt32Number* InputFormat,
+ cmsUInt32Number* OutputFormat,
+ cmsUInt32Number* dwFlags);
+
cmsBool OptimizeMatrixShaper15(cmsContext ContextID,
_cmsTransformFn* TransformFn,
void** UserData,
@@ -193,22 +205,22 @@ cmsBool Optimize8ByJoiningCurves(cmsContext ContextID,
cmsUInt32Number* dwFlags);
cmsBool OptimizeFloatByJoiningCurves(cmsContext ContextID,
- _cmsTransformFn* TransformFn,
- void** UserData,
- _cmsFreeUserDataFn* FreeUserData,
- cmsPipeline** Lut,
- cmsUInt32Number* InputFormat,
- cmsUInt32Number* OutputFormat,
- cmsUInt32Number* dwFlags);
+ _cmsTransformFn* TransformFn,
+ void** UserData,
+ _cmsFreeUserDataFn* FreeUserData,
+ cmsPipeline** Lut,
+ cmsUInt32Number* InputFormat,
+ cmsUInt32Number* OutputFormat,
+ cmsUInt32Number* dwFlags);
cmsBool OptimizeFloatMatrixShaper(cmsContext ContextID,
- _cmsTransformFn* TransformFn,
- void** UserData,
- _cmsFreeUserDataFn* FreeUserData,
- cmsPipeline** Lut,
- cmsUInt32Number* InputFormat,
- cmsUInt32Number* OutputFormat,
- cmsUInt32Number* dwFlags);
+ _cmsTransformFn* TransformFn,
+ void** UserData,
+ _cmsFreeUserDataFn* FreeUserData,
+ cmsPipeline** Lut,
+ cmsUInt32Number* InputFormat,
+ cmsUInt32Number* OutputFormat,
+ cmsUInt32Number* dwFlags);
cmsBool Optimize8BitRGBTransform(cmsContext ContextID,
_cmsTransformFn* TransformFn,
@@ -238,12 +250,23 @@ cmsBool OptimizeCLUTRGBTransform(cmsContext ContextID,
cmsUInt32Number* dwFlags);
cmsBool OptimizeCLUTCMYKTransform(cmsContext ContextID,
- _cmsTransformFn* TransformFn,
- void** UserData,
- _cmsFreeUserDataFn* FreeDataFn,
- cmsPipeline** Lut,
- cmsUInt32Number* InputFormat,
- cmsUInt32Number* OutputFormat,
- cmsUInt32Number* dwFlags);
+ _cmsTransformFn* TransformFn,
+ void** UserData,
+ _cmsFreeUserDataFn* FreeDataFn,
+ cmsPipeline** Lut,
+ cmsUInt32Number* InputFormat,
+ cmsUInt32Number* OutputFormat,
+ cmsUInt32Number* dwFlags);
+
+
+cmsBool OptimizeCLUTLabTransform(cmsContext ContextID,
+ _cmsTransformFn* TransformFn,
+ void** UserData,
+ _cmsFreeUserDataFn* FreeDataFn,
+ cmsPipeline** Lut,
+ cmsUInt32Number* InputFormat,
+ cmsUInt32Number* OutputFormat,
+ cmsUInt32Number* dwFlags);
+
#endif
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_matsh.c b/lcms2mt/plugins/fast_float/src/fast_float_matsh.c
index 07396e59e..3ff1fc03d 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_matsh.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_matsh.c
@@ -137,15 +137,16 @@ VXMatShaperFloatData* SetMatShaper(cmsContext ContextID, cmsToneCurve* Curve1[3]
// A fast matrix-shaper evaluator for floating point
static
void MatShaperFloat(cmsContext ContextID, struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
{
VXMatShaperFloatData* p = (VXMatShaperFloatData*) _cmsGetTransformUserData(CMMcargo);
cmsFloat32Number l1, l2, l3;
cmsFloat32Number r, g, b;
- cmsUInt32Number ii;
+ cmsUInt32Number i, ii;
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
cmsUInt32Number SourceIncrements[cmsMAXCHANNELS];
cmsUInt32Number DestStartingOrder[cmsMAXCHANNELS];
@@ -154,54 +155,79 @@ void MatShaperFloat(cmsContext ContextID, struct _cmstransform_struct *CMMcargo,
const cmsUInt8Number* rin;
const cmsUInt8Number* gin;
const cmsUInt8Number* bin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* rout;
cmsUInt8Number* gout;
cmsUInt8Number* bout;
+ cmsUInt8Number* aout = NULL;
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(cmsGetTransformInputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM)CMMcargo), Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
- bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2];
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- rout = (cmsUInt8Number*)Output + DestStartingOrder[0];
- gout = (cmsUInt8Number*)Output + DestStartingOrder[1];
- bout = (cmsUInt8Number*)Output + DestStartingOrder[2];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- for (ii=0; ii < len; ii++) {
+ rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1] + strideIn;
+ bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2] + strideIn;
- r = flerp(p->Shaper1R, *(cmsFloat32Number*)rin);
- g = flerp(p->Shaper1G, *(cmsFloat32Number*)gin);
- b = flerp(p->Shaper1B, *(cmsFloat32Number*)bin);
+ if (nalpha)
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[3] + strideIn;
- l1 = p->Mat[0][0] * r + p->Mat[0][1] * g + p->Mat[0][2] * b ;
- l2 = p->Mat[1][0] * r + p->Mat[1][1] * g + p->Mat[1][2] * b ;
- l3 = p->Mat[2][0] * r + p->Mat[2][1] * g + p->Mat[2][2] * b ;
+ rout = (cmsUInt8Number*)Output + DestStartingOrder[0] + strideOut;
+ gout = (cmsUInt8Number*)Output + DestStartingOrder[1] + strideOut;
+ bout = (cmsUInt8Number*)Output + DestStartingOrder[2] + strideOut;
- if (p->UseOff) {
+ if (nalpha)
+ aout = (cmsUInt8Number*)Output + DestStartingOrder[3] + strideOut;
- l1 += p->Off[0];
- l2 += p->Off[1];
- l3 += p->Off[2];
- }
+ for (ii = 0; ii < PixelsPerLine; ii++) {
- *(cmsFloat32Number*)rout = flerp(p->Shaper2R, l1);
- *(cmsFloat32Number*)gout = flerp(p->Shaper2G, l2);
- *(cmsFloat32Number*)bout = flerp(p->Shaper2B, l3);
+ r = flerp(p->Shaper1R, *(cmsFloat32Number*)rin);
+ g = flerp(p->Shaper1G, *(cmsFloat32Number*)gin);
+ b = flerp(p->Shaper1B, *(cmsFloat32Number*)bin);
- rin += SourceIncrements[0];
- gin += SourceIncrements[1];
- bin += SourceIncrements[2];
+ l1 = p->Mat[0][0] * r + p->Mat[0][1] * g + p->Mat[0][2] * b;
+ l2 = p->Mat[1][0] * r + p->Mat[1][1] * g + p->Mat[1][2] * b;
+ l3 = p->Mat[2][0] * r + p->Mat[2][1] * g + p->Mat[2][2] * b;
- rout += DestIncrements[0];
- gout += DestIncrements[1];
- bout += DestIncrements[2];
- }
+ if (p->UseOff) {
+
+ l1 += p->Off[0];
+ l2 += p->Off[1];
+ l3 += p->Off[2];
+ }
+
+ *(cmsFloat32Number*)rout = flerp(p->Shaper2R, l1);
+ *(cmsFloat32Number*)gout = flerp(p->Shaper2G, l2);
+ *(cmsFloat32Number*)bout = flerp(p->Shaper2B, l3);
+
+ rin += SourceIncrements[0];
+ gin += SourceIncrements[1];
+ bin += SourceIncrements[2];
+ rout += DestIncrements[0];
+ gout += DestIncrements[1];
+ bout += DestIncrements[2];
+
+ if (ain)
+ {
+ *(cmsFloat32Number*)aout = *(cmsFloat32Number*)ain;
+ ain += SourceIncrements[3];
+ aout += DestIncrements[3];
+ }
+ }
+
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
+ }
}
@@ -313,7 +339,7 @@ cmsBool OptimizeFloatMatrixShaper(cmsContext ContextID,
*UserData = SetMatShaper(ContextID, mpeC1 ->TheCurves, &res, (cmsVEC3*) Data2 ->Offset, mpeC2->TheCurves);
*FreeUserData = FreeMatShaper;
- *TransformFn = (_cmsTransformFn) MatShaperFloat;
+ *TransformFn = (_cmsTransformFn)MatShaperFloat;
}
*dwFlags &= ~cmsFLAGS_CAN_CHANGE_FORMATTER;
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_separate.c b/lcms2mt/plugins/fast_float/src/fast_float_separate.c
index c4186a929..ce53282c6 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_separate.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_separate.c
@@ -179,7 +179,7 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,
// Dispatcher por chunky and planar RGB
-void _cmsComputeComponentIncrements(cmsUInt32Number Format,
+CMSCHECKPOINT void CMSEXPORT _cmsComputeComponentIncrements(cmsUInt32Number Format,
cmsUInt32Number BytesPerPlane,
cmsUInt32Number* nChannels,
cmsUInt32Number* nAlpha,
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_sup.c b/lcms2mt/plugins/fast_float/src/fast_float_sup.c
index 9a375a4b6..6d03249a7 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_sup.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_sup.c
@@ -35,33 +35,39 @@ cmsBool Floating_Point_Transforms_Dispatcher(cmsContext ContextID,
cmsUInt32Number* dwFlags)
{
- // Try to optimize as a set of curves plus a matrix plus a set of curves
- if (OptimizeMatrixShaper15(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize as a set of curves plus a matrix plus a set of curves
+ if (OptimizeMatrixShaper15(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize by joining curves
- if (Optimize8ByJoiningCurves(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize by joining curves
+ if (Optimize8ByJoiningCurves(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize as a set of curves plus a matrix plus a set of curves
- if (Optimize8MatrixShaper(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+#ifndef CMS_DONT_USE_SSE2
+ // Try to use SSE2 to optimize as a set of curves plus a matrix plus a set of curves
+ if (Optimize8MatrixShaperSSE(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+#endif
+ // Try to optimize as a set of curves plus a matrix plus a set of curves
+ if (Optimize8MatrixShaper(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize by joining curves
- if (OptimizeFloatByJoiningCurves(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize by joining curves
+ if (OptimizeFloatByJoiningCurves(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize as a set of curves plus a matrix plus a set of curves
- if (OptimizeFloatMatrixShaper(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize as a set of curves plus a matrix plus a set of curves
+ if (OptimizeFloatMatrixShaper(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize using prelinearization plus tetrahedral
- if (Optimize8BitRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize using prelinearization plus tetrahedral
+ if (Optimize8BitRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize using prelinearization plus tetrahedral
- if (Optimize16BitRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize using prelinearization plus tetrahedral
+ if (Optimize16BitRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize using prelinearization plus tetrahedral
- if (OptimizeCLUTRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize using prelinearization plus tetrahedral
+ if (OptimizeCLUTRGBTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
- // Try to optimize using prelinearization plus tetrahedral
- if (OptimizeCLUTCMYKTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize using prelinearization plus tetrahedral
+ if (OptimizeCLUTCMYKTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
+ // Try to optimize for Lab float as input
+ if (OptimizeCLUTLabTransform(ContextID, TransformFn, UserData, FreeUserData, Lut, InputFormat, OutputFormat, dwFlags)) return TRUE;
// Cannot optimize, use lcms normal process
return FALSE;
@@ -78,13 +84,15 @@ static cmsPluginTransform PluginList = {
{ cmsPluginMagicNumber, REQUIRED_LCMS_VERSION, cmsPluginTransformSig, (cmsPluginBase *) &PluginFastFloat },
- Floating_Point_Transforms_Dispatcher
+ // When initializing a union, the initializer list must have only one member, which initializes the first member of
+ // the union unless a designated initializer is used (C99)
+
+ { (_cmsTransformFactory) Floating_Point_Transforms_Dispatcher }
};
// This is the main plug-in installer.
// Using a function to retrieve the plug-in entry point allows us to execute initialization data.
-void* cmsFastFloatExtensions(void)
+void* CMSEXPORT cmsFastFloatExtensions(void)
{
return (void*)&PluginList;
}
-
diff --git a/lcms2mt/plugins/fast_float/src/fast_float_tethra.c b/lcms2mt/plugins/fast_float/src/fast_float_tethra.c
index 6bb688f7b..d8abc0f46 100644
--- a/lcms2mt/plugins/fast_float/src/fast_float_tethra.c
+++ b/lcms2mt/plugins/fast_float/src/fast_float_tethra.c
@@ -28,7 +28,7 @@ typedef struct {
} FloatCLUTData;
-// Precomputes tables for 8-bit on input devicelink.
+// Allocates container
static
FloatCLUTData* FloatCLUTAlloc(cmsContext ContextID, const cmsInterpParams* p)
{
@@ -38,53 +38,53 @@ FloatCLUTData* FloatCLUTAlloc(cmsContext ContextID, const cmsInterpParams* p)
if (fd == NULL) return NULL;
fd ->p = p;
+
return fd;
}
-// Sampler implemented by another LUT. This is a clean way to precalculate the devicelink 3D CLUT for
-// almost any transform. We use floating point precision and then convert from floating point to 16 bits.
+// Sampler implemented by another LUT.
static
int XFormSampler(cmsContext ContextID, CMSREGISTER const cmsFloat32Number In[], CMSREGISTER cmsFloat32Number Out[], CMSREGISTER void* Cargo)
{
- // Evaluate in 16 bits
cmsPipelineEvalFloat(ContextID, In, Out, (cmsPipeline*) Cargo);
-
- // Always succeed
return TRUE;
}
-
-
-// A optimized interpolation for 8-bit input.
+// A optimized interpolation for input.
#define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan])
static
void FloatCLUTEval(cmsContext ContextID,
struct _cmstransform_struct *CMMcargo,
- const cmsFloat32Number* Input,
- cmsFloat32Number* Output,
- cmsUInt32Number len,
- cmsUInt32Number Stride)
+ const void* Input,
+ void* Output,
+ cmsUInt32Number PixelsPerLine,
+ cmsUInt32Number LineCount,
+ const cmsStride* Stride)
+
{
+ FloatCLUTData* pfloat = (FloatCLUTData*)_cmsGetTransformUserData(CMMcargo);
+
cmsFloat32Number r, g, b;
cmsFloat32Number px, py, pz;
int x0, y0, z0;
int X0, Y0, Z0, X1, Y1, Z1;
cmsFloat32Number rx, ry, rz;
cmsFloat32Number c0, c1 = 0, c2 = 0, c3 = 0;
-
cmsUInt32Number OutChan;
- FloatCLUTData* p8 = (FloatCLUTData*) _cmsGetTransformUserData(CMMcargo);
- const cmsInterpParams* p = p8 ->p;
- cmsUInt32Number TotalOut = p -> nOutputs;
+ const cmsInterpParams* p = pfloat->p;
+ cmsUInt32Number TotalOut = p->nOutputs;
+ cmsUInt32Number TotalPlusAlpha;
const cmsFloat32Number* LutTable = (const cmsFloat32Number*)p->Table;
- cmsUInt32Number ii;
- const cmsUInt8Number* rin;
- const cmsUInt8Number* gin;
- const cmsUInt8Number* bin;
+
+ cmsUInt32Number i, ii;
+ const cmsUInt8Number* rin;
+ const cmsUInt8Number* gin;
+ const cmsUInt8Number* bin;
+ const cmsUInt8Number* ain = NULL;
cmsUInt8Number* out[cmsMAXCHANNELS];
cmsUInt32Number SourceStartingOrder[cmsMAXCHANNELS];
@@ -96,112 +96,125 @@ void FloatCLUTEval(cmsContext ContextID,
cmsUInt32Number OutputFormat = cmsGetTransformOutputFormat(ContextID, (cmsHTRANSFORM) CMMcargo);
cmsUInt32Number nchans, nalpha;
+ cmsUInt32Number strideIn, strideOut;
- _cmsComputeComponentIncrements(InputFormat, Stride, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
- _cmsComputeComponentIncrements(OutputFormat, Stride, &nchans, &nalpha, DestStartingOrder, DestIncrements);
+ _cmsComputeComponentIncrements(InputFormat, Stride->BytesPerPlaneIn, &nchans, &nalpha, SourceStartingOrder, SourceIncrements);
+ _cmsComputeComponentIncrements(OutputFormat, Stride->BytesPerPlaneOut, &nchans, &nalpha, DestStartingOrder, DestIncrements);
- // SeparateRGB(InputFormat, Stride, SourceStartingOrder, SourceIncrements);
- // SeparateRGB(OutputFormat, Stride, DestStartingOrder, DestIncrements);
+ if (!(_cmsGetTransformFlags((cmsHTRANSFORM)CMMcargo) & cmsFLAGS_COPY_ALPHA))
+ nalpha = 0;
- rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0];
- gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1];
- bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2];
+ strideIn = strideOut = 0;
+ for (i = 0; i < LineCount; i++) {
- for (ii=0; ii < TotalOut; ii++)
- out[ii] = (cmsUInt8Number*) Output + DestStartingOrder[ii];
+ rin = (const cmsUInt8Number*)Input + SourceStartingOrder[0] + strideIn;
+ gin = (const cmsUInt8Number*)Input + SourceStartingOrder[1] + strideIn;
+ bin = (const cmsUInt8Number*)Input + SourceStartingOrder[2] + strideIn;
+ if (nalpha)
+ ain = (const cmsUInt8Number*)Input + SourceStartingOrder[3] + strideIn;
- for (ii=0; ii < len; ii++) {
+ TotalPlusAlpha = TotalOut;
+ if (ain) TotalPlusAlpha++;
- r = fclamp(*(cmsFloat32Number*)rin);
- g = fclamp(*(cmsFloat32Number*)gin);
- b = fclamp(*(cmsFloat32Number*)bin);
+ for (ii = 0; ii < TotalPlusAlpha; ii++)
+ out[ii] = (cmsUInt8Number*)Output + DestStartingOrder[ii] + strideOut;
- rin += SourceIncrements[0];
- gin += SourceIncrements[1];
- bin += SourceIncrements[2];
+ for (ii = 0; ii < PixelsPerLine; ii++) {
- px = r * p->Domain[0];
- py = g * p->Domain[1];
- pz = b * p->Domain[2];
+ r = fclamp(*(cmsFloat32Number*)rin);
+ g = fclamp(*(cmsFloat32Number*)gin);
+ b = fclamp(*(cmsFloat32Number*)bin);
+ rin += SourceIncrements[0];
+ gin += SourceIncrements[1];
+ bin += SourceIncrements[2];
- x0 = (int)_cmsQuickFloor(px); rx = (px - (cmsFloat32Number)x0);
- y0 = (int)_cmsQuickFloor(py); ry = (py - (cmsFloat32Number)y0);
- z0 = (int)_cmsQuickFloor(pz); rz = (pz - (cmsFloat32Number)z0);
+ px = r * p->Domain[0];
+ py = g * p->Domain[1];
+ pz = b * p->Domain[2];
- X0 = p->opta[2] * x0;
- X1 = X0 + (r >= 1.0 ? 0 : p->opta[2]);
+ x0 = _cmsQuickFloor(px); rx = (px - (cmsFloat32Number)x0);
+ y0 = _cmsQuickFloor(py); ry = (py - (cmsFloat32Number)y0);
+ z0 = _cmsQuickFloor(pz); rz = (pz - (cmsFloat32Number)z0);
- Y0 = p->opta[1] * y0;
- Y1 = Y0 + (g >= 1.0 ? 0 : p->opta[1]);
- Z0 = p->opta[0] * z0;
- Z1 = Z0 + (b >= 1.0 ? 0 : p->opta[0]);
+ X0 = p->opta[2] * x0;
+ X1 = X0 + (r >= 1.0 ? 0 : p->opta[2]);
- for (OutChan = 0; OutChan < TotalOut; OutChan++) {
+ Y0 = p->opta[1] * y0;
+ Y1 = Y0 + (g >= 1.0 ? 0 : p->opta[1]);
- // These are the 6 Tetrahedral
+ Z0 = p->opta[0] * z0;
+ Z1 = Z0 + (b >= 1.0 ? 0 : p->opta[0]);
- c0 = DENS(X0, Y0, Z0);
+ for (OutChan = 0; OutChan < TotalOut; OutChan++) {
- if (rx >= ry && ry >= rz) {
+ // These are the 6 Tetrahedral
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ c0 = DENS(X0, Y0, Z0);
- }
- else
- if (rx >= rz && rz >= ry) {
+ if (rx >= ry && ry >= rz) {
- c1 = DENS(X1, Y0, Z0) - c0;
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- }
- else
- if (rz >= rx && rx >= ry) {
+ }
+ else
+ if (rx >= rz && rz >= ry) {
- c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
- c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ c1 = DENS(X1, Y0, Z0) - c0;
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
- }
- else
- if (ry >= rx && rx >= rz) {
+ }
+ else
+ if (rz >= rx && rx >= ry) {
- c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
+ c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
+ c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
- }
- else
- if (ry >= rz && rz >= rx) {
+ }
+ else
+ if (ry >= rx && rx >= rz) {
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z0) - c0;
- c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
+ c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
- }
- else
- if (rz >= ry && ry >= rx) {
+ }
+ else
+ if (ry >= rz && rz >= rx) {
- c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - c0;
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z0) - c0;
+ c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
- }
- else {
- c1 = c2 = c3 = 0;
- }
+ }
+ else
+ if (rz >= ry && ry >= rx) {
- *(cmsFloat32Number*) (out[OutChan]) = c0 + c1 * rx + c2 * ry + c3 * rz;
+ c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
+ c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
+ c3 = DENS(X0, Y0, Z1) - c0;
- out[OutChan] += DestIncrements[OutChan];
+ }
+ else {
+ c1 = c2 = c3 = 0;
+ }
- }
+ *(cmsFloat32Number*)(out[OutChan]) = c0 + c1 * rx + c2 * ry + c3 * rz;
+ out[OutChan] += DestIncrements[OutChan];
+ }
+ if (ain)
+ *out[TotalOut] = *ain;
+ }
+
+ strideIn += Stride->BytesPerLineIn;
+ strideOut += Stride->BytesPerLineOut;
}
}
@@ -224,23 +237,22 @@ cmsBool OptimizeCLUTRGBTransform(cmsContext ContextID,
int nGridPoints;
cmsPipeline* OptimizedLUT = NULL;
cmsStage* OptimizedCLUTmpe;
- cmsColorSpaceSignature OutputColorSpace;
cmsStage* mpe;
- FloatCLUTData* p8;
+ FloatCLUTData* pfloat;
_cmsStageCLutData* data;
// For empty transforms, do nothing
if (*Lut == NULL) return FALSE;
- // This is a loosy optimization! does not apply in floating-point cases
+ // Check for floating point only
if (!T_FLOAT(*InputFormat) || !T_FLOAT(*OutputFormat)) return FALSE;
- // Only on 8-bit
- if (T_BYTES(*InputFormat) != 4 || T_BYTES(*OutputFormat) != 4) return FALSE;
+ // Only on floats
+ if (T_BYTES(*InputFormat) != sizeof(cmsFloat32Number) ||
+ T_BYTES(*OutputFormat) != sizeof(cmsFloat32Number)) return FALSE;
- // Only on RGB
- if (T_COLORSPACE(*InputFormat) != PT_RGB) return FALSE;
- if (T_COLORSPACE(*OutputFormat) != PT_RGB) return FALSE;
+ // Input has to be RGB, Output may be any
+ if (T_COLORSPACE(*InputFormat) != PT_RGB) return FALSE;
OriginalLut = *Lut;
@@ -251,14 +263,12 @@ cmsBool OptimizeCLUTRGBTransform(cmsContext ContextID,
if (cmsStageType(ContextID, mpe) == cmsSigNamedColorElemType) return FALSE;
}
- OutputColorSpace = _cmsICCcolorSpace(ContextID, T_COLORSPACE(*OutputFormat));
nGridPoints = _cmsReasonableGridpointsByColorspace(cmsSigRgbData, *dwFlags);
// Create the result LUT
OptimizedLUT = cmsPipelineAlloc(ContextID, 3, cmsPipelineOutputChannels(ContextID, OriginalLut));
if (OptimizedLUT == NULL) goto Error;
-
// Allocate the CLUT for result
OptimizedCLUTmpe = cmsStageAllocCLutFloat(ContextID, nGridPoints, 3, cmsPipelineOutputChannels(ContextID, OriginalLut), NULL);
@@ -271,15 +281,15 @@ cmsBool OptimizeCLUTRGBTransform(cmsContext ContextID,
// Set the evaluator, copy parameters
data = (_cmsStageCLutData*) cmsStageData(ContextID, OptimizedCLUTmpe);
- p8 = FloatCLUTAlloc(ContextID, data ->Params);
- if (p8 == NULL) return FALSE;
+ pfloat = FloatCLUTAlloc(ContextID, data ->Params);
+ if (pfloat == NULL) return FALSE;
// And return the obtained LUT
cmsPipelineFree(ContextID, OriginalLut);
*Lut = OptimizedLUT;
- *TransformFn = (_cmsTransformFn) FloatCLUTEval;
- *UserData = p8;
+ *TransformFn = (_cmsTransformFn)FloatCLUTEval;
+ *UserData = pfloat;
*FreeDataFn = _cmsFree;
*dwFlags &= ~cmsFLAGS_CAN_CHANGE_FORMATTER;
return TRUE;
diff --git a/lcms2mt/plugins/fast_float/testbed/Makefile.am b/lcms2mt/plugins/fast_float/testbed/Makefile.am
index 9bd2412a4..3cc777066 100644
--- a/lcms2mt/plugins/fast_float/testbed/Makefile.am
+++ b/lcms2mt/plugins/fast_float/testbed/Makefile.am
@@ -5,18 +5,16 @@
# Don't require all the GNU mandated files
AUTOMAKE_OPTIONS = 1.7 foreign
-INCLUDES = -I$(builddir)/../include -I$(srcdir)/../include -I$(srcdir)/../src \
- -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(builddir)/../include -I$(srcdir)/../include -I$(srcdir)/../src \
+ -I$(top_builddir)/include
check_PROGRAMS = fast_float_testbed
-fast_float_testbed_LDADD = $(top_builddir)/src/liblcms2mt.la $(srcdir)/../src/liblcms2mt_fast_float.la
+fast_float_testbed_LDADD = $(srcdir)/../src/liblcms2mt_fast_float.la
fast_float_testbed_LDFLAGS = @LDFLAGS@
-fast_float_testbed_SOURCES = fast_float_testbed.c
+fast_float_testbed_SOURCES = fast_float_testbed.c
-EXTRA_DIST = test0.icc test1.icc test2.icc test3.icc test5.icc
+EXTRA_DIST = test0.icc test1.icc test2.icc test3.icc test5.icc
check:
./fast_float_testbed
-
-
diff --git a/lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c b/lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c
index 650454bc3..34bafd78d 100644
--- a/lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c
+++ b/lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c
@@ -28,13 +28,17 @@
// Some pixel representations
typedef struct { cmsUInt8Number r, g, b; } Scanline_rgb8bits;
typedef struct { cmsUInt8Number r, g, b, a; } Scanline_rgba8bits;
+typedef struct { cmsUInt8Number c, m, y, k; } Scanline_cmyk8bits;
typedef struct { cmsUInt16Number r, g, b; } Scanline_rgb16bits;
typedef struct { cmsUInt16Number r, g, b, a; } Scanline_rgba16bits;
+typedef struct { cmsUInt16Number c, m, y, k; } Scanline_cmyk16bits;
typedef struct { cmsUInt16Number r, g, b; } Scanline_rgb15bits;
typedef struct { cmsUInt16Number r, g, b, a; } Scanline_rgba15bits;
typedef struct { cmsUInt16Number r, g, b, a; } Scanline_cmyk15bits;
typedef struct { cmsFloat32Number r, g, b; } Scanline_rgbFloat;
typedef struct { cmsFloat32Number r, g, b, a; } Scanline_rgbaFloat;
+typedef struct { cmsFloat32Number c, m, y, k; } Scanline_cmykFloat;
+typedef struct { cmsFloat32Number L, a, b; } Scanline_LabFloat;
// 15 bit mode. <=> 8 bits mode
#define FROM_8_TO_15(x8) (cmsUInt16Number) ((((cmsUInt64Number)x8 << 15)) / 0xFF)
@@ -165,7 +169,7 @@ void CheckFormatters15(void)
C(TYPE_ABGR_15_SE);
C(TYPE_BGRA_15);
C(TYPE_BGRA_15_SE);
- C(TYPE_YMC_15),
+ C(TYPE_YMC_15);
C(TYPE_CMY_15);
C(TYPE_CMY_15_PLANAR);
C(TYPE_CMY_15_SE);
@@ -202,8 +206,6 @@ cmsInt32Number checkSingleComputeIncrements(cmsUInt32Number Format, cmsUInt32Num
nTotal = nAlpha + nChannels;
-
-
for (i = 0; i < nTotal; i++)
{
cmsUInt32Number so = va_arg(args, cmsUInt32Number);
@@ -492,7 +494,6 @@ void TryAllValues16bits(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcmsProf
cmsDoTransform(Raw, xformRaw, bufferIn, bufferRawOut, npixels);
cmsDoTransform(Plugin, xformPlugin, bufferIn, bufferPluginOut, npixels);
-#if 1
// Lets compare results
j = 0;
for (r = 0; r < 256; r++)
@@ -511,7 +512,6 @@ void TryAllValues16bits(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcmsProf
j++;
}
-#endif
free(bufferIn); free(bufferRawOut);
free(bufferPluginOut);
@@ -611,7 +611,7 @@ void TryAllValuesFloat(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcmsProfi
}
static
-void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent)
+void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent, cmsBool copyAlpha)
{
Scanline_rgbaFloat* bufferIn;
Scanline_rgbaFloat* bufferRawOut;
@@ -621,8 +621,10 @@ void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcms
int j;
cmsUInt32Number npixels = 256 * 256 * 256;
- cmsHTRANSFORM xformRaw = cmsCreateTransform(Raw, hlcmsProfileIn, TYPE_RGBA_FLT, hlcmsProfileOut, TYPE_RGBA_FLT, Intent, cmsFLAGS_NOCACHE);
- cmsHTRANSFORM xformPlugin = cmsCreateTransform(Plugin, hlcmsProfileIn, TYPE_RGBA_FLT, hlcmsProfileOut, TYPE_RGBA_FLT, Intent, cmsFLAGS_NOCACHE);
+ cmsUInt32Number flags = cmsFLAGS_NOCACHE | ( copyAlpha? cmsFLAGS_COPY_ALPHA : 0);
+
+ cmsHTRANSFORM xformRaw = cmsCreateTransform(Raw, hlcmsProfileIn, TYPE_RGBA_FLT, hlcmsProfileOut, TYPE_RGBA_FLT, Intent, flags);
+ cmsHTRANSFORM xformPlugin = cmsCreateTransform(Plugin, hlcmsProfileIn, TYPE_RGBA_FLT, hlcmsProfileOut, TYPE_RGBA_FLT, Intent, flags);
cmsCloseProfile(Raw, hlcmsProfileIn);
cmsCloseProfile(Plugin, hlcmsProfileOut);
@@ -637,6 +639,9 @@ void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcms
bufferRawOut = (Scanline_rgbaFloat*)malloc(npixels * sizeof(Scanline_rgbaFloat));
bufferPluginOut = (Scanline_rgbaFloat*)malloc(npixels * sizeof(Scanline_rgbaFloat));
+ memset(bufferRawOut, 0, npixels * sizeof(Scanline_rgbaFloat));
+ memset(bufferPluginOut, 0, npixels * sizeof(Scanline_rgbaFloat));
+
// Same input to both transforms
j = 0;
for (r = 0; r < 256; r++)
@@ -655,7 +660,6 @@ void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcms
cmsDoTransform(Raw, xformRaw, bufferIn, bufferRawOut, npixels);
cmsDoTransform(Plugin, xformPlugin, bufferIn, bufferPluginOut, npixels);
-#if 1
// Lets compare results
j = 0;
for (r = 0; r < 256; r++)
@@ -663,15 +667,14 @@ void TryAllValuesFloatAlpha(cmsContext Raw, cmsContext Plugin, cmsHPROFILE hlcms
for (b = 0; b < 256; b++) {
if (!ValidFloat(bufferRawOut[j].r, bufferPluginOut[j].r) ||
- !ValidFloat(bufferRawOut[j].g, bufferPluginOut[j].g) ||
- !ValidFloat(bufferRawOut[j].b, bufferPluginOut[j].b) ||
- !ValidFloat(bufferRawOut[j].a, bufferPluginOut[j].a))
- Fail("Conversion failed at (%f %f %f %f) != (%f %f %f %f)", bufferRawOut[j].r, bufferRawOut[j].g, bufferRawOut[j].b, bufferRawOut[j].a,
+ !ValidFloat(bufferRawOut[j].g, bufferPluginOut[j].g) ||
+ !ValidFloat(bufferRawOut[j].b, bufferPluginOut[j].b) ||
+ !ValidFloat(bufferRawOut[j].a, bufferPluginOut[j].a))
+ Fail("Conversion failed at (%f %f %f %f) != (%f %f %f %f)", bufferRawOut[j].r, bufferRawOut[j].g, bufferRawOut[j].b, bufferRawOut[j].a,
bufferPluginOut[j].r, bufferPluginOut[j].g, bufferPluginOut[j].b, bufferPluginOut[j].a);
j++;
}
-#endif
free(bufferIn); free(bufferRawOut);
free(bufferPluginOut);
@@ -783,9 +786,6 @@ void CheckChangeFormat(cmsContext ContextID)
xform = cmsCreateTransform(ContextID, hsRGB, TYPE_RGB_16, hLab, TYPE_Lab_16, INTENT_PERCEPTUAL, 0);
- cmsCloseProfile(ContextID, hsRGB);
- cmsCloseProfile(ContextID, hLab);
-
cmsDoTransform(ContextID, xform, rgb16, lab16_1, 1);
xform2 = cmsCloneTransformChangingFormats(ContextID, xform, TYPE_RGB_8, TYPE_Lab_16);
@@ -883,12 +883,17 @@ void CheckLab2Roundtrip(cmsContext ContextID)
static
void CheckConversionFloat(cmsContext Raw, cmsContext Plugin)
{
- printf("Crash test...");
- TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test5.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL);
+ printf("Crash test.");
+ TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test5.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL, FALSE);
+ printf("..");
+ TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test5.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL, TRUE);
printf("Ok\n");
- printf("Crash (II) test...");
- TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test0.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL);
+
+ printf("Crash (II) test.");
+ TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test0.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL, FALSE);
+ printf("..");
+ TryAllValuesFloatAlpha(Raw, Plugin, cmsOpenProfileFromFile(Raw, "test0.icc", "r"), cmsOpenProfileFromFile(Raw, "test0.icc", "r"), INTENT_PERCEPTUAL, TRUE);
printf("Ok\n");
// Matrix-shaper should be accurate
@@ -909,6 +914,85 @@ void CheckConversionFloat(cmsContext Raw, cmsContext Plugin)
}
+static
+cmsBool ValidFloat2(cmsFloat32Number a, cmsFloat32Number b)
+{
+ return fabsf(a - b) < 0.007;
+}
+
+
+static
+cmsFloat32Number distance(cmsFloat32Number rgb1[], cmsFloat32Number rgb2[])
+{
+ cmsFloat32Number dr = rgb2[0] - rgb1[0];
+ cmsFloat32Number dg = rgb2[1] - rgb1[1];
+ cmsFloat32Number db = rgb2[2] - rgb1[2];
+
+ return dr * dr + dg * dg + db * db;
+}
+
+static
+void CheckLab2RGB(cmsContext plugin)
+{
+ cmsHPROFILE hLab = cmsCreateLab4Profile(plugin);
+ cmsHPROFILE hRGB = cmsOpenProfileFromFile(plugin, "test3.icc", "r");
+ cmsContext noPlugin = cmsCreateContext(0, 0);
+
+ cmsHTRANSFORM hXformNoPlugin = cmsCreateTransform(noPlugin, hLab, TYPE_Lab_FLT, hRGB, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE);
+ cmsHTRANSFORM hXformPlugin = cmsCreateTransform(plugin, hLab, TYPE_Lab_FLT, hRGB, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE);
+
+ cmsFloat32Number Lab[3], RGB[3], RGB2[3];
+
+ cmsFloat32Number maxInside = 0, maxOutside = 0, L, a, b;
+
+ printf("Checking Lab -> RGB...");
+ for (L = 4; L <= 100; L++)
+ {
+ for (a = -30; a < +30; a++)
+ for (b = -30; b < +30; b++)
+ {
+ cmsFloat32Number d;
+
+ Lab[0] = L; Lab[1] = a; Lab[2] = b;
+ cmsDoTransform(hXformNoPlugin, Lab, RGB, 1);
+ cmsDoTransform(hXformPlugin, Lab, RGB2, 1);
+
+ d = distance(RGB, RGB2);
+ if (d > maxInside)
+ maxInside = d;
+ }
+ }
+
+
+ for (L = 1; L <= 100; L += 5)
+ {
+ for (a = -100; a < +100; a += 5)
+ for (b = -100; b < +100; b += 5)
+ {
+ cmsFloat32Number d;
+
+ Lab[0] = L; Lab[1] = a; Lab[2] = b;
+ cmsDoTransform(hXformNoPlugin, Lab, RGB, 1);
+ cmsDoTransform(hXformPlugin, Lab, RGB2, 1);
+
+ d = distance(RGB, RGB2);
+ if (d > maxOutside)
+ maxOutside = d;
+ }
+
+ }
+
+
+ printf("Max distance: Inside gamut %f, Outside gamut %f\n", sqrtf(maxInside), sqrtf(maxOutside));
+
+ cmsDeleteTransform(hXformNoPlugin);
+ cmsDeleteTransform(hXformPlugin);
+
+ cmsDeleteContext(noPlugin);
+}
+
+
+
// --------------------------------------------------------------------------------------------------
// P E R F O R M A N C E C H E C K S
@@ -931,22 +1015,40 @@ void PerformanceHeader(void)
printf(" MPixel/sec. MByte/sec.\n");
}
+
static
-cmsFloat64Number Performance(const char* Title, perf_fn fn, cmsContext ct, const char* inICC, const char* outICC, size_t sz, cmsFloat64Number prev)
+cmsHPROFILE loadProfile(const char* name)
{
- cmsHPROFILE hlcmsProfileIn;
- cmsHPROFILE hlcmsProfileOut;
+ if (*name == '*')
+ {
+ if (strcmp(name, "*lab") == 0)
+ {
+ return cmsCreateLab4Profile(ct);
+ }
+ else
+ if (strcmp(name, "*xyz") == 0)
+ {
+ return cmsCreateXYZProfile(ct);
+ }
+ else
+ if (strcmp(name, "*curves") == 0)
+ {
+ return CreateCurves(ct);
+ }
+ else
+ Fail("Unknown builtin '%s'", name);
- if (inICC == NULL)
- hlcmsProfileIn = CreateCurves(ct);
- else
- hlcmsProfileIn = cmsOpenProfileFromFile(ct, inICC, "r");
+ }
+
+ return cmsOpenProfileFromFile(ct, name, "r");
+}
- if (outICC == NULL)
- hlcmsProfileOut = CreateCurves(ct);
- else
- hlcmsProfileOut = cmsOpenProfileFromFile(ct, outICC, "r");
+static
+cmsFloat64Number Performance(const char* Title, perf_fn fn, cmsContext ct, const char* inICC, const char* outICC, size_t sz, cmsFloat64Number prev)
+{
+ cmsHPROFILE hlcmsProfileIn = loadProfile(inICC);
+ cmsHPROFILE hlcmsProfileOut = loadProfile(outICC);
cmsFloat64Number n = fn(ct, hlcmsProfileIn, hlcmsProfileOut);
@@ -1278,98 +1380,357 @@ cmsFloat64Number SpeedTest16bitsRGB(cmsContext ct, cmsHPROFILE hlcmsProfileIn, c
return MPixSec(diff);
}
-
static
-void SpeedTest8(cmsContext ct)
+cmsFloat64Number SpeedTest16bitsCMYK(cmsContext ct, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut)
{
- printf("\n\nP E R F O R M A N C E T E S T S 8 B I T S\n");
- printf( "==============================================\n\n");
- PerformanceHeader();
- Performance("8 bits on CLUT profiles ", SpeedTest8bitsRGB, ct, "test5.icc", "test3.icc", sizeof(Scanline_rgb8bits), 0);
- Performance("8 bits on Matrix-Shaper profiles", SpeedTest8bitsRGB, ct, "test5.icc", "test0.icc", sizeof(Scanline_rgb8bits), 0);
- Performance("8 bits on same Matrix-Shaper ", SpeedTest8bitsRGB, ct, "test0.icc", "test0.icc", sizeof(Scanline_rgb8bits), 0);
- Performance("8 bits on curves ", SpeedTest8bitsRGB, ct, NULL, NULL, sizeof(Scanline_rgb8bits), 0);
- // Performance("8 bits on CMYK CLUT profiles ", SpeedTest8bitsCMYK, ct, "test1.icc", "test2.icc", sizeof(Scanline_rgba15bits), 0);
+ cmsInt32Number r, g, b, j;
+ clock_t atime;
+ cmsFloat64Number diff;
+ cmsHTRANSFORM hlcmsxform;
+ Scanline_cmyk16bits* In;
+ cmsUInt32Number Mb;
+
+ if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL)
+ Fail("Unable to open profiles");
+
+ hlcmsxform = cmsCreateTransformTHR(ct, hlcmsProfileIn, TYPE_CMYK_16, hlcmsProfileOut, TYPE_CMYK_16, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE);
+ cmsCloseProfile(hlcmsProfileIn);
+ cmsCloseProfile(hlcmsProfileOut);
+
+ Mb = 256 * 256 * 256 * sizeof(Scanline_cmyk16bits);
+ In = (Scanline_cmyk16bits*)malloc(Mb);
+
+ j = 0;
+ for (r = 0; r < 256; r++)
+ for (g = 0; g < 256; g++)
+ for (b = 0; b < 256; b++) {
+
+ In[j].c = (cmsUInt16Number)r;
+ In[j].m = (cmsUInt16Number)g;
+ In[j].y = (cmsUInt16Number)b;
+ In[j].k = (cmsUInt16Number)r;
+
+ j++;
+ }
+
+ atime = clock();
+
+ cmsDoTransform(hlcmsxform, In, In, 256 * 256 * 256);
+
+ diff = clock() - atime;
+ free(In);
+
+ cmsDeleteTransform(hlcmsxform);
+ return MPixSec(diff);
}
+
+static
+void SpeedTest8(void)
+{
+ cmsContext noPlugin = cmsCreateContext(0, 0);
+
+ cmsFloat64Number t[10];
+
+ printf("\n\n");
+ printf("P E R F O R M A N C E T E S T S 8 B I T S (D E F A U L T)\n");
+ printf("==============================================================\n\n");
+ fflush(stdout);
+
+ PerformanceHeader();
+ t[0] = Performance("8 bits on CLUT profiles ", SpeedTest8bitsRGB, noPlugin, "test5.icc", "test3.icc", sizeof(Scanline_rgb8bits), 0);
+ t[1] = Performance("8 bits on Matrix-Shaper ", SpeedTest8bitsRGB, noPlugin, "test5.icc", "test0.icc", sizeof(Scanline_rgb8bits), 0);
+ t[2] = Performance("8 bits on same MatrixSh ", SpeedTest8bitsRGB, noPlugin, "test0.icc", "test0.icc", sizeof(Scanline_rgb8bits), 0);
+ t[3] = Performance("8 bits on curves ", SpeedTest8bitsRGB, noPlugin, "*curves", "*curves", sizeof(Scanline_rgb8bits), 0);
+
+ // Note that context 0 has the plug-in installed
+
+ printf("\n\n");
+ printf("P E R F O R M A N C E T E S T S 8 B I T S (P L U G I N)\n");
+ printf("===========================================================\n\n");
+ fflush(stdout);
+
+ PerformanceHeader();
+ Performance("8 bits on CLUT profiles ", SpeedTest8bitsRGB, 0, "test5.icc", "test3.icc", sizeof(Scanline_rgb8bits), t[0]);
+ Performance("8 bits on Matrix-Shaper ", SpeedTest8bitsRGB, 0, "test5.icc", "test0.icc", sizeof(Scanline_rgb8bits), t[1]);
+ Performance("8 bits on same MatrixSh ", SpeedTest8bitsRGB, 0, "test0.icc", "test0.icc", sizeof(Scanline_rgb8bits), t[2]);
+ Performance("8 bits on curves ", SpeedTest8bitsRGB, 0, "*curves", "*curves", sizeof(Scanline_rgb8bits), t[3]);
+
+ cmsDeleteContext(noPlugin);
+}
+
static
void SpeedTest15(cmsContext ct)
{
- printf("\n\nP E R F O R M A N C E T E S T S 1 5 B I T S\n");
- printf( "================================================\n\n");
+ printf("\n\nP E R F O R M A N C E T E S T S 1 5 B I T S (P L U G I N)\n");
+ printf( "===============================================================\n\n");
PerformanceHeader();
- Performance("15 bits on CLUT profiles ", SpeedTest15bitsRGB, ct, "test5.icc", "test3.icc", sizeof(Scanline_rgb15bits), 0);
- Performance("15 bits on Matrix-Shaper profiles", SpeedTest15bitsRGB, ct, "test5.icc", "test0.icc", sizeof(Scanline_rgb15bits), 0);
- Performance("15 bits on same Matrix-Shaper ", SpeedTest15bitsRGB, ct, "test0.icc", "test0.icc", sizeof(Scanline_rgb15bits), 0);
- Performance("15 bits on curves ", SpeedTest15bitsRGB, ct, NULL, NULL, sizeof(Scanline_rgb15bits), 0);
+ Performance("15 bits on CLUT profiles ", SpeedTest15bitsRGB, ct, "test5.icc", "test3.icc", sizeof(Scanline_rgb15bits), 0);
+ Performance("15 bits on Matrix-Shaper profiles", SpeedTest15bitsRGB, ct, "test5.icc", "test0.icc", sizeof(Scanline_rgb15bits), 0);
+ Performance("15 bits on same Matrix-Shaper ", SpeedTest15bitsRGB, ct, "test0.icc", "test0.icc", sizeof(Scanline_rgb15bits), 0);
+ Performance("15 bits on curves ", SpeedTest15bitsRGB, ct, "*curves", "*curves", sizeof(Scanline_rgb15bits), 0);
Performance("15 bits on CMYK CLUT profiles ", SpeedTest15bitsCMYK, ct, "test1.icc", "test2.icc", sizeof(Scanline_rgba15bits), 0);
}
static
void SpeedTest16(cmsContext ct)
{
- printf("\n\nP E R F O R M A N C E T E S T S 1 6 B I T S\n");
- printf("================================================\n\n");
+ cmsContext noPlugin = cmsCreateContext(0, 0);
+
+
+ printf("\n\n");
+ printf("P E R F O R M A N C E T E S T S 1 6 B I T S (D E F A U L T)\n");
+ printf("=================================================================\n\n");
PerformanceHeader();
- Performance("16 bits on CLUT profiles ", SpeedTest16bitsRGB, ct, "test5.icc", "test3.icc", sizeof(Scanline_rgb15bits), 0);
+ Performance("16 bits on CLUT profiles ", SpeedTest16bitsRGB, noPlugin, "test5.icc", "test3.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on Matrix-Shaper profiles", SpeedTest16bitsRGB, noPlugin, "test5.icc", "test0.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on same Matrix-Shaper ", SpeedTest16bitsRGB, noPlugin, "test0.icc", "test0.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on curves ", SpeedTest16bitsRGB, noPlugin, "*curves", "*curves", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on CMYK CLUT profiles ", SpeedTest16bitsCMYK, noPlugin, "test1.icc", "test2.icc", sizeof(Scanline_cmyk16bits), 0);
+ printf("\n\n");
+ printf("P E R F O R M A N C E T E S T S 1 6 B I T S (P L U G I N)\n");
+ printf("===============================================================\n\n");
+
+ PerformanceHeader();
+ Performance("16 bits on CLUT profiles ", SpeedTest16bitsRGB, ct, "test5.icc", "test3.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on Matrix-Shaper profiles", SpeedTest16bitsRGB, ct, "test5.icc", "test0.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on same Matrix-Shaper ", SpeedTest16bitsRGB, ct, "test0.icc", "test0.icc", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on curves ", SpeedTest16bitsRGB, ct, "*curves", "*curves", sizeof(Scanline_rgb16bits), 0);
+ Performance("16 bits on CMYK CLUT profiles ", SpeedTest16bitsCMYK, ct, "test1.icc", "test2.icc", sizeof(Scanline_cmyk16bits), 0);
}
// The worst case is used, no cache and all rgb combinations
static
cmsFloat64Number SpeedTestFloatRGB(cmsContext ct, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut)
{
- cmsInt32Number r, g, b, j;
+ cmsInt32Number j;
clock_t atime;
cmsFloat64Number diff;
cmsHTRANSFORM hlcmsxform;
- Scanline_rgbFloat *In;
- cmsUInt32Number Mb;
+ void *In;
+ cmsUInt32Number size, Mb;
+ cmsUInt32Number inFormatter=0, outFormatter=0;
+ cmsFloat64Number seconds;
if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL)
- Fail("Unable to open profiles");
+ Fail("Unable to open profiles");
+
+
+ switch (cmsGetColorSpace(hlcmsProfileIn))
+ {
+ case cmsSigRgbData: inFormatter = TYPE_RGB_FLT; break;
+ case cmsSigLabData: inFormatter = TYPE_Lab_FLT; break;
- hlcmsxform = cmsCreateTransform(ct, hlcmsProfileIn, TYPE_RGB_FLT, hlcmsProfileOut, TYPE_RGB_FLT, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE);
+ default:
+ Fail("Invalid colorspace");
+ }
+
+ switch (cmsGetColorSpace(hlcmsProfileOut))
+ {
+ case cmsSigRgbData: outFormatter = TYPE_RGB_FLT; break;
+ case cmsSigLabData: outFormatter = TYPE_Lab_FLT; break;
+ case cmsSigXYZData: outFormatter = TYPE_XYZ_FLT; break;
+
+ default:
+ Fail("Invalid colorspace");
+ }
+
+ hlcmsxform = cmsCreateTransformTHR(ct, hlcmsProfileIn, inFormatter, hlcmsProfileOut, outFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE);
cmsCloseProfile(ct, hlcmsProfileIn);
cmsCloseProfile(ct, hlcmsProfileOut);
- Mb = 256 * 256 * 256 * sizeof(Scanline_rgbFloat);
- In = (Scanline_rgbFloat*)malloc(Mb);
+
j = 0;
- for (r = 0; r < 256; r++)
- for (g = 0; g < 256; g++)
- for (b = 0; b < 256; b++) {
- In[j].r = (cmsFloat32Number)r / 255.0f;
- In[j].g = (cmsFloat32Number)g / 255.0f;
- In[j].b = (cmsFloat32Number)b / 255.0f;
+ if (inFormatter == TYPE_RGB_FLT)
+ {
+ cmsInt32Number r, g, b;
+ Scanline_rgbFloat* fill;
- j++;
- }
+ size = 256 * 256 * 256;
+ Mb = size * sizeof(Scanline_rgbFloat);
+ In = malloc(Mb);
+ fill = (Scanline_rgbFloat*)In;
+
+ for (r = 0; r < 256; r++)
+ for (g = 0; g < 256; g++)
+ for (b = 0; b < 256; b++) {
+
+ fill[j].r = (cmsFloat32Number)r / 255.0f;
+ fill[j].g = (cmsFloat32Number)g / 255.0f;
+ fill[j].b = (cmsFloat32Number)b / 255.0f;
+
+ j++;
+ }
+
+ }
+ else
+ {
+ cmsFloat32Number L, a, b;
+ Scanline_LabFloat* fill;
+
+ size = 100 * 256 * 256;
+ Mb = size * sizeof(Scanline_LabFloat);
+ In = malloc(Mb);
+ fill = (Scanline_LabFloat*)In;
+
+ for (L = 0; L < 100; L++)
+ for (a = -127.0; a < 127.0; a++)
+ for (b = -127.0; b < +127.0; b++) {
+
+ fill[j].L = L;
+ fill[j].a = a;
+ fill[j].b = b;
+
+ j++;
+ }
+ }
atime = clock();
- cmsDoTransform(ct, hlcmsxform, In, In, 256 * 256 * 256);
+cmsDoTransform(ct, hlcmsxform, In, In, size);
diff = clock() - atime;
free(In);
cmsDeleteTransform(ct, hlcmsxform);
- return MPixSec(diff);
+
+ seconds = (cmsFloat64Number)diff / (cmsFloat64Number)CLOCKS_PER_SEC;
+ return ((cmsFloat64Number)size) / (1024.0 * 1024.0 * seconds);
}
+static
+cmsFloat64Number SpeedTestFloatCMYK(cmsContext ct, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut)
+{
+ cmsInt32Number c, m, y, k, j;
+ clock_t atime;
+ cmsFloat64Number diff;
+ cmsHTRANSFORM hlcmsxform;
+ Scanline_cmykFloat* In;
+ cmsUInt32Number Mb;
+
+ if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL)
+ Fail("Unable to open profiles");
+
+
+ hlcmsxform = cmsCreateTransform(ct, hlcmsProfileIn, TYPE_CMYK_FLT, hlcmsProfileOut, TYPE_CMYK_FLT, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE);
+ cmsCloseProfile(ct, hlcmsProfileIn);
+ cmsCloseProfile(ct, hlcmsProfileOut);
+
+ Mb = 64 * 64 * 64 * 64 * sizeof(Scanline_cmykFloat);
+ In = (Scanline_cmykFloat*)malloc(Mb);
+
+ j = 0;
+ for (c = 0; c < 256; c += 4)
+ for (m = 0; m < 256; m += 4)
+ for (y = 0; y < 256; y += 4)
+ for (k = 0; k < 256; k += 4) {
+
+ In[j].c = (cmsFloat32Number)c / 255.0f;
+ In[j].m = (cmsFloat32Number)m / 255.0f;
+ In[j].y = (cmsFloat32Number)y / 255.0f;
+ In[j].k = (cmsFloat32Number)k / 255.0f;
+
+ j++;
+ }
+
+ atime = clock();
+
+ cmsDoTransform(ct, hlcmsxform, In, In, 64 * 64 * 64 * 64);
+
+ diff = clock() - atime;
+ free(In);
+
+ cmsDeleteTransform(ct, hlcmsxform);
+ return MPixSec(diff);
+}
+
+
+static
+cmsFloat64Number SpeedTestFloatLab(cmsContext ct, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut)
+{
+ cmsInt32Number j;
+ clock_t atime;
+ cmsFloat64Number diff;
+ cmsHTRANSFORM hlcmsxform;
+ void* In;
+ cmsUInt32Number size, Mb;
+ cmsUInt32Number outFormatter = 0;
+ cmsFloat64Number seconds;
+ cmsFloat32Number L, a, b;
+ Scanline_LabFloat* fill;
+
+
+ if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL)
+ Fail("Unable to open profiles");
+
+
+ if (cmsGetColorSpace(hlcmsProfileIn) != cmsSigLabData)
+ {
+ Fail("Invalid colorspace");
+ }
+
+ switch (cmsGetColorSpace(hlcmsProfileOut))
+ {
+ case cmsSigRgbData: outFormatter = TYPE_RGB_FLT; break;
+ case cmsSigLabData: outFormatter = TYPE_Lab_FLT; break;
+ case cmsSigXYZData: outFormatter = TYPE_XYZ_FLT; break;
+
+ default:
+ Fail("Invalid colorspace");
+ }
+
+ hlcmsxform = cmsCreateTransformTHR(ct, hlcmsProfileIn, TYPE_Lab_FLT, hlcmsProfileOut, outFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE);
+ cmsCloseProfile(hlcmsProfileIn);
+ cmsCloseProfile(hlcmsProfileOut);
+
+ j = 0;
+
+ size = 100 * 256 * 256;
+ Mb = size * sizeof(Scanline_LabFloat);
+ In = malloc(Mb);
+ fill = (Scanline_LabFloat*)In;
+
+ for (L = 0; L < 100; L++)
+ for (a = -127.0; a < 127.0; a++)
+ for (b = -127.0; b < +127.0; b++) {
+
+ fill[j].L = L;
+ fill[j].a = a;
+ fill[j].b = b;
+
+ j++;
+ }
+
+
+ atime = clock();
+
+ cmsDoTransform(hlcmsxform, In, In, size);
+
+ diff = clock() - atime;
+ free(In);
+
+ cmsDeleteTransform(hlcmsxform);
+
+ seconds = (cmsFloat64Number)diff / (cmsFloat64Number)CLOCKS_PER_SEC;
+ return ((cmsFloat64Number)size) / (1024.0 * 1024.0 * seconds);
+}
+
static
void SpeedTestFloat(cmsContext noPlugin, cmsContext plugin)
{
- cmsFloat64Number t[10];
+ cmsContext noPlugin = cmsCreateContext(0, 0);
+
+ cmsFloat64Number t[10] = { 0 };
printf("\n\n");
printf("P E R F O R M A N C E T E S T S F L O A T (D E F A U L T)\n");
@@ -1380,7 +1741,12 @@ void SpeedTestFloat(cmsContext noPlugin, cmsContext plugin)
t[0] = Performance("Floating point on CLUT profiles ", SpeedTestFloatRGB, noPlugin, "test5.icc", "test3.icc", sizeof(Scanline_rgbFloat), 0);
t[1] = Performance("Floating point on Matrix-Shaper ", SpeedTestFloatRGB, noPlugin, "test5.icc", "test0.icc", sizeof(Scanline_rgbFloat), 0);
t[2] = Performance("Floating point on same MatrixSh ", SpeedTestFloatRGB, noPlugin, "test0.icc", "test0.icc", sizeof(Scanline_rgbFloat), 0);
- t[3] = Performance("Floating point on curves ", SpeedTestFloatRGB, noPlugin, NULL, NULL, sizeof(Scanline_rgbFloat), 0);
+ t[3] = Performance("Floating point on curves ", SpeedTestFloatRGB, noPlugin, "*curves", "*curves", sizeof(Scanline_rgbFloat), 0);
+ t[4] = Performance("Floating point on RGB->Lab ", SpeedTestFloatRGB, noPlugin, "test5.icc", "*lab", sizeof(Scanline_rgbFloat), 0);
+ t[5] = Performance("Floating point on RGB->XYZ ", SpeedTestFloatRGB, noPlugin, "test3.icc", "*xyz", sizeof(Scanline_rgbFloat), 0);
+ t[6] = Performance("Floating point on CMYK->CMYK ", SpeedTestFloatCMYK, noPlugin, "test1.icc", "test2.icc",sizeof(Scanline_cmykFloat), 0);
+ t[7] = Performance("Floating point on Lab->RGB ", SpeedTestFloatLab, noPlugin, "*lab", "test3.icc", sizeof(Scanline_LabFloat), 0);
+
// Note that context 0 has the plug-in installed
@@ -1393,7 +1759,13 @@ void SpeedTestFloat(cmsContext noPlugin, cmsContext plugin)
Performance("Floating point on CLUT profiles ", SpeedTestFloatRGB, plugin, "test5.icc", "test3.icc", sizeof(Scanline_rgbFloat), t[0]);
Performance("Floating point on Matrix-Shaper ", SpeedTestFloatRGB, plugin, "test5.icc", "test0.icc", sizeof(Scanline_rgbFloat), t[1]);
Performance("Floating point on same MatrixSh ", SpeedTestFloatRGB, plugin, "test0.icc", "test0.icc", sizeof(Scanline_rgbFloat), t[2]);
- Performance("Floating point on curves ", SpeedTestFloatRGB, plugin, NULL, NULL, sizeof(Scanline_rgbFloat), t[3]);
+ Performance("Floating point on curves ", SpeedTestFloatRGB, plugin, "*curves", "*curves", sizeof(Scanline_rgbFloat), t[3]);
+ Performance("Floating point on RGB->Lab ", SpeedTestFloatRGB, plugin, "test5.icc", "*lab", sizeof(Scanline_rgbFloat), t[4]);
+ Performance("Floating point on RGB->XYZ ", SpeedTestFloatRGB, plugin, "test3.icc", "*xyz", sizeof(Scanline_rgbFloat), t[5]);
+ Performance("Floating point on CMYK->CMYK ", SpeedTestFloatCMYK, plugin, "test1.icc", "test2.icc", sizeof(Scanline_cmykFloat), t[6]);
+ Performance("Floating point on Lab->RGB ", SpeedTestFloatLab, plugin, "*lab", "test3.icc", sizeof(Scanline_LabFloat), t[7]);
+
+ cmsDeleteContext(noPlugin);
}
@@ -1657,7 +2029,7 @@ void TestGrayTransformPerformance(cmsContext ct)
pixels = 256 * 256 * 256;
Mb = pixels* 2*sizeof(float);
- In = malloc(Mb);
+ In = (float*) malloc(Mb);
for (j = 0; j < pixels*2; j++)
In[j] = (j % 256) / 255.0f;
@@ -1706,7 +2078,7 @@ void TestGrayTransformPerformance1(cmsContext ct)
pixels = 256 * 256 * 256;
Mb = pixels* sizeof(float);
- In = malloc(Mb);
+ In = (float*) malloc(Mb);
for (j = 0; j < pixels; j++)
In[j] = (j % 256) / 255.0f;
@@ -1729,7 +2101,7 @@ int main()
cmsContext raw = cmsCreateContext(NULL, NULL);
cmsContext plugin = cmsCreateContext(NULL, NULL);
- printf("FastFloating point extensions testbed - 1.2\n");
+ printf("FastFloating point extensions testbed - 1.3\n");
printf("Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved\n");
printf("\nInstalling error logger ... ");
@@ -1741,7 +2113,6 @@ int main()
cmsPlugin(plugin, cmsFastFloatExtensions());
printf("done.\n\n");
- CheckLab2Roundtrip(plugin);
CheckComputeIncrements();
@@ -1752,6 +2123,9 @@ int main()
// 16 bits functionality
CheckAccuracy16Bits(raw, plugin);
+ // Lab to whatever
+ CheckLab2RGB(plugin);
+
// Change format
CheckChangeFormat(plugin);
diff --git a/lcms2mt/plugins/fast_float/testbed/test0.icc b/lcms2mt/plugins/fast_float/testbed/test0.icc
index a79f576b5..c233a5300 100644
--- a/lcms2mt/plugins/fast_float/testbed/test0.icc
+++ b/lcms2mt/plugins/fast_float/testbed/test0.icc
Binary files differ
diff --git a/lcms2mt/src/Makefile.in b/lcms2mt/src/Makefile.in
index f161d9d64..2ac603483 100644
--- a/lcms2mt/src/Makefile.in
+++ b/lcms2mt/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -168,21 +168,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/cmsalpha.Plo \
- ./$(DEPDIR)/cmscam02.Plo ./$(DEPDIR)/cmscgats.Plo \
- ./$(DEPDIR)/cmscnvrt.Plo ./$(DEPDIR)/cmserr.Plo \
- ./$(DEPDIR)/cmsgamma.Plo ./$(DEPDIR)/cmsgmt.Plo \
- ./$(DEPDIR)/cmshalf.Plo ./$(DEPDIR)/cmsintrp.Plo \
- ./$(DEPDIR)/cmsio0.Plo ./$(DEPDIR)/cmsio1.Plo \
- ./$(DEPDIR)/cmslut.Plo ./$(DEPDIR)/cmsmd5.Plo \
- ./$(DEPDIR)/cmsmtrx.Plo ./$(DEPDIR)/cmsnamed.Plo \
- ./$(DEPDIR)/cmsopt.Plo ./$(DEPDIR)/cmspack.Plo \
- ./$(DEPDIR)/cmspcs.Plo ./$(DEPDIR)/cmsplugin.Plo \
- ./$(DEPDIR)/cmsps2.Plo ./$(DEPDIR)/cmssamp.Plo \
- ./$(DEPDIR)/cmssm.Plo ./$(DEPDIR)/cmstypes.Plo \
- ./$(DEPDIR)/cmsvirt.Plo ./$(DEPDIR)/cmswtpnt.Plo \
- ./$(DEPDIR)/cmsxform.Plo
+am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -279,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -410,8 +397,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -467,38 +454,32 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsalpha.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscam02.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscgats.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscnvrt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmserr.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsgamma.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsgmt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmshalf.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsintrp.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsio0.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsio1.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmslut.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsmd5.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsmtrx.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsnamed.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsopt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmspack.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmspcs.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsplugin.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsps2.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmssamp.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmssm.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmstypes.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsvirt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmswtpnt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsxform.Plo@am__quote@ # am--include-marker
-
-$(am__depfiles_remade):
- @$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
-
-am--depfiles: $(am__depfiles_remade)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsalpha.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscam02.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscgats.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmscnvrt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmserr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsgamma.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsgmt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmshalf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsintrp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsio0.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsio1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmslut.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsmd5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsmtrx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsnamed.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsopt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmspack.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmspcs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsplugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsps2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmssamp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmssm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmstypes.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsvirt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmswtpnt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmsxform.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -582,10 +563,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -658,32 +636,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/cmsalpha.Plo
- -rm -f ./$(DEPDIR)/cmscam02.Plo
- -rm -f ./$(DEPDIR)/cmscgats.Plo
- -rm -f ./$(DEPDIR)/cmscnvrt.Plo
- -rm -f ./$(DEPDIR)/cmserr.Plo
- -rm -f ./$(DEPDIR)/cmsgamma.Plo
- -rm -f ./$(DEPDIR)/cmsgmt.Plo
- -rm -f ./$(DEPDIR)/cmshalf.Plo
- -rm -f ./$(DEPDIR)/cmsintrp.Plo
- -rm -f ./$(DEPDIR)/cmsio0.Plo
- -rm -f ./$(DEPDIR)/cmsio1.Plo
- -rm -f ./$(DEPDIR)/cmslut.Plo
- -rm -f ./$(DEPDIR)/cmsmd5.Plo
- -rm -f ./$(DEPDIR)/cmsmtrx.Plo
- -rm -f ./$(DEPDIR)/cmsnamed.Plo
- -rm -f ./$(DEPDIR)/cmsopt.Plo
- -rm -f ./$(DEPDIR)/cmspack.Plo
- -rm -f ./$(DEPDIR)/cmspcs.Plo
- -rm -f ./$(DEPDIR)/cmsplugin.Plo
- -rm -f ./$(DEPDIR)/cmsps2.Plo
- -rm -f ./$(DEPDIR)/cmssamp.Plo
- -rm -f ./$(DEPDIR)/cmssm.Plo
- -rm -f ./$(DEPDIR)/cmstypes.Plo
- -rm -f ./$(DEPDIR)/cmsvirt.Plo
- -rm -f ./$(DEPDIR)/cmswtpnt.Plo
- -rm -f ./$(DEPDIR)/cmsxform.Plo
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -729,32 +682,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/cmsalpha.Plo
- -rm -f ./$(DEPDIR)/cmscam02.Plo
- -rm -f ./$(DEPDIR)/cmscgats.Plo
- -rm -f ./$(DEPDIR)/cmscnvrt.Plo
- -rm -f ./$(DEPDIR)/cmserr.Plo
- -rm -f ./$(DEPDIR)/cmsgamma.Plo
- -rm -f ./$(DEPDIR)/cmsgmt.Plo
- -rm -f ./$(DEPDIR)/cmshalf.Plo
- -rm -f ./$(DEPDIR)/cmsintrp.Plo
- -rm -f ./$(DEPDIR)/cmsio0.Plo
- -rm -f ./$(DEPDIR)/cmsio1.Plo
- -rm -f ./$(DEPDIR)/cmslut.Plo
- -rm -f ./$(DEPDIR)/cmsmd5.Plo
- -rm -f ./$(DEPDIR)/cmsmtrx.Plo
- -rm -f ./$(DEPDIR)/cmsnamed.Plo
- -rm -f ./$(DEPDIR)/cmsopt.Plo
- -rm -f ./$(DEPDIR)/cmspack.Plo
- -rm -f ./$(DEPDIR)/cmspcs.Plo
- -rm -f ./$(DEPDIR)/cmsplugin.Plo
- -rm -f ./$(DEPDIR)/cmsps2.Plo
- -rm -f ./$(DEPDIR)/cmssamp.Plo
- -rm -f ./$(DEPDIR)/cmssm.Plo
- -rm -f ./$(DEPDIR)/cmstypes.Plo
- -rm -f ./$(DEPDIR)/cmsvirt.Plo
- -rm -f ./$(DEPDIR)/cmswtpnt.Plo
- -rm -f ./$(DEPDIR)/cmsxform.Plo
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -775,9 +703,9 @@ uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
- clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+ ctags-am 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-dvi install-dvi-am install-exec \
diff --git a/lcms2mt/src/cmsalpha.c b/lcms2mt/src/cmsalpha.c
index 697161ccb..c192d927a 100644
--- a/lcms2mt/src/cmsalpha.c
+++ b/lcms2mt/src/cmsalpha.c
@@ -75,7 +75,7 @@ static
void from8to16(void* dst, const void* src)
{
cmsUInt8Number n = *(cmsUInt8Number*)src;
- *(cmsUInt16Number*) dst = FROM_8_TO_16(n);
+ *(cmsUInt16Number*) dst = (cmsUInt16Number) FROM_8_TO_16(n);
}
static
@@ -88,13 +88,13 @@ void from8to16SE(void* dst, const void* src)
static
void from8toFLT(void* dst, const void* src)
{
- *(cmsFloat32Number*)dst = (*(cmsUInt8Number*)src) / 255.0f;
+ *(cmsFloat32Number*)dst = (cmsFloat32Number) (*(cmsUInt8Number*)src) / 255.0f;
}
static
void from8toDBL(void* dst, const void* src)
{
- *(cmsFloat64Number*)dst = (*(cmsUInt8Number*)src) / 255.0;
+ *(cmsFloat64Number*)dst = (cmsFloat64Number) (*(cmsUInt8Number*)src) / 255.0;
}
static
@@ -153,13 +153,13 @@ void from16SEtoFLT(void* dst, const void* src)
static
void from16toDBL(void* dst, const void* src)
{
- *(cmsFloat64Number*)dst = (*(cmsUInt16Number*)src) / 65535.0f;
+ *(cmsFloat64Number*)dst = (cmsFloat64Number) (*(cmsUInt16Number*)src) / 65535.0;
}
static
void from16SEtoDBL(void* dst, const void* src)
{
- *(cmsFloat64Number*)dst = (CHANGE_ENDIAN(*(cmsUInt16Number*)src)) / 65535.0f;
+ *(cmsFloat64Number*)dst = (cmsFloat64Number) (CHANGE_ENDIAN(*(cmsUInt16Number*)src)) / 65535.0;
}
static
@@ -275,6 +275,7 @@ void fromHLFto16SE(void* dst, const void* src)
cmsUNUSED_PARAMETER(src);
#endif
}
+
static
void fromHLFtoFLT(void* dst, const void* src)
{
@@ -319,6 +320,7 @@ void fromDBLto16SE(void* dst, const void* src)
cmsUInt16Number i = _cmsQuickSaturateWord(n * 65535.0f);
*(cmsUInt16Number*)dst = CHANGE_ENDIAN(i);
}
+
static
void fromDBLtoFLT(void* dst, const void* src)
{
@@ -359,11 +361,12 @@ int FormatterPos(cmsUInt32Number frm)
#endif
if (b == 4 && T_FLOAT(frm))
return 4; // FLT
- if (b == 2 && !T_FLOAT(frm)) {
- if (T_ENDIAN16(frm))
- return 2; // 16SE
- else
- return 1; // 16
+ if (b == 2 && !T_FLOAT(frm))
+ {
+ if (T_ENDIAN16(frm))
+ return 2; // 16SE
+ else
+ return 1; // 16
}
if (b == 1 && !T_FLOAT(frm))
return 0; // 8
@@ -386,7 +389,7 @@ static cmsFormatterAlphaFn FormattersAlpha[6][6] = {
int in_n = FormatterPos(in);
int out_n = FormatterPos(out);
- if (in_n < 0 || out_n < 0 || in_n > 4 || out_n > 4) {
+ if (in_n < 0 || out_n < 0 || in_n > 5 || out_n > 5) {
cmsSignalError(id, cmsERROR_UNKNOWN_EXTENSION, "Unrecognized alpha channel width");
return NULL;
@@ -568,6 +571,8 @@ void _cmsHandleExtraChannels(cmsContext ContextID, _cmsTRANSFORM* p, const void*
// Check for conversions 8, 16, half, float, dbl
copyValueFn = _cmsGetFormatterAlpha(ContextID, p->InputFormat, p->OutputFormat);
+ if (copyValueFn == NULL)
+ return;
if (nExtra == 1) { // Optimized routine for copying a single extra channel quickly
diff --git a/lcms2mt/src/cmscgats.c b/lcms2mt/src/cmscgats.c
index 3657177da..dcad06a0b 100644
--- a/lcms2mt/src/cmscgats.c
+++ b/lcms2mt/src/cmscgats.c
@@ -1495,6 +1495,14 @@ cmsBool CMSEXPORT cmsIT8SetDataFormat(cmsContext ContextID, cmsHANDLE h, int n,
return SetDataFormat(ContextID, it8, n, Sample);
}
+// A safe atoi that returns 0 when NULL input is given
+static
+cmsInt32Number satoi(const char* b)
+{
+ if (b == NULL) return 0;
+ return atoi(b);
+}
+
static
void AllocateDataSet(cmsContext ContextID, cmsIT8* it8)
{
@@ -1502,14 +1510,15 @@ void AllocateDataSet(cmsContext ContextID, cmsIT8* it8)
if (t -> Data) return; // Already allocated
- t-> nSamples = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_FIELDS"));
- t-> nPatches = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_SETS"));
+ t-> nSamples = satoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_FIELDS"));
+ t-> nPatches = satoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_SETS"));
if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
{
SynError(ContextID, it8, "AllocateDataSet: too much data");
}
else {
+ // Some dumb analizers warns of possible overflow here, just take a look couple of lines above.
t->Data = (char**)AllocChunk(ContextID, it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
if (t->Data == NULL) {
@@ -1676,11 +1685,11 @@ void WriteHeader(cmsContext ContextID, cmsIT8* it8, SAVESTREAM* fp)
break;
case WRITE_HEXADECIMAL:
- Writef(ContextID, fp, "\t0x%X", atoi(p ->Value));
+ Writef(ContextID, fp, "\t0x%X", satoi(p ->Value));
break;
case WRITE_BINARY:
- Writef(ContextID, fp, "\t0x%B", atoi(p ->Value));
+ Writef(ContextID, fp, "\t0x%B", satoi(p ->Value));
break;
case WRITE_PAIR:
@@ -1709,7 +1718,7 @@ void WriteDataFormat(cmsContext ContextID, SAVESTREAM* fp, cmsIT8* it8)
WriteStr(ContextID, fp, "BEGIN_DATA_FORMAT\n");
WriteStr(ContextID, fp, " ");
- nSamples = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_FIELDS"));
+ nSamples = satoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_FIELDS"));
for (i = 0; i < nSamples; i++) {
@@ -1732,7 +1741,7 @@ void WriteData(cmsContext ContextID, SAVESTREAM* fp, cmsIT8* it8)
WriteStr (ContextID, fp, "BEGIN_DATA\n");
- t->nPatches = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_SETS"));
+ t->nPatches = satoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_SETS"));
for (i = 0; i < t-> nPatches; i++) {
diff --git a/lcms2mt/src/cmscnvrt.c b/lcms2mt/src/cmscnvrt.c
index e3a2ddbc1..642636967 100644
--- a/lcms2mt/src/cmscnvrt.c
+++ b/lcms2mt/src/cmscnvrt.c
@@ -731,6 +731,9 @@ cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID,
cmsUInt32Number ICCIntents[256];
cmsStage* CLUT;
cmsUInt32Number i, nGridPoints;
+ cmsUInt32Number lastProfilePos;
+ cmsUInt32Number preservationProfilesCount;
+ cmsHPROFILE hLastProfile;
// Sanity check
@@ -740,20 +743,36 @@ cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID,
for (i=0; i < nProfiles; i++)
ICCIntents[i] = TranslateNonICCIntents(TheIntents[i]);
+
+ // Trim all CMYK devicelinks at the end
+ lastProfilePos = nProfiles - 1;
+ hLastProfile = hProfiles[lastProfilePos];
+
+ while (lastProfilePos > 1)
+ {
+ hLastProfile = hProfiles[--lastProfilePos];
+ if (cmsGetColorSpace(ContextID, hLastProfile) != cmsSigCmykData ||
+ cmsGetDeviceClass(ContextID, hLastProfile) != cmsSigLinkClass)
+ break;
+ }
+
+ preservationProfilesCount = lastProfilePos + 1;
+
// Check for non-cmyk profiles
if (cmsGetColorSpace(ContextID, hProfiles[0]) != cmsSigCmykData ||
- cmsGetColorSpace(ContextID, hProfiles[nProfiles-1]) != cmsSigCmykData)
+ !(cmsGetColorSpace(ContextID, hLastProfile) == cmsSigCmykData ||
+ cmsGetDeviceClass(ContextID, hLastProfile) == cmsSigOutputClass))
return DefaultICCintents(ContextID, nProfiles, ICCIntents, hProfiles, BPC, AdaptationStates, dwFlags);
- memset(&bp, 0, sizeof(bp));
-
// Allocate an empty LUT for holding the result
Result = cmsPipelineAlloc(ContextID, 4, 4);
if (Result == NULL) return NULL;
+ memset(&bp, 0, sizeof(bp));
+
// Create a LUT holding normal ICC transform
bp.cmyk2cmyk = DefaultICCintents(ContextID,
- nProfiles,
+ preservationProfilesCount,
ICCIntents,
hProfiles,
BPC,
@@ -765,7 +784,7 @@ cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID,
// Now, compute the tone curve
bp.KTone = _cmsBuildKToneCurve(ContextID,
4096,
- nProfiles,
+ preservationProfilesCount,
ICCIntents,
hProfiles,
BPC,
@@ -790,6 +809,19 @@ cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID,
if (!cmsStageSampleCLut16bit(ContextID, CLUT, BlackPreservingGrayOnlySampler, (void*) &bp, 0))
goto Error;
+
+ // Insert possible devicelinks at the end
+ for (i = lastProfilePos + 1; i < nProfiles; i++)
+ {
+ cmsPipeline* devlink = _cmsReadDevicelinkLUT(ContextID, hProfiles[i], ICCIntents[i]);
+ if (devlink == NULL)
+ goto Error;
+
+ if (!cmsPipelineCat(ContextID, Result, devlink))
+ goto Error;
+ }
+
+
// Get rid of xform and tone curve
cmsPipelineFree(ContextID, bp.cmyk2cmyk);
cmsFreeToneCurve(ContextID, bp.KTone);
@@ -908,6 +940,8 @@ int BlackPreservingSampler(cmsContext ContextID, CMSREGISTER const cmsUInt16Numb
return TRUE;
}
+
+
// This is the entry for black-plane preserving, which are non-ICC
static
cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
@@ -919,10 +953,14 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
cmsUInt32Number dwFlags)
{
PreserveKPlaneParams bp;
+
cmsPipeline* Result = NULL;
cmsUInt32Number ICCIntents[256];
cmsStage* CLUT;
cmsUInt32Number i, nGridPoints;
+ cmsUInt32Number lastProfilePos;
+ cmsUInt32Number preservationProfilesCount;
+ cmsHPROFILE hLastProfile;
cmsHPROFILE hLab;
// Sanity check
@@ -932,32 +970,45 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
for (i=0; i < nProfiles; i++)
ICCIntents[i] = TranslateNonICCIntents(TheIntents[i]);
+ // Trim all CMYK devicelinks at the end
+ lastProfilePos = nProfiles - 1;
+ hLastProfile = hProfiles[lastProfilePos];
+
+ while (lastProfilePos > 1)
+ {
+ hLastProfile = hProfiles[--lastProfilePos];
+ if (cmsGetColorSpace(ContextID, hLastProfile) != cmsSigCmykData ||
+ cmsGetDeviceClass(ContextID, hLastProfile) != cmsSigLinkClass)
+ break;
+ }
+
+ preservationProfilesCount = lastProfilePos + 1;
+
// Check for non-cmyk profiles
if (cmsGetColorSpace(ContextID, hProfiles[0]) != cmsSigCmykData ||
- !(cmsGetColorSpace(ContextID, hProfiles[nProfiles-1]) == cmsSigCmykData ||
- cmsGetDeviceClass(ContextID, hProfiles[nProfiles-1]) == cmsSigOutputClass))
+ !(cmsGetColorSpace(ContextID, hLastProfile) == cmsSigCmykData ||
+ cmsGetDeviceClass(ContextID, hLastProfile) == cmsSigOutputClass))
return DefaultICCintents(ContextID, nProfiles, ICCIntents, hProfiles, BPC, AdaptationStates, dwFlags);
// Allocate an empty LUT for holding the result
Result = cmsPipelineAlloc(ContextID, 4, 4);
if (Result == NULL) return NULL;
-
memset(&bp, 0, sizeof(bp));
// We need the input LUT of the last profile, assuming this one is responsible of
// black generation. This LUT will be searched in inverse order.
- bp.LabK2cmyk = _cmsReadInputLUT(ContextID, hProfiles[nProfiles-1], INTENT_RELATIVE_COLORIMETRIC);
+ bp.LabK2cmyk = _cmsReadInputLUT(ContextID, hLastProfile, INTENT_RELATIVE_COLORIMETRIC);
if (bp.LabK2cmyk == NULL) goto Cleanup;
// Get total area coverage (in 0..1 domain)
- bp.MaxTAC = cmsDetectTAC(ContextID, hProfiles[nProfiles-1]) / 100.0;
+ bp.MaxTAC = cmsDetectTAC(ContextID, hLastProfile) / 100.0;
if (bp.MaxTAC <= 0) goto Cleanup;
// Create a LUT holding normal ICC transform
bp.cmyk2cmyk = DefaultICCintents(ContextID,
- nProfiles,
+ preservationProfilesCount,
ICCIntents,
hProfiles,
BPC,
@@ -966,7 +1017,7 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
if (bp.cmyk2cmyk == NULL) goto Cleanup;
// Now the tone curve
- bp.KTone = _cmsBuildKToneCurve(ContextID, 4096, nProfiles,
+ bp.KTone = _cmsBuildKToneCurve(ContextID, 4096, preservationProfilesCount,
ICCIntents,
hProfiles,
BPC,
@@ -976,14 +1027,14 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
// To measure the output, Last profile to Lab
hLab = cmsCreateLab4Profile(ContextID, NULL);
- bp.hProofOutput = cmsCreateTransform(ContextID, hProfiles[nProfiles-1],
+ bp.hProofOutput = cmsCreateTransform(ContextID, hLastProfile,
CHANNELS_SH(4)|BYTES_SH(2), hLab, TYPE_Lab_DBL,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE);
if ( bp.hProofOutput == NULL) goto Cleanup;
// Same as anterior, but lab in the 0..1 range
- bp.cmyk2Lab = cmsCreateTransform(ContextID, hProfiles[nProfiles-1],
+ bp.cmyk2Lab = cmsCreateTransform(ContextID, hLastProfile,
FLOAT_SH(1)|CHANNELS_SH(4)|BYTES_SH(4), hLab,
FLOAT_SH(1)|CHANNELS_SH(3)|BYTES_SH(4),
INTENT_RELATIVE_COLORIMETRIC,
@@ -1006,6 +1057,18 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID,
cmsStageSampleCLut16bit(ContextID, CLUT, BlackPreservingSampler, (void*) &bp, 0);
+ // Insert possible devicelinks at the end
+ for (i = lastProfilePos + 1; i < nProfiles; i++)
+ {
+ cmsPipeline* devlink = _cmsReadDevicelinkLUT(ContextID, hProfiles[i], ICCIntents[i]);
+ if (devlink == NULL)
+ goto Cleanup;
+
+ if (!cmsPipelineCat(ContextID, Result, devlink))
+ goto Cleanup;
+ }
+
+
Cleanup:
if (bp.cmyk2cmyk) cmsPipelineFree(ContextID, bp.cmyk2cmyk);
@@ -1018,6 +1081,8 @@ Cleanup:
return Result;
}
+
+
// Link routines ------------------------------------------------------------------------------------------------------
// Chain several profiles into a single LUT. It just checks the parameters and then calls the handler
diff --git a/lcms2mt/src/cmsgamma.c b/lcms2mt/src/cmsgamma.c
index ad00b1292..6edbc841e 100644
--- a/lcms2mt/src/cmsgamma.c
+++ b/lcms2mt/src/cmsgamma.c
@@ -59,11 +59,11 @@ static cmsFloat64Number DefaultEvalParametricFn(cmsContext ContextID, cmsInt32Nu
// The built-in list
static _cmsParametricCurvesCollection DefaultCurves = {
- 9, // # of curve types
- { 1, 2, 3, 4, 5, 6, 7, 8, 108 }, // Parametric curve ID
- { 1, 3, 4, 5, 7, 4, 5, 5, 1 }, // Parameters by type
- DefaultEvalParametricFn, // Evaluator
- NULL // Next in chain
+ 10, // # of curve types
+ { 1, 2, 3, 4, 5, 6, 7, 8, 108, 109 }, // Parametric curve ID
+ { 1, 3, 4, 5, 7, 4, 5, 5, 1, 1 }, // Parameters by type
+ DefaultEvalParametricFn, // Evaluator
+ NULL // Next in chain
};
// Duplicates the zone of memory used by the plug-in in the new context
@@ -300,8 +300,8 @@ cmsToneCurve* AllocateToneCurveStruct(cmsContext ContextID, cmsUInt32Number nEnt
return p;
Error:
- if (p->SegInterp) _cmsFree(ContextID, p->SegInterp);
- if (p -> Segments) _cmsFree(ContextID, p ->Segments);
+ if (p -> SegInterp) _cmsFree(ContextID, p -> SegInterp);
+ if (p -> Segments) _cmsFree(ContextID, p -> Segments);
if (p -> Evals) _cmsFree(ContextID, p -> Evals);
if (p ->Table16) _cmsFree(ContextID, p ->Table16);
_cmsFree(ContextID, p);
@@ -309,6 +309,32 @@ Error:
}
+// Generates a sigmoidal function with desired steepness.
+cmsINLINE double sigmoid_base(double k, double t)
+{
+ return (1.0 / (1.0 + exp(-k * t))) - 0.5;
+}
+
+cmsINLINE double inverted_sigmoid_base(double k, double t)
+{
+ return -log((1.0 / (t + 0.5)) - 1.0) / k;
+}
+
+cmsINLINE double sigmoid_factory(double k, double t)
+{
+ double correction = 0.5 / sigmoid_base(k, 1);
+
+ return correction * sigmoid_base(k, 2.0 * t - 1.0) + 0.5;
+}
+
+cmsINLINE double inverse_sigmoid_factory(double k, double t)
+{
+ double correction = 0.5 / sigmoid_base(k, 1);
+
+ return (inverted_sigmoid_base(k, (t - 0.5) / correction) + 1.0) / 2.0;
+}
+
+
// Parametric Fn using floating point
static
cmsFloat64Number DefaultEvalParametricFn(cmsContext ContextID, cmsInt32Number Type, const cmsFloat64Number Params[], cmsFloat64Number R)
@@ -641,6 +667,7 @@ cmsFloat64Number DefaultEvalParametricFn(cmsContext ContextID, cmsInt32Number Ty
}
break;
+
// S-Shaped: (1 - (1-x)^1/g)^1/g
case 108:
if (fabs(Params[0]) < MATRIX_DET_TOLERANCE)
@@ -658,6 +685,15 @@ cmsFloat64Number DefaultEvalParametricFn(cmsContext ContextID, cmsInt32Number Ty
Val = 1 - pow(1 - pow(R, Params[0]), Params[0]);
break;
+ // Sigmoidals
+ case 109:
+ Val = sigmoid_factory(Params[0], R);
+ break;
+
+ case -109:
+ Val = inverse_sigmoid_factory(Params[0], R);
+ break;
+
default:
// Unsupported parametric curve. Should never reach here
return 0;
@@ -941,7 +977,7 @@ cmsToneCurve* CMSEXPORT cmsJoinToneCurve(cmsContext ContextID,
//Iterate
for (i=0; i < nResultingPoints; i++) {
- t = (cmsFloat32Number) i / (nResultingPoints-1);
+ t = (cmsFloat32Number) i / (cmsFloat32Number)(nResultingPoints-1);
x = cmsEvalToneCurveFloat(ContextID, X, t);
Res[i] = cmsEvalToneCurveFloat(ContextID, Yreversed, x);
}
@@ -1155,6 +1191,7 @@ cmsBool CMSEXPORT cmsSmoothToneCurve(cmsContext ContextID, cmsToneCurve* Tab, c
cmsBool SuccessStatus = TRUE;
cmsFloat32Number *w, *y, *z;
cmsUInt32Number i, nItems, Zeros, Poles;
+ cmsBool notCheck = FALSE;
if (Tab != NULL && Tab->InterpParams != NULL)
{
@@ -1180,6 +1217,12 @@ cmsBool CMSEXPORT cmsSmoothToneCurve(cmsContext ContextID, cmsToneCurve* Tab, c
w[i + 1] = 1.0;
}
+ if (lambda < 0)
+ {
+ notCheck = TRUE;
+ lambda = -lambda;
+ }
+
if (smooth2(ContextID, w, y, z, (cmsFloat32Number)lambda, (int)nItems))
{
// Do some reality - checking...
@@ -1192,7 +1235,7 @@ cmsBool CMSEXPORT cmsSmoothToneCurve(cmsContext ContextID, cmsToneCurve* Tab, c
if (z[i] < z[i - 1])
{
cmsSignalError(ContextID, cmsERROR_RANGE, "cmsSmoothToneCurve: Non-Monotonic.");
- SuccessStatus = FALSE;
+ SuccessStatus = notCheck;
break;
}
}
@@ -1200,13 +1243,13 @@ cmsBool CMSEXPORT cmsSmoothToneCurve(cmsContext ContextID, cmsToneCurve* Tab, c
if (SuccessStatus && Zeros > (nItems / 3))
{
cmsSignalError(ContextID, cmsERROR_RANGE, "cmsSmoothToneCurve: Degenerated, mostly zeros.");
- SuccessStatus = FALSE;
+ SuccessStatus = notCheck;
}
if (SuccessStatus && Poles > (nItems / 3))
{
cmsSignalError(ContextID, cmsERROR_RANGE, "cmsSmoothToneCurve: Degenerated, mostly poles.");
- SuccessStatus = FALSE;
+ SuccessStatus = notCheck;
}
if (SuccessStatus) // Seems ok
@@ -1433,3 +1476,14 @@ cmsFloat64Number CMSEXPORT cmsEstimateGamma(cmsContext ContextID, const cmsToneC
return (sum / n); // The mean
}
+
+
+// Retrieve parameters on one-segment tone curves
+
+cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(cmsContext contextID, const cmsToneCurve* t)
+{
+ _cmsAssert(t != NULL);
+
+ if (t->nSegments != 1) return NULL;
+ return t->Segments[0].Params;
+}
diff --git a/lcms2mt/src/cmsintrp.c b/lcms2mt/src/cmsintrp.c
index 590328aa9..a8854113d 100644
--- a/lcms2mt/src/cmsintrp.c
+++ b/lcms2mt/src/cmsintrp.c
@@ -412,12 +412,13 @@ void BilinearInterp16(cmsContext ContextID,
const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table;
int OutChan, TotalOut;
cmsS15Fixed16Number fx, fy;
- CMSREGISTER int rx, ry;
- int x0, y0;
- CMSREGISTER int X0, X1, Y0, Y1;
- int d00, d01, d10, d11,
- dx0, dx1,
- dxy;
+ CMSREGISTER int rx, ry;
+ int x0, y0;
+ CMSREGISTER int X0, X1, Y0, Y1;
+
+ int d00, d01, d10, d11,
+ dx0, dx1,
+ dxy;
cmsUNUSED_PARAMETER(ContextID);
TotalOut = p -> nOutputs;
@@ -474,11 +475,12 @@ void TrilinearInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[],
int x0, y0, z0,
X0, Y0, Z0, X1, Y1, Z1;
int TotalOut, OutChan;
+
cmsFloat32Number fx, fy, fz,
- d000, d001, d010, d011,
- d100, d101, d110, d111,
- dx00, dx01, dx10, dx11,
- dxy0, dxy1, dxyz;
+ d000, d001, d010, d011,
+ d100, d101, d110, d111,
+ dx00, dx01, dx10, dx11,
+ dxy0, dxy1, dxyz;
cmsUNUSED_PARAMETER(ContextID);
TotalOut = p -> nOutputs;
@@ -546,13 +548,13 @@ void TrilinearInterp16(cmsContext ContextID,
const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table;
int OutChan, TotalOut;
cmsS15Fixed16Number fx, fy, fz;
- CMSREGISTER int rx, ry, rz;
- int x0, y0, z0;
- CMSREGISTER int X0, X1, Y0, Y1, Z0, Z1;
- int d000, d001, d010, d011,
- d100, d101, d110, d111,
- dx00, dx01, dx10, dx11,
- dxy0, dxy1, dxyz;
+ CMSREGISTER int rx, ry, rz;
+ int x0, y0, z0;
+ CMSREGISTER int X0, X1, Y0, Y1, Z0, Z1;
+ int d000, d001, d010, d011,
+ d100, d101, d110, d111,
+ dx00, dx01, dx10, dx11,
+ dxy0, dxy1, dxyz;
cmsUNUSED_PARAMETER(ContextID);
TotalOut = p -> nOutputs;
@@ -621,8 +623,8 @@ void TetrahedralInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[]
{
const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;
cmsFloat32Number px, py, pz;
- int x0, y0, z0,
- X0, Y0, Z0, X1, Y1, Z1;
+ int x0, y0, z0,
+ X0, Y0, Z0, X1, Y1, Z1;
cmsFloat32Number rx, ry, rz;
cmsFloat32Number c0, c1=0, c2=0, c3=0;
int OutChan, TotalOut;
@@ -713,9 +715,6 @@ void TetrahedralInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[]
#undef DENS
-
-
-
static CMS_NO_SANITIZE
void TetrahedralInterp16(cmsContext ContextID,
CMSREGISTER const cmsUInt16Number Input[],
@@ -727,7 +726,7 @@ void TetrahedralInterp16(cmsContext ContextID,
cmsS15Fixed16Number rx, ry, rz;
int x0, y0, z0;
cmsS15Fixed16Number c0, c1, c2, c3, Rest;
- cmsS15Fixed16Number X0, X1, Y0, Y1, Z0, Z1;
+ cmsUInt32Number X0, X1, Y0, Y1, Z0, Z1;
cmsUInt32Number TotalOut = p -> nOutputs;
cmsUNUSED_PARAMETER(ContextID);
@@ -752,7 +751,7 @@ void TetrahedralInterp16(cmsContext ContextID,
Z0 = p -> opta[0] * z0;
Z1 = (Input[2] == 0xFFFFU ? 0 : p->opta[0]);
- LutTable = &LutTable[X0+Y0+Z0];
+ LutTable += X0+Y0+Z0;
// Output should be computed as x = ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest))
// which expands as: x = (Rest + ((Rest+0x7fff)/0xFFFF) + 0x8000)>>16
@@ -1038,8 +1037,6 @@ void Eval4Inputs(cmsContext ContextID,
// For more that 3 inputs (i.e., CMYK)
// evaluate two 3-dimensional interpolations and then linearly interpolate between them.
-
-
static
void Eval4InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
cmsFloat32Number Output[],
@@ -1082,354 +1079,102 @@ void Eval4InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
}
}
-
-static CMS_NO_SANITIZE
-void Eval5Inputs(cmsContext ContextID,
- CMSREGISTER const cmsUInt16Number Input[],
- CMSREGISTER cmsUInt16Number Output[],
- CMSREGISTER const cmsInterpParams* p16)
-{
- const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;
- cmsS15Fixed16Number fk;
- cmsS15Fixed16Number k0, rk;
- int K0, K1;
- const cmsUInt16Number* T;
- cmsUInt32Number i;
- cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
-
- fk = _cmsToFixedDomain((cmsS15Fixed16Number) Input[0] * p16 -> Domain[0]);
- k0 = FIXED_TO_INT(fk);
- rk = FIXED_REST_TO_INT(fk);
-
- K0 = p16 -> opta[4] * k0;
- K1 = p16 -> opta[4] * (k0 + (Input[0] != 0xFFFFU ? 1 : 0));
-
- p1 = *p16;
- memmove(&p1.Domain[0], &p16 ->Domain[1], 4*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval4Inputs(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval4Inputs(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p16 -> nOutputs; i++) {
-
- Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]);
- }
-
-}
-
-
-static
-void Eval5InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
- cmsFloat32Number Output[],
- const cmsInterpParams* p)
-{
- const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;
- cmsFloat32Number rest;
- cmsFloat32Number pk;
- int k0, K0, K1;
- const cmsFloat32Number* T;
- cmsUInt32Number i;
- cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- pk = fclamp(Input[0]) * p->Domain[0];
- k0 = _cmsQuickFloor(pk);
- rest = pk - (cmsFloat32Number) k0;
-
- K0 = p -> opta[4] * k0;
- K1 = K0 + (fclamp(Input[0]) >= 1.0 ? 0 : p->opta[4]);
-
- p1 = *p;
- memmove(&p1.Domain[0], &p ->Domain[1], 4*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval4InputsFloat(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval4InputsFloat(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p -> nOutputs; i++) {
-
- cmsFloat32Number y0 = Tmp1[i];
- cmsFloat32Number y1 = Tmp2[i];
-
- Output[i] = y0 + (y1 - y0) * rest;
- }
-}
-
-
-
-static CMS_NO_SANITIZE
-void Eval6Inputs(cmsContext ContextID,
- CMSREGISTER const cmsUInt16Number Input[],
- CMSREGISTER cmsUInt16Number Output[],
- CMSREGISTER const cmsInterpParams* p16)
-{
- const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;
- cmsS15Fixed16Number fk;
- cmsS15Fixed16Number k0, rk;
- int K0, K1;
- const cmsUInt16Number* T;
- cmsUInt32Number i;
- cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- fk = _cmsToFixedDomain((cmsS15Fixed16Number) Input[0] * p16 -> Domain[0]);
- k0 = FIXED_TO_INT(fk);
- rk = FIXED_REST_TO_INT(fk);
-
- K0 = p16 -> opta[5] * k0;
- K1 = p16 -> opta[5] * (k0 + (Input[0] != 0xFFFFU ? 1 : 0));
-
- p1 = *p16;
- memmove(&p1.Domain[0], &p16 ->Domain[1], 5*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval5Inputs(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval5Inputs(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p16 -> nOutputs; i++) {
-
- Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]);
- }
-
-}
-
-
-static
-void Eval6InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
- cmsFloat32Number Output[],
- const cmsInterpParams* p)
-{
- const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;
- cmsFloat32Number rest;
- cmsFloat32Number pk;
- int k0, K0, K1;
- const cmsFloat32Number* T;
- cmsUInt32Number i;
- cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- pk = fclamp(Input[0]) * p->Domain[0];
- k0 = _cmsQuickFloor(pk);
- rest = pk - (cmsFloat32Number) k0;
-
- K0 = p -> opta[5] * k0;
- K1 = K0 + (fclamp(Input[0]) >= 1.0 ? 0 : p->opta[5]);
-
- p1 = *p;
- memmove(&p1.Domain[0], &p ->Domain[1], 5*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval5InputsFloat(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval5InputsFloat(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p -> nOutputs; i++) {
-
- cmsFloat32Number y0 = Tmp1[i];
- cmsFloat32Number y1 = Tmp2[i];
-
- Output[i] = y0 + (y1 - y0) * rest;
- }
-}
-
-
-static CMS_NO_SANITIZE
-void Eval7Inputs(cmsContext ContextID,
- CMSREGISTER const cmsUInt16Number Input[],
- CMSREGISTER cmsUInt16Number Output[],
- CMSREGISTER const cmsInterpParams* p16)
-{
- const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;
- cmsS15Fixed16Number fk;
- cmsS15Fixed16Number k0, rk;
- int K0, K1;
- const cmsUInt16Number* T;
- cmsUInt32Number i;
- cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
-
- fk = _cmsToFixedDomain((cmsS15Fixed16Number) Input[0] * p16 -> Domain[0]);
- k0 = FIXED_TO_INT(fk);
- rk = FIXED_REST_TO_INT(fk);
-
- K0 = p16 -> opta[6] * k0;
- K1 = p16 -> opta[6] * (k0 + (Input[0] != 0xFFFFU ? 1 : 0));
-
- p1 = *p16;
- memmove(&p1.Domain[0], &p16 ->Domain[1], 6*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval6Inputs(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval6Inputs(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p16 -> nOutputs; i++) {
- Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]);
- }
-}
-
-
-static
-void Eval7InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
- cmsFloat32Number Output[],
- const cmsInterpParams* p)
-{
- const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;
- cmsFloat32Number rest;
- cmsFloat32Number pk;
- int k0, K0, K1;
- const cmsFloat32Number* T;
- cmsUInt32Number i;
- cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- pk = fclamp(Input[0]) * p->Domain[0];
- k0 = _cmsQuickFloor(pk);
- rest = pk - (cmsFloat32Number) k0;
-
- K0 = p -> opta[6] * k0;
- K1 = K0 + (fclamp(Input[0]) >= 1.0 ? 0 : p->opta[6]);
-
- p1 = *p;
- memmove(&p1.Domain[0], &p ->Domain[1], 6*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval6InputsFloat(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval6InputsFloat(ContextID, Input + 1, Tmp2, &p1);
-
-
- for (i=0; i < p -> nOutputs; i++) {
-
- cmsFloat32Number y0 = Tmp1[i];
- cmsFloat32Number y1 = Tmp2[i];
-
- Output[i] = y0 + (y1 - y0) * rest;
-
- }
-}
-
-static CMS_NO_SANITIZE
-void Eval8Inputs(cmsContext ContextID,
- CMSREGISTER const cmsUInt16Number Input[],
- CMSREGISTER cmsUInt16Number Output[],
- CMSREGISTER const cmsInterpParams* p16)
-{
- const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;
- cmsS15Fixed16Number fk;
- cmsS15Fixed16Number k0, rk;
- int K0, K1;
- const cmsUInt16Number* T;
- cmsUInt32Number i;
- cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- fk = _cmsToFixedDomain((cmsS15Fixed16Number) Input[0] * p16 -> Domain[0]);
- k0 = FIXED_TO_INT(fk);
- rk = FIXED_REST_TO_INT(fk);
-
- K0 = p16 -> opta[7] * k0;
- K1 = p16 -> opta[7] * (k0 + (Input[0] != 0xFFFFU ? 1 : 0));
-
- p1 = *p16;
- memmove(&p1.Domain[0], &p16 ->Domain[1], 7*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval7Inputs(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
- Eval7Inputs(ContextID, Input + 1, Tmp2, &p1);
-
- for (i=0; i < p16 -> nOutputs; i++) {
- Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]);
- }
+#define EVAL_FNS(N,NM) static CMS_NO_SANITIZE \
+void Eval##N##Inputs(cmsContext contextID, CMSREGISTER const cmsUInt16Number Input[], CMSREGISTER cmsUInt16Number Output[], CMSREGISTER const cmsInterpParams* p16) \
+{\
+ const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table;\
+ cmsS15Fixed16Number fk;\
+ cmsS15Fixed16Number k0, rk;\
+ int K0, K1;\
+ const cmsUInt16Number* T;\
+ cmsUInt32Number i;\
+ cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];\
+ cmsInterpParams p1;\
+\
+ fk = _cmsToFixedDomain((cmsS15Fixed16Number) Input[0] * p16 -> Domain[0]);\
+ k0 = FIXED_TO_INT(fk);\
+ rk = FIXED_REST_TO_INT(fk);\
+\
+ K0 = p16 -> opta[NM] * k0;\
+ K1 = p16 -> opta[NM] * (k0 + (Input[0] != 0xFFFFU ? 1 : 0));\
+\
+ p1 = *p16;\
+ memmove(&p1.Domain[0], &p16 ->Domain[1], NM*sizeof(cmsUInt32Number));\
+\
+ T = LutTable + K0;\
+ p1.Table = T;\
+\
+ Eval##NM##Inputs(contextID, Input + 1, Tmp1, &p1);\
+\
+ T = LutTable + K1;\
+ p1.Table = T;\
+\
+ Eval##NM##Inputs(contextID, Input + 1, Tmp2, &p1);\
+\
+ for (i=0; i < p16 -> nOutputs; i++) {\
+\
+ Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]);\
+ }\
+}\
+\
+static void Eval##N##InputsFloat(cmsContext contextID,\
+ const cmsFloat32Number Input[], \
+ cmsFloat32Number Output[],\
+ const cmsInterpParams * p)\
+{\
+ const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;\
+ cmsFloat32Number rest;\
+ cmsFloat32Number pk;\
+ int k0, K0, K1;\
+ const cmsFloat32Number* T;\
+ cmsUInt32Number i;\
+ cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];\
+ cmsInterpParams p1;\
+\
+ pk = fclamp(Input[0]) * p->Domain[0];\
+ k0 = _cmsQuickFloor(pk);\
+ rest = pk - (cmsFloat32Number) k0;\
+\
+ K0 = p -> opta[NM] * k0;\
+ K1 = K0 + (fclamp(Input[0]) >= 1.0 ? 0 : p->opta[NM]);\
+\
+ p1 = *p;\
+ memmove(&p1.Domain[0], &p ->Domain[1], NM*sizeof(cmsUInt32Number));\
+\
+ T = LutTable + K0;\
+ p1.Table = T;\
+\
+ Eval##NM##InputsFloat(contextID, Input + 1, Tmp1, &p1);\
+\
+ T = LutTable + K1;\
+ p1.Table = T;\
+\
+ Eval##NM##InputsFloat(contextID, Input + 1, Tmp2, &p1);\
+\
+ for (i=0; i < p -> nOutputs; i++) {\
+\
+ cmsFloat32Number y0 = Tmp1[i];\
+ cmsFloat32Number y1 = Tmp2[i];\
+\
+ Output[i] = y0 + (y1 - y0) * rest;\
+ }\
}
-
-static
-void Eval8InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[],
- cmsFloat32Number Output[],
- const cmsInterpParams* p)
-{
- const cmsFloat32Number* LutTable = (cmsFloat32Number*) p -> Table;
- cmsFloat32Number rest;
- cmsFloat32Number pk;
- int k0, K0, K1;
- const cmsFloat32Number* T;
- cmsUInt32Number i;
- cmsFloat32Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS];
- cmsInterpParams p1;
-
- pk = fclamp(Input[0]) * p->Domain[0];
- k0 = _cmsQuickFloor(pk);
- rest = pk - (cmsFloat32Number) k0;
-
- K0 = p -> opta[7] * k0;
- K1 = K0 + (fclamp(Input[0]) >= 1.0 ? 0 : p->opta[7]);
-
- p1 = *p;
- memmove(&p1.Domain[0], &p ->Domain[1], 7*sizeof(cmsUInt32Number));
-
- T = LutTable + K0;
- p1.Table = T;
-
- Eval7InputsFloat(ContextID, Input + 1, Tmp1, &p1);
-
- T = LutTable + K1;
- p1.Table = T;
-
- Eval7InputsFloat(ContextID, Input + 1, Tmp2, &p1);
-
-
- for (i=0; i < p -> nOutputs; i++) {
-
- cmsFloat32Number y0 = Tmp1[i];
- cmsFloat32Number y1 = Tmp2[i];
-
- Output[i] = y0 + (y1 - y0) * rest;
- }
-}
+/**
+* Thanks to Carles Llopis for the templating idea
+*/
+EVAL_FNS(5, 4)
+EVAL_FNS(6, 5)
+EVAL_FNS(7, 6)
+EVAL_FNS(8, 7)
+EVAL_FNS(9, 8)
+EVAL_FNS(10, 9)
+EVAL_FNS(11, 10)
+EVAL_FNS(12, 11)
+EVAL_FNS(13, 12)
+EVAL_FNS(14, 13)
+EVAL_FNS(15, 14)
// The default factory
static
@@ -1530,6 +1275,53 @@ cmsInterpFunction DefaultInterpolatorsFactory(cmsUInt32Number nInputChannels, cm
Interpolation.Lerp16 = Eval8Inputs;
break;
+ case 9:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval9InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval9Inputs;
+ break;
+
+ case 10:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval10InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval10Inputs;
+ break;
+
+ case 11:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval11InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval11Inputs;
+ break;
+
+ case 12:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval12InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval12Inputs;
+ break;
+
+ case 13:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval13InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval13Inputs;
+ break;
+
+ case 14:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval14InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval14Inputs;
+ break;
+
+ case 15:
+ if (IsFloat)
+ Interpolation.LerpFloat = Eval15InputsFloat;
+ else
+ Interpolation.Lerp16 = Eval15Inputs;
break;
default:
diff --git a/lcms2mt/src/cmsio0.c b/lcms2mt/src/cmsio0.c
index 0dd6ca120..83b374453 100644
--- a/lcms2mt/src/cmsio0.c
+++ b/lcms2mt/src/cmsio0.c
@@ -266,7 +266,7 @@ cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buff
_cmsFree(ContextID, fm);
_cmsFree(ContextID, iohandler);
- cmsSignalError(ContextID, cmsERROR_READ, "Couldn't allocate %ld bytes for profile", size);
+ cmsSignalError(ContextID, cmsERROR_READ, "Couldn't allocate %ld bytes for profile", (long) size);
return NULL;
}
@@ -1207,25 +1207,28 @@ cmsBool SaveTags(cmsContext ContextID, _cmsICCPROFILE* Icc, _cmsICCPROFILE* File
// In this case a blind copy of the block data is performed
if (FileOrig != NULL && Icc -> TagOffsets[i]) {
- cmsUInt32Number TagSize = FileOrig -> TagSizes[i];
- cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i];
- void* Mem;
+ if (FileOrig->IOhandler != NULL)
+ {
+ cmsUInt32Number TagSize = FileOrig->TagSizes[i];
+ cmsUInt32Number TagOffset = FileOrig->TagOffsets[i];
+ void* Mem;
- if (!FileOrig ->IOhandler->Seek(ContextID, FileOrig ->IOhandler, TagOffset)) return FALSE;
+ if (!FileOrig ->IOhandler->Seek(ContextID, FileOrig ->IOhandler, TagOffset)) return FALSE;
- Mem = _cmsMalloc(ContextID, TagSize);
- if (Mem == NULL) return FALSE;
+ Mem = _cmsMalloc(ContextID, TagSize);
+ if (Mem == NULL) return FALSE;
- if (FileOrig ->IOhandler->Read(ContextID, FileOrig->IOhandler, Mem, TagSize, 1) != 1) return FALSE;
- if (!io ->Write(ContextID, io, TagSize, Mem)) return FALSE;
- _cmsFree(ContextID, Mem);
+ if (FileOrig ->IOhandler->Read(ContextID, FileOrig->IOhandler, Mem, TagSize, 1) != 1) return FALSE;
+ if (!io ->Write(ContextID, io, TagSize, Mem)) return FALSE;
+ _cmsFree(ContextID, Mem);
- Icc -> TagSizes[i] = (io ->UsedSpace - Begin);
+ Icc->TagSizes[i] = (io->UsedSpace - Begin);
- // Align to 32 bit boundary.
- if (! _cmsWriteAlignment(ContextID, io))
- return FALSE;
+ // Align to 32 bit boundary.
+ if (! _cmsWriteAlignment(ContextID, io))
+ return FALSE;
+ }
}
continue;
diff --git a/lcms2mt/src/cmslut.c b/lcms2mt/src/cmslut.c
index 241b6ae88..5c861004a 100644
--- a/lcms2mt/src/cmslut.c
+++ b/lcms2mt/src/cmslut.c
@@ -397,8 +397,7 @@ cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number R
NewElem = (_cmsStageMatrixData*) _cmsMallocZero(ContextID, sizeof(_cmsStageMatrixData));
if (NewElem == NULL) goto Error;
- NewMPE ->Data = (void*) NewElem;
-
+ NewMPE->Data = (void*)NewElem;
NewElem ->Double = (cmsFloat64Number*) _cmsCalloc(ContextID, n, sizeof(cmsFloat64Number));
if (NewElem->Double == NULL) goto Error;
@@ -407,7 +406,6 @@ cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number R
NewElem ->Double[i] = Matrix[i];
}
-
if (Offset != NULL) {
NewElem ->Offset = (cmsFloat64Number*) _cmsCalloc(ContextID, Rows, sizeof(cmsFloat64Number));
@@ -416,7 +414,6 @@ cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number R
for (i=0; i < Rows; i++) {
NewElem ->Offset[i] = Offset[i];
}
-
}
return NewMPE;
@@ -1346,7 +1343,7 @@ void _LUTeval16(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], CM
// Does evaluate the LUT on cmsFloat32Number-basis.
static
-void _LUTevalFloat(cmsContext ContextID, CMSREGISTER const cmsFloat32Number In[], CMSREGISTER cmsFloat32Number Out[], const void* D)
+void _LUTevalFloat(cmsContext ContextID, const cmsFloat32Number In[], cmsFloat32Number Out[], const void* D)
{
cmsPipeline* lut = (cmsPipeline*) D;
cmsStage *mpe;
@@ -1663,8 +1660,9 @@ cmsUInt32Number CMSEXPORT cmsPipelineStageCount(cmsContext ContextID, const cmsP
// 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.
-void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsContext ContextID, cmsPipeline* Lut,
- _cmsOPTeval16Fn Eval16,
+void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsContext ContextID,
+ cmsPipeline* Lut,
+ _cmsPipelineEval16Fn Eval16,
void* PrivateData,
_cmsFreeUserDataFn FreePrivateDataFn,
_cmsDupUserDataFn DupPrivateDataFn)
diff --git a/lcms2mt/src/cmsnamed.c b/lcms2mt/src/cmsnamed.c
index cd751b47f..fa2555293 100644
--- a/lcms2mt/src/cmsnamed.c
+++ b/lcms2mt/src/cmsnamed.c
@@ -178,12 +178,16 @@ cmsBool AddMLUBlock(cmsContext ContextID, cmsMLU* mlu, cmsUInt32Number size, con
// Convert from a 3-char code to a cmsUInt16Number. It is done in this way because some
// compilers don't properly align beginning of strings
-
static
cmsUInt16Number strTo16(const char str[3])
{
- const cmsUInt8Number* ptr8 = (const cmsUInt8Number*)str;
- cmsUInt16Number n = (cmsUInt16Number)(((cmsUInt16Number)ptr8[0] << 8) | ptr8[1]);
+ const cmsUInt8Number* ptr8;
+ cmsUInt16Number n;
+
+ // For non-existent strings
+ if (str == NULL) return 0;
+ ptr8 = (const cmsUInt8Number*)str;
+ n = (cmsUInt16Number)(((cmsUInt16Number)ptr8[0] << 8) | ptr8[1]);
return n;
}
@@ -198,6 +202,7 @@ void strFrom16(char str[3], cmsUInt16Number n)
}
// Add an ASCII entry. Do not add any \0 termination (ICC1v43_2010-12.pdf page 61)
+// In the case the user explicitely sets an empty string, we force a \0
cmsBool CMSEXPORT cmsMLUsetASCII(cmsContext ContextID, cmsMLU* mlu, const char LanguageCode[3], const char CountryCode[3], const char* ASCIIString)
{
cmsUInt32Number i, len = (cmsUInt32Number) strlen(ASCIIString);
@@ -208,6 +213,12 @@ cmsBool CMSEXPORT cmsMLUsetASCII(cmsContext ContextID, cmsMLU* mlu, const char L
if (mlu == NULL) return FALSE;
+ // len == 0 would prevent operation, so we set a empty string pointing to zero
+ if (len == 0)
+ {
+ len = 1;
+ }
+
WStr = (wchar_t*) _cmsCalloc(ContextID, len, sizeof(wchar_t));
if (WStr == NULL) return FALSE;
@@ -245,6 +256,9 @@ cmsBool CMSEXPORT cmsMLUsetWide(cmsContext ContextID, cmsMLU* mlu, const char L
if (WideString == NULL) return FALSE;
len = (cmsUInt32Number) (mywcslen(WideString)) * sizeof(wchar_t);
+ if (len == 0)
+ len = sizeof(wchar_t);
+
return AddMLUBlock(ContextID, mlu, len, WideString, Lang, Cntry);
}
diff --git a/lcms2mt/src/cmsopt.c b/lcms2mt/src/cmsopt.c
index 7fb5e0293..8fca60f84 100644
--- a/lcms2mt/src/cmsopt.c
+++ b/lcms2mt/src/cmsopt.c
@@ -379,7 +379,20 @@ Prelin16Data* PrelinOpt16alloc(cmsContext ContextID,
p16 -> EvalCurveOut16 = (_cmsInterpFn16*) _cmsCalloc(ContextID, nOutputs, sizeof(_cmsInterpFn16));
+ if (p16->EvalCurveOut16 == NULL)
+ {
+ _cmsFree(ContextID, p16);
+ return NULL;
+ }
+
p16 -> ParamsCurveOut16 = (cmsInterpParams**) _cmsCalloc(ContextID, nOutputs, sizeof(cmsInterpParams* ));
+ if (p16->ParamsCurveOut16 == NULL)
+ {
+
+ _cmsFree(ContextID, p16->EvalCurveOut16);
+ _cmsFree(ContextID, p16);
+ return NULL;
+ }
for (i=0; i < nOutputs; i++) {
@@ -406,7 +419,10 @@ Prelin16Data* PrelinOpt16alloc(cmsContext ContextID,
// Sampler implemented by another LUT. This is a clean way to precalculate the devicelink 3D CLUT for
// almost any transform. We use floating point precision and then convert from floating point to 16 bits.
static
-cmsInt32Number XFormSampler16(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], CMSREGISTER cmsUInt16Number Out[], CMSREGISTER void* Cargo)
+cmsInt32Number XFormSampler16(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void* Cargo)
{
cmsPipeline* Lut = (cmsPipeline*) Cargo;
cmsFloat32Number InFloat[cmsMAXCHANNELS], OutFloat[cmsMAXCHANNELS];
@@ -765,7 +781,7 @@ Error:
if (DataSetIn == NULL && DataSetOut == NULL) {
- _cmsPipelineSetOptimizationParameters(ContextID, Dest, (_cmsOPTeval16Fn) DataCLUT->Params->Interpolation.Lerp16, DataCLUT->Params, NULL, NULL);
+ _cmsPipelineSetOptimizationParameters(ContextID, Dest, (_cmsPipelineEval16Fn) DataCLUT->Params->Interpolation.Lerp16, DataCLUT->Params, NULL, NULL);
}
else {
@@ -929,9 +945,9 @@ void PrelinEval8(cmsContext ContextID,
g = (cmsUInt8Number) (Input[1] >> 8);
b = (cmsUInt8Number) (Input[2] >> 8);
- X0 = X1 = (cmsS15Fixed16Number) p8->X0[r];
- Y0 = Y1 = (cmsS15Fixed16Number) p8->Y0[g];
- Z0 = Z1 = (cmsS15Fixed16Number) p8->Z0[b];
+ X0 = (cmsS15Fixed16Number) p8->X0[r];
+ Y0 = (cmsS15Fixed16Number) p8->Y0[g];
+ Z0 = (cmsS15Fixed16Number) p8->Z0[b];
rx = p8 ->rx[r];
ry = p8 ->ry[g];
@@ -1900,7 +1916,7 @@ cmsBool _cmsRegisterOptimizationPlugin(cmsContext ContextID, cmsPluginBase* Dat
}
// The entry point for LUT optimization
-cmsBool _cmsOptimizePipeline(cmsContext ContextID,
+cmsBool CMSEXPORT _cmsOptimizePipeline(cmsContext ContextID,
cmsPipeline** PtrLut,
cmsUInt32Number Intent,
cmsUInt32Number* InputFormat,
diff --git a/lcms2mt/src/cmspack.c b/lcms2mt/src/cmspack.c
index 150c081db..01065c0d3 100644
--- a/lcms2mt/src/cmspack.c
+++ b/lcms2mt/src/cmspack.c
@@ -2904,7 +2904,7 @@ cmsUInt8Number* UnrollHalfTo16(cmsContext ContextID,
if (Reverse) v = maximum - v;
- wIn[index] = _cmsQuickSaturateWord(v * maximum);
+ wIn[index] = _cmsQuickSaturateWord((cmsFloat64Number) v * maximum);
}
diff --git a/lcms2mt/src/cmspcs.c b/lcms2mt/src/cmspcs.c
index 743d479fd..7a3e30970 100644
--- a/lcms2mt/src/cmspcs.c
+++ b/lcms2mt/src/cmspcs.c
@@ -668,7 +668,7 @@ cmsFloat64Number CMSEXPORT cmsCIE2000DeltaE(cmsContext ContextID, const cmsCIELa
// This function returns a number of gridpoints to be used as LUT table. It assumes same number
// of gripdpoints in all dimensions. Flags may override the choice.
-cmsUInt32Number _cmsReasonableGridpointsByColorspace(cmsContext ContextID, cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags)
+cmsUInt32Number CMSEXPORT _cmsReasonableGridpointsByColorspace(cmsContext ContextID, cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags)
{
cmsUInt32Number nChannels;
diff --git a/lcms2mt/src/cmsplugin.c b/lcms2mt/src/cmsplugin.c
index 206368c44..2a6e6b6bf 100644
--- a/lcms2mt/src/cmsplugin.c
+++ b/lcms2mt/src/cmsplugin.c
@@ -186,7 +186,7 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsContext ContextID, cmsIOHANDLER* io,
return TRUE;
#elif defined (__BORLANDC__)
return TRUE;
- #elif !defined(_MSC_VER) && !defined(HAVE_FPCLASSIFY)
+ #elif !defined(_MSC_VER) && (defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L) && !defined(HAVE_FPCLASSIFY)
return TRUE;
#else
@@ -503,6 +503,7 @@ cmsBool CMSEXPORT _cmsIOPrintf(cmsContext ContextID, cmsIOHANDLER* io, const cha
int len;
cmsUInt8Number Buffer[2048];
cmsBool rc;
+ cmsUInt8Number* ptr;
_cmsAssert(io != NULL);
_cmsAssert(frm != NULL);
@@ -515,6 +516,13 @@ cmsBool CMSEXPORT _cmsIOPrintf(cmsContext ContextID, cmsIOHANDLER* io, const cha
return FALSE; // Truncated, which is a fatal error for us
}
+ // setlocale may be active, no commas are needed in PS generator
+ // and PS generator is our only client
+ for (ptr = Buffer; *ptr; ptr++)
+ {
+ if (*ptr == ',') *ptr = '.';
+ }
+
rc = io ->Write(ContextID, io, (cmsUInt32Number) len, Buffer);
va_end(args);
@@ -675,15 +683,21 @@ struct _cmsContext_struct* _cmsGetContext(cmsContext ContextID)
return &globalContext;
// Search
+ _cmsEnterCriticalSectionPrimitive(&_cmsContextPoolHeadMutex);
+
for (ctx = _cmsContextPoolHead;
ctx != NULL;
ctx = ctx ->Next) {
// Found it?
- if (id == ctx)
- return ctx; // New-style context,
+ if (id == ctx)
+ {
+ _cmsLeaveCriticalSectionPrimitive(&_cmsContextPoolHeadMutex);
+ return ctx; // New-style context
+ }
}
+ _cmsLeaveCriticalSectionPrimitive(&_cmsContextPoolHeadMutex);
return &globalContext;
}
@@ -918,25 +932,6 @@ cmsContext CMSEXPORT cmsDupContext(cmsContext ContextID, void* NewUserData)
}
-/*
-static
-struct _cmsContext_struct* FindPrev(struct _cmsContext_struct* id)
-{
- struct _cmsContext_struct* prev;
-
- // Search for previous
- for (prev = _cmsContextPoolHead;
- prev != NULL;
- prev = prev ->Next)
- {
- if (prev ->Next == id)
- return prev;
- }
-
- return NULL; // List is empty or only one element!
-}
-*/
-
// Frees any resources associated with the given context,
// and destroys the context placeholder.
// The ContextID can no longer be used in any THR operation.
diff --git a/lcms2mt/src/cmsps2.c b/lcms2mt/src/cmsps2.c
index 62558bfc3..bdaaf6d6e 100644
--- a/lcms2mt/src/cmsps2.c
+++ b/lcms2mt/src/cmsps2.c
@@ -529,9 +529,10 @@ void Emit1Gamma(cmsContext ContextID, cmsIOHANDLER* m, cmsToneCurve* Table, cons
// Compare gamma table
static
-cmsBool GammaTableEquals(cmsUInt16Number* g1, cmsUInt16Number* g2, cmsUInt32Number nEntries)
+cmsBool GammaTableEquals(cmsUInt16Number* g1, cmsUInt16Number* g2, cmsUInt32Number nG1, cmsUInt32Number nG2)
{
- return memcmp(g1, g2, nEntries* sizeof(cmsUInt16Number)) == 0;
+ if (nG1 != nG2) return FALSE;
+ return memcmp(g1, g2, nG1 * sizeof(cmsUInt16Number)) == 0;
}
@@ -547,12 +548,12 @@ void EmitNGamma(cmsContext ContextID, cmsIOHANDLER* m, cmsUInt32Number n, cmsTon
{
if (g[i] == NULL) return; // Error
- if (i > 0 && GammaTableEquals(g[i-1]->Table16, g[i]->Table16, g[i]->nEntries)) {
+ if (i > 0 && GammaTableEquals(g[i-1]->Table16, g[i]->Table16, g[i-1]->nEntries, g[i]->nEntries)) {
_cmsIOPrintf(ContextID, m, "/%s%d /%s%d load def\n", nameprefix, i, nameprefix, i-1);
}
else {
- snprintf(buffer, sizeof(buffer), "%s%d", nameprefix, i);
+ snprintf(buffer, sizeof(buffer), "%s%d", nameprefix, (int) i);
buffer[sizeof(buffer)-1] = '\0';
Emit1Gamma(ContextID, m, g[i], buffer);
}
@@ -807,7 +808,7 @@ int EmitCIEBasedDEF(cmsContext ContextID, cmsIOHANDLER* m, cmsPipeline* Pipeline
if (cmsStageType(ContextID, mpe) == cmsSigCurveSetElemType) {
- numchans = cmsStageOutputChannels(ContextID, mpe);
+ numchans = (int) cmsStageOutputChannels(ContextID, mpe);
for (i = 0; i < numchans; ++i) {
snprintf(buffer, sizeof(buffer), "lcms2gammaproc%d", i);
buffer[sizeof(buffer) - 1] = '\0';
diff --git a/lcms2mt/src/cmssamp.c b/lcms2mt/src/cmssamp.c
index c563fac6d..8fb1d1f6f 100644
--- a/lcms2mt/src/cmssamp.c
+++ b/lcms2mt/src/cmssamp.c
@@ -82,10 +82,10 @@ cmsBool BlackPointAsDarkerColorant(cmsContext ContextID,
return FALSE;
}
- // Create a formatter which has n channels and floating point
+ // Create a formatter which has n channels and no floating point
dwFormat = cmsFormatterForColorspaceOfProfile(ContextID, hInput, 2, FALSE);
- // Try to get black by using black colorant
+ // Try to get black by using black colorant
Space = cmsGetColorSpace(ContextID, hInput);
// This function returns darker colorant in 16 bits for several spaces
diff --git a/lcms2mt/src/cmstypes.c b/lcms2mt/src/cmstypes.c
index 85256ef7a..1d8c2a383 100644
--- a/lcms2mt/src/cmstypes.c
+++ b/lcms2mt/src/cmstypes.c
@@ -1907,6 +1907,7 @@ cmsBool Type_LUT8_Write(cmsContext ContextID, struct _cms_typehandler_struct* s
mpe = NewLUT -> Elements;
if (mpe ->Type == cmsSigMatrixElemType) {
+ if (mpe->InputChannels != 3 || mpe->OutputChannels != 3) return FALSE;
MatMPE = (_cmsStageMatrixData*) mpe ->Data;
mpe = mpe -> Next;
}
@@ -1932,7 +1933,6 @@ cmsBool Type_LUT8_Write(cmsContext ContextID, struct _cms_typehandler_struct* s
return FALSE;
}
-
if (clut == NULL)
clutPoints = 0;
else
@@ -1947,15 +1947,13 @@ cmsBool Type_LUT8_Write(cmsContext ContextID, struct _cms_typehandler_struct* s
if (MatMPE != NULL) {
- for (i = 0; i < n; i++)
+ for (i = 0; i < 9; i++)
{
if (!_cmsWrite15Fixed16Number(ContextID, io, MatMPE->Double[i])) return FALSE;
}
}
else {
- if (n != 9) return FALSE;
-
if (!_cmsWrite15Fixed16Number(ContextID, io, 1)) return FALSE;
if (!_cmsWrite15Fixed16Number(ContextID, io, 0)) return FALSE;
if (!_cmsWrite15Fixed16Number(ContextID, io, 0)) return FALSE;
@@ -2178,9 +2176,9 @@ Error:
// Some empty defaults are created for missing parts
static
-cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
+cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
{
- cmsUInt32Number nTabSize, n;
+ cmsUInt32Number nTabSize;
cmsPipeline* NewLUT = (cmsPipeline*) Ptr;
cmsStage* mpe;
_cmsStageToneCurvesData* PreMPE = NULL, *PostMPE = NULL;
@@ -2194,6 +2192,7 @@ cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct*
if (mpe != NULL && mpe ->Type == cmsSigMatrixElemType) {
MatMPE = (_cmsStageMatrixData*) mpe ->Data;
+ if (mpe->InputChannels != 3 || mpe->OutputChannels != 3) return FALSE;
mpe = mpe -> Next;
}
@@ -2232,11 +2231,9 @@ cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct*
if (!_cmsWriteUInt8Number(ContextID, io, (cmsUInt8Number) clutPoints)) return FALSE;
if (!_cmsWriteUInt8Number(ContextID, io, 0)) return FALSE; // Padding
- n = NewLUT->InputChannels * NewLUT->OutputChannels;
-
if (MatMPE != NULL) {
- for (i = 0; i < n; i++)
+ for (i = 0; i < 9; i++)
{
if (!_cmsWrite15Fixed16Number(ContextID, io, MatMPE->Double[i])) return FALSE;
}
@@ -2244,8 +2241,6 @@ cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct*
}
else {
- if (n != 9) return FALSE;
-
if (!_cmsWrite15Fixed16Number(ContextID, io, 1)) return FALSE;
if (!_cmsWrite15Fixed16Number(ContextID, io, 0)) return FALSE;
if (!_cmsWrite15Fixed16Number(ContextID, io, 0)) return FALSE;
@@ -3048,6 +3043,9 @@ void *Type_ColorantTable_Read(cmsContext ContextID, struct _cms_typehandler_stru
}
List = cmsAllocNamedColorList(ContextID, Count, 0, "", "");
+ if (List == NULL)
+ return NULL;
+
for (i=0; i < Count; i++) {
if (io ->Read(ContextID, io,Name, 32, 1) != 1) goto Error;
diff --git a/lcms2mt/src/cmsxform.c b/lcms2mt/src/cmsxform.c
index e9b34341d..7440e6786 100644
--- a/lcms2mt/src/cmsxform.c
+++ b/lcms2mt/src/cmsxform.c
@@ -269,7 +269,7 @@ void FloatXFORM(cmsContext ContextID, _cmsTRANSFORM* p,
strideIn = 0;
strideOut = 0;
memset(fIn, 0, sizeof(fIn));
- memset(fOut, 0, sizeof(fIn));
+ memset(fOut, 0, sizeof(fOut));
for (i = 0; i < LineCount; i++) {
@@ -966,7 +966,7 @@ cmsBool _cmsRegisterTransformPlugin(cmsContext ContextID, cmsPluginBase* Data)
if (fl == NULL) return FALSE;
// Check for full xform plug-ins previous to 2.8, we would need an adapter in that case
- if (Plugin->base.ExpectedVersion < 2080-2000) {
+ if (Plugin->base.ExpectedVersion < 2080) {
fl->OldXform = TRUE;
}
@@ -1014,6 +1014,12 @@ void CMSEXPORT _cmsGetTransformFormattersFloat(struct _cmstransform_struct *CMMc
if (ToOutput) *ToOutput = CMMcargo ->ToOutputFloat;
}
+// returns original flags
+cmsUInt32Number CMSEXPORT _cmsGetTransformFlags(struct _cmstransform_struct* CMMcargo)
+{
+ _cmsAssert(CMMcargo != NULL);
+ return CMMcargo->core->dwOriginalFlags;
+}
void
_cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number dwFlags)
@@ -1153,43 +1159,46 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
p->core->Lut = lut;
// Let's see if any plug-in want to do the transform by itself
- if (core->Lut != NULL && !(*dwFlags & cmsFLAGS_NOOPTIMIZE)) {
-
- for (Plugin = ctx->TransformCollection;
- Plugin != NULL;
- Plugin = Plugin->Next) {
-
- if (Plugin->Factory(ContextID, &p->xform, &core->UserData, &core->FreeUserData, &core->Lut, InputFormat, OutputFormat, dwFlags)) {
-
- // Last plugin in the declaration order takes control. We just keep
- // the original parameters as a logging.
- // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
- // an optimized transform is not reusable. The plug-in can, however, change
- // the flags and make it suitable.
-
- p->InputFormat = *InputFormat;
- p->OutputFormat = *OutputFormat;
- core->dwOriginalFlags = *dwFlags;
-
- // Fill the formatters just in case the optimized routine is interested.
- // No error is thrown if the formatter doesn't exist. It is up to the optimization
- // factory to decide what to do in those cases.
- p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
- p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
- p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
- p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
-
- // Save the day? (Ignore the warning)
- if (Plugin->OldXform) {
- p->OldXform = (_cmsTransformFn)(void*) p->xform;
- p->xform = _cmsTransform2toTransformAdaptor;
- }
- return p;
- }
- }
-
- // Not suitable for the transform plug-in, let's check the pipeline plug-in
- _cmsOptimizePipeline(ContextID, &core->Lut, Intent, InputFormat, OutputFormat, dwFlags);
+ if (core->Lut != NULL) {
+ if (!(*dwFlags & cmsFLAGS_NOOPTIMIZE)) {
+
+ for (Plugin = ctx->TransformCollection;
+ Plugin != NULL;
+ Plugin = Plugin->Next) {
+
+ if (Plugin->Factory(ContextID, &p->xform, &core->UserData, &core->FreeUserData, &core->Lut, InputFormat, OutputFormat, dwFlags)) {
+
+ // Last plugin in the declaration order takes control. We just keep
+ // the original parameters as a logging.
+ // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
+ // an optimized transform is not reusable. The plug-in can, however, change
+ // the flags and make it suitable.
+
+ p->InputFormat = *InputFormat;
+ p->OutputFormat = *OutputFormat;
+ core->dwOriginalFlags = *dwFlags;
+
+ // Fill the formatters just in case the optimized routine is interested.
+ // No error is thrown if the formatter doesn't exist. It is up to the optimization
+ // factory to decide what to do in those cases.
+ p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
+ p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
+ p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+ p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+
+ // Save the day? (Ignore the warning)
+ if (Plugin->OldXform) {
+ p->OldXform = (_cmsTransformFn)(void*) p->xform;
+ p->xform = _cmsTransform2toTransformAdaptor;
+ }
+
+ return p;
+ }
+ }
+ }
+
+ // Not suitable for the transform plug-in, let's check the pipeline plug-in
+ _cmsOptimizePipeline(ContextID, &core->Lut, Intent, InputFormat, OutputFormat, dwFlags);
}
// Check whatever this is a true floating point transform
@@ -1599,7 +1608,7 @@ cmsUInt32Number CMSEXPORT cmsGetTransformOutputFormat(cmsContext ContextID, cmsH
return xform->OutputFormat;
}
-cmsHTRANSFORM CMSEXPORT cmsCloneTransformChangingFormats(cmsContext ContextID,
+cmsHTRANSFORM cmsCloneTransformChangingFormats(cmsContext ContextID,
const cmsHTRANSFORM hTransform,
cmsUInt32Number InputFormat,
cmsUInt32Number OutputFormat)
diff --git a/lcms2mt/src/extra_xform.h b/lcms2mt/src/extra_xform.h
index e42a81daa..51dd0e05b 100644
--- a/lcms2mt/src/extra_xform.h
+++ b/lcms2mt/src/extra_xform.h
@@ -189,13 +189,13 @@ void FUNCTION_NAME(cmsContext ContextID,
XFORM_TYPE wOut[cmsMAXCHANNELS];
#endif
#ifdef GAMUTCHECK
- _cmsOPTeval16Fn evalGamut = core->GamutCheck->Eval16Fn;
+ _cmsPipelineEval16Fn evalGamut = core->GamutCheck->Eval16Fn;
#endif /* GAMUTCHECK */
#ifdef XFORM_FLOAT
_cmsPipelineEvalFloatFn eval = core->Lut->EvalFloatFn;
const cmsPipeline *data = core->Lut;
#else
- _cmsOPTeval16Fn eval = core->Lut->Eval16Fn;
+ _cmsPipelineEval16Fn eval = core->Lut->Eval16Fn;
void *data = core->Lut->Data;
#endif
cmsUInt32Number bppi = Stride->BytesPerPlaneIn;
diff --git a/lcms2mt/src/lcms2_internal.h b/lcms2mt/src/lcms2_internal.h
index 175b3c998..da205ebf1 100644
--- a/lcms2mt/src/lcms2_internal.h
+++ b/lcms2mt/src/lcms2_internal.h
@@ -116,12 +116,13 @@
#define isinf(x) (!_finite((x)))
# endif
-#else
-# if !defined(HAVE_ISINF)
-# if !defined(isinf)
-# define isinf(x) (!finite((x)))
-# endif
-# endif
+#if !defined(_MSC_VER) && (defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L)
+ #if !defined(isinf)
+ #define isinf(x) (!finite((x)))
+ #endif
+#endif
+
+
#endif
// A fast way to convert from/to 16 <-> 8 bits
@@ -903,13 +904,7 @@ cmsStage* _cmsStageClipNegatives(cmsContext ContextID,
// For curve set only
-cmsToneCurve** _cmsStageGetPtrToCurveSet(const cmsStage* mpe);
-
-
-// Pipeline Evaluator (in floating point)
-typedef void (* _cmsPipelineEvalFloatFn)(cmsContext ContextID, const cmsFloat32Number In[],
- cmsFloat32Number Out[],
- const void* Data);
+cmsToneCurve** _cmsStageGetPtrToCurveSet(const cmsStage* mpe);
struct _cmsPipeline_struct {
@@ -919,7 +914,7 @@ struct _cmsPipeline_struct {
// Data & evaluators
void *Data;
- _cmsOPTeval16Fn Eval16Fn;
+ _cmsPipelineEval16Fn Eval16Fn;
_cmsPipelineEvalFloatFn EvalFloatFn;
_cmsFreeUserDataFn FreeDataFn;
_cmsDupUserDataFn DupDataFn;
@@ -963,14 +958,15 @@ cmsSEQ* _cmsCompileProfileSequence(cmsContext ContextID, cmsUInt32Number nProfil
// LUT optimization ------------------------------------------------------------------------------------------------
CMSCHECKPOINT cmsUInt16Number CMSEXPORT _cmsQuantizeVal(cmsFloat64Number i, cmsUInt32Number MaxSamples);
-cmsUInt32Number _cmsReasonableGridpointsByColorspace(cmsContext ContextID, cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags);
+
+CMSAPI cmsUInt32Number CMSEXPORT _cmsReasonableGridpointsByColorspace(cmsContext ContextID, cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags);
cmsBool _cmsEndPointsBySpace(cmsColorSpaceSignature Space,
cmsUInt16Number **White,
cmsUInt16Number **Black,
cmsUInt32Number *nOutputs);
-cmsBool _cmsOptimizePipeline(cmsContext ContextID,
+CMSAPI cmsBool CMSEXPORT _cmsOptimizePipeline(cmsContext ContextID,
cmsPipeline** Lut,
cmsUInt32Number Intent,
cmsUInt32Number* InputFormat,
diff --git a/lcms2mt/src/lcms2mt.def b/lcms2mt/src/lcms2mt.def
index 0703fed88..8f8033a96 100644
--- a/lcms2mt/src/lcms2mt.def
+++ b/lcms2mt/src/lcms2mt.def
@@ -344,3 +344,4 @@ cmsMD5add = cmsMD5add
cmsMD5alloc = cmsMD5alloc
cmsMD5finish = cmsMD5finish
_cmsComputeInterpParams = _cmsComputeInterpParams
+cmsGetToneCurveParams = cmsGetToneCurveParams
diff --git a/lcms2mt/testbed/Makefile.am b/lcms2mt/testbed/Makefile.am
index 8fd93f937..5a91f6452 100644
--- a/lcms2mt/testbed/Makefile.am
+++ b/lcms2mt/testbed/Makefile.am
@@ -20,7 +20,7 @@ testcms_SOURCES = testcms2.c testplugin.c zoo_icc.c testcms2.h
EXTRA_DIST = test1.icc bad.icc toosmall.icc test2.icc \
test3.icc test4.icc \
- test5.icc ibm-t61.icc
+ test5.icc ibm-t61.icc crayons.icc bad_mpe.icc
check:
if [ $(top_srcdir) != $(top_builddir) ]; then \
@@ -30,5 +30,3 @@ check:
if [ $(top_srcdir) != $(top_builddir) ]; then \
rm -f $(top_builddir)/testbed/*.ic?; \
fi
-
-
diff --git a/lcms2mt/testbed/Makefile.in b/lcms2mt/testbed/Makefile.in
index d8f9416d8..5ad60a7df 100644
--- a/lcms2mt/testbed/Makefile.in
+++ b/lcms2mt/testbed/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -134,9 +134,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/testcms2.Po \
- ./$(DEPDIR)/testplugin.Po ./$(DEPDIR)/zoo_icc.Po
+am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -233,6 +231,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -339,7 +338,7 @@ testcms_LDFLAGS = -static @LDFLAGS@
testcms_SOURCES = testcms2.c testplugin.c zoo_icc.c testcms2.h
EXTRA_DIST = test1.icc bad.icc toosmall.icc test2.icc \
test3.icc test4.icc \
- test5.icc ibm-t61.icc
+ test5.icc ibm-t61.icc crayons.icc bad_mpe.icc
all: all-am
@@ -362,8 +361,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -394,15 +393,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcms2.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testplugin.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoo_icc.Po@am__quote@ # am--include-marker
-
-$(am__depfiles_remade):
- @$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
-
-am--depfiles: $(am__depfiles_remade)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcms2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testplugin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoo_icc.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -486,10 +479,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -560,9 +550,7 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/testcms2.Po
- -rm -f ./$(DEPDIR)/testplugin.Po
- -rm -f ./$(DEPDIR)/zoo_icc.Po
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -608,9 +596,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/testcms2.Po
- -rm -f ./$(DEPDIR)/testplugin.Po
- -rm -f ./$(DEPDIR)/zoo_icc.Po
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -631,7 +617,7 @@ uninstall-am:
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
diff --git a/lcms2mt/testbed/testcms2.c b/lcms2mt/testbed/testcms2.c
index f633f5655..87c3d460e 100644
--- a/lcms2mt/testbed/testcms2.c
+++ b/lcms2mt/testbed/testcms2.c
@@ -24,7 +24,6 @@
//---------------------------------------------------------------------------------
//
-
#include "testcms2.h"
// A single check. Returns 1 if success, 0 if failed
@@ -463,7 +462,7 @@ cmsFloat64Number Clip(cmsFloat64Number v)
}
static
-cmsInt32Number ForwardSampler(cmsContext ContextID, register const cmsUInt16Number In[], cmsUInt16Number Out[], void* Cargo)
+cmsInt32Number ForwardSampler(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], cmsUInt16Number Out[], void* Cargo)
{
FakeCMYKParams* p = (FakeCMYKParams*) Cargo;
cmsFloat64Number rgb[3], cmyk[4];
@@ -493,7 +492,7 @@ cmsInt32Number ForwardSampler(cmsContext ContextID, register const cmsUInt16Numb
static
-cmsInt32Number ReverseSampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
+cmsInt32Number ReverseSampler(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], CMSREGISTER cmsUInt16Number Out[], CMSREGISTER void* Cargo)
{
FakeCMYKParams* p = (FakeCMYKParams*) Cargo;
cmsFloat64Number c, m, y, k, rgb[3];
@@ -1726,9 +1725,10 @@ cmsUInt16Number Fn8D3(cmsUInt16Number a1, cmsUInt16Number a2, cmsUInt16Number a3
static
-cmsInt32Number Sampler3D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler3D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], 0, 0, 0, 0, 0, 3);
@@ -1742,9 +1742,10 @@ cmsInt32Number Sampler3D(cmsContext ContextID, register const cmsUInt16Number In
}
static
-cmsInt32Number Sampler4D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler4D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], In[3], 0, 0, 0, 0, 4);
@@ -1757,9 +1758,10 @@ cmsInt32Number Sampler4D(cmsContext ContextID, register const cmsUInt16Number In
}
static
-cmsInt32Number Sampler5D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler5D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], In[3], In[4], 0, 0, 0, 5);
@@ -1772,9 +1774,10 @@ cmsInt32Number Sampler5D(cmsContext ContextID, register const cmsUInt16Number In
}
static
-cmsInt32Number Sampler6D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler6D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], In[3], In[4], In[5], 0, 0, 6);
@@ -1787,9 +1790,10 @@ cmsInt32Number Sampler6D(cmsContext ContextID, register const cmsUInt16Number In
}
static
-cmsInt32Number Sampler7D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler7D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], In[3], In[4], In[5], In[6], 0, 7);
@@ -1802,9 +1806,10 @@ cmsInt32Number Sampler7D(cmsContext ContextID, register const cmsUInt16Number In
}
static
-cmsInt32Number Sampler8D(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register void * Cargo)
+cmsInt32Number Sampler8D(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER void * Cargo)
{
Out[0] = Fn8D1(In[0], In[1], In[2], In[3], In[4], In[5], In[6], In[7], 8);
@@ -3759,6 +3764,73 @@ Error:
+// For educational purposes ONLY. No error checking is performed!
+static
+cmsInt32Number CreateNamedColorProfile(cmsContext ContextID)
+{
+ // Color list database
+ cmsNAMEDCOLORLIST* colors = cmsAllocNamedColorList(ContextID, 0, 10, 4, "PANTONE", "TCX");
+
+ // Containers for names
+ cmsMLU* DescriptionMLU, *CopyrightMLU;
+
+ // Create n empty profile
+ cmsHPROFILE hProfile = cmsOpenProfileFromFile(ContextID, "named.icc", "w");
+
+ // Values
+ cmsCIELab Lab;
+ cmsUInt16Number PCS[3], Colorant[4];
+
+ // Set profile class
+ cmsSetProfileVersion(ContextID, hProfile, 4.3);
+ cmsSetDeviceClass(ContextID, hProfile, cmsSigNamedColorClass);
+ cmsSetColorSpace(ContextID, hProfile, cmsSigCmykData);
+ cmsSetPCS(ContextID, hProfile, cmsSigLabData);
+ cmsSetHeaderRenderingIntent(ContextID, hProfile, INTENT_PERCEPTUAL);
+
+ // Add description and copyright only in english/US
+ DescriptionMLU = cmsMLUalloc(ContextID, 1);
+ CopyrightMLU = cmsMLUalloc(ContextID, 1);
+
+ cmsMLUsetWide(ContextID, DescriptionMLU, "en", "US", L"Profile description");
+ cmsMLUsetWide(ContextID, CopyrightMLU, "en", "US", L"Profile copyright");
+
+ cmsWriteTag(ContextID, hProfile, cmsSigProfileDescriptionTag, DescriptionMLU);
+ cmsWriteTag(ContextID, hProfile, cmsSigCopyrightTag, CopyrightMLU);
+
+ // Set the media white point
+ cmsWriteTag(ContextID, hProfile, cmsSigMediaWhitePointTag, cmsD50_XYZ());
+
+
+ // Populate one value, Colorant = CMYK values in 16 bits, PCS[] = Encoded Lab values (in V2 format!!)
+ Lab.L = 50; Lab.a = 10; Lab.b = -10;
+ cmsFloat2LabEncodedV2(ContextID, PCS, &Lab);
+ Colorant[0] = 10 * 257; Colorant[1] = 20 * 257; Colorant[2] = 30 * 257; Colorant[3] = 40 * 257;
+ cmsAppendNamedColor(ContextID, colors, "Hazelnut 14-1315", PCS, Colorant);
+
+ // Another one. Consider to write a routine for that
+ Lab.L = 40; Lab.a = -5; Lab.b = 8;
+ cmsFloat2LabEncodedV2(ContextID, PCS, &Lab);
+ Colorant[0] = 10 * 257; Colorant[1] = 20 * 257; Colorant[2] = 30 * 257; Colorant[3] = 40 * 257;
+ cmsAppendNamedColor(ContextID, colors, "Kale 18-0107", PCS, Colorant);
+
+ // Write the colors database
+ cmsWriteTag(ContextID, hProfile, cmsSigNamedColor2Tag, colors);
+
+ // That will create the file
+ cmsCloseProfile(ContextID, hProfile);
+
+ // Free resources
+ cmsFreeNamedColorList(ContextID, colors);
+ cmsMLUfree(ContextID, DescriptionMLU);
+ cmsMLUfree(ContextID, CopyrightMLU);
+
+ remove("named.icc");
+
+ return 1;
+}
+
+
// ----------------------------------------------------------------------------------------------------------
// Formatters
@@ -4880,7 +4952,7 @@ cmsBool CheckOneStr(cmsContext ContextID, cmsMLU* mlu, cmsInt32Number n)
static
-void SetOneStr(cmsContext ContextID, cmsMLU** mlu, wchar_t* s1, wchar_t* s2)
+void SetOneStr(cmsContext ContextID, cmsMLU** mlu, const wchar_t* s1, const wchar_t* s2)
{
*mlu = cmsMLUalloc(ContextID, 0);
cmsMLUsetWide(ContextID, *mlu, "en", "US", s1);
@@ -8145,6 +8217,49 @@ int CheckProofingIntersection(cmsContext ContextID)
return 1;
}
+/**
+* In 2.11: When I create a RGB profile, set the copyright data with an empty string,
+* then call cmsMD5computeID on said profile, the program crashes.
+*/
+static
+int CheckEmptyMLUC(cmsContext context)
+{
+ cmsCIExyY white = { 0.31271, 0.32902, 1.0 };
+ cmsCIExyYTRIPLE primaries =
+ {
+ .Red = { 0.640, 0.330, 1.0 },
+ .Green = { 0.300, 0.600, 1.0 },
+ .Blue = { 0.150, 0.060, 1.0 }
+ };
+
+ cmsFloat64Number parameters[10] = { 2.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+ cmsToneCurve* toneCurve = cmsBuildParametricToneCurve(context, 1, parameters);
+ cmsToneCurve* toneCurves[3] = { toneCurve, toneCurve, toneCurve };
+
+ cmsHPROFILE profile = cmsCreateRGBProfileTHR(context, &white, &primaries, toneCurves);
+
+ cmsSetLogErrorHandlerTHR(context, FatalErrorQuit);
+
+ cmsFreeToneCurve(toneCurve);
+
+ // Set an empty copyright tag. This should log an error.
+ cmsMLU* mlu = cmsMLUalloc(context, 1);
+
+ cmsMLUsetASCII(mlu, "en", "AU", "");
+ cmsMLUsetWide(mlu, "en", "EN", L"");
+ cmsWriteTag(profile, cmsSigCopyrightTag, mlu);
+ cmsMLUfree(mlu);
+
+ // This will cause a crash after setting an empty copyright tag.
+ cmsMD5computeID(profile);
+
+ // Cleanup
+ cmsCloseProfile(profile);
+ DebugMemDontCheckThis(context);
+
+ return 1;
+}
+
// --------------------------------------------------------------------------------------------------
// P E R F O R M A N C E C H E C K S
// --------------------------------------------------------------------------------------------------
@@ -8836,10 +8951,6 @@ void PrintSupportedIntents(void)
// ---------------------------------------------------------------------------------------
-#ifdef LCMS_FAST_EXTENSIONS
- void* cmsFast8Bitextensions(void);
-#endif
-
int main(int argc, char* argv[])
{
cmsInt32Number Exhaustive = 0;
@@ -8868,8 +8979,10 @@ int main(int argc, char* argv[])
}
#ifdef LCMS_FAST_EXTENSIONS
- printf("Installing fast 8 bit extension ...");
- cmsPlugin(cmsFast8Bitextensions());
+ //printf("Installing fast 8 bit extension ...");
+ //cmsPlugin(cmsFast8Bitextensions());
+ printf("Installing fast float extension ...");
+ cmsPlugin(cmsFastFloatExtensions());
printf("done.\n");
#endif
@@ -9013,6 +9126,8 @@ int main(int argc, char* argv[])
// Named color
Check(ctx, "Named color lists", CheckNamedColorList);
+ Check(ctx, "Create named color profile", CreateNamedColorProfile);
+
// Profile I/O (this one is huge!)
Check(ctx, "Profile creation", CheckProfileCreation);
@@ -9083,6 +9198,7 @@ int main(int argc, char* argv[])
Check(ctx, "Transform line stride RGB", CheckTransformLineStride);
Check(ctx, "Forged MPE profile", CheckForgedMPE);
Check(ctx, "Proofing intersection", CheckProofingIntersection);
+ Check(ctx, "Empty MLUC", CheckEmptyMLUC);
}
if (DoPluginTests)
diff --git a/lcms2mt/testbed/testcms2.h b/lcms2mt/testbed/testcms2.h
index 980f2c0ba..41d6ba055 100755
--- a/lcms2mt/testbed/testcms2.h
+++ b/lcms2mt/testbed/testcms2.h
@@ -29,6 +29,10 @@
#include "lcms2_internal.h"
+#ifdef LCMS_FAST_EXTENSIONS
+# include "fast_float_internal.h"
+#endif
+
// On Visual Studio, use debug CRT
#ifdef _MSC_VER
# include "crtdbg.h"
diff --git a/lcms2mt/testbed/testplugin.c b/lcms2mt/testbed/testplugin.c
index 90d8e75c2..c9e3553f1 100755
--- a/lcms2mt/testbed/testplugin.c
+++ b/lcms2mt/testbed/testplugin.c
@@ -236,9 +236,10 @@ void Fake1Dfloat(cmsContext ContextID, const cmsFloat32Number Value[],
// This fake interpolation just uses scrambled negated indexes for output
static
-void Fake3D16(cmsContext ContextID, register const cmsUInt16Number Input[],
- register cmsUInt16Number Output[],
- register const struct _cms_interp_struc* p)
+void Fake3D16(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number Input[],
+ CMSREGISTER cmsUInt16Number Output[],
+ CMSREGISTER const struct _cms_interp_struc* p)
{
Output[0] = 0xFFFF - Input[2];
Output[1] = 0xFFFF - Input[1];
@@ -620,10 +621,11 @@ Error:
#define TYPE_RGB_565 (COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(0) | (1 << 23))
-cmsUInt8Number* my_Unroll565(cmsContext ContextID, register struct _cmstransform_struct* nfo,
- register cmsUInt16Number wIn[],
- register cmsUInt8Number* accum,
- register cmsUInt32Number Stride)
+cmsUInt8Number* my_Unroll565(cmsContext ContextID,
+ CMSREGISTER struct _cmstransform_struct* nfo,
+ CMSREGISTER cmsUInt16Number wIn[],
+ CMSREGISTER cmsUInt8Number* accum,
+ CMSREGISTER cmsUInt32Number Stride)
{
cmsUInt16Number pixel = *(cmsUInt16Number*) accum; // Take whole pixel
@@ -638,13 +640,14 @@ cmsUInt8Number* my_Unroll565(cmsContext ContextID, register struct _cmstransform
return accum + 2;
}
-cmsUInt8Number* my_Pack565(cmsContext ContextID, register _cmsTRANSFORM* info,
- register cmsUInt16Number wOut[],
- register cmsUInt8Number* output,
- register cmsUInt32Number Stride)
+cmsUInt8Number* my_Pack565(cmsContext ContextID,
+ CMSREGISTER _cmsTRANSFORM* info,
+ CMSREGISTER cmsUInt16Number wOut[],
+ CMSREGISTER cmsUInt8Number* output,
+ CMSREGISTER cmsUInt32Number Stride)
{
- register cmsUInt16Number pixel;
+ CMSREGISTER cmsUInt16Number pixel;
int r, g, b;
r = (int) floor(( wOut[2] * 31) / 65535.0 + 0.5);
@@ -1085,9 +1088,10 @@ Error:
// --------------------------------------------------------------------------------------------------
static
-void FastEvaluateCurves(cmsContext ContextID, register const cmsUInt16Number In[],
- register cmsUInt16Number Out[],
- register const void* Data)
+void FastEvaluateCurves(cmsContext ContextID,
+ CMSREGISTER const cmsUInt16Number In[],
+ CMSREGISTER cmsUInt16Number Out[],
+ CMSREGISTER const void* Data)
{
Out[0] = In[0];
}
@@ -1502,4 +1506,3 @@ cmsInt32Number CheckMethodPackDoublesFromFloat(cmsContext ContextID)
return 1;
}
-
diff --git a/lcms2mt/testbed/zoo_icc.c b/lcms2mt/testbed/zoo_icc.c
index 929bb5d5c..3a914a57f 100755
--- a/lcms2mt/testbed/zoo_icc.c
+++ b/lcms2mt/testbed/zoo_icc.c
@@ -81,7 +81,7 @@ void PrintInfo(cmsContext ContextID, cmsHPROFILE h, cmsInfoType Info)
len = cmsGetProfileInfo(ContextID, h, Info, "en", "US", NULL, 0);
if (len == 0) return;
- text = _cmsMalloc(id, len);
+ text = (wchar_t*) _cmsMalloc(id, len);
cmsGetProfileInfo(ContextID, h, Info, "en", "US", text, len);
wprintf(L"%s\n", text);
diff --git a/lcms2mt/utils/common/utils.h b/lcms2mt/utils/common/utils.h
index 6c78b062e..9ad59e90d 100644
--- a/lcms2mt/utils/common/utils.h
+++ b/lcms2mt/utils/common/utils.h
@@ -67,8 +67,6 @@ void FatalError(const char *frm, ...);
extern int xoptind;
extern char *xoptarg;
-extern int xopterr;
-extern char SW;
int xgetopt(int argc, char *argv[], char *optionS);
diff --git a/lcms2mt/utils/common/vprf.c b/lcms2mt/utils/common/vprf.c
index 9e8c13e9b..5f8faab09 100644
--- a/lcms2mt/utils/common/vprf.c
+++ b/lcms2mt/utils/common/vprf.c
@@ -142,7 +142,7 @@ void PrintBuiltins(void)
"\t*Gray22 - Monochrome of Gamma 2.2\n"
"\t*Gray30 - Monochrome of Gamma 3.0\n"
"\t*null - Monochrome black for all input\n"
- "\t*Lin2222- CMYK linearization of gamma 2.2 on each channel\n");
+ "\t*Lin2222- CMYK linearization of gamma 2.2 on each channel\n\n");
}
@@ -231,7 +231,7 @@ void PrintRenderingIntents(cmsContext ContextID)
char* Descriptions[200];
cmsUInt32Number n, i;
- fprintf(stderr, "%ct<n> rendering intent:\n\n", SW);
+ fprintf(stderr, "-t<n> rendering intent:\n\n");
n = cmsGetSupportedIntents(ContextID, 200, Codes, Descriptions);
@@ -254,7 +254,7 @@ cmsBool SaveMemoryBlock(const cmsUInt8Number* Buffer, cmsUInt32Number dwLen, con
}
if (fwrite(Buffer, 1, dwLen, out) != dwLen) {
- FatalError("Cannot write %ld bytes to %s", dwLen, Filename);
+ FatalError("Cannot write %ld bytes to %s", (long) dwLen, Filename);
return FALSE;
}
diff --git a/lcms2mt/utils/common/xgetopt.c b/lcms2mt/utils/common/xgetopt.c
index 7f3dc548a..d553a0830 100644
--- a/lcms2mt/utils/common/xgetopt.c
+++ b/lcms2mt/utils/common/xgetopt.c
@@ -1,75 +1,100 @@
-/*
- getopt.c
-*/
+//---------------------------------------------------------------------------------
+//
+// Little Color Management System
+// Copyright (c) 1998-2020 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
+// is furnished to do so, subject to the following conditions:
+//
+// 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
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//---------------------------------------------------------------------------------
+//
+// xgetopt.c -- loosely based on System V getopt()
+//
+// option ::= SW [optLetter]* [argLetter space* argument]
+//
-#include <errno.h>
#include <string.h>
#include <stdio.h>
-int xoptind = 1; /* index of which argument is next */
-char *xoptarg; /* pointer to argument of current option */
-int xopterr = 0; /* allow error message */
+int xoptind = 1;
+char *xoptarg;
-static char *letP = NULL; /* remember next option char's location */
-char SW = '-'; /* DOS switch character, either '-' or '/' */
+static char *nextArg = NULL;
-/*
- Parse the command line options, System V style.
+#define SW '-'
- Standard option syntax is:
- option ::= SW [optLetter]* [argLetter space* argument]
-
-*/
-
-int xgetopt(int argc, char *argv[], char *optionS)
+int xgetopt(int argc, char* argv[], char* optionS)
{
unsigned char ch;
- char *optP;
+ char* optP;
- if (SW == 0) {
- SW = '/';
- }
+ if (argc > xoptind)
+ {
- if (argc > xoptind) {
- if (letP == NULL) {
- if ((letP = argv[xoptind]) == NULL ||
- *(letP++) != SW) goto gopEOF;
- if (*letP == SW) {
- xoptind++; goto gopEOF;
- }
+ if (nextArg == NULL)
+ {
+ if ((nextArg = argv[xoptind]) == NULL || *(nextArg++) != SW) goto end_eof;
}
- if (0 == (ch = *(letP++))) {
- xoptind++; goto gopEOF;
+
+ if ((ch = *(nextArg++)) == 0)
+ {
+ xoptind++;
+ goto end_eof;
}
- if (':' == ch || (optP = strchr(optionS, ch)) == NULL)
- goto gopError;
- if (':' == *(++optP)) {
+
+ if (ch == ':' || (optP = strchr(optionS, ch)) == NULL)
+ goto end_error;
+
+ if (*(++optP) == ':')
+ {
xoptind++;
- if (0 == *letP) {
- if (argc <= xoptind) goto gopError;
- letP = argv[xoptind++];
+
+ if (*nextArg == 0)
+ {
+ if (argc <= xoptind) goto end_error;
+ nextArg = argv[xoptind++];
}
- xoptarg = letP;
- letP = NULL;
- } else {
- if (0 == *letP) {
+
+ xoptarg = nextArg;
+ nextArg = NULL;
+
+ }
+ else
+ {
+ if (*nextArg == 0)
+ {
xoptind++;
- letP = NULL;
+ nextArg = NULL;
}
+
xoptarg = NULL;
}
+
return ch;
}
-gopEOF:
- xoptarg = letP = NULL;
+
+end_eof:
+ xoptarg = nextArg = NULL;
return EOF;
-gopError:
+end_error:
xoptarg = NULL;
- errno = EINVAL;
- if (xopterr)
- perror ("get command line option");
- return ('?');
+ return '?';
}
diff --git a/lcms2mt/utils/jpgicc/Makefile.in b/lcms2mt/utils/jpgicc/Makefile.in
index 978d6ad73..3d27bddc9 100644
--- a/lcms2mt/utils/jpgicc/Makefile.in
+++ b/lcms2mt/utils/jpgicc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
-am__maybe_remake_depfiles =
+am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -265,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -388,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -576,10 +577,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/utils/jpgicc/jpgicc.c b/lcms2mt/utils/jpgicc/jpgicc.c
index 41deff08e..00ac7aea5 100644
--- a/lcms2mt/utils/jpgicc/jpgicc.c
+++ b/lcms2mt/utils/jpgicc/jpgicc.c
@@ -866,8 +866,8 @@ int DoTransform(cmsContext ContextID, cmsHTRANSFORM hXForm, int OutputColorSpace
if (EmbedProfile && cOutProf)
DoEmbedProfile(cOutProf);
- ScanLineIn = (JSAMPROW) malloc(Decompressor.output_width * Decompressor.num_components);
- ScanLineOut = (JSAMPROW) malloc(Compressor.image_width * Compressor.num_components);
+ ScanLineIn = (JSAMPROW) malloc((size_t) Decompressor.output_width * Decompressor.num_components);
+ ScanLineOut = (JSAMPROW) malloc((size_t) Compressor.image_width * Compressor.num_components);
while (Decompressor.output_scanline <
Decompressor.output_height) {
@@ -1028,97 +1028,89 @@ int TransformImage(cmsContext ContextID, char *cDefInpProf, char *cOutputProf)
}
-// Simply print help
-
static
-void Help(int level)
+void Help(cmsContext ContextID, int level)
{
- fprintf(stderr, "little cms ICC profile applier for JPEG - v3.2 [LittleCMS %2.2f]\n\n", LCMS_VERSION / 1000.0);
-
- switch(level) {
-
- default:
- case 0:
- fprintf(stderr, "usage: jpgicc [flags] input.jpg output.jpg\n");
+ UTILS_UNUSED_PARAMETER(level);
- fprintf(stderr, "\nflags:\n\n");
- fprintf(stderr, "%cv - Verbose\n", SW);
- fprintf(stderr, "%ci<profile> - Input profile (defaults to sRGB)\n", SW);
- fprintf(stderr, "%co<profile> - Output profile (defaults to sRGB)\n", SW);
+ fprintf(stderr, "usage: jpgicc [flags] input.jpg output.jpg\n");
- PrintRenderingIntents(NULL);
+ fprintf(stderr, "\nflags:\n\n");
+ fprintf(stderr, "-v - Verbose\n");
+ fprintf(stderr, "-i<profile> - Input profile (defaults to sRGB)\n");
+ fprintf(stderr, "-o<profile> - Output profile (defaults to sRGB)\n");
+ PrintBuiltins();
- fprintf(stderr, "%cb - Black point compensation\n", SW);
- fprintf(stderr, "%cd<0..1> - Observer adaptation state (abs.col. only)\n", SW);
- fprintf(stderr, "%cn - Ignore embedded profile\n", SW);
- fprintf(stderr, "%ce - Embed destination profile\n", SW);
- fprintf(stderr, "%cs<new profile> - Save embedded profile as <new profile>\n", SW);
+ PrintRenderingIntents(ContextID);
- fprintf(stderr, "\n");
- fprintf(stderr, "%cc<0,1,2,3> - Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes) [defaults to 1]\n", SW);
- fprintf(stderr, "\n");
+ fprintf(stderr, "-b - Black point compensation\n");
+ fprintf(stderr, "-d<0..1> - Observer adaptation state (abs.col. only)\n");
+ fprintf(stderr, "-n - Ignore embedded profile\n");
+ fprintf(stderr, "-e - Embed destination profile\n");
+ fprintf(stderr, "-s<new profile> - Save embedded profile as <new profile>\n");
- fprintf(stderr, "%cp<profile> - Soft proof profile\n", SW);
- fprintf(stderr, "%cm<0,1,2,3> - SoftProof intent\n", SW);
- fprintf(stderr, "%cg - Marks out-of-gamut colors on softproof\n", SW);
- fprintf(stderr, "%c!<r>,<g>,<b> - Out-of-gamut marker channel values\n", SW);
+ fprintf(stderr, "\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "%cq<0..100> - Output JPEG quality\n", SW);
+ fprintf(stderr, "-c<0,1,2,3> - Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes) [defaults to 1]\n");
+ fprintf(stderr, "\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "%ch<0,1,2,3> - More help\n", SW);
- break;
+ fprintf(stderr, "-p<profile> - Soft proof profile\n");
+ fprintf(stderr, "-m<0,1,2,3> - SoftProof intent\n");
+ fprintf(stderr, "-g - Marks out-of-gamut colors on softproof\n");
+ fprintf(stderr, "-!<r>,<g>,<b> - Out-of-gamut marker channel values\n");
- case 1:
+ fprintf(stderr, "\n");
+ fprintf(stderr, "-q<0..100> - Output JPEG quality\n");
- fprintf(stderr, "Examples:\n\n"
- "To color correct from scanner to sRGB:\n"
- "\tjpgicc %ciscanner.icm in.jpg out.jpg\n"
- "To convert from monitor1 to monitor2:\n"
- "\tjpgicc %cimon1.icm %comon2.icm in.jpg out.jpg\n"
- "To make a CMYK separation:\n"
- "\tjpgicc %coprinter.icm inrgb.jpg outcmyk.jpg\n"
- "To recover sRGB from a CMYK separation:\n"
- "\tjpgicc %ciprinter.icm incmyk.jpg outrgb.jpg\n"
- "To convert from CIELab ITU/Fax JPEG to sRGB\n"
- "\tjpgicc in.jpg out.jpg\n\n",
- SW, SW, SW, SW, SW);
- break;
+ fprintf(stderr, "Examples:\n\n"
+ "To color correct from scanner to sRGB:\n"
+ "\tjpgicc -iscanner.icm in.jpg out.jpg\n"
+ "To convert from monitor1 to monitor2:\n"
+ "\tjpgicc -imon1.icm -omon2.icm in.jpg out.jpg\n"
+ "To make a CMYK separation:\n"
+ "\tjpgicc -oprinter.icm inrgb.jpg outcmyk.jpg\n"
+ "To recover sRGB from a CMYK separation:\n"
+ "\tjpgicc -iprinter.icm incmyk.jpg outrgb.jpg\n"
+ "To convert from CIELab ITU/Fax JPEG to sRGB\n"
+ "\tjpgicc in.jpg out.jpg\n\n");
- case 2:
- PrintBuiltins();
- break;
- case 3:
+ fprintf(stderr, "This program is intended to be a demo of the Little CMS\n"
+ "color engine. Both lcms and this program are open source.\n"
+ "You can obtain both in source code at https://www.littlecms.com\n"
+ "For suggestions, comments, bug reports etc. send mail to\n"
+ "info@littlecms.com\n\n");
- fprintf(stderr, "This program is intended to be a demo of the little cms\n"
- "engine. Both lcms and this program are freeware. You can\n"
- "obtain both in source code at http://www.littlecms.com\n"
- "For suggestions, comments, bug reports etc. send mail to\n"
- "marti@littlecms.com\n\n");
- break;
- }
-
- exit(0);
+ exit(0);
}
// The toggles stuff
static
-void HandleSwitches(int argc, char *argv[])
+void HandleSwitches(cmsContext ContextID, int argc, char *argv[])
{
int s;
- while ((s=xgetopt(argc,argv,"bBnNvVGgh:H:i:I:o:O:P:p:t:T:c:C:Q:q:M:m:L:l:eEs:S:!:D:d:")) != EOF) {
+ while ((s=xgetopt(argc,argv,"bBnNvVGgh:H:i:I:o:O:P:p:t:T:c:C:Q:q:M:m:L:l:eEs:S:!:D:d:-:")) != EOF) {
switch (s)
{
+ case '-':
+ if (strcmp(xoptarg, "help") == 0)
+ {
+ Help(ContextID, 0);
+ }
+ else
+ {
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
+ break;
+
case 'b':
case 'B':
BlackPointCompensation = TRUE;
@@ -1198,7 +1190,7 @@ void HandleSwitches(int argc, char *argv[])
case 'h': {
int a = atoi(xoptarg);
- Help(a);
+ Help(ContextID, a);
}
break;
@@ -1240,12 +1232,16 @@ int main(int argc, char* argv[])
{
cmsContext ContextID = cmsCreateContext(NULL, NULL);
- InitUtils(NULL, "jpgicc");
+ fprintf(stderr, "Little CMS ICC profile applier for JPEG - v3.3 [LittleCMS %2.2f]\n\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n");
+ fflush(stderr);
+
+ InitUtils(ContextID, "jpgicc");
- HandleSwitches(argc, argv);
+ HandleSwitches(ContextID, argc, argv);
if ((argc - xoptind) != 2) {
- Help(0);
+ Help(ContextID, 0);
}
OpenInput(argv[xoptind]);
@@ -1262,6 +1258,3 @@ int main(int argc, char* argv[])
return 0;
}
-
-
-
diff --git a/lcms2mt/utils/linkicc/Makefile.in b/lcms2mt/utils/linkicc/Makefile.in
index c5cb2fc9d..4477c79aa 100644
--- a/lcms2mt/utils/linkicc/Makefile.in
+++ b/lcms2mt/utils/linkicc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
-am__maybe_remake_depfiles =
+am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -265,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -388,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -576,10 +577,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/utils/linkicc/linkicc.c b/lcms2mt/utils/linkicc/linkicc.c
index 3be4323f4..389b986ec 100644
--- a/lcms2mt/utils/linkicc/linkicc.c
+++ b/lcms2mt/utils/linkicc/linkicc.c
@@ -47,190 +47,185 @@ static cmsFloat64Number Version = 4.3;
// The manual
static
-int Help(int level)
+int Help(cmsContext ContextID, int level)
{
- switch (level) {
-
- default:
- case 0:
-
- fprintf(stderr, "\nlinkicc: Links profiles into a single devicelink.\n");
-
- fprintf(stderr, "\n");
- fprintf(stderr, "usage: linkicc [flags] <profiles>\n\n");
- fprintf(stderr, "flags:\n\n");
- fprintf(stderr, "%co<profile> - Output devicelink profile. [defaults to 'devicelink.icc']\n", SW);
-
- PrintRenderingIntents(NULL);
-
- fprintf(stderr, "%cc<0,1,2> - Precision (0=LowRes, 1=Normal, 2=Hi-res) [defaults to 1]\n", SW);
- fprintf(stderr, "%cn<gridpoints> - Alternate way to set precision, number of CLUT points\n", SW);
- fprintf(stderr, "%cd<description> - description text (quotes can be used)\n", SW);
- fprintf(stderr, "%cy<copyright> - copyright notice (quotes can be used)\n", SW);
-
- fprintf(stderr, "\n%ck<0..400> - Ink-limiting in %% (CMYK only)\n", SW);
- fprintf(stderr, "%c8 - Creates 8-bit devicelink\n", SW);
- fprintf(stderr, "%cx - Creatively, guess deviceclass of resulting profile.\n", SW);
- fprintf(stderr, "%cb - Black point compensation\n", SW);
- fprintf(stderr, "%ca<0..1> - Observer adaptation state (abs.col. only)\n\n", SW);
- fprintf(stderr, "%cl - Use linearization curves (may affect accuracy)\n", SW);
- fprintf(stderr, "%cr<v.r> - Profile version. (CAUTION: may change the profile implementation)\n", SW);
- fprintf(stderr, "\n");
- fprintf(stderr, "Colorspaces must be paired except Lab/XYZ, that can be interchanged.\n\n");
-
- fprintf(stderr, "%ch<0,1,2,3> - More help\n", SW);
- break;
-
- case 1:
- PrintBuiltins();
- break;
-
- case 2:
-
- fprintf(stderr, "\nExamples:\n\n"
- "To create 'devicelink.icm' from a.icc to b.icc:\n"
- "\tlinkicc a.icc b.icc\n\n"
- "To create 'out.icc' from sRGB to cmyk.icc:\n"
- "\tlinkicc -o out.icc *sRGB cmyk.icc\n\n"
- "To create a sRGB input profile working in Lab:\n"
- "\tlinkicc -x -o sRGBLab.icc *sRGB *Lab\n\n"
- "To create a XYZ -> sRGB output profile:\n"
- "\tlinkicc -x -o sRGBLab.icc *XYZ *sRGB\n\n"
- "To create a abstract profile doing softproof for cmyk.icc:\n"
- "\tlinkicc -t1 -x -o softproof.icc *Lab cmyk.icc cmyk.icc *Lab\n\n"
- "To create a 'grayer' sRGB input profile:\n"
- "\tlinkicc -x -o grayer.icc *sRGB gray.icc gray.icc *Lab\n\n"
- "To embed ink limiting into a cmyk output profile:\n"
- "\tlinkicc -x -o cmyklimited.icc -k 250 cmyk.icc *Lab\n\n");
- break;
-
- case 3:
-
- fprintf(stderr, "This program is intended to be a demo of the little cms\n"
- "engine. Both lcms and this program are freeware. You can\n"
- "obtain both in source code at http://www.littlecms.com\n"
- "For suggestions, comments, bug reports etc. send mail to\n"
- "info@littlecms.com\n\n");
- }
-
- exit(0);
+ UTILS_UNUSED_PARAMETER(level);
+
+ fprintf(stderr, "\nlinkicc: Links profiles into a single devicelink.\n");
+
+ fprintf(stderr, "\n");
+ fprintf(stderr, "usage: linkicc [flags] <profiles>\n\n");
+ fprintf(stderr, "flags:\n\n");
+ fprintf(stderr, "-o<profile> - Output devicelink profile. [defaults to 'devicelink.icc']\n");
+
+ PrintRenderingIntents(ContextID);
+
+ fprintf(stderr, "-c<0,1,2> - Precision (0=LowRes, 1=Normal, 2=Hi-res) [defaults to 1]\n");
+ fprintf(stderr, "-n<gridpoints> - Alternate way to set precision, number of CLUT points\n");
+ fprintf(stderr, "-d<description> - description text (quotes can be used)\n");
+ fprintf(stderr, "-y<copyright> - copyright notice (quotes can be used)\n");
+
+ fprintf(stderr, "\n-k<0..400> - Ink-limiting in %% (CMYK only)\n");
+ fprintf(stderr, "-8 - Creates 8-bit devicelink\n");
+ fprintf(stderr, "-x - Creatively, guess deviceclass of resulting profile.\n");
+ fprintf(stderr, "-b - Black point compensation\n");
+ fprintf(stderr, "-a<0..1> - Observer adaptation state (abs.col. only)\n\n");
+ fprintf(stderr, "-l - Use linearization curves (may affect accuracy)\n");
+ fprintf(stderr, "-r<v.r> - Profile version. (CAUTION: may change the profile implementation)\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Colorspaces must be paired except Lab/XYZ, that can be interchanged.\n\n");
+
+ PrintBuiltins();
+
+ fprintf(stderr, "\nExamples:\n\n"
+ "To create 'devicelink.icm' from a.icc to b.icc:\n"
+ "\tlinkicc a.icc b.icc\n\n"
+ "To create 'out.icc' from sRGB to cmyk.icc:\n"
+ "\tlinkicc -o out.icc *sRGB cmyk.icc\n\n"
+ "To create a sRGB input profile working in Lab:\n"
+ "\tlinkicc -x -o sRGBLab.icc *sRGB *Lab\n\n"
+ "To create a XYZ -> sRGB output profile:\n"
+ "\tlinkicc -x -o sRGBLab.icc *XYZ *sRGB\n\n"
+ "To create a abstract profile doing softproof for cmyk.icc:\n"
+ "\tlinkicc -t1 -x -o softproof.icc *Lab cmyk.icc cmyk.icc *Lab\n\n"
+ "To create a 'grayer' sRGB input profile:\n"
+ "\tlinkicc -x -o grayer.icc *sRGB gray.icc gray.icc *Lab\n\n"
+ "To embed ink limiting into a cmyk output profile:\n"
+ "\tlinkicc -x -o cmyklimited.icc -k 250 cmyk.icc *Lab\n\n");
+
+ fprintf(stderr, "This program is intended to be a demo of the Little CMS\n"
+ "color engine. Both lcms and this program are open source.\n"
+ "You can obtain both in source code at https://www.littlecms.com\n"
+ "For suggestions, comments, bug reports etc. send mail to\n"
+ "info@littlecms.com\n\n");
+
+ exit(0);
}
// The toggles stuff
static
-void HandleSwitches(int argc, char *argv[])
+void HandleSwitches(cmsContext ContextID, int argc, char *argv[])
{
int s;
- while ((s = xgetopt(argc,argv,"a:A:BbC:c:D:d:h:H:k:K:lLn:N:O:o:r:R:T:t:V:v:xX8y:Y:")) != EOF) {
+ while ((s = xgetopt(argc,argv,"a:A:BbC:c:D:d:h:H:k:K:lLn:N:O:o:r:R:T:t:V:v:xX8y:Y:-:")) != EOF) {
switch (s) {
+ case '-':
+ if (strcmp(xoptarg, "help") == 0)
+ {
+ Help(ContextID, 0);
+ }
+ else
+ {
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
+ break;
+
+ case 'a':
+ case 'A':
+ ObserverAdaptationState = atof(xoptarg);
+ if (ObserverAdaptationState < 0 ||
+ ObserverAdaptationState > 1.0)
+ FatalError("Adaptation state should be 0..1");
+ break;
+
+ case 'b':
+ case 'B':
+ BlackPointCompensation = TRUE;
+ break;
+
+ case 'c':
+ case 'C':
+ PrecalcMode = atoi(xoptarg);
+ if (PrecalcMode < 0 || PrecalcMode > 2) {
+ FatalError("Unknown precalc mode '%d'", PrecalcMode);
+ }
+ break;
+
+ case 'd':
+ case 'D':
+ // Doing that is correct and safe: Description points to memory allocated in the command line.
+ // same for Copyright and output devicelink.
+ Description = xoptarg;
+ break;
+
+ case 'h':
+ case 'H':
+ Help(ContextID, atoi(xoptarg));
+ return;
+
+ case 'k':
+ case 'K':
+ InkLimit = atof(xoptarg);
+ if (InkLimit < 0.0 || InkLimit > 400.0) {
+ FatalError("Ink limit must be 0%%..400%%");
+ }
+ break;
- case 'a':
- case 'A':
- ObserverAdaptationState = atof(xoptarg);
- if (ObserverAdaptationState < 0 ||
- ObserverAdaptationState > 1.0)
- FatalError("Adaptation state should be 0..1");
- break;
- case 'b':
- case 'B':
- BlackPointCompensation = TRUE;
- break;
+ case 'l':
+ case 'L': KeepLinearization = TRUE;
+ break;
- case 'c':
- case 'C':
- PrecalcMode = atoi(xoptarg);
- if (PrecalcMode < 0 || PrecalcMode > 2) {
- FatalError("Unknown precalc mode '%d'", PrecalcMode);
- }
- break;
-
- case 'd':
- case 'D':
- // Doing that is correct and safe: Description points to memory allocated in the command line.
- // same for Copyright and output devicelink.
- Description = xoptarg;
- break;
-
- case 'h':
- case 'H':
- Help(atoi(xoptarg));
- return;
-
- case 'k':
- case 'K':
- InkLimit = atof(xoptarg);
- if (InkLimit < 0.0 || InkLimit > 400.0) {
- FatalError("Ink limit must be 0%%..400%%");
- }
- break;
-
-
- case 'l':
- case 'L': KeepLinearization = TRUE;
- break;
-
- case 'n':
- case 'N':
- if (PrecalcMode != 1) {
- FatalError("Precalc mode already specified");
- }
- NumOfGridPoints = atoi(xoptarg);
- break;
-
- case 'o':
- case 'O':
- cOutProf = xoptarg;
- break;
-
-
- case 'r':
- case 'R':
- Version = atof(xoptarg);
- if (Version < 2.0 || Version > 4.3) {
- fprintf(stderr, "WARNING: lcms was not aware of this version, tag types may be wrong!\n");
- }
- break;
-
- case 't':
- case 'T':
- Intent = atoi(xoptarg); // Will be validated latter on
- break;
+ case 'n':
+ case 'N':
+ if (PrecalcMode != 1) {
+ FatalError("Precalc mode already specified");
+ }
+ NumOfGridPoints = atoi(xoptarg);
+ break;
- case 'V':
- case 'v':
- Verbose = atoi(xoptarg);
- if (Verbose < 0 || Verbose > 3) {
- FatalError("Unknown verbosity level '%d'", Verbose);
- }
- break;
+ case 'o':
+ case 'O':
+ cOutProf = xoptarg;
+ break;
- case '8':
- lUse8bits = TRUE;
- break;
+ case 'r':
+ case 'R':
+ Version = atof(xoptarg);
+ if (Version < 2.0 || Version > 4.3) {
+ fprintf(stderr, "WARNING: lcms was not aware of this version, tag types may be wrong!\n");
+ }
+ break;
+
+ case 't':
+ case 'T':
+ Intent = atoi(xoptarg); // Will be validated latter on
+ break;
+
+ case 'V':
+ case 'v':
+ Verbose = atoi(xoptarg);
+ if (Verbose < 0 || Verbose > 3) {
+ FatalError("Unknown verbosity level '%d'", Verbose);
+ }
+ break;
+
+ case '8':
+ lUse8bits = TRUE;
+ break;
- case 'y':
- case 'Y':
- Copyright = xoptarg;
- break;
+ case 'y':
+ case 'Y':
+ Copyright = xoptarg;
+ break;
- case 'x':
- case 'X': TagResult = TRUE;
- break;
+ case 'x':
+ case 'X': TagResult = TRUE;
+ break;
- default:
+ default:
- FatalError("Unknown option - run without args to see valid ones.\n");
- }
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
}
}
@@ -275,7 +270,8 @@ int main(int argc, char *argv[])
cmsContext ContextID = NULL;
// Here we are
- fprintf(stderr, "little cms ICC device link generator - v2.2 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Little CMS ICC device link generator - v3.0 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n");
fflush(stderr);
// Initialize
@@ -283,12 +279,12 @@ int main(int argc, char *argv[])
rc = 0;
// Get the options
- HandleSwitches(argc, argv);
+ HandleSwitches(ContextID, argc, argv);
// How many profiles to link?
nargs = (argc - xoptind);
if (nargs < 1)
- return Help(0);
+ return Help(ContextID, 0);
if (nargs > 255) {
FatalError("Holy profile! what are you trying to do with so many profiles!?");
diff --git a/lcms2mt/utils/matlab/lcms_rsp b/lcms2mt/utils/matlab/lcms_rsp
index c2b8c8d3a..06c4a96e2 100644
--- a/lcms2mt/utils/matlab/lcms_rsp
+++ b/lcms2mt/utils/matlab/lcms_rsp
@@ -1,27 +1,30 @@
+-v -compatibleArrayDims
-O
--I..\..\include
+-I../../include
icctrans.c
-..\..\src\cmscam02.c
-..\..\src\cmscgats.c
-..\..\src\cmscnvrt.c
-..\..\src\cmserr.c
-..\..\src\cmsgamma.c
-..\..\src\cmsgmt.c
-..\..\src\cmsintrp.c
-..\..\src\cmsio0.c
-..\..\src\cmsio1.c
-..\..\src\cmslut.c
-..\..\src\cmsmd5.c
-..\..\src\cmsmtrx.c
-..\..\src\cmsnamed.c
-..\..\src\cmsopt.c
-..\..\src\cmspack.c
-..\..\src\cmspcs.c
-..\..\src\cmsplugin.c
-..\..\src\cmsps2.c
-..\..\src\cmssamp.c
-..\..\src\cmssm.c
-..\..\src\cmstypes.c
-..\..\src\cmsvirt.c
-..\..\src\cmswtpnt.c
-..\..\src\cmsxform.c
+../../src/cmscam02.c
+../../src/cmscgats.c
+../../src/cmscnvrt.c
+../../src/cmserr.c
+../../src/cmsgamma.c
+../../src/cmsgmt.c
+../../src/cmsintrp.c
+../../src/cmsio0.c
+../../src/cmsio1.c
+../../src/cmslut.c
+../../src/cmsmd5.c
+../../src/cmsmtrx.c
+../../src/cmsnamed.c
+../../src/cmsopt.c
+../../src/cmspack.c
+../../src/cmspcs.c
+../../src/cmsplugin.c
+../../src/cmsps2.c
+../../src/cmssamp.c
+../../src/cmssm.c
+../../src/cmstypes.c
+../../src/cmsvirt.c
+../../src/cmswtpnt.c
+../../src/cmsxform.c
+../../src/cmshalf.c
+../../src/cmsalpha.c
diff --git a/lcms2mt/utils/psicc/Makefile.in b/lcms2mt/utils/psicc/Makefile.in
index a7f446898..06e6959c5 100644
--- a/lcms2mt/utils/psicc/Makefile.in
+++ b/lcms2mt/utils/psicc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
-am__maybe_remake_depfiles =
+am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -265,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -388,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -576,10 +577,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/utils/psicc/psicc.c b/lcms2mt/utils/psicc/psicc.c
index 3a4d99617..d3630d297 100644
--- a/lcms2mt/utils/psicc/psicc.c
+++ b/lcms2mt/utils/psicc/psicc.c
@@ -37,6 +37,35 @@ static int PrecalcMode = 1;
static int NumOfGridPoints = 0;
+
+static
+void Help(void)
+{
+ fprintf(stderr, "usage: psicc [flags] [<Output file>]\n\n");
+
+ fprintf(stderr, "flags:\n\n");
+
+ fprintf(stderr, "-i<profile> - Input profile: Generates Color Space Array (CSA)\n");
+ fprintf(stderr, "-o<profile> - Output profile: Generates Color Rendering Dictionary(CRD)\n");
+
+ fprintf(stderr, "-t<0,1,2,3> - Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute)\n");
+
+ fprintf(stderr, "-b - Black point compensation (CRD only)\n");
+ fprintf(stderr, "-u - Do NOT generate resource name on CRD\n");
+ fprintf(stderr, "-c<0,1,2> - Precision (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only)\n");
+ fprintf(stderr, "-n<gridpoints> - Alternate way to set precission, number of CLUT points (CRD only)\n");
+
+ fprintf(stderr, "\n");
+ fprintf(stderr, "If no output file is specified, output goes to stdout.\n\n");
+ fprintf(stderr, "This program is intended to be a demo of the little cms\n"
+ "engine. Both lcms and this program are freeware. You can\n"
+ "obtain both in source code at https://www.littlecms.com\n"
+ "For suggestions, comments, bug reports etc. send mail to\n"
+ "info@littlecms.com\n\n");
+
+ exit(0);
+}
+
// The toggles stuff
static
@@ -44,10 +73,21 @@ void HandleSwitches(int argc, char *argv[])
{
int s;
- while ((s = xgetopt(argc,argv,"uUbBI:i:O:o:T:t:c:C:n:N:")) != EOF) {
+ while ((s = xgetopt(argc,argv,"uUbBI:i:O:o:T:t:c:C:n:N:-:")) != EOF) {
- switch (s){
+ switch (s)
+ {
+ case '-':
+ if (strcmp(xoptarg, "help") == 0)
+ {
+ Help();
+ }
+ else
+ {
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
+ break;
case 'i':
case 'I':
@@ -99,34 +139,7 @@ void HandleSwitches(int argc, char *argv[])
}
}
-static
-void Help(void)
-{
- fprintf(stderr, "little CMS ICC PostScript generator - v2.1 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
-
- fprintf(stderr, "usage: psicc [flags] [<Output file>]\n\n");
-
- fprintf(stderr, "flags:\n\n");
-
- fprintf(stderr, "%ci<profile> - Input profile: Generates Color Space Array (CSA)\n", SW);
- fprintf(stderr, "%co<profile> - Output profile: Generates Color Rendering Dictionary(CRD)\n", SW);
- fprintf(stderr, "%ct<0,1,2,3> - Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute)\n", SW);
-
- fprintf(stderr, "%cb - Black point compensation (CRD only)\n", SW);
- fprintf(stderr, "%cu - Do NOT generate resource name on CRD\n", SW);
- fprintf(stderr, "%cc<0,1,2> - Precision (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only)\n", SW);
- fprintf(stderr, "%cn<gridpoints> - Alternate way to set precission, number of CLUT points (CRD only)\n", SW);
-
- fprintf(stderr, "\n");
- fprintf(stderr, "If no output file is specified, output goes to stdout.\n\n");
- fprintf(stderr, "This program is intended to be a demo of the little cms\n"
- "engine. Both lcms and this program are freeware. You can\n"
- "obtain both in source code at http://www.littlecms.com\n"
- "For suggestions, comments, bug reports etc. send mail to\n"
- "info@littlecms.com\n\n");
- exit(0);
-}
static
@@ -200,6 +213,10 @@ int main(int argc, char *argv[])
int nargs;
cmsContext ContextID = NULL;
+ fprintf(stderr, "Little CMS ICC PostScript generator - v2.1 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n");
+ fflush(stderr);
+
// Initialize
InitUtils(NULL, "psicc");
@@ -229,5 +246,3 @@ int main(int argc, char *argv[])
return 0;
}
-
-
diff --git a/lcms2mt/utils/tificc/Makefile.in b/lcms2mt/utils/tificc/Makefile.in
index c85c881d1..53bcd8b33 100644
--- a/lcms2mt/utils/tificc/Makefile.in
+++ b/lcms2mt/utils/tificc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
-am__maybe_remake_depfiles =
+am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -265,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -388,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -576,10 +577,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/utils/tificc/tifdiff.c b/lcms2mt/utils/tificc/tifdiff.c
index fb12b3c46..05b9b180b 100644
--- a/lcms2mt/utils/tificc/tifdiff.c
+++ b/lcms2mt/utils/tificc/tifdiff.c
@@ -87,20 +87,20 @@ void ConsoleErrorHandler(const char* module, const char* fmt, va_list ap)
static
void Help()
{
- fprintf(stderr, "Little cms TIFF compare utility. v1.0\n\n");
+ fprintf(stderr, "Little CMS TIFF compare utility. v1.1\n\n");
fprintf(stderr, "usage: tiffdiff [flags] input.tif output.tif\n");
fprintf(stderr, "\nflags:\n\n");
- fprintf(stderr, "%co<tiff> - Output TIFF file\n", SW);
- fprintf(stderr, "%cg<CGATS> - Output results in CGATS file\n", SW);
+ fprintf(stderr, "-o<tiff> - Output TIFF file\n");
+ fprintf(stderr, "-g<CGATS> - Output results in CGATS file\n");
fprintf(stderr, "\n");
- fprintf(stderr, "%cv - Verbose (show warnings)\n", SW);
- fprintf(stderr, "%ch - This help\n", SW);
+ fprintf(stderr, "-v - Verbose (show warnings)\n");
+ fprintf(stderr, "-h - This help\n");
fflush(stderr);
@@ -704,5 +704,3 @@ int main(int argc, char* argv[])
return 0;
}
-
-
diff --git a/lcms2mt/utils/tificc/tificc.c b/lcms2mt/utils/tificc/tificc.c
index 445cc338e..9801a1c47 100644
--- a/lcms2mt/utils/tificc/tificc.c
+++ b/lcms2mt/utils/tificc/tificc.c
@@ -684,7 +684,7 @@ void DoEmbedProfile(TIFF* Out, const char* ProfileFile)
EmbedLen = (cmsUInt32Number) fread(EmbedBuffer, 1, (size_t) size, f);
if (EmbedLen != (cmsUInt32Number) size)
- FatalError("Cannot read %ld bytes to %s", size, ProfileFile);
+ FatalError("Cannot read %ld bytes to %s", (long) size, ProfileFile);
fclose(f);
EmbedBuffer[EmbedLen] = 0;
@@ -926,84 +926,67 @@ int TransformImage(cmsContext ContextID, TIFF* in, TIFF* out, const char *cDefIn
// Print help
static
-void Help(int level)
+void Help(cmsContext ContextID, int level)
{
- fprintf(stderr, "little cms ICC profile applier for TIFF - v6.2 [LittleCMS %2.2f]\n\n", LCMS_VERSION / 1000.0);
- fflush(stderr);
+ UTILS_UNUSED_PARAMETER(level);
- switch(level) {
+ fprintf(stderr, "usage: tificc [flags] input.tif output.tif\n");
- default:
- case 0:
+ fprintf(stderr, "\nflags:\n\n");
+ fprintf(stderr, "-v - Verbose\n");
+ fprintf(stderr, "-i<profile> - Input profile (defaults to sRGB)\n");
+ fprintf(stderr, "-o<profile> - Output profile (defaults to sRGB)\n");
+ fprintf(stderr, "-l<profile> - Transform by device-link profile\n");
- fprintf(stderr, "usage: tificc [flags] input.tif output.tif\n");
+ PrintBuiltins();
- fprintf(stderr, "\nflags:\n\n");
- fprintf(stderr, "%cv - Verbose\n", SW);
- fprintf(stderr, "%ci<profile> - Input profile (defaults to sRGB)\n", SW);
- fprintf(stderr, "%co<profile> - Output profile (defaults to sRGB)\n", SW);
- fprintf(stderr, "%cl<profile> - Transform by device-link profile\n", SW);
+ PrintRenderingIntents(ContextID);
- PrintRenderingIntents(NULL);
+ fprintf(stderr, "-b - Black point compensation\n");
+ fprintf(stderr, "-d<0..1> - Observer adaptation state (abs.col. only)\n");
- fprintf(stderr, "%cb - Black point compensation\n", SW);
- fprintf(stderr, "%cd<0..1> - Observer adaptation state (abs.col. only)\n", SW);
+ fprintf(stderr, "-c<0,1,2,3> - Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes)\n");
+ fprintf(stderr, "\n");
- fprintf(stderr, "%cc<0,1,2,3> - Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes)\n", SW);
- fprintf(stderr, "\n");
+ fprintf(stderr, "-w<8,16,32> - Output depth. Use 32 for floating-point\n\n");
+ fprintf(stderr, "-a - Handle channels > 4 as alpha\n");
- fprintf(stderr, "%cw<8,16,32> - Output depth. Use 32 for floating-point\n\n", SW);
- fprintf(stderr, "%ca - Handle channels > 4 as alpha\n", SW);
+ fprintf(stderr, "-n - Ignore embedded profile on input\n");
+ fprintf(stderr, "-e - Embed destination profile\n");
+ fprintf(stderr, "-s<new profile> - Save embedded profile as <new profile>\n");
+ fprintf(stderr, "\n");
- fprintf(stderr, "%cn - Ignore embedded profile on input\n", SW);
- fprintf(stderr, "%ce - Embed destination profile\n", SW);
- fprintf(stderr, "%cs<new profile> - Save embedded profile as <new profile>\n", SW);
- fprintf(stderr, "\n");
+ fprintf(stderr, "-p<profile> - Soft proof profile\n");
+ fprintf(stderr, "-m<n> - Soft proof intent\n");
+ fprintf(stderr, "-g - Marks out-of-gamut colors on softproof\n");
- fprintf(stderr, "%cp<profile> - Soft proof profile\n", SW);
- fprintf(stderr, "%cm<n> - Soft proof intent\n", SW);
- fprintf(stderr, "%cg - Marks out-of-gamut colors on softproof\n", SW);
+ fprintf(stderr, "\n");
- fprintf(stderr, "\n");
+ fprintf(stderr, "-k<0..400> - Ink-limiting in %% (CMYK only)\n");
+ fprintf(stderr, "\n");
- fprintf(stderr, "%ck<0..400> - Ink-limiting in %% (CMYK only)\n", SW);
- fprintf(stderr, "\n");
- fprintf(stderr, "%ch<0,1,2,3> - More help\n", SW);
- break;
- case 1:
-
- fprintf(stderr, "Examples:\n\n"
- "To color correct from scanner to sRGB:\n"
- "\ttificc %ciscanner.icm in.tif out.tif\n"
- "To convert from monitor1 to monitor2:\n"
- "\ttificc %cimon1.icm %comon2.icm in.tif out.tif\n"
- "To make a CMYK separation:\n"
- "\ttificc %coprinter.icm inrgb.tif outcmyk.tif\n"
- "To recover sRGB from a CMYK separation:\n"
- "\ttificc %ciprinter.icm incmyk.tif outrgb.tif\n"
- "To convert from CIELab TIFF to sRGB\n"
- "\ttificc %ci*Lab in.tif out.tif\n\n",
- SW, SW, SW, SW, SW, SW);
- break;
+ fprintf(stderr, "Examples:\n\n"
+ "To color correct from scanner to sRGB:\n"
+ "\ttificc -iscanner.icm in.tif out.tif\n"
+ "To convert from monitor1 to monitor2:\n"
+ "\ttificc -imon1.icm -omon2.icm in.tif out.tif\n"
+ "To make a CMYK separation:\n"
+ "\ttificc -oprinter.icm inrgb.tif outcmyk.tif\n"
+ "To recover sRGB from a CMYK separation:\n"
+ "\ttificc -iprinter.icm incmyk.tif outrgb.tif\n"
+ "To convert from CIELab TIFF to sRGB\n"
+ "\ttificc -i*Lab in.tif out.tif\n\n");
- case 2:
- PrintBuiltins();
- break;
- case 3:
+ fprintf(stderr, "This program is intended to be a demo of the Little CMS\n"
+ "color engine. Both lcms and this program are open source.\n"
+ "You can obtain both in source code at https://www.littlecms.com\n"
+ "For suggestions, comments, bug reports etc. send mail to\n"
+ "info@littlecms.com\n\n");
- fprintf(stderr, "This program is intended to be a demo of the little cms\n"
- "engine. Both lcms and this program are freeware. You can\n"
- "obtain both in source code at http://www.littlecms.com\n"
- "For suggestions, comments, bug reports etc. send mail to\n"
- "info@littlecms.com\n\n");
- break;
- }
-
- fflush(stderr);
exit(0);
}
@@ -1011,14 +994,26 @@ void Help(int level)
// The toggles stuff
static
-void HandleSwitches(int argc, char *argv[])
+void HandleSwitches(cmsContext ContextID, int argc, char *argv[])
{
int s;
- while ((s=xgetopt(argc,argv,"aAeEbBw:W:nNvVGgh:H:i:I:o:O:P:p:t:T:c:C:l:L:M:m:K:k:S:s:D:d:")) != EOF) {
+ while ((s=xgetopt(argc,argv,"aAeEbBw:W:nNvVGgh:H:i:I:o:O:P:p:t:T:c:C:l:L:M:m:K:k:S:s:D:d:-:")) != EOF) {
switch (s) {
+
+ case '-':
+ if (strcmp(xoptarg, "help") == 0)
+ {
+ Help(ContextID, 0);
+ }
+ else
+ {
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
+ break;
+
case 'a':
case 'A':
StoreAsAlpha = TRUE;
@@ -1125,7 +1120,7 @@ void HandleSwitches(int argc, char *argv[])
case 'h': {
int a = atoi(xoptarg);
- Help(a);
+ Help(ContextID, a);
}
break;
@@ -1145,17 +1140,22 @@ int main(int argc, char* argv[])
cmsContext ContextID;
TIFF *in, *out;
+
+ fprintf(stderr, "Little CMS ICC profile applier for TIFF - v6.3 [LittleCMS %2.2f]\n\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n");
+ fflush(stderr);
+
ContextID = cmsCreateContext(NULL, NULL);
cmsPlugin(ContextID, &TiffLabPlugin);
InitUtils(ContextID, "tificc");
- HandleSwitches(argc, argv);
+ HandleSwitches(ContextID, argc, argv);
if ((argc - xoptind) != 2) {
- Help(0);
+ Help(ContextID, 0);
}
diff --git a/lcms2mt/utils/transicc/Makefile.in b/lcms2mt/utils/transicc/Makefile.in
index c4032bc2e..f3e029b55 100644
--- a/lcms2mt/utils/transicc/Makefile.in
+++ b/lcms2mt/utils/transicc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
-am__maybe_remake_depfiles =
+am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -265,6 +265,7 @@ LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
+LIB_PLUGINS = @LIB_PLUGINS@
LIB_THREAD = @LIB_THREAD@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
@@ -388,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -576,10 +577,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
+distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/lcms2mt/utils/transicc/transicc.c b/lcms2mt/utils/transicc/transicc.c
index a92e3e180..5d6856318 100644
--- a/lcms2mt/utils/transicc/transicc.c
+++ b/lcms2mt/utils/transicc/transicc.c
@@ -96,43 +96,44 @@ void Help(void)
fprintf(stderr, "usage: transicc [flags] [CGATS input] [CGATS output]\n\n");
fprintf(stderr, "flags:\n\n");
- fprintf(stderr, "%cv<0..3> - Verbosity level\n", SW);
+ fprintf(stderr, "-v<0..3> - Verbosity level\n");
- fprintf(stderr, "%ce[op] - Encoded representation of numbers\n", SW);
- fprintf(stderr, "\t%cw - use 16 bits\n", SW);
- fprintf(stderr, "\t%cx - Hexadecimal\n\n", SW);
+ fprintf(stderr, "-e[op] - Encoded representation of numbers\n");
+ fprintf(stderr, "\t-w - use 16 bits\n");
+ fprintf(stderr, "\t-x - Hexadecimal\n\n");
- fprintf(stderr, "%cs - bounded mode (clip negatives and highliths)\n", SW);
- fprintf(stderr, "%cq - Quantize (round decimals)\n\n", SW);
+ fprintf(stderr, "-s - bounded mode (clip negatives and highlights)\n");
+ fprintf(stderr, "-q - Quantize (round decimals)\n\n");
- fprintf(stderr, "%ci<profile> - Input profile (defaults to sRGB)\n", SW);
- fprintf(stderr, "%co<profile> - Output profile (defaults to sRGB)\n", SW);
- fprintf(stderr, "%cl<profile> - Transform by device-link profile\n", SW);
+ fprintf(stderr, "-i<profile> - Input profile (defaults to sRGB)\n");
+ fprintf(stderr, "-o<profile> - Output profile (defaults to sRGB)\n");
+ fprintf(stderr, "-l<profile> - Transform by device-link profile\n");
- fprintf(stderr, "\nYou can use '*Lab', '*xyz' and others as built-in profiles\n\n");
+ PrintBuiltins();
PrintRenderingIntents(NULL);
fprintf(stderr, "\n");
- fprintf(stderr, "%cd<0..1> - Observer adaptation state (abs.col. only)\n\n", SW);
+ fprintf(stderr, "-d<0..1> - Observer adaptation state (abs.col. only)\n\n");
- fprintf(stderr, "%cb - Black point compensation\n", SW);
+ fprintf(stderr, "-b - Black point compensation\n");
- fprintf(stderr, "%cc<0,1,2,3> Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes)\n\n", SW);
- fprintf(stderr, "%cn - Terse output, intended for pipe usage\n", SW);
+ fprintf(stderr, "-c<0,1,2,3> Precalculates transform (0=Off, 1=Normal, 2=Hi-res, 3=LoRes)\n\n");
+ fprintf(stderr, "-n - Terse output, intended for pipe usage\n");
- fprintf(stderr, "%cp<profile> - Soft proof profile\n", SW);
- fprintf(stderr, "%cm<0,1,2,3> - Soft proof intent\n", SW);
- fprintf(stderr, "%cg - Marks out-of-gamut colors on softproof\n\n", SW);
+ fprintf(stderr, "-p<profile> - Soft proof profile\n");
+ fprintf(stderr, "-m<0,1,2,3> - Soft proof intent\n");
+ fprintf(stderr, "-g - Marks out-of-gamut colors on softproof\n\n");
- fprintf(stderr, "This program is intended to be a demo of the little cms\n"
- "engine. Both lcms and this program are freeware. You can\n"
- "obtain both in source code at http://www.littlecms.com\n"
+ fprintf(stderr, "This program is intended to be a demo of the Little CMS\n"
+ "color engine. Both lcms and this program are open source.\n"
+ "You can obtain both in source code at https://www.littlecms.com\n"
"For suggestions, comments, bug reports etc. send mail to\n"
"info@littlecms.com\n\n");
+
}
@@ -145,10 +146,22 @@ void HandleSwitches(cmsContext ContextID, int argc, char *argv[])
int s;
while ((s = xgetopt(argc, argv,
- "bBC:c:d:D:eEgGI:i:L:l:m:M:nNO:o:p:P:QqSsT:t:V:v:WwxX!:")) != EOF) {
+ "bBC:c:d:D:eEgGI:i:L:l:m:M:nNO:o:p:P:QqSsT:t:V:v:WwxX!:-:")) != EOF) {
switch (s){
+ case '-':
+ if (strcmp(xoptarg, "help") == 0)
+ {
+ Help();
+ exit(0);
+ }
+ else
+ {
+ FatalError("Unknown option - run without args to see valid ones.\n");
+ }
+ break;
+
case '!':
IncludePart = xoptarg;
break;
@@ -457,7 +470,7 @@ cmsBool OpenTransforms(cmsContext ContextID)
if (cmsGetDeviceClass(ContextID, hInput) == cmsSigLinkClass ||
cmsGetDeviceClass(ContextID, hOutput) == cmsSigLinkClass)
- FatalError("Use %cl flag for devicelink profiles!\n", SW);
+ FatalError("Use -l flag for devicelink profiles!\n");
InputColorSpace = cmsGetColorSpace(ContextID, hInput);
@@ -858,7 +871,7 @@ cmsFloat64Number GetIT8Val(cmsContext ContextID, const char* Name, cmsFloat64Num
// Read input values from CGATS file.
static
- void TakeCGATSValues(cmsContext ContextID, int nPatch, cmsFloat64Number Float[])
+void TakeCGATSValues(cmsContext ContextID, int nPatch, cmsFloat64Number Float[])
{
// At first take the name if SAMPLE_ID is present
@@ -1241,7 +1254,9 @@ int main(int argc, char *argv[])
int nPatch = 0;
- fprintf(stderr, "LittleCMS ColorSpace conversion calculator - 4.3 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "LittleCMS ColorSpace conversion calculator - 5.0 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n");
+ fflush(stderr);
InitUtils(ContextID, "transicc");
@@ -1313,5 +1328,3 @@ int main(int argc, char *argv[])
// All is ok
return 0;
}
-
-