summaryrefslogtreecommitdiff
path: root/tiff/contrib/win_dib
diff options
context:
space:
mode:
Diffstat (limited to 'tiff/contrib/win_dib')
-rwxr-xr-xtiff/contrib/win_dib/Makefile.am27
-rwxr-xr-xtiff/contrib/win_dib/Makefile.in494
-rwxr-xr-xtiff/contrib/win_dib/Makefile.w95134
-rwxr-xr-xtiff/contrib/win_dib/README.Tiffile31
-rwxr-xr-xtiff/contrib/win_dib/README.tiff2dib51
-rwxr-xr-xtiff/contrib/win_dib/Tiffile.cpp449
-rwxr-xr-xtiff/contrib/win_dib/tiff2dib.c379
7 files changed, 1565 insertions, 0 deletions
diff --git a/tiff/contrib/win_dib/Makefile.am b/tiff/contrib/win_dib/Makefile.am
new file mode 100755
index 0000000..2bdccd0
--- /dev/null
+++ b/tiff/contrib/win_dib/Makefile.am
@@ -0,0 +1,27 @@
+# Tag Image File Format (TIFF) Software
+#
+# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE 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 SAM LEFFLER OR SILICON GRAPHICS 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.
+
+# Process this file with automake to produce Makefile.in.
+
+EXTRA_DIST = Makefile.w95 README.Tiffile README.tiff2dib Tiffile.cpp tiff2dib.c
+
diff --git a/tiff/contrib/win_dib/Makefile.in b/tiff/contrib/win_dib/Makefile.in
new file mode 100755
index 0000000..1f0e8a8
--- /dev/null
+++ b/tiff/contrib/win_dib/Makefile.in
@@ -0,0 +1,494 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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@
+
+# Tag Image File Format (TIFF) Software
+#
+# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE 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 SAM LEFFLER OR SILICON GRAPHICS 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.
+
+# Process this file with automake to produce Makefile.in.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@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@
+subdir = contrib/win_dib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/config/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GLUT_CFLAGS = @GLUT_CFLAGS@
+GLUT_LIBS = @GLUT_LIBS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBDIR = @LIBDIR@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@
+LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@
+LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@
+LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@
+LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@
+LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@
+LIBTIFF_VERSION = @LIBTIFF_VERSION@
+LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+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@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+tiff_libs_private = @tiff_libs_private@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = Makefile.w95 README.Tiffile README.tiff2dib Tiffile.cpp tiff2dib.c
+all: all-am
+
+.SUFFIXES:
+$(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 ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/win_dib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign contrib/win_dib/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
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+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 "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$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
+installdirs:
+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:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool 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 install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tiff/contrib/win_dib/Makefile.w95 b/tiff/contrib/win_dib/Makefile.w95
new file mode 100755
index 0000000..3f461ef
--- /dev/null
+++ b/tiff/contrib/win_dib/Makefile.w95
@@ -0,0 +1,134 @@
+# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.w95,v 1.2 1994/11/28
+06:13:31 sam Exp $
+#
+# Tag Image File Format Library
+#
+# Copyright (c) 1988, 1989, 1990, 1991, 1992 Sam Leffler
+# Copyright (c) 1991, 1992 Silicon Graphics, Inc.
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE 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 SAM LEFFLER OR SILICON GRAPHICS 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 Makefile is for use with microsoft nmake version 1.50 and
+# Microsoft 32-bit C/C++ Compiler 9.00
+#
+DESTDIR=.
+#
+IPATH= -I.
+CONF_LIBRARY=$(NULL)
+COPTS= -Oxa -DBSDTYPES -Zd
+CFLAGS= $(COPTS) $(CONF_LIBRARY)
+#
+INCS= tiff.h tiffio.h
+SRCS= tif_aux.c \
+ tif_close.c \
+ tif_codec.c \
+ tif_compress.c \
+ tif_dir.c \
+ tif_dirinfo.c \
+ tif_dirread.c \
+ tif_dirwrite.c \
+ tif_dumpmode.c \
+ tif_error.c \
+ tif_getimage.c \
+ tif_jpeg.c \
+ tif_flush.c \
+ tif_lzw.c \
+ tif_next.c \
+ tif_open.c \
+ tif_packbits.c \
+ tif_predict \
+ tif_print.c \
+ tif_read.c \
+ tif_swab.c \
+ tif_strip.c \
+ tif_thunder.c \
+ tif_tile.c \
+ tif_version.c \
+ tif_warning.c \
+ tif_write.c \
+ tif_win32.c
+
+
+OBJS= tif_aux.obj \
+ tif_close.obj \
+ tif_codec.obj \
+ tif_compress.obj \
+ tif_dir.obj \
+ tif_dirinfo.obj \
+ tif_dirread.obj \
+ tif_dirwrite.obj \
+ tif_dumpmode.obj \
+ tif_error.obj \
+ tif_getimage.obj \
+ tif_jpeg.obj \
+ tif_flush.obj \
+ tif_lzw.obj \
+ tif_next.obj \
+ tif_open.obj \
+ tif_packbits.obj \
+ tif_predict.obj \
+ tif_print.obj \
+ tif_read.obj \
+ tif_swab.obj \
+ tif_strip.obj \
+ tif_thunder.obj \
+ tif_tile.obj \
+ tif_version.obj \
+ tif_warning.obj \
+ tif_write.obj \
+ tif_win32.obj
+
+
+
+ALL= libtiff.lib
+
+all: $(ALL)
+
+%.obj : %.c
+ $(CC) $(CFLAGS) -c $*.c
+
+
+#.INCLUDE .IGNORE : depend
+
+libtiff.lib: $(OBJS)
+ - del libtiff.lib
+ lib /OUT:libtiff.lib $(OBJS)
+
+
+#To include fax3 support, you need to modify mkg3states.c so it could run
+#under windows 95 or NT. This application make the file g3state.h.
+#after that, you have to add to the build script : tif_fax3.c and tif_fax3.obj
+#and define CCITT_SUPPORT in the file tifconf.h
+
+#$(OBJS): tiffio.h tiff.h tiffcomp.h tiffiop.h tiffconf.h
+#tif_fax3.obj: tif_fax3.c g3states.h t4.h tif_fax3.h
+
+#g3states.h: mkg3states.c t4.h
+# $(CC) $(CFLAGS) mkg3states.c
+# mkg3states -c > g3states.h
+
+
+clean:
+ del *.obj
+ del mkg3stat
+ del g3states.h
+
+tags: $(SRCS)
+ $(CTAGS) $(SRCS)
diff --git a/tiff/contrib/win_dib/README.Tiffile b/tiff/contrib/win_dib/README.Tiffile
new file mode 100755
index 0000000..82c6e5c
--- /dev/null
+++ b/tiff/contrib/win_dib/README.Tiffile
@@ -0,0 +1,31 @@
+Frank,
+
+I attached a file that uses RGBA interface (tif_getimage.c) to read a tiff
+file and convert to a DIB. It's advantage is that it is easy to read *any*
+tiff file suported by libtiff and easily convert it to a DIB. The disadvantage
+is that bilevel (B&W) bitmaps (and all other non-rgba images) are also
+converted to RGBA, thus taking up 32x as much memory as needed (4 bytes per
+pixel, rather than 1 bit). I read tiff files, but don't need to
+write them. And my files are typically small, so the overhead is mostly
+inconsequential. But for bilevel images, I overrode the get() and put()
+routines of the RGBA interface to just copy the data from the input raster
+to the output raster, rather than expanding out to full 32 bit format. It
+would be nice if there were a simple way to handle all palletized images,
+but that would take more custom routines, and it's not that important to me.
+
+Usage:
+
+ m_pDIB = (PBITMAPINFOHEADER)::ReadTIFF(pathName);
+ if (m_pDIB != 0) {
+ m_format = IMAGETYPE_TIF;
+ }
+
+This is intended as Win32, but the modifications for new get() and put()
+routines may be independent of platform.
+
+Thanks for your work supporting the forum and the library!
+
+Regards,
+
+Mark James
+mark@james.net
diff --git a/tiff/contrib/win_dib/README.tiff2dib b/tiff/contrib/win_dib/README.tiff2dib
new file mode 100755
index 0000000..3e6075f
--- /dev/null
+++ b/tiff/contrib/win_dib/README.tiff2dib
@@ -0,0 +1,51 @@
+
+Date: 04 Dec 95 10:34:23 EST
+From: Philippe <100423.3705@compuserve.com>
+To: TIFF/sam Leffler <sam@cthulhu.engr.sgi.com>
+Subject: TIFF library and Windows 95
+Message-Id: <951204153422_100423.3705_BHG101-1@CompuServe.COM>
+
+Sam,
+
+First, let me thanks all of you how have worked
+on that great TIFF library !
+
+Here is some information that may help someone.
+
+I build the library under Windows 95 as a 32-bit library.
+The contribution of Scott Wagner (tif_win32.c) worked fine, but
+the makefile "makefile.msc" was unsable because it was
+written for DOS or Windows 3.1 and all the files names
+are limited to 8 characters.
+
+Here is the makefile I used : makefile.w95
+
+Also, I had to disable fax3 support because I wasn't able
+to build (as it is) the tool "mkg3states" to generate the include
+file "g3states.h".
+This source file must be modify to be build under Windows 95.
+
+To build the library under Windows 95 with Visual C++ 2.0,
+I had to :
+
+- undefine CCITT_SUPPORT in "tiffconf.h"
+
+- create the file version.h with this line :
+ #define VERSION "3.4beta024"
+
+- build the makefile "makefile.w95"
+
+I also join the source file "tif2dib.c" that I created,
+it contain the function LoadTIFFinDIB that load
+a TIFF file and build a memory DIB with it and return the
+HANDLE (HDIB) of the memory bloc containing this DIB.
+Since DIB is the "natural" bitmap format for Windows 3.1, 95 and NT,
+this function sould be usefull for some Windows 95 (or NT) developer.
+
+
+Sorry for my approximate english ...
+
+Regards,
+
+Philippe Tenenhaus 100423.3705@compuserve.com
+Paris
diff --git a/tiff/contrib/win_dib/Tiffile.cpp b/tiff/contrib/win_dib/Tiffile.cpp
new file mode 100755
index 0000000..9d958b1
--- /dev/null
+++ b/tiff/contrib/win_dib/Tiffile.cpp
@@ -0,0 +1,449 @@
+#include "StdAfx.h"
+
+//#define STRICT
+#include <windows.h>
+#include <windowsx.h>
+#include <commdlg.h>
+#include <stdlib.h> // MAX_ constants
+#include "diblib.h"
+
+/*--------------------------------------------------------------------
+ READ TIFF
+ Load the TIFF data from the file into memory. Return
+ a pointer to a valid DIB (or NULL for errors).
+ Uses the TIFFRGBA interface to libtiff.lib to convert
+ most file formats to a useable form. We just keep the 32 bit
+ form of the data to display, rather than optimizing for the
+ display.
+
+ Main entry points:
+
+ int ChkTIFF ( LPCTSTR lpszPath )
+ PVOID ReadTIFF ( LPCTSTR lpszPath )
+
+ RETURN
+ A valid DIB pointer for success; NULL for failure.
+
+ --------------------------------------------------------------------*/
+
+#include "TiffLib/tiff.h"
+#include "TiffLib/tiffio.h"
+#include <assert.h>
+#include <stdio.h>
+
+
+// piggyback some data on top of the RGBA Image
+struct TIFFDibImage {
+ TIFFRGBAImage tif;
+ int dibinstalled;
+} ;
+
+
+HANDLE LoadTIFFinDIB(LPCTSTR lpFileName);
+HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster) ;
+
+static void
+MyWarningHandler(const char* module, const char* fmt, va_list ap)
+{
+ // ignore all warnings (unused tags, etc)
+ return;
+}
+
+static void
+MyErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+ return;
+}
+
+// Turn off the error and warning handlers to check if a valid file.
+// Necessary because of the way that the Doc loads images and restart files.
+int ChkTIFF ( LPCTSTR lpszPath )
+{
+ int rtn = 0;
+
+ TIFFErrorHandler eh;
+ TIFFErrorHandler wh;
+
+ eh = TIFFSetErrorHandler(NULL);
+ wh = TIFFSetWarningHandler(NULL);
+
+ TIFF* tif = TIFFOpen(lpszPath, "r");
+ if (tif) {
+ rtn = 1;
+ TIFFClose(tif);
+ }
+
+ TIFFSetErrorHandler(eh);
+ TIFFSetWarningHandler(wh);
+
+ return rtn;
+}
+
+void DibInstallHack(TIFFDibImage* img) ;
+
+PVOID ReadTIFF ( LPCTSTR lpszPath )
+{
+ void* pDIB = 0;
+ TIFFErrorHandler wh;
+
+ wh = TIFFSetWarningHandler(MyWarningHandler);
+
+ if (ChkTIFF(lpszPath)) {
+ TIFF* tif = TIFFOpen(lpszPath, "r");
+ if (tif) {
+ char emsg[1024];
+
+ if (TIFFRGBAImageOK(tif, emsg)) {
+ TIFFDibImage img;
+ char emsg[1024];
+
+ if (TIFFRGBAImageBegin(&img.tif, tif, -1, emsg)) {
+ size_t npixels;
+ uint32* raster;
+
+ DibInstallHack(&img);
+
+ npixels = img.tif.width * img.tif.height;
+ raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
+ if (raster != NULL) {
+ if (TIFFRGBAImageGet(&img.tif, raster, img.tif.width, img.tif.height)) {
+ pDIB = TIFFRGBA2DIB(&img, raster);
+ }
+ }
+ _TIFFfree(raster);
+ }
+ TIFFRGBAImageEnd(&img.tif);
+ }
+ else {
+ TRACE("Unable to open image(%s): %s\n", lpszPath, emsg );
+ }
+ TIFFClose(tif);
+ }
+ }
+
+ TIFFSetWarningHandler(wh);
+
+ return pDIB;
+}
+
+
+
+HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster)
+{
+ void* pDIB = 0;
+ TIFFRGBAImage* img = &dib->tif;
+
+ uint32 imageLength;
+ uint32 imageWidth;
+ uint16 BitsPerSample;
+ uint16 SamplePerPixel;
+ uint32 RowsPerStrip;
+ uint16 PhotometricInterpretation;
+
+ BITMAPINFOHEADER bi;
+ int dwDIBSize ;
+
+ TIFFGetField(img->tif, TIFFTAG_IMAGEWIDTH, &imageWidth);
+ TIFFGetField(img->tif, TIFFTAG_IMAGELENGTH, &imageLength);
+ TIFFGetField(img->tif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample);
+ TIFFGetField(img->tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip);
+ TIFFGetField(img->tif, TIFFTAG_SAMPLESPERPIXEL, &SamplePerPixel);
+ TIFFGetField(img->tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation);
+
+ if ( BitsPerSample == 1 && SamplePerPixel == 1 && dib->dibinstalled ) { // bilevel
+ bi.biSize = sizeof(BITMAPINFOHEADER);
+ bi.biWidth = imageWidth;
+ bi.biHeight = imageLength;
+ bi.biPlanes = 1; // always
+ bi.biBitCount = 1;
+ bi.biCompression = BI_RGB;
+ bi.biSizeImage = WIDTHBYTES(bi.biWidth * bi.biBitCount) * bi.biHeight;
+ bi.biXPelsPerMeter = 0;
+ bi.biYPelsPerMeter = 0;
+ bi.biClrUsed = 0; // must be zero for RGB compression (none)
+ bi.biClrImportant = 0; // always
+
+ // Get the size of the DIB
+ dwDIBSize = GetDIBSize( &bi );
+
+ // Allocate for the BITMAPINFO structure and the color table.
+ pDIB = GlobalAllocPtr( GHND, dwDIBSize );
+ if (pDIB == 0) {
+ return( NULL );
+ }
+
+ // Copy the header info
+ *((BITMAPINFOHEADER*)pDIB) = bi;
+
+ // Get a pointer to the color table
+ RGBQUAD *pRgbq = (RGBQUAD *)((LPSTR)pDIB + sizeof(BITMAPINFOHEADER));
+
+ pRgbq[0].rgbRed = 0;
+ pRgbq[0].rgbBlue = 0;
+ pRgbq[0].rgbGreen = 0;
+ pRgbq[0].rgbReserved = 0;
+ pRgbq[1].rgbRed = 255;
+ pRgbq[1].rgbBlue = 255;
+ pRgbq[1].rgbGreen = 255;
+ pRgbq[1].rgbReserved = 255;
+
+ // Pointers to the bits
+ //PVOID pbiBits = (LPSTR)pRgbq + bi.biClrUsed * sizeof(RGBQUAD);
+ //
+ // In the BITMAPINFOHEADER documentation, it appears that
+ // there should be no color table for 32 bit images, but
+ // experience shows that the image is off by 3 words if it
+ // is not included. So here it is.
+ PVOID pbiBits = GetDIBImagePtr((BITMAPINFOHEADER*)pDIB); //(LPSTR)pRgbq + 3 * sizeof(RGBQUAD);
+
+ int sizeWords = bi.biSizeImage/4;
+ RGBQUAD* rgbDib = (RGBQUAD*)pbiBits;
+ long* rgbTif = (long*)raster;
+
+ _TIFFmemcpy(pbiBits, raster, bi.biSizeImage);
+ }
+
+ // For now just always default to the RGB 32 bit form. // save as 32 bit for simplicity
+ else if ( true /*BitsPerSample == 8 && SamplePerPixel == 3*/ ) { // 24 bit color
+
+ bi.biSize = sizeof(BITMAPINFOHEADER);
+ bi.biWidth = imageWidth;
+ bi.biHeight = imageLength;
+ bi.biPlanes = 1; // always
+ bi.biBitCount = 32;
+ bi.biCompression = BI_RGB;
+ bi.biSizeImage = WIDTHBYTES(bi.biWidth * bi.biBitCount) * bi.biHeight;
+ bi.biXPelsPerMeter = 0;
+ bi.biYPelsPerMeter = 0;
+ bi.biClrUsed = 0; // must be zero for RGB compression (none)
+ bi.biClrImportant = 0; // always
+
+ // Get the size of the DIB
+ dwDIBSize = GetDIBSize( &bi );
+
+ // Allocate for the BITMAPINFO structure and the color table.
+ pDIB = GlobalAllocPtr( GHND, dwDIBSize );
+ if (pDIB == 0) {
+ return( NULL );
+ }
+
+ // Copy the header info
+ *((BITMAPINFOHEADER*)pDIB) = bi;
+
+ // Get a pointer to the color table
+ RGBQUAD *pRgbq = (RGBQUAD *)((LPSTR)pDIB + sizeof(BITMAPINFOHEADER));
+
+ // Pointers to the bits
+ //PVOID pbiBits = (LPSTR)pRgbq + bi.biClrUsed * sizeof(RGBQUAD);
+ //
+ // In the BITMAPINFOHEADER documentation, it appears that
+ // there should be no color table for 32 bit images, but
+ // experience shows that the image is off by 3 words if it
+ // is not included. So here it is.
+ PVOID pbiBits = (LPSTR)pRgbq + 3 * sizeof(RGBQUAD);
+
+ int sizeWords = bi.biSizeImage/4;
+ RGBQUAD* rgbDib = (RGBQUAD*)pbiBits;
+ long* rgbTif = (long*)raster;
+
+ // Swap the byte order while copying
+ for ( int i = 0 ; i < sizeWords ; ++i )
+ {
+ rgbDib[i].rgbRed = TIFFGetR(rgbTif[i]);
+ rgbDib[i].rgbBlue = TIFFGetB(rgbTif[i]);
+ rgbDib[i].rgbGreen = TIFFGetG(rgbTif[i]);
+ rgbDib[i].rgbReserved = 0;
+ }
+ }
+
+ return pDIB;
+}
+
+
+
+
+///////////////////////////////////////////////////////////////
+//
+// Hacked from tif_getimage.c in libtiff in v3.5.7
+//
+//
+typedef unsigned char u_char;
+
+
+#define DECLAREContigPutFunc(name) \
+static void name(\
+ TIFFRGBAImage* img, \
+ uint32* cp, \
+ uint32 x, uint32 y, \
+ uint32 w, uint32 h, \
+ int32 fromskew, int32 toskew, \
+ u_char* pp \
+)
+
+#define DECLARESepPutFunc(name) \
+static void name(\
+ TIFFRGBAImage* img,\
+ uint32* cp,\
+ uint32 x, uint32 y, \
+ uint32 w, uint32 h,\
+ int32 fromskew, int32 toskew,\
+ u_char* r, u_char* g, u_char* b, u_char* a\
+)
+
+DECLAREContigPutFunc(putContig1bitTile);
+static int getStripContig1Bit(TIFFRGBAImage* img, uint32* uraster, uint32 w, uint32 h);
+
+//typdef struct TIFFDibImage {
+// TIFFRGBAImage tif;
+// dibinstalled;
+//} TIFFDibImage ;
+
+void DibInstallHack(TIFFDibImage* dib) {
+ TIFFRGBAImage* img = &dib->tif;
+ dib->dibinstalled = false;
+ switch (img->photometric) {
+ case PHOTOMETRIC_MINISWHITE:
+ case PHOTOMETRIC_MINISBLACK:
+ switch (img->bitspersample) {
+ case 1:
+ img->put.contig = putContig1bitTile;
+ img->get = getStripContig1Bit;
+ dib->dibinstalled = true;
+ break;
+ }
+ break;
+ }
+}
+
+/*
+ * 1-bit packed samples => 1-bit
+ *
+ * Override to just copy the data
+ */
+DECLAREContigPutFunc(putContig1bitTile)
+{
+ int samplesperpixel = img->samplesperpixel;
+
+ (void) y;
+ fromskew *= samplesperpixel;
+ int wb = WIDTHBYTES(w);
+ u_char* ucp = (u_char*)cp;
+
+ /* Conver 'w' to bytes from pixels (rounded up) */
+ w = (w+7)/8;
+
+ while (h-- > 0) {
+ _TIFFmemcpy(ucp, pp, w);
+ /*
+ for (x = wb; x-- > 0;) {
+ *cp++ = rgbi(Map[pp[0]], Map[pp[1]], Map[pp[2]]);
+ pp += samplesperpixel;
+ }
+ */
+ ucp += (wb + toskew);
+ pp += (w + fromskew);
+ }
+}
+
+/*
+ * Hacked from the tif_getimage.c file.
+ */
+static uint32
+setorientation(TIFFRGBAImage* img, uint32 h)
+{
+ TIFF* tif = img->tif;
+ uint32 y;
+
+ switch (img->orientation) {
+ case ORIENTATION_BOTRIGHT:
+ case ORIENTATION_RIGHTBOT: /* XXX */
+ case ORIENTATION_LEFTBOT: /* XXX */
+ TIFFWarning(TIFFFileName(tif), "using bottom-left orientation");
+ img->orientation = ORIENTATION_BOTLEFT;
+ /* fall thru... */
+ case ORIENTATION_BOTLEFT:
+ y = 0;
+ break;
+ case ORIENTATION_TOPRIGHT:
+ case ORIENTATION_RIGHTTOP: /* XXX */
+ case ORIENTATION_LEFTTOP: /* XXX */
+ default:
+ TIFFWarning(TIFFFileName(tif), "using top-left orientation");
+ img->orientation = ORIENTATION_TOPLEFT;
+ /* fall thru... */
+ case ORIENTATION_TOPLEFT:
+ y = h-1;
+ break;
+ }
+ return (y);
+}
+
+/*
+ * Get a strip-organized image that has
+ * PlanarConfiguration contiguous if SamplesPerPixel > 1
+ * or
+ * SamplesPerPixel == 1
+ *
+ * Hacked from the tif_getimage.c file.
+ *
+ * This is set up to allow us to just copy the data to the raster
+ * for 1-bit bitmaps
+ */
+static int
+getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+ TIFF* tif = img->tif;
+ tileContigRoutine put = img->put.contig;
+ uint16 orientation;
+ uint32 row, y, nrow, rowstoread;
+ uint32 pos;
+ u_char* buf;
+ uint32 rowsperstrip;
+ uint32 imagewidth = img->width;
+ tsize_t scanline;
+ int32 fromskew, toskew;
+ tstrip_t strip;
+ tsize_t stripsize;
+ u_char* braster = (u_char*)raster; // byte wide raster
+ uint32 wb = WIDTHBYTES(w);
+ int ret = 1;
+
+ buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif));
+ if (buf == 0) {
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
+ return (0);
+ }
+ y = setorientation(img, h);
+ orientation = img->orientation;
+ toskew = -(int32) (orientation == ORIENTATION_TOPLEFT ? wb+wb : wb-wb);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+ scanline = TIFFScanlineSize(tif);
+ fromskew = (w < imagewidth ? imagewidth - w : 0)/8;
+ for (row = 0; row < h; row += nrow)
+ {
+ rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
+ nrow = (row + rowstoread > h ? h - row : rowstoread);
+ strip = TIFFComputeStrip(tif,row+img->row_offset, 0);
+ stripsize = ((row + img->row_offset)%rowsperstrip + nrow) * scanline;
+ if (TIFFReadEncodedStrip(tif, strip, buf, stripsize ) < 0
+ && img->stoponerr)
+ {
+ ret = 0;
+ break;
+ }
+
+ pos = ((row + img->row_offset) % rowsperstrip) * scanline;
+ (*put)(img, (uint32*)(braster+y*wb), 0, y, w, nrow, fromskew, toskew, buf + pos);
+ y += (orientation == ORIENTATION_TOPLEFT ?-(int32) nrow : (int32) nrow);
+ }
+ _TIFFfree(buf);
+ return (ret);
+}
+
+/*
+ * Local Variables:
+ * mode: c++
+ * c-basic-offset: 8
+ * fill-column: 78
+ * End:
+ */
diff --git a/tiff/contrib/win_dib/tiff2dib.c b/tiff/contrib/win_dib/tiff2dib.c
new file mode 100755
index 0000000..475ef30
--- /dev/null
+++ b/tiff/contrib/win_dib/tiff2dib.c
@@ -0,0 +1,379 @@
+/*************************************************************************
+ *
+ * Source file for Windows 95/Win32.
+ *
+ * The function LoadTIFFinDIB in this source file let you load
+ * a TIFF file and build a memory DIB with it and return the
+ * HANDLE (HDIB) of the memory bloc containing the DIB.
+ *
+ * Example :
+ *
+ * HDIB hDIB;
+ * hDIB = LoadTIFFinDIB("sample.tif");
+ *
+ *
+ * To build this source file you must include the TIFF library
+ * in your project.
+ *
+ * 4/12/95 Philippe Tenenhaus 100423.3705@compuserve.com
+ *
+ ************************************************************************/
+
+
+#include "tiffio.h"
+
+#define HDIB HANDLE
+#define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
+#define CVT(x) (((x) * 255L) / ((1L<<16)-1))
+
+static HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount);
+static LPSTR FindDIBBits(LPSTR lpDIB);
+static WORD PaletteSize(LPSTR lpDIB);
+static WORD DIBNumColors(LPSTR lpDIB);
+static int checkcmap(int n, uint16* r, uint16* g, uint16* b);
+
+
+
+/*************************************************************************
+ *
+ * HDIB LoadTIFFinDIB(LPSTR lpFileName)
+ *
+ * Parameter:
+ *
+ * LPSTR lpDIB - File name of a tiff imag
+ *
+ * Return Value:
+ *
+ * LPSTR - HANDLE of a DIB
+ *
+ * Description:
+ *
+ * This function load a TIFF file and build a memory DIB with it
+ * and return the HANDLE (HDIB) of the memory bloc containing
+ * the DIB.
+ *
+ * 4/12/95 Philippe Tenenhaus 100423.3705@compuserve.com
+ *
+ ************************************************************************/
+
+HDIB LoadTIFFinDIB(LPSTR lpFileName)
+{
+ TIFF *tif;
+ unsigned long imageLength;
+ unsigned long imageWidth;
+ unsigned int BitsPerSample;
+ unsigned long LineSize;
+ unsigned int SamplePerPixel;
+ unsigned long RowsPerStrip;
+ int PhotometricInterpretation;
+ long nrow;
+ unsigned long row;
+ char *buf;
+ LPBITMAPINFOHEADER lpDIB;
+ HDIB hDIB;
+ char *lpBits;
+ HGLOBAL hStrip;
+ int i,l;
+ int Align;
+
+ tif = TIFFOpen(lpFileName, "r");
+
+ if (!tif)
+ goto TiffOpenError;
+
+ TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imageWidth);
+ TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imageLength);
+ TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample);
+ TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip);
+ TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip);
+ TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation);
+
+ LineSize = TIFFScanlineSize(tif); //Number of byte in ine line
+
+ SamplePerPixel = (int) (LineSize/imageWidth);
+
+ //Align = Number of byte to add at the end of each line of the DIB
+ Align = 4 - (LineSize % 4);
+ if (Align == 4) Align = 0;
+
+
+ //Create a new DIB
+ hDIB = CreateDIB((DWORD) imageWidth, (DWORD) imageLength, (WORD)
+(BitsPerSample*SamplePerPixel));
+ lpDIB = (LPBITMAPINFOHEADER) GlobalLock(hDIB);
+ if (!lpDIB)
+ goto OutOfDIBMemory;
+
+ if (lpDIB)
+ lpBits = FindDIBBits((LPSTR) lpDIB);
+
+ //In the tiff file the lines are save from up to down
+ //In a DIB the lines must be save from down to up
+ if (lpBits)
+ {
+ lpBits = FindDIBBits((LPSTR) lpDIB);
+ lpBits+=((imageWidth*SamplePerPixel)+Align)*(imageLength-1);
+ //now lpBits pointe on the bottom line
+
+ hStrip = GlobalAlloc(GHND,TIFFStripSize(tif));
+ buf = GlobalLock(hStrip);
+
+ if (!buf)
+ goto OutOfBufMemory;
+
+ //PhotometricInterpretation = 2 image is RGB
+ //PhotometricInterpretation = 3 image have a color palette
+ if (PhotometricInterpretation == 3)
+ {
+ uint16* red;
+ uint16* green;
+ uint16* blue;
+ int16 i;
+ LPBITMAPINFO lpbmi;
+ int Palette16Bits;
+
+ TIFFGetField(tif, TIFFTAG_COLORMAP, &red, &green, &blue);
+
+ //Is the palette 16 or 8 bits ?
+ if (checkcmap(1<<BitsPerSample, red, green, blue) == 16)
+ Palette16Bits = TRUE;
+ else
+ Palette16Bits = FALSE;
+
+ lpbmi = (LPBITMAPINFO)lpDIB;
+
+ //load the palette in the DIB
+ for (i = (1<<BitsPerSample)-1; i >= 0; i--)
+ {
+ if (Palette16Bits)
+ {
+ lpbmi->bmiColors[i].rgbRed =(BYTE) CVT(red[i]);
+ lpbmi->bmiColors[i].rgbGreen = (BYTE) CVT(green[i]);
+ lpbmi->bmiColors[i].rgbBlue = (BYTE) CVT(blue[i]);
+ }
+ else
+ {
+ lpbmi->bmiColors[i].rgbRed = (BYTE) red[i];
+ lpbmi->bmiColors[i].rgbGreen = (BYTE) green[i];
+ lpbmi->bmiColors[i].rgbBlue = (BYTE) blue[i];
+ }
+ }
+
+ }
+
+ //read the tiff lines and save them in the DIB
+ //with RGB mode, we have to change the order of the 3 samples RGB
+<=> BGR
+ for (row = 0; row < imageLength; row += RowsPerStrip)
+ {
+ nrow = (row + RowsPerStrip > imageLength ? imageLength - row :
+RowsPerStrip);
+ if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0),
+ buf, nrow*LineSize)==-1)
+ {
+ goto TiffReadError;
+ }
+ else
+ {
+ for (l = 0; l < nrow; l++)
+ {
+ if (SamplePerPixel == 3)
+ for (i=0;i< (int) (imageWidth);i++)
+ {
+ lpBits[i*SamplePerPixel+0]=buf[l*LineSize+i*Sample
+PerPixel+2];
+ lpBits[i*SamplePerPixel+1]=buf[l*LineSize+i*Sample
+PerPixel+1];
+ lpBits[i*SamplePerPixel+2]=buf[l*LineSize+i*Sample
+PerPixel+0];
+ }
+ else
+ memcpy(lpBits, &buf[(int) (l*LineSize)], (int)
+imageWidth*SamplePerPixel);
+
+ lpBits-=imageWidth*SamplePerPixel+Align;
+
+ }
+ }
+ }
+ GlobalUnlock(hStrip);
+ GlobalFree(hStrip);
+ GlobalUnlock(hDIB);
+ TIFFClose(tif);
+ }
+
+ return hDIB;
+
+ OutOfBufMemory:
+
+ TiffReadError:
+ GlobalUnlock(hDIB);
+ GlobalFree(hStrip);
+ OutOfDIBMemory:
+ TIFFClose(tif);
+ TiffOpenError:
+ return (HANDLE) 0;
+
+
+}
+
+
+static int checkcmap(int n, uint16* r, uint16* g, uint16* b)
+{
+ while (n-- > 0)
+ if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
+ return (16);
+
+ return (8);
+}
+
+
+
+/*************************************************************************
+ * All the following functions were created by microsoft, they are
+ * parts of the sample project "wincap" given with the SDK Win32.
+ *
+ * Microsoft says that :
+ *
+ * You have a royalty-free right to use, modify, reproduce and
+ * distribute the Sample Files (and/or any modified version) in
+ * any way you find useful, provided that you agree that
+ * Microsoft has no warranty obligations or liability for any
+ * Sample Application Files which are modified.
+ *
+ ************************************************************************/
+
+HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount)
+{
+ BITMAPINFOHEADER bi; // bitmap header
+ LPBITMAPINFOHEADER lpbi; // pointer to BITMAPINFOHEADER
+ DWORD dwLen; // size of memory block
+ HDIB hDIB;
+ DWORD dwBytesPerLine; // Number of bytes per scanline
+
+
+ // Make sure bits per pixel is valid
+ if (wBitCount <= 1)
+ wBitCount = 1;
+ else if (wBitCount <= 4)
+ wBitCount = 4;
+ else if (wBitCount <= 8)
+ wBitCount = 8;
+ else if (wBitCount <= 24)
+ wBitCount = 24;
+ else
+ wBitCount = 4; // set default value to 4 if parameter is bogus
+
+ // initialize BITMAPINFOHEADER
+ bi.biSize = sizeof(BITMAPINFOHEADER);
+ bi.biWidth = dwWidth; // fill in width from parameter
+ bi.biHeight = dwHeight; // fill in height from parameter
+ bi.biPlanes = 1; // must be 1
+ bi.biBitCount = wBitCount; // from parameter
+ bi.biCompression = BI_RGB;
+ bi.biSizeImage = (dwWidth*dwHeight*wBitCount)/8; //0; // 0's here
+mean "default"
+ bi.biXPelsPerMeter = 2834; //0;
+ bi.biYPelsPerMeter = 2834; //0;
+ bi.biClrUsed = 0;
+ bi.biClrImportant = 0;
+
+ // calculate size of memory block required to store the DIB. This
+ // block should be big enough to hold the BITMAPINFOHEADER, the color
+ // table, and the bits
+
+ dwBytesPerLine = (((wBitCount * dwWidth) + 31) / 32 * 4);
+ dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight);
+
+ // alloc memory block to store our bitmap
+ hDIB = GlobalAlloc(GHND, dwLen);
+
+ // major bummer if we couldn't get memory block
+ if (!hDIB)
+ {
+ return NULL;
+ }
+
+ // lock memory and get pointer to it
+ lpbi = (VOID FAR *)GlobalLock(hDIB);
+
+ // use our bitmap info structure to fill in first part of
+ // our DIB with the BITMAPINFOHEADER
+ *lpbi = bi;
+
+ // Since we don't know what the colortable and bits should contain,
+ // just leave these blank. Unlock the DIB and return the HDIB.
+
+ GlobalUnlock(hDIB);
+
+ /* return handle to the DIB */
+ return hDIB;
+}
+
+
+LPSTR FAR FindDIBBits(LPSTR lpDIB)
+{
+ return (lpDIB + *(LPDWORD)lpDIB + PaletteSize(lpDIB));
+}
+
+
+WORD FAR PaletteSize(LPSTR lpDIB)
+{
+ /* calculate the size required by the palette */
+ if (IS_WIN30_DIB (lpDIB))
+ return (DIBNumColors(lpDIB) * sizeof(RGBQUAD));
+ else
+ return (DIBNumColors(lpDIB) * sizeof(RGBTRIPLE));
+}
+
+
+WORD DIBNumColors(LPSTR lpDIB)
+{
+ WORD wBitCount; // DIB bit count
+
+ /* If this is a Windows-style DIB, the number of colors in the
+ * color table can be less than the number of bits per pixel
+ * allows for (i.e. lpbi->biClrUsed can be set to some value).
+ * If this is the case, return the appropriate value.
+ */
+
+ if (IS_WIN30_DIB(lpDIB))
+ {
+ DWORD dwClrUsed;
+
+ dwClrUsed = ((LPBITMAPINFOHEADER)lpDIB)->biClrUsed;
+ if (dwClrUsed)
+ return (WORD)dwClrUsed;
+ }
+
+ /* Calculate the number of colors in the color table based on
+ * the number of bits per pixel for the DIB.
+ */
+ if (IS_WIN30_DIB(lpDIB))
+ wBitCount = ((LPBITMAPINFOHEADER)lpDIB)->biBitCount;
+ else
+ wBitCount = ((LPBITMAPCOREHEADER)lpDIB)->bcBitCount;
+
+ /* return number of colors based on bits per pixel */
+ switch (wBitCount)
+ {
+ case 1:
+ return 2;
+
+ case 4:
+ return 16;
+
+ case 8:
+ return 256;
+
+ default:
+ return 0;
+ }
+}
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 8
+ * fill-column: 78
+ * End:
+ */