added dependencies and build files (loosely inspired by Sebastian Dorda's love-native-android)

This commit is contained in:
Martin Felis
2013-12-05 17:58:37 +01:00
parent 9604528a96
commit 95a086a47f
3700 changed files with 1691119 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#
# Makefile for building lcms sample programs
# Originally Written by Bob Friesenhahn, June 2003
# Additions and bugs by Marti Maria
# Don't require all the GNU mandated files
AUTOMAKE_OPTIONS = 1.7 foreign
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/utils/common -I$(top_builddir)/utils/common
bin_PROGRAMS = wtpt
wtpt_LDADD = $(top_builddir)/src/liblcms2.la
wtpt_LDFLAGS = @LDFLAGS@
wtpt_SOURCES = wtpt.c ../common/xgetopt.c ../common/vprf.c ../common/utils.h
wtpt_MANS = wtpt.1
EXTRA_DIST = $(man_MANS) roundtrip.c mktiff8.c mkgrayer.c mkcmy.c itufax.c
+611
View File
@@ -0,0 +1,611 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile for building lcms sample programs
# Originally Written by Bob Friesenhahn, June 2003
# Additions and bugs by Marti Maria Oct 2004
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = icctrans$(EXEEXT) wtpt$(EXEEXT) icc2ps$(EXEEXT) \
icclink$(EXEEXT)
subdir = samples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_icc2ps_OBJECTS = icc2ps.$(OBJEXT) xgetopt.$(OBJEXT)
icc2ps_OBJECTS = $(am_icc2ps_OBJECTS)
icc2ps_DEPENDENCIES = $(top_builddir)/src/liblcms.la
icc2ps_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(icc2ps_LDFLAGS) \
$(LDFLAGS) -o $@
am_icclink_OBJECTS = icclink.$(OBJEXT) xgetopt.$(OBJEXT) \
vprf.$(OBJEXT)
icclink_OBJECTS = $(am_icclink_OBJECTS)
icclink_DEPENDENCIES = $(top_builddir)/src/liblcms.la
icclink_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(icclink_LDFLAGS) \
$(LDFLAGS) -o $@
am_icctrans_OBJECTS = icctrans.$(OBJEXT) xgetopt.$(OBJEXT) \
vprf.$(OBJEXT)
icctrans_OBJECTS = $(am_icctrans_OBJECTS)
icctrans_DEPENDENCIES = $(top_builddir)/src/liblcms.la
icctrans_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(icctrans_LDFLAGS) \
$(LDFLAGS) -o $@
am_wtpt_OBJECTS = wtpt.$(OBJEXT) xgetopt.$(OBJEXT)
wtpt_OBJECTS = $(am_wtpt_OBJECTS)
wtpt_DEPENDENCIES = $(top_builddir)/src/liblcms.la
wtpt_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(wtpt_LDFLAGS) \
$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(icc2ps_SOURCES) $(icclink_SOURCES) $(icctrans_SOURCES) \
$(wtpt_SOURCES)
DIST_SOURCES = $(icc2ps_SOURCES) $(icclink_SOURCES) \
$(icctrans_SOURCES) $(wtpt_SOURCES)
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INT16_T = @INT16_T@
INT32_T = @INT32_T@
INT64_T = @INT64_T@
INT8_T = @INT8_T@
JPEGICC_DEPLIBS = @JPEGICC_DEPLIBS@
LCMS_LIB_DEPLIBS = @LCMS_LIB_DEPLIBS@
LCMS_PYEXECDIR = @LCMS_PYEXECDIR@
LCMS_PYINCLUDE = @LCMS_PYINCLUDE@
LCMS_PYLIB = @LCMS_PYLIB@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBRARY_AGE = @LIBRARY_AGE@
LIBRARY_CURRENT = @LIBRARY_CURRENT@
LIBRARY_REVISION = @LIBRARY_REVISION@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_JPEG = @LIB_JPEG@
LIB_MATH = @LIB_MATH@
LIB_TIFF = @LIB_TIFF@
LIB_ZLIB = @LIB_ZLIB@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TIFFICC_DEPLIBS = @TIFFICC_DEPLIBS@
UINT16_T = @UINT16_T@
UINT32_T = @UINT32_T@
UINT64_T = @UINT64_T@
UINT8_T = @UINT8_T@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
inline = @inline@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Don't require all the GNU mandated files
AUTOMAKE_OPTIONS = 1.7 foreign
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
icctrans_LDADD = $(top_builddir)/src/liblcms.la
icctrans_LDFLAGS = @LDFLAGS@
icctrans_SOURCES = icctrans.c xgetopt.c vprf.c
icctrans_MANS = icctrans.1
wtpt_LDADD = $(top_builddir)/src/liblcms.la
wtpt_LDFLAGS = @LDFLAGS@
wtpt_SOURCES = wtpt.c xgetopt.c
icc2ps_LDADD = $(top_builddir)/src/liblcms.la
icc2ps_LDFLAGS = @LDFLAGS@
icc2ps_SOURCES = icc2ps.c xgetopt.c
icclink_LDADD = $(top_builddir)/src/liblcms.la
icclink_LDFLAGS = @LDFLAGS@
icclink_SOURCES = icclink.c xgetopt.c vprf.c
man_MANS = wtpt.1 icc2ps.1 icclink.1
EXTRA_DIST = $(man_MANS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign samples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
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)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
icc2ps$(EXEEXT): $(icc2ps_OBJECTS) $(icc2ps_DEPENDENCIES)
@rm -f icc2ps$(EXEEXT)
$(icc2ps_LINK) $(icc2ps_OBJECTS) $(icc2ps_LDADD) $(LIBS)
icclink$(EXEEXT): $(icclink_OBJECTS) $(icclink_DEPENDENCIES)
@rm -f icclink$(EXEEXT)
$(icclink_LINK) $(icclink_OBJECTS) $(icclink_LDADD) $(LIBS)
icctrans$(EXEEXT): $(icctrans_OBJECTS) $(icctrans_DEPENDENCIES)
@rm -f icctrans$(EXEEXT)
$(icctrans_LINK) $(icctrans_OBJECTS) $(icctrans_LDADD) $(LIBS)
wtpt$(EXEEXT): $(wtpt_OBJECTS) $(wtpt_DEPENDENCIES)
@rm -f wtpt$(EXEEXT)
$(wtpt_LINK) $(wtpt_OBJECTS) $(wtpt_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icc2ps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icclink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icctrans.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vprf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wtpt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetopt.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-info: install-info-am
install-man: install-man1
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-man \
uninstall-man1
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+138
View File
@@ -0,0 +1,138 @@
//
// Little cms
// Copyright (C) 1998-2003 Marti Maria
//
// 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.
#include "lcms.h"
// This is a sample on how to build a profile for decoding ITU T.42/Fax JPEG
// streams. The profile has an additional ability in the input direction of
// gamut compress values between 85 < a < -85 and -75 < b < 125. This conforms
// the default range for ITU/T.42 -- See RFC 2301, section 6.2.3 for details
// L* = [0, 100]
// a* = [85, 85]
// b* = [75, 125]
// These functions does convert the encoding of ITUFAX to floating point
static
void ITU2Lab(WORD In[3], LPcmsCIELab Lab)
{
Lab -> L = (double) In[0] / 655.35;
Lab -> a = (double) 170.* (In[1] - 32768.) / 65535.;
Lab -> b = (double) 200.* (In[2] - 24576.) / 65535.;
}
static
void Lab2ITU(LPcmsCIELab Lab, WORD Out[3])
{
Out[0] = (WORD) floor((double) (Lab -> L / 100.)* 65535. + 0.5);
Out[1] = (WORD) floor((double) (Lab -> a / 170.)* 65535. + 32768. + 0.5);
Out[2] = (WORD) floor((double) (Lab -> b / 200.)* 65535. + 24576. + 0.5);
}
// These are the samplers-- They are passed as callbacks to cmsSample3DGrid()
// then, cmsSample3DGrid() will sweel whole Lab gamut calling these functions
// once for each node. In[] will contain the Lab PCS value to convert to ITUFAX
// on InputDirection, or the ITUFAX value to convert to Lab in OutputDirection
// You can change the number of sample points if desired, the algorithm will
// remain same. 33 points gives good accurancy, but you can reduce to 22 or less
// is space is critical
#define GRID_POINTS 33
static
int InputDirection(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
cmsCIELab Lab;
cmsLabEncoded2Float(&Lab, In);
cmsClampLab(&Lab, 85, -85, 125, -75); // This function does the necessary gamut remapping
Lab2ITU(&Lab, Out);
return TRUE;
}
static
int OutputDirection(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
cmsCIELab Lab;
ITU2Lab(In, &Lab);
cmsFloat2LabEncoded(Out, &Lab);
return TRUE;
}
// The main entry point. Just create a profile an populate it with required tags.
// note that cmsOpenProfileFromFile("itufax.icm", "w") will NOT delete the file
// if already exists. This is for obvious safety reasons.
int main(int argc, char *argv[])
{
LPLUT AToB0, BToA0;
cmsHPROFILE hProfile;
fprintf(stderr, "Creating itufax.icm...");
unlink("itufax.icm");
hProfile = cmsOpenProfileFromFile("itufax.icm", "w");
AToB0 = cmsAllocLUT();
BToA0 = cmsAllocLUT();
cmsAlloc3DGrid(AToB0, GRID_POINTS, 3, 3);
cmsAlloc3DGrid(BToA0, GRID_POINTS, 3, 3);
cmsSample3DGrid(AToB0, InputDirection, NULL, 0);
cmsSample3DGrid(BToA0, OutputDirection, NULL, 0);
cmsAddTag(hProfile, icSigAToB0Tag, AToB0);
cmsAddTag(hProfile, icSigBToA0Tag, BToA0);
cmsSetColorSpace(hProfile, icSigLabData);
cmsSetPCS(hProfile, icSigLabData);
cmsSetDeviceClass(hProfile, icSigColorSpaceClass);
cmsAddTag(hProfile, icSigProfileDescriptionTag, "ITU T.42/Fax JPEG CIEL*a*b*");
cmsAddTag(hProfile, icSigCopyrightTag, "No Copyright, use freely.");
cmsAddTag(hProfile, icSigDeviceMfgDescTag, "Little cms");
cmsAddTag(hProfile, icSigDeviceModelDescTag, "ITU T.42/Fax JPEG CIEL*a*b*");
cmsCloseProfile(hProfile);
cmsFreeLUT(AToB0);
cmsFreeLUT(BToA0);
fprintf(stderr, "Done.\n");
return 0;
}
+170
View File
@@ -0,0 +1,170 @@
//
// Little cms
// Copyright (C) 1998-2003 Marti Maria
//
// 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.
//
// THIS SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
// EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
// WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL MARTI MARIA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
// INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
// OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
// WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
// LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
// OF THIS SOFTWARE.
//
// Version 1.12
#include "lcms.h"
typedef struct {
cmsHPROFILE hLab;
cmsHPROFILE hRGB;
cmsHTRANSFORM Lab2RGB;
cmsHTRANSFORM RGB2Lab;
} CARGO, FAR* LPCARGO;
// Our space will be CIE primaries plus a gamma of 4.5
static
int Forward(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
LPCARGO C = (LPCARGO) Cargo;
WORD RGB[3];
cmsCIELab Lab;
cmsLabEncoded2Float(&Lab, In);
printf("%g %g %g\n", Lab.L, Lab.a, Lab.b);
cmsDoTransform(C ->Lab2RGB, In, &RGB, 1);
Out[0] = 0xFFFF - RGB[0]; // Our CMY is negative of RGB
Out[1] = 0xFFFF - RGB[1];
Out[2] = 0xFFFF - RGB[2];
return TRUE;
}
static
int Reverse(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
LPCARGO C = (LPCARGO) Cargo;
WORD RGB[3];
RGB[0] = 0xFFFF - In[0];
RGB[1] = 0xFFFF - In[1];
RGB[2] = 0xFFFF - In[2];
cmsDoTransform(C ->RGB2Lab, &RGB, Out, 1);
return TRUE;
}
static
void InitCargo(LPCARGO Cargo)
{
Cargo -> hLab = cmsCreateLabProfile(NULL);
Cargo -> hRGB = cmsCreate_sRGBProfile();
Cargo->Lab2RGB = cmsCreateTransform(Cargo->hLab, TYPE_Lab_16,
Cargo ->hRGB, TYPE_RGB_16,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOTPRECALC);
Cargo->RGB2Lab = cmsCreateTransform(Cargo ->hRGB, TYPE_RGB_16,
Cargo ->hLab, TYPE_Lab_16,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOTPRECALC);
}
static
void FreeCargo(LPCARGO Cargo)
{
cmsDeleteTransform(Cargo ->Lab2RGB);
cmsDeleteTransform(Cargo ->RGB2Lab);
cmsCloseProfile(Cargo ->hLab);
cmsCloseProfile(Cargo ->hRGB);
}
int main(void)
{
LPLUT AToB0, BToA0;
CARGO Cargo;
cmsHPROFILE hProfile;
fprintf(stderr, "Creating lcmscmy.icm...");
InitCargo(&Cargo);
hProfile = cmsCreateLabProfile(NULL);
AToB0 = cmsAllocLUT();
BToA0 = cmsAllocLUT();
cmsAlloc3DGrid(AToB0, 25, 3, 3);
cmsAlloc3DGrid(BToA0, 25, 3, 3);
cmsSample3DGrid(AToB0, Reverse, &Cargo, 0);
cmsSample3DGrid(BToA0, Forward, &Cargo, 0);
cmsAddTag(hProfile, icSigAToB0Tag, AToB0);
cmsAddTag(hProfile, icSigBToA0Tag, BToA0);
cmsSetColorSpace(hProfile, icSigCmyData);
cmsSetDeviceClass(hProfile, icSigOutputClass);
cmsAddTag(hProfile, icSigProfileDescriptionTag, "CMY ");
cmsAddTag(hProfile, icSigCopyrightTag, "Copyright (c) HP, 2007. All rights reserved.");
cmsAddTag(hProfile, icSigDeviceMfgDescTag, "Little cms");
cmsAddTag(hProfile, icSigDeviceModelDescTag, "CMY space");
_cmsSaveProfile(hProfile, "lcmscmy.icm");
cmsFreeLUT(AToB0);
cmsFreeLUT(BToA0);
cmsCloseProfile(hProfile);
FreeCargo(&Cargo);
fprintf(stderr, "Done.\n");
return 0;
}
+93
View File
@@ -0,0 +1,93 @@
//
// Little cms
// Copyright (C) 1998-2003 Marti Maria
//
// 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.
#include "lcms.h"
static
int Forward(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
cmsCIELab Lab;
cmsLabEncoded2Float(&Lab, In);
if (fabs(Lab.a) < 3 && fabs(Lab.b) < 3) {
double L_01 = Lab.L / 100.0;
WORD K;
if (L_01 > 1) L_01 = 1;
K = (WORD) floor(L_01* 65535.0 + 0.5);
Out[0] = Out[1] = Out[2] = K;
}
else {
Out[0] = 0xFFFF; Out[1] = 0; Out[2] = 0;
}
return TRUE;
}
int main(int argc, char *argv[])
{
LPLUT BToA0;
cmsHPROFILE hProfile;
fprintf(stderr, "Creating interpol2.icc...");
unlink("interpol2.icc");
hProfile = cmsOpenProfileFromFile("interpol2.icc", "w8");
BToA0 = cmsAllocLUT();
cmsAlloc3DGrid(BToA0, 17, 3, 3);
cmsSample3DGrid(BToA0, Forward, NULL, 0);
cmsAddTag(hProfile, icSigBToA0Tag, BToA0);
cmsSetColorSpace(hProfile, icSigRgbData);
cmsSetPCS(hProfile, icSigLabData);
cmsSetDeviceClass(hProfile, icSigOutputClass);
cmsAddTag(hProfile, icSigProfileDescriptionTag, "Interpolation test");
cmsAddTag(hProfile, icSigCopyrightTag, "Copyright (c) HP 2007. All rights reserved.");
cmsAddTag(hProfile, icSigDeviceMfgDescTag, "Little cms");
cmsAddTag(hProfile, icSigDeviceModelDescTag, "Interpolation test profile");
cmsCloseProfile(hProfile);
cmsFreeLUT(BToA0);
fprintf(stderr, "Done.\n");
return 0;
}
+150
View File
@@ -0,0 +1,150 @@
//
// Little cms
// Copyright (C) 1998-2010 Marti Maria
//
// 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.
// Creates a devicelink that decodes TIFF8 Lab files
#include "lcms2.h"
#include <stdlib.h>
#include <math.h>
static
double DecodeAbTIFF(double ab)
{
if (ab <= 128.)
ab += 127.;
else
ab -= 127.;
return ab;
}
static
cmsToneCurve* CreateStep(void)
{
cmsToneCurve* Gamma;
cmsUInt16Number* Table;
int i;
double a;
Table = calloc(4096, sizeof(cmsUInt16Number));
if (Table == NULL) return NULL;
for (i=0; i < 4096; i++) {
a = (double) i * 255. / 4095.;
a = DecodeAbTIFF(a);
Table[i] = (cmsUInt16Number) floor(a * 257. + 0.5);
}
Gamma = cmsBuildTabulatedToneCurve16(0, 4096, Table);
free(Table);
return Gamma;
}
static
cmsToneCurve* CreateLinear(void)
{
cmsUInt16Number Linear[2] = { 0, 0xffff };
return cmsBuildTabulatedToneCurve16(0, 2, Linear);
}
// Set the copyright and description
static
cmsBool SetTextTags(cmsHPROFILE hProfile)
{
cmsMLU *DescriptionMLU, *CopyrightMLU;
cmsBool rc = FALSE;
DescriptionMLU = cmsMLUalloc(0, 1);
CopyrightMLU = cmsMLUalloc(0, 1);
if (DescriptionMLU == NULL || CopyrightMLU == NULL) goto Error;
if (!cmsMLUsetASCII(DescriptionMLU, "en", "US", "Little cms Tiff8 CIELab")) goto Error;
if (!cmsMLUsetASCII(CopyrightMLU, "en", "US", "Copyright (c) Marti Maria, 2010. All rights reserved.")) goto Error;
if (!cmsWriteTag(hProfile, cmsSigProfileDescriptionTag, DescriptionMLU)) goto Error;
if (!cmsWriteTag(hProfile, cmsSigCopyrightTag, CopyrightMLU)) goto Error;
rc = TRUE;
Error:
if (DescriptionMLU)
cmsMLUfree(DescriptionMLU);
if (CopyrightMLU)
cmsMLUfree(CopyrightMLU);
return rc;
}
int main(int argc, char *argv[])
{
cmsHPROFILE hProfile;
cmsPipeline *AToB0;
cmsToneCurve* PreLinear[3];
cmsToneCurve *Lin, *Step;
fprintf(stderr, "Creating lcmstiff8.icm...");
remove("lcmstiff8.icm");
hProfile = cmsOpenProfileFromFile("lcmstiff8.icm", "w");
// Create linearization
Lin = CreateLinear();
Step = CreateStep();
PreLinear[0] = Lin;
PreLinear[1] = Step;
PreLinear[2] = Step;
AToB0 = cmsPipelineAlloc(0, 3, 3);
cmsPipelineInsertStage(AToB0,
cmsAT_BEGIN, cmsStageAllocToneCurves(0, 3, PreLinear));
cmsSetColorSpace(hProfile, cmsSigLabData);
cmsSetPCS(hProfile, cmsSigLabData);
cmsSetDeviceClass(hProfile, cmsSigLinkClass);
cmsSetProfileVersion(hProfile, 4.2);
cmsWriteTag(hProfile, cmsSigAToB0Tag, AToB0);
SetTextTags(hProfile);
cmsCloseProfile(hProfile);
cmsFreeToneCurve(Lin);
cmsFreeToneCurve(Step);
cmsPipelineFree(AToB0);
fprintf(stderr, "Done.\n");
return 0;
}
+66
View File
@@ -0,0 +1,66 @@
#include "lcms2.h"
static
double VecDist(BYTE bin[3], BYTE bout[3])
{
double rdist, gdist, bdist;
rdist = fabs(bout[0] - bin[0]);
gdist = fabs(bout[1] - bin[1]);
bdist = fabs(bout[2] - bin[2]);
return (sqrt((rdist*rdist + gdist*gdist + bdist*bdist)));
}
int main(int argc, char* argv[])
{
int r, g, b;
BYTE RGB[3], RGB_OUT[3];
cmsHTRANSFORM xform;
cmsHPROFILE hProfile;
double err, SumX=0, SumX2=0, Peak = 0, n = 0;
if (argc != 2) {
printf("roundtrip <icc profile>\n");
return 1;
}
hProfile = cmsOpenProfileFromFile(argv[1], "r");
xform = cmsCreateTransform(hProfile,TYPE_RGB_8, hProfile, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOTPRECALC);
for (r=0; r< 256; r++) {
printf("%d \r", r);
for (g=0; g < 256; g++) {
for (b=0; b < 256; b++) {
RGB[0] = r;
RGB[1] = g;
RGB[2] = b;
cmsDoTransform(xform, RGB, RGB_OUT, 1);
err = VecDist(RGB, RGB_OUT);
SumX += err;
SumX2 += err * err;
n += 1.0;
if (err > Peak)
Peak = err;
}
}
}
printf("Average %g\n", SumX / n);
printf("Max %g\n", Peak);
printf("Std %g\n", sqrt((n*SumX2 - SumX * SumX) / (n*(n-1))));
cmsCloseProfile(hProfile);
cmsDeleteTransform(xform);
return 0;
}
+65
View File
@@ -0,0 +1,65 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2010 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the Software
// 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.
//
//---------------------------------------------------------------------------------
//
#include "lcms2.h"
#include <string.h>
#include <math.h>
static
int PrintUsage(void)
{
fprintf(stderr, "Sets profile version\n\nUsage: vericc --r<version> iccprofile.icc\n");
return 0;
}
int main(int argc, char *argv[])
{
cmsHPROFILE hProfile;
char* ptr;
cmsFloat64Number Version;
if (argc != 3) return PrintUsage();
ptr = argv[1];
if (strncmp(ptr, "--r", 3) != 0) return PrintUsage();
ptr += 3;
if (!*ptr) { fprintf(stderr, "Wrong version number\n"); return 1; }
Version = atof(ptr);
hProfile = cmsOpenProfileFromFile(argv[2], "r");
if (hProfile == NULL) { fprintf(stderr, "'%s': cannot open\n", argv[2]); return 1; }
cmsSetProfileVersion(hProfile, Version);
cmsSaveProfileToFile(hProfile, "$$tmp.icc");
cmsCloseProfile(hProfile);
remove(argv[2]);
rename("$$tmp.icc", argv[2]);
return 0;
}
+28
View File
@@ -0,0 +1,28 @@
.\"Shiju P. Nair September 30, 2004
.TH WTPT 1 "September 30, 2004"
.SH NAME
wtpt - Show media white of profiles, identifying black body locus.
.SH SYNOPSIS
.B wtpt
.RI [ profile ]
.SH DESCRIPTION
lcms is a standalone CMM engine, which deals with the color management.
It implements a fast transformation between ICC profiles.
.B wtpt
shows media white of profiles, identifying black body locus.
.P
If no parameters are given, then this program will
ask for XYZ value of media white. If parameter given, it must be
the profile to inspect.
.SH NOTES
For suggestions, comments, bug reports etc. send mail to
info@littlecms.com
.SH SEE ALSO
.BR jpegicc (1),
.BR tifficc (1),
.BR icc2ps (1),
.BR icclink (1),
.BR icctrans (1)
.SH AUTHOR
This manual page was written by Shiju p. Nair <shiju.p@gmail.com>,
for the Debian project.
+94
View File
@@ -0,0 +1,94 @@
//
// Little cms
// Copyright (C) 1998-2000 Marti Maria
//
// THIS SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
// EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
// WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL MARTI MARIA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
// INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
// OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
// WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
// LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
// OF THIS SOFTWARE.
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Example: how to show white points of profiles
#include "lcms.h"
static
void ShowWhitePoint(LPcmsCIEXYZ WtPt)
{
cmsCIELab Lab;
cmsCIELCh LCh;
cmsCIExyY xyY;
char Buffer[1024];
_cmsIdentifyWhitePoint(Buffer, WtPt);
printf("%s\n", Buffer);
cmsXYZ2Lab(NULL, &Lab, WtPt);
cmsLab2LCh(&LCh, &Lab);
cmsXYZ2xyY(&xyY, WtPt);
printf("XYZ=(%3.1f, %3.1f, %3.1f)\n", WtPt->X, WtPt->Y, WtPt->Z);
printf("Lab=(%3.3f, %3.3f, %3.3f)\n", Lab.L, Lab.a, Lab.b);
printf("(x,y)=(%3.3f, %3.3f)\n", xyY.x, xyY.y);
printf("Hue=%3.2f, Chroma=%3.2f\n", LCh.h, LCh.C);
printf("\n");
}
int main (int argc, char *argv[])
{
printf("Show media white of profiles, identifying black body locus. v2\n\n");
if (argc == 2) {
cmsCIEXYZ WtPt;
cmsHPROFILE hProfile = cmsOpenProfileFromFile(argv[1], "r");
printf("%s\n", cmsTakeProductName(hProfile));
cmsTakeMediaWhitePoint(&WtPt, hProfile);
ShowWhitePoint(&WtPt);
cmsCloseProfile(hProfile);
}
else
{
cmsCIEXYZ xyz;
printf("usage:\n\nIf no parameters are given, then this program will\n");
printf("ask for XYZ value of media white. If parameter given, it must be\n");
printf("the profile to inspect.\n\n");
printf("X? "); scanf("%lf", &xyz.X);
printf("Y? "); scanf("%lf", &xyz.Y);
printf("Z? "); scanf("%lf", &xyz.Z);
ShowWhitePoint(&xyz);
}
return 0;
}