summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Leffler <sam@engr.sgi.com>1995-10-16 22:50:32 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-06-22 18:34:45 +0100
commit74a4ba75cb606153ec47c90b3bb625cf025821ae (patch)
tree17d6542c1ba3afd3aab2be51571b5e44089b20b8
parent9448a913ed3e137176b45c9b304271e47a6da035 (diff)
downloadlibtiff-git-74a4ba75cb606153ec47c90b3bb625cf025821ae.tar.gz
v3.4beta024 releasev3.4beta024
-rw-r--r--Makefile.in47
-rw-r--r--config.site33
-rwxr-xr-xconfigure488
-rwxr-xr-xcontrib/acorn/ReadMe79
-rwxr-xr-xcontrib/acorn/SetVars3
-rwxr-xr-xcontrib/acorn/convert175
-rwxr-xr-xcontrib/acorn/install124
-rwxr-xr-xcontrib/vms/libtiff/tiffshraxp.optbin3221 -> 3221 bytes
-rw-r--r--contrib/win32/README111
-rw-r--r--contrib/win32/dllshell.c38
-rw-r--r--contrib/win32/libtiff.def72
-rw-r--r--dist/tiff.alpha2
-rw-r--r--html/Makefile.in3
-rw-r--r--html/build.html194
-rw-r--r--html/contrib.html28
-rw-r--r--html/index.html4
-rw-r--r--html/internals.html23
-rw-r--r--html/libtiff.html4
-rw-r--r--html/v3.4beta024.html138
-rw-r--r--libtiff/Makefile.in93
-rw-r--r--libtiff/mkg3states.c27
-rwxr-xr-xlibtiff/mkversion.c132
-rw-r--r--libtiff/tif_apple.c4
-rw-r--r--libtiff/tif_codec.c6
-rw-r--r--libtiff/tif_compress.c4
-rw-r--r--libtiff/tif_fax3.c12
-rw-r--r--libtiff/tif_open.c4
-rw-r--r--libtiff/tif_packbits.c11
-rw-r--r--libtiff/tif_print.c14
-rw-r--r--libtiff/tif_strip.c4
-rw-r--r--libtiff/tif_tile.c8
-rw-r--r--libtiff/tif_win32.c295
-rw-r--r--libtiff/tif_write.c64
-rw-r--r--libtiff/tiff.h8
-rw-r--r--libtiff/tiffcomp.h100
-rw-r--r--libtiff/tiffio.h6
-rw-r--r--libtiff/tiffiop.h19
-rw-r--r--man/Makefile.in237
-rw-r--r--man/TIFFClose.3t8
-rw-r--r--man/TIFFError.3t14
-rw-r--r--man/TIFFFlush.3t8
-rw-r--r--man/TIFFGetField.3t47
-rw-r--r--man/TIFFOpen.3t8
-rw-r--r--man/TIFFPrintDirectory.3t8
-rw-r--r--man/TIFFRGBAImage.3t275
-rw-r--r--man/TIFFReadDirectory.3t19
-rw-r--r--man/TIFFReadEncodedStrip.3t12
-rw-r--r--man/TIFFReadEncodedTile.3t12
-rw-r--r--man/TIFFReadRGBAImage.3t30
-rw-r--r--man/TIFFReadRawStrip.3t13
-rw-r--r--man/TIFFReadRawTile.3t17
-rw-r--r--man/TIFFReadScanline.3t13
-rw-r--r--man/TIFFReadTile.3t8
-rw-r--r--man/TIFFSetDirectory.3t29
-rw-r--r--man/TIFFSetField.3t46
-rw-r--r--man/TIFFWarning.3t12
-rw-r--r--man/TIFFWriteDirectory.3t8
-rw-r--r--man/TIFFWriteEncodedStrip.3t26
-rw-r--r--man/TIFFWriteEncodedTile.3t8
-rw-r--r--man/TIFFWriteRawStrip.3t21
-rw-r--r--man/TIFFWriteRawTile.3t8
-rw-r--r--man/TIFFWriteScanline.3t8
-rw-r--r--man/TIFFbuffer.3t77
-rw-r--r--man/TIFFcodec.3t73
-rw-r--r--man/TIFFmemory.3t84
-rw-r--r--man/TIFFquery.3t (renamed from man/query.3t)55
-rw-r--r--man/TIFFsize.3t (renamed from man/size.3t)60
-rw-r--r--man/TIFFstrip.3t (renamed from man/strip.3t)55
-rw-r--r--man/TIFFswab.3t (renamed from man/swab.3t)8
-rw-r--r--man/TIFFtile.3t (renamed from man/tile.3t)61
-rw-r--r--man/fax2tiff.16
-rw-r--r--man/gif2tiff.112
-rw-r--r--man/libtiff.3t (renamed from man/intro.3t)197
-rw-r--r--man/pal2rgb.110
-rw-r--r--man/ppm2tiff.117
-rw-r--r--man/ras2tiff.115
-rw-r--r--man/rgb2ycbcr.183
-rw-r--r--man/sgi2tiff.112
-rw-r--r--man/thumbnail.16
-rw-r--r--man/tiff2bw.116
-rw-r--r--man/tiff2ps.118
-rw-r--r--man/tiffcmp.16
-rw-r--r--man/tiffcp.113
-rw-r--r--man/tiffdither.111
-rw-r--r--man/tiffdump.110
-rw-r--r--man/tiffgt.1115
-rw-r--r--man/tiffinfo.18
-rw-r--r--man/tiffmedian.111
-rw-r--r--man/tiffsplit.16
-rw-r--r--man/tiffsv.113
-rw-r--r--port/Makefile.in6
-rw-r--r--port/strcasecmp.c17
-rw-r--r--tools/Makefile.in14
-rw-r--r--tools/fax2ps.c43
-rw-r--r--tools/fax2tiff.c17
-rw-r--r--tools/gif2tiff.c6
-rw-r--r--tools/pal2rgb.c6
-rw-r--r--tools/ppm2tiff.c8
-rw-r--r--tools/ras2tiff.c6
-rw-r--r--tools/rgb2ycbcr.c6
-rw-r--r--tools/sgi2tiff.c57
-rw-r--r--tools/sgigt.c13
-rw-r--r--tools/sgisv.c13
-rw-r--r--tools/thumbnail.c89
-rw-r--r--tools/tiff2bw.c6
-rw-r--r--tools/tiff2ps.c647
-rw-r--r--tools/tiffcmp.c17
-rw-r--r--tools/tiffcp.c89
-rw-r--r--tools/tiffdither.c6
-rw-r--r--tools/tiffdump.c32
-rw-r--r--tools/tiffinfo.c6
-rw-r--r--tools/tiffmedian.c6
-rw-r--r--tools/tiffsplit.c6
113 files changed, 4180 insertions, 1266 deletions
diff --git a/Makefile.in b/Makefile.in
index 71867cf3..b1dd3b3f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.25 1995/07/19 01:53:48 sam Exp $
+# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.37 1995/10/16 22:01:20 sam Exp $
#
# @WARNING@
#
@@ -27,9 +27,8 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
-DEPTH = .
-SRCDIR = ${DEPTH}/@SRCDIR@
+SRCDIR = @SRCDIR@
#
# VERSION: @VERSION@
@@ -42,6 +41,7 @@ SRCDIR = ${DEPTH}/@SRCDIR@
SHELL = /bin/sh
NULL =
ECHO = echo
+GENDIST = ${TOOLROOT}/usr/sbin/gendist
all default:
@if [ "@PORT@" = yes ]; then \
@@ -50,17 +50,11 @@ all default:
@${ECHO} "= "libtiff; cd libtiff; ${MAKE}
@${ECHO} "= "tools; cd tools; ${MAKE}
@${ECHO} "= "man; cd man; ${MAKE}
- @if [ "@HTML@" = yes ]; then \
- ${ECHO} "= "html; cd html; ${MAKE}; \
- fi
install:
@${ECHO} "= "libtiff; cd libtiff; ${MAKE} install
@${ECHO} "= "tools; cd tools; ${MAKE} install
@${ECHO} "= "man; cd man; ${MAKE} install
- @if [ "@HTML@" = yes ]; then \
- ${ECHO} "= "html; cd html; ${MAKE} install; \
- fi
clean:
@if [ "@PORT@" = yes ]; then \
@@ -69,14 +63,11 @@ clean:
@${ECHO} "= "libtiff; cd libtiff; ${MAKE} clean
@${ECHO} "= "tools; cd tools; ${MAKE} clean
@${ECHO} "= "man; cd man; ${MAKE} clean
- @if [ "@HTML@" = yes ]; then \
- ${ECHO} "= "html; cd html; ${MAKE} clean; \
- fi
# -cd contrib/dbs; ${MAKE} clean
# -cd contrib/dbs/xtiff; ${MAKE} clean
clobber distclean: clean
- rm -f Makefile port.h config.log
+ rm -f Makefile libtiff/port.h config.log
rm -f libtiff/Makefile
rm -f tools/Makefile
rm -f man/Makefile
@@ -86,11 +77,13 @@ clobber distclean: clean
# The folllowing rule creates a binary distribution for IRIX.
#
product::
+ test -d dist || mkdir dist
rm -f dist/rawidb
SRC=`pwd` RAWIDB=`pwd`/dist/rawidb ${MAKE} install
rm -f dist/idb
sort -u +4 dist/rawidb > dist/idb
- gendist -v -dist dist -idb dist/idb -sbase `pwd` -spec ${SRCDIR}/dist/tiff.spec
+ ${GENDIST} -v -dist dist -idb dist/idb \
+ -sbase `pwd` -spec ${SRCDIR}/dist/tiff.spec
#
# These rules are used to create the source distribution images
@@ -124,6 +117,7 @@ TIFFFILES=\
libtiff/tiffiop.h \
libtiff/mkg3states.c \
libtiff/mkspans.c \
+ libtiff/mkversion.c \
libtiff/tif_apple.c \
libtiff/tif_atari.c \
libtiff/tif_aux.c \
@@ -160,6 +154,7 @@ TIFFFILES=\
libtiff/tif_vms.c \
libtiff/tif_warning.c \
libtiff/tif_win3.c \
+ libtiff/tif_win32.c \
libtiff/tif_write.c \
libtiff/tif_zip.c \
port/Makefile.in \
@@ -227,6 +222,7 @@ TIFFFILES=\
man/TIFFReadRawTile.3t \
man/TIFFReadScanline.3t \
man/TIFFReadTile.3t \
+ man/TIFFRGBAImage.3t \
man/TIFFSetDirectory.3t \
man/TIFFSetField.3t \
man/TIFFWarning.3t \
@@ -236,12 +232,15 @@ TIFFFILES=\
man/TIFFWriteRawStrip.3t \
man/TIFFWriteRawTile.3t \
man/TIFFWriteScanline.3t \
- man/intro.3t \
- man/query.3t \
- man/size.3t \
- man/strip.3t \
- man/swab.3t \
- man/tile.3t \
+ man/libtiff.3t \
+ man/TIFFbuffer.3t \
+ man/TIFFcodec.3t \
+ man/TIFFmemory.3t \
+ man/TIFFquery.3t \
+ man/TIFFsize.3t \
+ man/TIFFstrip.3t \
+ man/TIFFswab.3t \
+ man/TIFFtile.3t \
html/Makefile.in \
html/bugs.html \
html/build.html \
@@ -255,6 +254,7 @@ TIFFFILES=\
html/misc.html \
html/support.html \
html/tools.html \
+ html/v3.4beta024.html \
html/v3.4beta018.html \
html/v3.4beta016.html \
html/v3.4beta007.html \
@@ -299,6 +299,8 @@ CONTRIBFILES=\
contrib/vms/tools/makevms.com \
contrib/tags \
contrib/mac-mpw \
+ contrib/acorn \
+ contrib/win32 \
${NULL}
DISTFILES=\
${TIFFFILES} \
@@ -309,20 +311,19 @@ DISTFILES=\
${NULL}
CONFIG=\
- -with-CC=ncc \
+ -with-CC=cc \
-with-GCOPTS=" " \
-with-JPEG=yes \
-with-DIR_JPEG=../src/jpeg-5a \
-with-ZIP=yes \
-with-DIR_LIBGZ=../src/zlib \
- -with-HTML \
${NULL}
rcsclean:
rcsclean ${TIFFFILES} && co ${TIFFFILES}
alpha:
- (cd ${SRCDIR}/dist; sh newalpha; sh newversion)
+ (cd ${SRCDIR}/dist; sh newversion)
-${MAKE} clean
${MAKE} alpha.stamp
${SRCDIR}/configure ${CONFIG}
diff --git a/config.site b/config.site
index 15d0760e..a680210e 100644
--- a/config.site
+++ b/config.site
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.5 1995/07/17 14:53:35 sam Exp $
+# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.7 1995/10/10 01:03:54 sam Exp $
#
# TIFF Software
#
@@ -40,8 +40,7 @@
#
# Package controls.
#
-#DSO="auto" # yes|no|auto configure DSO support
-#HTML="no" # yes|no configure HTML documentation
+#DSO="auto" # auto|IRIX configure DSO support for system
#JPEG="no" # yes|no configure JPEG support
#ZIP="no" # yes|no configure Deflate support
#LIBGL="auto" # yes|no|auto configure IRIS GL-based tools
@@ -61,31 +60,23 @@
# NB: JPEG support requires release 5 or later of the IJG code,
# which you can find on the Internet at ftp.uu.net:/graphics/jpeg/.
#
-#DIR_JPEG="../jpeg" # directory for JPEG include files
-#LIBJPEG="-L \${JPEGDIR} -ljpeg" # JPEG library to load
+#DIRS_LIBINC="$DIRS_LIBINC ../jpeg" # directory for JPEG include files
+#LIBJPEG="-L ../jpeg -ljpeg" # JPEG library to load
#
# Deflate-specific parameters; used when Deflate support is enabled.
#
-# NB: Deflate support requires version 0.92 or later of the libgz
-# library written by Jean-loup Gailly and Mark Adler. The library
-# was last found at ftp://ftp.uu.net/graphics/png/code/zlib-0.93.tar.gz.
+# NB: Deflate support requires version 0.92 or later of the zlib
+# library written by Jean-loup Gailly and Mark Adler. Starting
+# with about 0.95 the library is called libz.a (previously it was
+# libgz.a). The library was last found at
#
-#DIR_LIBGZ="../zlib" # directory for libgz include files
-#LIBGZ="-L \${ZIPDIR} -lgz" # libgz library to load
-
-#
-# HTML-specific parameters; only used when the
-# HTML package is configured for installation.
+# ftp://ftp.uu.net/graphics/png/code/zlib-0.93.tar.gz
#
-# Note that ``PATH''s are the virtual pathnames used
-# in forming URLs; they are not directory pathnames
-# in the filesystem.
+# Look for it also at ftp://ftp.uu.net/pub/archiving/zip/zlib.
#
-#DIR_HTML="/var/httpd/htdocs/tiff" # directory for HTML documentation
-#DIR_CGI="/var/httpd/cgi-bin" # directory for CGI scripts
-#HTMLPATH="/tiff" # virtual path to HTML materials
-#CGIPATH="/cgi-bin" # virtual path to CGI scripts
+#DIRS_LIBINC="$DIRS_LIBINC ../zlib" # directory for zlib include files
+#LIBGZ="-L ../zlib -lz" # libgz library to load
#
# Miscellaneous parameters.
diff --git a/configure b/configure
index b4f5891c..6211ecef 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Header: /usr/people/sam/tiff/RCS/configure,v 1.15 1995/07/17 14:57:08 sam Exp $
+# $Header: /usr/people/sam/tiff/RCS/configure,v 1.26 1995/10/15 23:39:31 sam Exp $
#
# Tag Image File Format (TIFF) Software
#
@@ -39,14 +39,10 @@
DIR_BIN=/usr/local/bin
DIR_LIB=/usr/local/lib
DIR_INC=/usr/local/include
-DIR_HTML=/var/httpd/htdocs/tiff
-DIR_CGI=/var/httpd/cgi-bin
-DIR_JPEG=.
-DIR_LIBGZ=.
-HTMLPATH=/tiff
-CGIPATH=/cgi-bin
+DIRS_LIBINC=
+DIR_JPEGLIB=
+DIR_GZLIB=
DSO=auto
-HTML=no
JPEG=no
ZIP=no
PORT=auto
@@ -141,7 +137,7 @@ do
-target|--target) ac_prev=TARGET;;
-target=*|--target=*) TARGET="$ac_optarg" ;;
-version|--version)
- echo "This is TIFF configure $Revision: 1.15 $"
+ echo "This is TIFF configure $Revision: 1.26 $"
exit 0
;;
-help|--help) usage; exit 0;;
@@ -192,6 +188,14 @@ if [ ! -r $SRCDIR/VERSION ]; then
fi
SRCDIR=`echo "$SRCDIR" | sed 's;\([^/]\)/*$;\1;'`
+if [ -r ${SRCDIR}/tif_version.c ] ; then
+ SRCDIR_IS_LIBTIFF=yes
+ PORDOTH=port.h
+else
+ SRCDIR_IS_LIBTIFF=no
+ PORTDOTH=libtiff/port.h
+fi
+
#
# Descriptor usage:
# 1: ???
@@ -207,7 +211,14 @@ else
fi
exec 5>./config.log # compiler messages and the like
-VERSION="v`cat $SRCDIR/VERSION``awk '{print $3}' $SRCDIR/dist/tiff.alpha`"
+if [ -r $SRCDIR/tiff.alpha ] ; then
+ VERSIONFILE=$SRCDIR/VERSION
+ ALPHAFILE=$SRCDIR/tiff.alpha
+else
+ VERSIONFILE=$SRCDIR/VERSION
+ ALPHAFILE=$SRCDIR/dist/tiff.alpha
+fi
+VERSION="v`cat $VERSIONFILE``awk '{print $3}' $ALPHAFILE`"
DATE=`date`
Note()
@@ -237,6 +248,18 @@ elif [ -f $SRCDIR/config.local ]; then
. $SRCDIR/config.local
fi
+#
+# Emulate old-style settups...
+#
+test -z "${DIR_JPEG:-}" || {
+ DIRS_LIBINC="${DIRS_LIBINC} ${DIR_JPEG}"
+ DIR_JPEGLIB=${DIR_JPEG}
+}
+test -z "${DIR_LIBGZ:-}" || {
+ DIRS_LIBINC="${DIRS_LIBINC} ${DIR_LIBGZ}"
+ DIR_GZLIB=${DIR_LIBGZ}
+}
+
identifyTarget()
{
random=`date | awk '{print $4}' | sed -e 's/.*://'` 2>/dev/null
@@ -270,6 +293,16 @@ else
Note "Warning, I don't seem to have the GNU config.sub script to canonicalize"
Note "your target specification; this may cause problems later on..."
fi
+if [ -z "${FILLORDER:-}" ]; then
+ #
+ # Host bit order within a word.
+ #
+ case $TARGET in
+ mips-dec-*) FILLORDER=LSB2MSB;;
+ i[345]86-*) FILLORDER=LSB2MSB;;
+ *) FILLORDER=MSB2LSB;;
+ esac
+fi
cat 1>&5 <<EOF
This file contains any messages produced by compilers while
@@ -328,6 +361,26 @@ findAppDef()
}
#
+# Find the full pathname of a header file; in search-path $DIRS_LIBINC
+#
+findHeader()
+{
+ case "$1" in
+ /*) echo "$1"; return ;;
+ esac
+ for i in ${DIRS_LIBINC}; do
+ test -r $i/$1 && {
+ if [ $SRCDIR_IS_LIBTIFF = yes ]; then
+ echo "$i/$1";
+ else
+ echo "../$i/$1";
+ fi
+ return;
+ }
+ done
+}
+
+#
# Locate a C and C++ compiler and verify they work and
# satisfy our needs (using assorted heuristics).
#
@@ -367,7 +420,7 @@ EOF
#
isGNU()
{
- $1 -E xgnu.c 2>&5 | egrep yes >/dev/null 2>&1
+ ($1 -E xgnu.c 2>&5 | egrep yes) >/dev/null 2>&1
}
#
@@ -377,41 +430,49 @@ cat>dummy.c<<EOF
main(int argc, char* argv) { exit(0); }
EOF
-: ${ENVOPTS=}
-CCOMPILER=
-for i in $CC gcc cc ncc dcc xlc c89 gcc2; do
- if isGNU $i; then
+checkCompiler()
+{
+ compiler=$1
+ if isGNU $compiler; then
ISGCC=yes
else
ISGCC=no
fi
#
# Guess special options needed to get an
- # ANSI C compiler and/or similar. Should
- # probably be combined with above checks
- # so we only select an ANSI C compiler.
+ # ANSI C compiler and/or similar. Must
+ # be combined with above checks so we only
+ # select an ANSI C compiler.
#
- if [ -z "$ENVOPTS" ]; then
+ if [ -z "${ENVOPTS:-}" ]; then
case $ISGCC-$TARGET in
- no-*-irix*) C_ANSI=-ansi;;
+ no-*-irix*) C_ANSI="-ansi";;
no-*-hp*) C_ANSI="-Aa -D_HPUX_SOURCE -Dhpux";;
no-*-apollo-*) C_ANSI="-A nansi";;
+ no-*-aix*) C_ANSI="-Dunix -qlanglvl=ansi -qsrcmsg";;
*-sco*) C_ANSI="-Dsco";;
- *-aix*) C_ANSI="-Dunix -qlanglvl=ansi -qsrcmsg" ;;
esac
else
C_ANSI="$ENVOPTS"
fi
$RM dummy dummy.o
- ($i -o dummy $C_ANSI dummy.c) >/dev/null 2>&5 && {
- CC=$i;
- CCOMPILER=`findApp $i $PATH`
- if [ -z "$ENVOPTS" ]; then
- ENVOPTS="$C_ANSI"
- fi
- break;
+ ($compiler -o dummy ${C_ANSI} dummy.c) >/dev/null 2>&5 && {
+ CC=$compiler;
+ test -z "${CCOMPILER:-}" && CCOMPILER=`findApp $compiler $PATH`
+ test -z "${ENVOPTS:-}" && ENVOPTS="${C_ANSI:-}"
+ return 0
}
-done
+ return 1
+}
+
+if [ -z "${CC:-}" ]; then
+ CCOMPILER=
+ for i in gcc cc ncc dcc xlc c89 gcc2; do
+ checkCompiler $i && break
+ done
+else
+ checkCompiler $CC
+fi
if [ -z "$CCOMPILER" ]; then
cat<<EOF
Cannot locate a working ANSI C compiler.
@@ -422,20 +483,21 @@ and rerun this script.
If command line options are required for ANSI C compilation, set the
variable ENVOPTS to these options and rerun this script.
-
-If you are trying to use GNU gcc, but you do not have version 2.6.1
-or newer, then you must update your compiler (and probably libg++ as
-well) before you can compile this software. Consult the documentation
-for information about obtaining an up-to-date version of gcc.
EOF
- boom
-fi
+ boom
+ fi
Note "Using $CCOMPILER for a C compiler (set CC to override)."
test "$ENVOPTS" && {
Note "Using $ENVOPTS to get the appropriate compilation environment."
}
+if [ ${ISGCC} = yes ] ; then
+ GCCversion="`${CCOMPILER} -v 2>&1 | \
+ sed -n -e '/version/s/.* \([0-9]*\)\.\([0-9]*\).\([0-9]*\)/\1.\2.\3/p'`"
+fi
+
+
CheckForGandO()
{
f=$1
@@ -445,17 +507,20 @@ CheckForGandO()
return 0
}
-if [ -z "$GCOPTS" ]; then
- $CCOMPILER $ENVOPTS -g -c dummy.c >/dev/null 2>&5 && {
+if [ -z "${GCOPTS:-}" ]; then
+ if $CCOMPILER $ENVOPTS -g -c dummy.c >/dev/null 2>&5; then
Note "Looks like $CCOMPILER supports the -g option."
- if $CCOMPILER $ENVOPTS $GCOPTS -c -g -O dummy.c >t 2>&1 && CheckForGandO t; then
- GCOPTS="$GCOPTS -g"
+ if $CCOMPILER $ENVOPTS -c -g -O dummy.c >t 2>&1 && CheckForGandO t; then
+ GCOPTS="-g"
else
Note "... but not together with the -O option, not using it."
+ GCOPTS=
fi
- }
+ else
+ GCOPTS=
+ fi
fi
-if [ "$GCOPTS" ]; then
+if [ ! -z "${GCOPTS}" ]; then
Note "Using \"$GCOPTS\" for C compiler options."
fi
@@ -493,7 +558,7 @@ fi
# in the Makefiles. If not, we add an explicit define
# for places where recursive calls are made.
#
-if [ -z "$SETMAKE" ]; then
+if [ -z "${SETMAKE:-}" ]; then
M=
eval `(cat<<'EOF'
all:
@@ -508,13 +573,13 @@ EOF
fi
fi
-test "$AR" || AR=`findApp ar $PATH`
+test -z "${AR:-}" && AR=`findApp ar $PATH`
if [ -z "$AR" ]; then
Note "*** Warning, could not locate a suitable ar command; using a default."
AR=ar
fi
-test "$AROPTS" || AROPTS=rc
-test "$RANLIB" || RANLIB=`findApp ranlib $PATH`
+test -z "${AROPTS:-}" && AROPTS=rc
+test -z "${RANLIB:-}" && RANLIB=`findApp ranlib $PATH`
if [ -z "$RANLIB" ]; then
Note "Warning, no ranlib, assuming it's not needed."
RANLIB=":"
@@ -770,7 +835,7 @@ EOF
CheckForBigEndian()
{
echo 'main() { int one = 1; char* cp = (char*)&one; exit(*cp!=0); }'>t.c
- runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c" >/dev/null
+ runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c">/dev/null && ./a.out
}
#
@@ -783,17 +848,10 @@ CheckPortDotH()
{
param=`grep "$1:" $2 | sed -e 's/.*:[ ]*\([^ ]*\).*/\1/'`
}
- getConfigTag TARGET port.h; target="$param"
- getConfigTag CCOMPILER port.h; ccompiler="$param"
+ getConfigTag TARGET $PORTDOTH; target="$param"
+ getConfigTag CCOMPILER $PORTDOTH; ccompiler="$param"
CCOMP=$CCOMPILER
if [ $ISGCC = yes ]; then
- getGCCVersion()
- {
- eval `$1 -v 2>&1 | \
- sed -n -e '/version/s/.* \([0-9]*\)\.\([0-9]*\).\([0-9]*\)/GCCdist=\1;GCCmajor=\2;GCCminor=\3/p'`
- GCCversion="${GCCdist}.${GCCmajor}.${GCCminor}"
- }
- getGCCVersion $CCOMPILER
CCOMP="${CCOMP}-${GCCversion}"
fi
test "$target" = "$TARGET" && test "$ccompiler" = "$CCOMP"
@@ -805,12 +863,11 @@ CheckPortDotH()
BuildPortDotH()
{
Note ""
- Note "Creating port.h with necessary definitions."
+ Note "Creating $PORTDOTH with necessary definitions."
(EmitCPlusPlusPrologue _PORT_
CheckForIncludeFile sys/types.h && echo '#include <sys/types.h>'
- CheckVarDecl mode_t 'typedef int mode_t;' sys/types.h stdlib.h
CheckVarDecl off_t 'typedef long off_t;' sys/types.h stdlib.h
CheckVarDecl size_t 'typedef unsigned size_t;' sys/types.h stdlib.h
CheckVarDecl u_char 'typedef unsigned char u_char;' sys/types.h
@@ -818,16 +875,6 @@ BuildPortDotH()
CheckVarDecl u_int 'typedef unsigned int u_int;' sys/types.h
CheckVarDecl u_long 'typedef unsigned long u_long;' sys/types.h
- if [ -z "$FILLORDER" ]; then
- #
- # Host bit order within a word.
- #
- case $TARGET in
- mips-dec-*) FILLORDER=LSB2MSB;;
- i[345]86-*) FILLORDER=LSB2MSB;;
- *) FILLORDER=MSB2LSB;;
- esac
- fi
echo "#define HOST_FILLORDER FILLORDER_${FILLORDER}"
CPU=`echo $TARGET | sed 's/-.*//'`
Note "... using $FILLORDER bit order for your $CPU cpu"
@@ -865,7 +912,7 @@ BuildPortDotH()
echo 'typedef double dblparam_t;'
Note "... using double for promoted floating point parameters"
- if [ -z "$INLINE" ]; then
+ if [ -z "${INLINE:-}" ]; then
if [ $ISGCC = yes ]; then
echo '#ifdef __STRICT_ANSI__'
echo '#define INLINE __inline__'
@@ -884,62 +931,55 @@ BuildPortDotH()
echo '#define GLOBALDATA(TYPE,NAME) extern TYPE NAME'
- CheckFuncDecl strcasecmp \
- 'extern int strcasecmp(const char*, const char*);' string.h
CheckFuncDecl memset 'extern void* memset(void*, int, size_t);' string.h
CheckFuncDecl floor 'extern double floor(double);' math.h
CheckFuncDecl ceil 'extern double ceil(double);' math.h
CheckFuncDecl exp 'extern double exp(double);' math.h
CheckFuncDecl pow 'extern double pow(double);' math.h
- CheckFuncDecl unlink 'extern int unlink(const char*);' unistd.h
CheckFuncDecl read 'extern int read(int, const void*, unsigned int);' unistd.h
CheckFuncDecl malloc 'extern void* malloc(size_t);' stdlib.h
CheckFuncDecl realloc 'extern void* realloc(void*, size_t);' stdlib.h
CheckFuncDecl free 'extern void free(void*);' stdlib.h
- CheckFuncDecl strtoul \
- 'extern unsigned long strtoul(const char*, char**, int);' stdlib.h
- #
- # unistd.h is for sco3.2v4.[0-2] and GNU libc (yech!)
- #
- CheckFuncDecl getopt \
- 'extern int getopt(int, char* const*, const char*);' stdlib.h unistd.h
- CheckVarDecl 'char.*optarg' 'extern char* optarg;' stdlib.h unistd.h
- CheckVarDecl 'int.*opterr' 'extern int opterr;' stdlib.h unistd.h
- CheckVarDecl 'int.*optind' 'extern int optind;' stdlib.h unistd.h
EmitCPlusPlusEpilogue
)>xport.h
- mv xport.h port.h; chmod 444 port.h
- Note "Done creating port.h."
+ mv xport.h $PORTDOTH; chmod 444 $PORTDOTH
+ Note "Done creating $PORTDOTH."
}
-if test -f port.h && CheckPortDotH; then
+if test -f $PORTDOTH && CheckPortDotH; then
Note ""
- Note "Using previously created port.h."
+ Note "Using previously created $PORTDOTH."
else
- $RM xport.h t.c a.out port.h
+ $RM xport.h t.c a.out $PORTDOTH
BuildPortDotH
fi
-Note ""
-Note "Checking system libraries for functionality to emulate."
+if [ "$PORT" = auto ]; then
+ Note ""
+ Note "Checking system libraries for functionality to emulate."
-FUNCS="
- strcasecmp
- strtoul
- getopt
-"
+ FUNCS="
+ strcasecmp
+ strtoul
+ getopt
+ "
-for i in $FUNCS; do
- CheckForFunc $i || {
- Note "... emulate $i"
- PORTFUNCS="$PORTFUNCS $i.c"
- }
-done
-if [ "$PORTFUNCS" ]; then
- LIBPORT='${PORT}/libport.a'
- PORT=yes
-else
- PORT=no
+ for i in $FUNCS; do
+ CheckForFunc $i || {
+ Note "... emulate $i"
+ PORTFUNCS="${PORTFUNCS:-} $i.c"
+ }
+ done
+ if [ "${PORTFUNCS:-}" ]; then
+ LIBPORT='../port/libport.a'
+ PORT=yes
+ else
+ PORT=no
+ fi
+fi
+if [ $PORT != yes ] ; then
+ LIBPORT=
+ PORTFUNCS=
fi
Note "Done checking system libraries."
@@ -947,10 +987,18 @@ Note ""
Note "Checking for Dynamic Shared Object (DSO) support."
if [ "$DSO" = auto ]; then
case $TARGET in
+ *-irix5.2*)
+ if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
+ DSOSUF=so
+ DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
+ DSO=IRIX52
+ fi
+ ;;
*-irix*)
if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
DSOSUF=so
- DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/${PORT}/irix/so_locations -quickstart_info'
+ DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
+ DSO=IRIX
fi
;;
*) DSO=no;;
@@ -973,24 +1021,19 @@ EOF
"t: t.o; ${CCOMPILER} ${ENVOPTS} ${DSOOPTS} -o t.${DSOSUF} t.o" >/dev/null
}
if CheckCCDSO; then
- Note "Looks like your system supports SVR4-style DSOs."
- DSO=yes
+ Note "Looks like your system supports $DSO-style DSOs."
else
cat 1>&4 <<EOF
-Looks like your system supports SVR4-style DSOs...
+Looks like your system supports $DSO-style DSOs...
... sigh, but $CCOMPILER does not support DSOs in the expected way.
EOF
DSO=no
fi
fi
-Note "Done checking for DSO support."
-
if [ "$DSO" = no ]; then
- MAKEDSOINCLUDE='#'
DSOSUF=a DSOOPTS=
-else
- MAKEDSOINCLUDE="$MAKEINCLUDE"
fi
+Note "Done checking for DSO support."
Note ""
if [ "$LIBIMAGE" = auto ]; then
@@ -1017,15 +1060,15 @@ Note "Selecting programs used during installation."
#
# Miscellaneous ``little'' programs.
#
-test "$CHMOD" || CHMOD=`findAppDef chmod $PATH chmod`
-test "$LN" || LN=`findAppDef ln $PATH ln`
-test "$SED" || SED=`findAppDef sed $PATH sed`
-test "$STRIP" || STRIP=`findAppDef strip $PATH strip`
+test -z "${CHMOD:-}" && CHMOD=`findAppDef chmod $PATH chmod`
+test -z "${LN:-}" && LN=`findAppDef ln $PATH ln`
+test -z "${SED:-}" && SED=`findAppDef sed $PATH sed`
+test -z "${STRIP:-}" && STRIP=`findAppDef strip $PATH strip`
#
# Check if mv -f is supported
#
-if [ -z "$MV_F" ]; then
+if [ -z "${MV_F:-}" ]; then
$RM t.c; echo "">t.c
if mv -f t.c t.o; then
Note "Looks like mv supports the -f option to force a move."
@@ -1040,7 +1083,7 @@ fi
#
# Check if ln -s creates a symbolic link.
#
-if [ -z "$LN_S" ]; then
+if [ -z "${LN_S:-}" ]; then
$RM t.c; $LN -s foo t.c && LN_S=-s
fi
if [ -n "$LN_S" ]; then
@@ -1053,10 +1096,10 @@ fi
#
# Pick install mechanism.
#
-if [ -z "$INSTALL" ]; then
+if [ -z "${INSTALL:-}" ]; then
case $TARGET in
*-irix*) INSTALL=`findApp install /sbin:$PATH`;;
- *) INSTALL='${SHELL} ${PORT}/install.sh';;
+ *) INSTALL='${SHELL} ../port/install.sh';;
esac
fi
@@ -1095,7 +1138,7 @@ bitchExecutable()
# 4. Whether or not the FlexFAX ``F'' suffix must be
# stripped for pages to be found (only for 4F pages).
#
-if [ -z "$DIR_MAN" ]; then
+if [ -z "${DIR_MAN:-}" ]; then
MANPATH="
$MANPATH
/usr/local/man
@@ -1109,7 +1152,7 @@ if [ -z "$DIR_MAN" ]; then
test -z "$DIR_MAN" && DIR_MAN=/usr/local/man
fi
Note "Looks like manual pages go in $DIR_MAN."
-if [ -z "$MANSCHEME" ]; then
+if [ -z "${MANSCHEME:-}" ]; then
case $TARGET in
*-bsdi*|*-netbsd*) MANSCHEME=bsd-nroff-gzip-0.gz;;
*-freebsd*) MANSCHEME=bsd-source-cat;;
@@ -1173,7 +1216,7 @@ fi
promptForNonNullStringParameter()
{
x="" val="$1" desc="$2"
- while [ -z "$x" ]; do
+ while [ -z "${x:-}" ]; do
prompt "$desc [$val]?"; read x
if [ "$x" ]; then
# strip leading and trailing white space
@@ -1188,7 +1231,7 @@ promptForNonNullStringParameter()
promptForManPageScheme()
{
x=""
- while [ -z "$x" ]; do
+ while [ -z "${x:-}" ]; do
prompt "Manual page installation scheme [$MANSCHEME]?"; read x
if [ "$x" ]; then
# strip leading and trailing white space
@@ -1258,8 +1301,7 @@ TIFF configuration parameters are:
[ 2] Directory for libraries: $DIR_LIB
[ 3] Directory for include files: $DIR_INC
[ 4] Directory for manual pages: $DIR_MAN
-[ 5] Directory for HTML documentation: $DIR_HTML
-[ 6] Manual page installation scheme: $MANSCHEME
+[ 5] Manual page installation scheme: $MANSCHEME
EOF
}
@@ -1279,13 +1321,66 @@ promptForParameter()
4) promptForNonNullStringParameter "$DIR_MAN" \
"Directory to install manual pages"; DIR_MAN="$param"
;;
- 5) promptForNonNullStringParameter "$DIR_HTML" \
- "Directory to install HTML documentation"; DIR_HTML="$param"
- ;;
- 6) promptForManPageScheme;;
+ 5) promptForManPageScheme;;
esac
}
+checkJPEG()
+{
+ if [ "${JPEG}" = yes ]; then
+ test "`findHeader jpeglib.h`" || {
+ cat<<EOF
+
+The set of libtiff include directories,
+
+ DIRS_LIBINC=${DIRS_LIBINC}
+
+does not seem to be setup correctly; "jpeglib.h" was not found.
+This must be corrected if the JPEG support is to be enabled.
+Either fix the pathname or disable the JPEG support.
+
+EOF
+ }
+ test -d "${DIR_JPEGLIB}" || {
+ cat<<EOF
+
+The JPEG library directory, ${DIR_JPEGLIB}, does not seem to exist.
+This must be corrected if the JPEG support is to be enabled.
+Either fix the pathname or disable the JPEG support.
+
+EOF
+ }
+ fi
+}
+
+checkZIP()
+{
+ if [ "${ZIP}" = yes ]; then
+ test "`findHeader zlib.h`" || {
+ cat<<EOF
+
+The set of libtiff include directories,
+
+ DIRS_LIBINC=${DIRS_LIBINC}
+
+does not seem to be setup correctly; "zlib.h" was not found.
+This must be corrected if the (G)ZIP support is to be enabled.
+Either fix the pathname or disable the (G)ZIP support.
+
+EOF
+ }
+ test -d "${DIR_GZLIB}" || {
+ cat<<EOF
+
+The libgz source directory, ${DIR_GZLIB}, does not seem to be setup
+correctly. This must be corrected if the ZIP support is to be enabled.
+Either fix the pathname or disable the ZIP support.
+
+EOF
+ }
+ fi
+}
+
if [ $QUIET = no ]; then
ok=skip
while [ "$ok" != y ] && [ "$ok" != yes ]; do
@@ -1307,29 +1402,12 @@ if [ $QUIET = no ]; then
;;
esac
ok=skip
- if [ "${JPEG}" = yes ]; then
- test -d "${DIR_JPEG}" || {
- cat<<EOF
-
-The JPEG source directory, ${DIR_JPEG}, does not seem to be setup
-correctly. This must be corrected if the JPEG support is to be enabled.
-Either fix the pathname or disable the JPEG support.
-
-EOF
- }
- fi
- if [ "${ZIP}" = yes ]; then
- test -d "${DIR_LIBGZ}" || {
- cat<<EOF
-
-The libgz source directory, ${DIR_LIBGZ}, does not seem to be setup
-correctly. This must be corrected if the ZIP support is to be enabled.
-Either fix the pathname or disable the ZIP support.
-
-EOF
- }
- fi
done
+ checkJPEG
+ checkZIP
+else
+ checkJPEG
+ checkZIP
fi
case $MANSCHEME in
@@ -1338,6 +1416,7 @@ case $MANSCHEME in
esac
case $MANSCHEME in
*-strip) MANSEDLOCAL="-e s/3T/3/g";;
+*) MANSEDLOCAL="";;
esac
case $MANSCHEME in
*-source-*) MANCVT='${MANSED} $? >$@';;
@@ -1363,15 +1442,15 @@ case $MANSCHEME in
esac
if [ "${JPEG}" = yes ]; then
- test "$CONF_JPEG" || CONF_JPEG="-DJPEG_SUPPORT"
- test "$LIBJPEG" || LIBJPEG="\${JPEGDIR}/libjpeg.a"
+ test -z "${CONF_JPEG:-}" && CONF_JPEG="-DJPEG_SUPPORT"
+ test -z "${LIBJPEG:-}" && LIBJPEG="${DIR_JPEGLIB}/libjpeg.a"
else
CONF_JPEG=
LIBJPEG=
fi
if [ "${ZIP}" = yes ]; then
- test "$CONF_ZIP" || CONF_ZIP="-DZIP_SUPPORT"
- test "$LIBGZ" || LIBGZ="\${ZIPDIR}/libgz.a"
+ test -z "${CONF_ZIP:-}" && CONF_ZIP="-DZIP_SUPPORT"
+ test -z "${LIBGZ:-}" && LIBGZ="${DIR_GZLIB}/libz.a"
else
CONF_ZIP=
LIBGZ=
@@ -1379,42 +1458,90 @@ fi
Note ""
+#
+# Fixup a list of potentially relative pathnames
+# so that they work when used in a subdirectory.
+#
+relativize()
+{
+ if [ $SRCDIR_IS_LIBTIFF = no ]; then
+ (for i do
+ case "$i" in
+ ./*|../*) echo "../$i" ;;
+ *) echo "$i" ;;
+ esac
+ done) | tr '\012' ' '
+ else
+ echo "$@"
+ fi
+}
+#
+# Generate a list of compiler include options,
+# relativizing any relative pathnames.
+#
+makeIncArgs()
+{
+ (for i do
+ case "$i" in
+ ./*|../*)
+ if [ $SRCDIR_IS_LIBTIFF = yes ]; then
+ echo "-I$i"
+ else
+ echo "-I../$i"
+ fi ;;
+ *) echo "-I$i" ;;
+ esac
+ done) | tr '\012' ' '
+}
+
+#
+# Setup parameters needed below.
+#
+if [ $SRCDIR_IS_LIBTIFF = yes ]; then
+ CONFIGDIR="."
+ LIBSRCDIR="${SRCDIR}"
+else
+ CONFIGDIR=".."
+ LIBSRCDIR="../${SRCDIR}/libtiff"
+fi
+
# NB: these should be sorted alphabetically
cat>>confsed<<EOF
/@AR@/s;;${AR};g
+/@ALPHAFILE@/s;;`relativize ${ALPHAFILE}`;g
/@AROPTS@/s;;${AROPTS};g
+/@CONFIGDIR@/s;;${CONFIGDIR};g
/@CCOMPILER@/s;;${CCOMPILER};g
-/@CGIPATH@/s;;${CGIPATH};g
/@CHMOD@/s;;${CHMOD};g
/@CONF_JPEG@/s;;${CONF_JPEG};g
/@CONF_ZIP@/s;;${CONF_ZIP};g
+/@COPT_LIBINC@/s;;`makeIncArgs ${DIRS_LIBINC}`;g
/@DATE@/s;;${DATE};g
+/@DEPEND_JPEGLIB@/s;;${CONF_JPEG:+`findHeader jpeglib.h` `findHeader jerror.h`};g
+/@DEPEND_ZLIB@/s;;${CONF_ZIP:+`findHeader zlib.h` `findHeader zutil.h`};g
/@DIR_BIN@/s;;${DIR_BIN};g
-/@DIR_CGI@/s;;${DIR_CGI};g
-/@DIR_HTML@/s;;${DIR_HTML};g
-/@DIR_JPEG@/s;;${DIR_JPEG};g
-/@DIR_LIBGZ@/s;;${DIR_LIBGZ};g
+/@DIR_JPEGLIB@/s;;`relativize ${DIR_JPEGLIB}`;g
+/@DIR_GZLIB@/s;;`relativize ${DIR_GZLIB}`;g
/@DIR_INC@/s;;${DIR_INC};g
/@DIR_LIB@/s;;${DIR_LIB};g
/@DIR_MAN@/s;;${DIR_MAN};g
+/@DIRS_LIBINC@/s;;`relativize ${DIRS_LIBINC}`;g
/@DSO@/s;;${DSO};g
/@DSOOPTS@/s;;${DSOOPTS};g
/@DSOSUF@/s;;${DSOSUF};g
/@ENVOPTS@/s;;${ENVOPTS};g
/@FILLORDER@/s;;${FILLORDER};g
/@GCOPTS@/s;;${GCOPTS};g
-/@HTML@/s;;${HTML};g
-/@HTMLPATH@/s;;${HTMLPATH};g
/@INSTALL@/s;;${INSTALL};g
-/@LIBJPEG@/s;;${LIBJPEG};g
+/@LIBJPEG@/s;;`relativize ${LIBJPEG}`;g
/@LIBGL@/s;;${LIBGL};g
-/@LIBGZ@/s;;${LIBGZ};g
+/@LIBGZ@/s;;`relativize ${LIBGZ}`;g
+/@LIBSRCDIR@/s;;${LIBSRCDIR};g
/@LIBIMAGE@/s;;${LIBIMAGE};g
/@LIBPORT@/s;;${LIBPORT};g
/@LN@/s;;${LN};g
/@LN_S@/s;;${LN_S};g
/@MACHDEPLIBS@/s;;${MACHDEPLIBS};g
-/@MAKEDSOINCLUDE@/s;;${MAKEDSOINCLUDE};g
/@MANAPPS@/s;;${MANAPPS};g
/@MANAPPNAME@/s;;${MANAPPNAME};g
/@MANLIBNAME@/s;;${MANLIBNAME};g
@@ -1431,8 +1558,8 @@ cat>>confsed<<EOF
/@STRIP@/s;;${STRIP};g
/@TARGET@/s;;${TARGET};g
/@VERSION@/s;;${VERSION};g
+/@VERSIONFILE@/s;;`relativize ${VERSIONFILE}`;g
/@WARNING@/s;;Warning, this file was automatically created by the TIFF configure script;g
-
EOF
SedConfigFiles()
@@ -1488,21 +1615,18 @@ EOF
#
# port/install.sh is the SGI install program emulator script.
#
-CONF_FILES="
- Makefile
- libtiff/Makefile
- man/Makefile
- tools/Makefile
- port/install.sh
-"
+CONF_FILES="Makefile"
+if [ $SRCDIR_IS_LIBTIFF != yes ] ; then
+ CONF_FILES="$CONF_FILES
+ libtiff/Makefile
+ man/Makefile
+ tools/Makefile
+ port/install.sh
+ "
+fi
+
SedConfigFiles $CONF_FILES
test $PORT = yes && SedConfigFiles port/Makefile
-test $HTML = yes && SedConfigFiles html/Makefile
-
-#
-# NB: the dist directory is needed only when building SGI inst images.
-#
-test -d dist || mkdir dist
Note "Done."
diff --git a/contrib/acorn/ReadMe b/contrib/acorn/ReadMe
new file mode 100755
index 00000000..dc16a79d
--- /dev/null
+++ b/contrib/acorn/ReadMe
@@ -0,0 +1,79 @@
+Building the Software on an Acorn RISC OS system
+
+The directory contrib/acorn contains support for compiling the library under
+Acorn C/C++ under Acorn's RISC OS 3.10 or above. Subsequent pathnames will
+use the Acorn format: The full-stop or period character is a pathname
+delimeter, and the slash character is not interpreted; the reverse position
+from Unix. Thus "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
+
+This support was contributed by Peter Greenham.
+(peterg@angmulti.demon.co.uk).
+
+Installing LibTIFF:
+
+LIBTIFF uses several files which have names longer than the normal RISC OS
+maximum of ten characters. This complicates matters. Maybe one day Acorn will
+address the problem and implement long filenames properly. Until then this
+gets messy, especially as I'm trying to do this with obeyfiles and not have
+to include binaries in this distribution.
+
+First of all, ensure you have Truncate configured on (type *Configure
+Truncate On) Although it is, of course, preferable to have long filenames,
+LIBTIFF can be installed with short filenames, and it will compile and link
+without problems. However, getting it there is more problematic.
+contrib.acorn.install is an installation obeyfile which will create a normal
+Acorn-style library from the source (ie: with c, h and o folders etc.), but
+needs the distribution library to have been unpacked into a location which is
+capable of supporting long filenames, even if only temporarily.
+
+My recommendation, until Acorn address this problem properly, is to use Jason
+Tribbeck's LongFilenames , or any other working system that gives you long
+filenames, like a nearby NFS server for instance.
+
+If you are using Longfilenames, even if only temporarily to install LIBTIFF,
+unpack the TAR into a RAMDisc which has been longfilenamed (ie: *addlongfs
+ram) and then install from there to the hard disk. Unfortunately
+Longfilenames seems a bit unhappy about copying a bunch of long-named files
+across the same filing system, but is happy going between systems. You'll
+need to create a ramdisk of about 2Mb.
+
+Now you can run the installation script I've supplied (in contrib.acorn),
+which will automate the process of installing LIBTIFF as an Acorn-style
+library. The syntax is as follows:
+
+install <source_dir> <dest_dir>
+
+Install will then create <dest_dir> and put the library in there. For
+example, having used LongFilenames on the RAMDisk and unpacked the library
+into there, you can then type:
+
+Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$ ADFS::4.$.LIBTIFF
+
+It doesn't matter if the destination location can cope with long filenames or
+not. The filenames will be truncated if necessary (*Configure Truncate On if
+you get errors) and all will be well.
+
+Compiling LibTIFF:
+
+Once the LibTIFF folder has been created and the files put inside, making the
+library should be just a matter of running 'SetVars' to set the appropriate
+system variables, then running 'Makefile'.
+
+OSLib
+
+OSLib is a comprehensive API for RISC OS machines, written by Jonathan
+Coxhead of Acorn Computers (although OSLib is not an official Acorn product).
+Using the OSLib SWI veneers produces code which is more compact and more
+efficient than code written using _kernel_swi or _swi. The Acorn port of
+LibTIFF can take advantage of this if present. Edit the Makefile and go to
+the Static dependencies section. The first entry is:
+
+# Static dependencies:
+@.o.tif_acorn: @.c.tif_acorn
+ cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
+Change the cc line to:
+
+ cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
+
+Remember, however, that OSLib is only recommended for efficiency's sake. It
+is not required.
diff --git a/contrib/acorn/SetVars b/contrib/acorn/SetVars
new file mode 100755
index 00000000..ea12d71d
--- /dev/null
+++ b/contrib/acorn/SetVars
@@ -0,0 +1,3 @@
+Set LibTIFF$Dir <Obey$Dir>
+Set LibTIFF$Path <LibTIFF$Dir>.
+Set C$Path <C$Path>,LibTIFF:
diff --git a/contrib/acorn/convert b/contrib/acorn/convert
new file mode 100755
index 00000000..1f64ed20
--- /dev/null
+++ b/contrib/acorn/convert
@@ -0,0 +1,175 @@
+RISC OS Conversion log
+======================
+
+mkversion.c
+~~~~~~~~~~~
+The RISC OS command-line does not allow the direct creation of the version.h
+file in the proper manner. To remedy this in such a way that the version
+header is made at compiletime, I wrote this small program. It is fully
+portable, so should work quite happily for any other platform that might need
+it.
+
+msg3states.c
+~~~~~~~~~~~~
+Needed getopt.c from the port folder, then compiled and worked fine.
+
+
+tiff.h
+~~~~~~
+
+====1====
+
+The symbol _MIPS_SZLONG, if not defined, causes a compiler error. Fixed by
+ensuring it does exist. This looks to me like this wouldn't be an
+Acorn-specific problem. The new code fragment is as follows:
+
+#ifndef _MIPS_SZLONG
+#define _MIPS_SZLONG 32
+#endif
+#if defined(__alpha) || _MIPS_SZLONG == 64
+
+
+
+tiffcomp.h
+~~~~~~~~~~
+
+====1====
+
+#if !defined(__MWERKS__) && !defined(THINK_C)
+#include <sys/types.h>
+#endif
+
+Acorn also doesn't have this header so:
+
+#if !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acorn)
+#include <sys/types.h>
+#endif
+
+====2====
+
+#ifdef VMS
+#include <file.h>
+#include <unixio.h>
+#else
+#include <fcntl.h>
+#endif
+
+This seems to indicate that fcntl.h is included on all systems except
+VMS. Odd, because I've never heard of it before. Sure it's in the ANSI
+definition? Anyway, following change:
+
+#ifdef VMS
+#include <file.h>
+#include <unixio.h>
+#else
+#ifndef __acorn
+#include <fcntl.h>
+#endif
+#endif
+
+This will probably change when I find out what it wants from fcntl.h!
+
+====3====
+
+#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
+#include <stdlib.h>
+#define BSDTYPES
+#endif
+
+Added RISC OS to above thus:
+
+#if defined(__MWERKS__) || defined(THINK_C) || defined(applec) || defined(__acorn)
+#include <stdlib.h>
+#define BSDTYPES
+#endif
+
+====4====
+
+/*
+ * The library uses the ANSI C/POSIX SEEK_*
+ * definitions that should be defined in unistd.h
+ * (except on VMS where they are in stdio.h and
+ * there is no unistd.h).
+ */
+#ifndef SEEK_SET
+#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
+#include <unistd.h>
+#endif
+
+RISC OS is like VMS and Mac in this regard. So changed to:
+
+/*
+ * The library uses the ANSI C/POSIX SEEK_*
+ * definitions that should be defined in unistd.h
+ * (except on VMS or the Mac or RISC OS, where they are in stdio.h and
+ * there is no unistd.h).
+ */
+#ifndef SEEK_SET
+#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__) && !defined(__acorn)
+#include <unistd.h>
+#endif
+#endif
+
+====5====
+
+NB: HAVE_IEEEFP is defined in tiffconf.h, not tiffcomp.h as mentioned
+in libtiff.README. (Note written on original port from 3.4beta004)
+
+Acorn C/C++ claims to accord with IEEE 754, so no change (yet) to
+tiffconf.h.
+
+====6====
+
+Unsure about whether this compiler supports inline functions. Will
+leave it on for the time being and see if it works! (Likely if
+everything else does.)
+
+... Seems to be OK ...
+
+====7====
+
+Added to the end:
+
+/*
+ * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
+ * on C alone. For that reason, the relevant functions have been
+ * implemented by myself in tif_acorn.c, and the elements from the header
+ * included here.
+ */
+
+#ifdef __acorn
+#ifdef __cplusplus
+#include <osfcn.h>
+#else
+#include "kernel.h"
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR 2
+#define O_APPEND 8
+#define O_CREAT 0x200
+#define O_TRUNC 0x400
+typedef long off_t;
+extern int open(const char *name, int flags, int mode);
+extern int close(int fd);
+extern int write(int fd, const char *buf, int nbytes);
+extern int read(int fd, char *buf, int nbytes);
+extern off_t lseek(int fd, off_t offset, int whence);
+#endif
+#endif
+
+
+===============================================================================
+
+tif_acorn.c
+~~~~~~~~~~~
+
+Created file tif_acorn.c, copied initially from tif_unix.c
+
+Documented internally where necessary.
+
+Note that I have implemented the low-level file-handling functions normally
+found in osfcn.h in here, and put the header info at the bottom of
+tiffcomp.h. This is further documented from a RISC OS perspective inside the
+file.
+
+===============================================================================
diff --git a/contrib/acorn/install b/contrib/acorn/install
new file mode 100755
index 00000000..fd0f3919
--- /dev/null
+++ b/contrib/acorn/install
@@ -0,0 +1,124 @@
+If "%0" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
+If "%1" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
+Set LibTiffInstall$Dir %0
+Set LibTiff$Dir %1
+Set Alias$CPY Copy <LibTiffInstall$Dir>.%%0 <LibTiff$Dir>.%%1 ~C~DF~NQRV
+CDir <LibTiff$Dir>
+CDir <LibTiff$Dir>.c
+CDir <LibTiff$Dir>.h
+CDir <LibTiff$Dir>.o
+CPY COPYRIGHT COPYRIGHT
+CPY README README
+CPY VERSION VERSION
+CPY contrib.acorn.SetVars SetVars
+CPY port.getopt/c c.getopt
+CPY libtiff.Makefile/acorn Makefile
+CPY libtiff.mkg3states/c c.mkg3states
+CPY libtiff.mkspans/c c.mkspans
+CPY libtiff.mkversion/c c.mkversion
+CPY libtiff.tif_acorn/c c.tif_acorn
+CPY libtiff.tif_aux/c c.tif_aux
+CPY libtiff.tif_close/c c.tif_close
+CPY libtiff.tif_codec/c c.tif_codec
+CPY libtiff.tif_compress/c c.tif_compre
+CPY libtiff.tif_dir/c c.tif_dir
+CPY libtiff.tif_dirinfo/c c.tif_dirinf
+CPY libtiff.tif_dirread/c c.tif_dirrea
+CPY libtiff.tif_dirwrite/c c.tif_dirwri
+CPY libtiff.tif_dumpmode/c c.tif_dumpmo
+CPY libtiff.tif_error/c c.tif_error
+CPY libtiff.tif_fax3/c c.tif_fax3
+CPY libtiff.tif_flush/c c.tif_flush
+CPY libtiff.tif_getimage/c c.tif_getima
+CPY libtiff.tif_jpeg/c c.tif_jpeg
+CPY libtiff.tif_lzw/c c.tif_lzw
+CPY libtiff.tif_next/c c.tif_next
+CPY libtiff.tif_open/c c.tif_open
+CPY libtiff.tif_packbits/c c.tif_packbi
+CPY libtiff.tif_predict/c c.tif_predic
+CPY libtiff.tif_print/c c.tif_print
+CPY libtiff.tif_read/c c.tif_read
+CPY libtiff.tif_strip/c c.tif_strip
+CPY libtiff.tif_swab/c c.tif_swab
+CPY libtiff.tif_thunder/c c.tif_thunde
+CPY libtiff.tif_tile/c c.tif_tile
+CPY libtiff.tif_version/c c.tif_versio
+CPY libtiff.tif_warning/c c.tif_warnin
+CPY libtiff.tif_write/c c.tif_write
+CPY libtiff.tif_zip/c c.tif_zip
+CPY libtiff.t4/h h.t4
+CPY libtiff.tiff/h h.tiff
+CPY libtiff.tiffcomp/h h.tiffcomp
+CPY libtiff.tiffconf/h h.tiffconf
+CPY libtiff.tiffio/h h.tiffio
+CPY libtiff.tiffiop/h h.tiffiop
+CPY libtiff.tif_dir/h h.tif_dir
+CPY libtiff.tif_fax3/h h.tif_fax3
+CPY libtiff.tif_predict/h h.tif_predic
+SetType <LibTiff$Dir>.COPYRIGHT Text
+SetType <LibTiff$Dir>.README Text
+SetType <LibTiff$Dir>.VERSION Text
+SetType <LibTiff$Dir>.SetVars Obey
+SetType <LibTiff$Dir>.Makefile fe1
+SetType <LibTiff$Dir>.c.getopt Text
+SetType <LibTiff$Dir>.c.mkg3states Text
+SetType <LibTiff$Dir>.c.mkspans Text
+SetType <LibTiff$Dir>.c.mkversion Text
+SetType <LibTiff$Dir>.c.tif_acorn Text
+SetType <LibTiff$Dir>.c.tif_aux Text
+SetType <LibTiff$Dir>.c.tif_close Text
+SetType <LibTiff$Dir>.c.tif_codec Text
+SetType <LibTiff$Dir>.c.tif_compre Text
+SetType <LibTiff$Dir>.c.tif_dir Text
+SetType <LibTiff$Dir>.c.tif_dirinf Text
+SetType <LibTiff$Dir>.c.tif_dirrea Text
+SetType <LibTiff$Dir>.c.tif_dirwri Text
+SetType <LibTiff$Dir>.c.tif_dumpmo Text
+SetType <LibTiff$Dir>.c.tif_error Text
+SetType <LibTiff$Dir>.c.tif_fax3 Text
+SetType <LibTiff$Dir>.c.tif_flush Text
+SetType <LibTiff$Dir>.c.tif_getima Text
+SetType <LibTiff$Dir>.c.tif_jpeg Text
+SetType <LibTiff$Dir>.c.tif_lzw Text
+SetType <LibTiff$Dir>.c.tif_next Text
+SetType <LibTiff$Dir>.c.tif_open Text
+SetType <LibTiff$Dir>.c.tif_packbi Text
+SetType <LibTiff$Dir>.c.tif_predic Text
+SetType <LibTiff$Dir>.c.tif_print Text
+SetType <LibTiff$Dir>.c.tif_read Text
+SetType <LibTiff$Dir>.c.tif_strip Text
+SetType <LibTiff$Dir>.c.tif_swab Text
+SetType <LibTiff$Dir>.c.tif_thunde Text
+SetType <LibTiff$Dir>.c.tif_tile Text
+SetType <LibTiff$Dir>.c.tif_versio Text
+SetType <LibTiff$Dir>.c.tif_warnin Text
+SetType <LibTiff$Dir>.c.tif_write Text
+SetType <LibTiff$Dir>.c.tif_zip Text
+SetType <LibTiff$Dir>.h.t4 Text
+SetType <LibTiff$Dir>.h.tiff Text
+SetType <LibTiff$Dir>.h.tiffcomp Text
+SetType <LibTiff$Dir>.h.tiffconf Text
+SetType <LibTiff$Dir>.h.tiffio Text
+SetType <LibTiff$Dir>.h.tiffiop Text
+SetType <LibTiff$Dir>.h.tif_dir Text
+SetType <LibTiff$Dir>.h.tif_fax3 Text
+SetType <LibTiff$Dir>.h.tif_predic Text
+Unset Alias$CPY
+Unset LibTiffInstall$Dir
+| Now attempt to restore longfilename status. If it causes an error, OK.
+Set Alias$RN Rename <LibTiff$Dir>.%%0 <LibTiff$Dir>.%%1
+Unset LibTiff$Dir
+RN c.tif_compre c.tif_compress
+RN c.tif_dirinf c.tif_dirinfo
+RN c.tif_dirrea c.tif_dirread
+RN c.tif_dirwri c.tif_dirwrite
+RN c.tif_dumpmo c.tif_dumpmode
+RN c.tif_getima c.tif_getimage
+RN c.tif_packbi c.tif_packbits
+RN c.tif_predic c.tif_predict
+RN c.tif_thunde c.tif_thunder
+RN c.tif_versio c.tif_version
+RN c.tif_warnin c.tif_warning
+RN h.tif_predic h.tif_predict
+Unset Alias$RN
+Echo All done!
diff --git a/contrib/vms/libtiff/tiffshraxp.opt b/contrib/vms/libtiff/tiffshraxp.opt
index fbf029e2..94e6abb4 100755
--- a/contrib/vms/libtiff/tiffshraxp.opt
+++ b/contrib/vms/libtiff/tiffshraxp.opt
Binary files differ
diff --git a/contrib/win32/README b/contrib/win32/README
new file mode 100644
index 00000000..649f829e
--- /dev/null
+++ b/contrib/win32/README
@@ -0,0 +1,111 @@
+This mail from Scott describes changes to the library that I have
+not made because I couldn't figure out exactly where they went.
+Anything not in this file has either been placed in the appropriate
+directory (e.g. libtiff/tif_win32.c) or applied to the current
+source code (e.g. libtiff/tiffiop.h).
+
+Note that the Window NT/Window 95 support is untested; Scott's work
+was done with an earlier version of the library. Hopefully this'll
+get cleaned up soon.
+
+ Sam
+
+Date: Fri, 14 Apr 95 17:01:42 EDT
+From: wagner@itek.com (scott wagner)
+Message-Id: <9504142101.AA00764@cyan.>
+To: sam@cthulhu.engr.sgi.com
+Subject: Re: Libtiff for Win32 (Windows NT / Windows 95)
+
+Hi, Sam!
+
+Enclosed are my libtiff for win32 pieces. They are in the form of 3 files
+(tif_w32.c, dllshell.c, and libtiff.def), and 2 diffs (for tiffiop.h and
+tiffio.h).
+
+Hope this is not too difficult to separate!
+
+Regards,
+Scott Wagner (wagner@itek.com)
+
+tif_w32.c ---------------------------------------------------------------
+
+tiffiop.h ---------------------------------------------------------------
+
+tiffio.h ---------------------------------------------------------------
+38a39
+> #ifdef _TIFFIOP_
+39a41,43
+> #else
+> typedef void TIFF; /* Avoid ANSI undefined structure warning */
+> #endif
+66a71,75
+> #ifdef WIN32 /* WIN32 identifies Win32 compiles */
+> #pragma warn -sig /* Turn off Borland warn of long to short int convert */
+> #pragma warn -par /* Turn off Borland warn "Parameter x is never used" */
+> DECLARE_HANDLE(thandle_t); /* Win32 file handle */
+> #else /* if not WIN32_ */
+67a77
+> #endif /* defined WIN32 */
+
+(Message tiff:1396)
+ -- using template mhl.format --
+Date: Mon, 17 Apr 1995 07:51:03 EDT
+To: sam@cthulhu.engr.sgi.com
+
+From: wagner@itek.com (scott wagner)
+Subject: Libtiff for Win32
+
+Return-Path: sam@flake.asd.sgi.com
+Delivery-Date: Mon, 17 Apr 1995 05:36:50 PDT
+Return-Path: sam@flake.asd.sgi.com
+
+Hello, Sam!
+
+> ... libtiff for win32 pieces. They are in the form of 3 files
+> (tif_w32.c, dllshell.c, and libtiff.def), and 2 diffs (for tiffiop.h and
+> tiffio.h).
+>
+> I don't understand how these pieces fit together. Can you please explain
+> what dllshell.c and libtiff.def are for?
+
+Sorry I was short on documentation here ... I was rushing to get home to
+dinner on Friday and the material for you was the last loose end I had to
+deal with. Excuses aside ...
+
+The goal of the adaptation of libtiff to Win32 was to replace only one
+environment-specific code module and to make minimal changes to header
+files. tif_win32.c required one addition to tiffio.h (the
+DECLARE_HANDLE line, which is probably a better way to typedef thandle-t
+under Windows 3.1 as well); it also required the addition of pv_map_handle
+to the tiff structure and the conditional definition of the
+TIFFUnmapFileContents macro in tiffiop.h (this because Win32 uses a handle
+and a pointer in mapping memory, and I needed to save both).
+
+Additionally, I made a general style change to tiffio.h. If tiffio.h is
+included by a client, which does not include tiffiop.h, then ANSI compilers
+warn about the typedef of TIFF to a non-existent structure. To avoid this,
+I changed the typedef of TIFF in this case to void.
+
+I also made a style change in the tiff structure. All references to tif_fd
+in the library treat it as int, yet the tif_fd member itself is short. I
+changed this member to int and added the reserved member to maintain
+32-bit structure member alignment in a 32 bit environment. [ At cost of
+4 more bytes in an already bloated structure! :-) ] As long as fd's are
+less than 64k, the old member works; this is not the case in Win32, and is
+not generally a safe assumption.
+
+The module dllshell.c and the file libtiff.def are not specific to the
+functionality of libtiff; they are used to make a Win32 dynamic link
+library, and would be best packaged with a Win32 makefile, which I have
+not yet perfected. I will, however, commit to a Borland and Microsoft C
+makefile for libtiff; perhaps these two could be combined with the
+makefile for the _next_ (!) release of libtiff when it is ready.
+
+Once again, sorry for the confused message on Friday. I hope that at
+least tif_w32 and the tiffio.h and tiffiop.h diffs will be useful for
+this release.
+
+Regards,
+Scott Wagner (wagner@itek.com)
+Itek Graphix
+Rochester, NY
diff --git a/contrib/win32/dllshell.c b/contrib/win32/dllshell.c
new file mode 100644
index 00000000..839ebdb5
--- /dev/null
+++ b/contrib/win32/dllshell.c
@@ -0,0 +1,38 @@
+dllshell.c ---------------------------------------------------------------
+#define STRICT
+#include <windows.h>
+#pragma hdrstop
+
+#pragma argsused
+
+/* DLL has an entry point LibMain || DllEntryPoint and an exit point WEP. */
+
+#if defined(__FLAT__)
+
+BOOL WINAPI DllEntryPoint(HINSTANCE hinstDll, DWORD fdwRreason,
+ LPVOID plvReserved)
+{
+ return 1; /* Indicate that the DLL was initialized successfully. */
+}
+
+#else /* not flat model */
+
+int FAR PASCAL LibMain(HINSTANCE hInstance, WORD wDataSegment, WORD wHeapSize,
+ LPSTR lpszCmdLine)
+{
+/* The startup code for the DLL initializes the local heap(if there is one)
+ with a call to LocalInit which locks the data segment. */
+
+ if ( wHeapSize != 0 )
+ UnlockData( 0 );
+ return 1; /* Indicate that the DLL was initialized successfully. */
+}
+
+#endif /* __FLAT */
+
+#pragma argsused
+
+int FAR PASCAL WEP ( int bSystemExit )
+{
+ return 1;
+}
diff --git a/contrib/win32/libtiff.def b/contrib/win32/libtiff.def
new file mode 100644
index 00000000..7f41bed3
--- /dev/null
+++ b/contrib/win32/libtiff.def
@@ -0,0 +1,72 @@
+LIBRARY LIBTIFF
+EXETYPE WINDOWS
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE
+HEAPSIZE 4096
+STACKSIZE 8192
+EXPORTS
+_TIFFGetVersion @1
+_TIFFClose @2
+_TIFFFlush @3
+_TIFFFlushData @4
+_TIFFGetField @5
+_TIFFVGetField @6
+_TIFFGetFieldDefaulted @7
+_TIFFVGetFieldDefaulted @8
+_TIFFReadDirectory @9
+_TIFFScanlineSize @10
+_TIFFStripSize @11
+_TIFFVStripSize @12
+_TIFFTileRowSize @13
+_TIFFTileSize @14
+_TIFFVTileSize @15
+_TIFFFileno @16
+_TIFFGetMode @17
+_TIFFIsTiled @18
+_TIFFIsByteSwapped @19
+_TIFFCurrentRow @20
+_TIFFCurrentDirectory @21
+_TIFFCurrentStrip @22
+_TIFFCurrentTile @23
+_TIFFReadBufferSetup @24
+_TIFFLastDirectory @25
+_TIFFSetDirectory @26
+_TIFFSetSubDirectory @27
+_TIFFUnlinkDirectory @28
+_TIFFSetField @29
+_TIFFVSetField @30
+_TIFFWriteDirectory @31
+_TIFFReadScanline @32
+_TIFFWriteScanline @33
+_TIFFReadRGBAImage @34
+_TIFFOpen @35
+_TIFFFdOpen @36
+_TIFFClientOpen @37
+_TIFFFileName @38
+_TIFFError @39
+_TIFFWarning @40
+_TIFFSetErrorHandler @41
+_TIFFSetWarningHandler @42
+_TIFFComputeTile @43
+_TIFFCheckTile @44
+_TIFFNumberOfTiles @45
+_TIFFReadTile @46
+_TIFFWriteTile @47
+_TIFFComputeStrip @48
+_TIFFNumberOfStrips @49
+_TIFFReadEncodedStrip @50
+_TIFFReadRawStrip @51
+_TIFFReadEncodedTile @52
+_TIFFReadRawTile @53
+_TIFFWriteEncodedStrip @54
+_TIFFWriteRawStrip @55
+_TIFFWriteEncodedTile @56
+_TIFFWriteRawTile @57
+_TIFFSetWriteOffset @58
+_TIFFSwabShort @59
+_TIFFSwabLong @60
+_TIFFSwabArrayOfShort @61
+_TIFFSwabArrayOfLong @62
+_TIFFReverseBits @63
+_TIFFGetBitRevTable @64
+_TIFFModeCCITTFax3 @65
diff --git a/dist/tiff.alpha b/dist/tiff.alpha
index 86878704..0fe3f9f2 100644
--- a/dist/tiff.alpha
+++ b/dist/tiff.alpha
@@ -1 +1 @@
-define ALPHA 018
+define ALPHA 024
diff --git a/html/Makefile.in b/html/Makefile.in
index c6a70530..d11bce14 100644
--- a/html/Makefile.in
+++ b/html/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.4 1995/07/19 01:54:06 sam Exp $
+# $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.5 1995/10/10 16:56:09 sam Exp $
#
# @WARNING@
#
@@ -64,6 +64,7 @@ HTMLFILES=\
v3.4beta007.html \
v3.4beta016.html \
v3.4beta018.html \
+ v3.4beta024.html \
${NULL}
IMAGES=\
images/back.gif \
diff --git a/html/build.html b/html/build.html
index 111674ca..362678f0 100644
--- a/html/build.html
+++ b/html/build.html
@@ -23,6 +23,7 @@ for viewing with version 1.1 or newer of the
<LI><A HREf=#Mac>Building on a Macintosh system</A>.
<LI><A HREF=#PC>Building on an MS-DOS or Windows system</A>.
<LI><A HREF=#VMS>Building on a VMS system</A>.
+<LI><A HREF=#Acorn>Building on an Acorn RISC OS system</A>.
<LI><A HREF=#Other>Building the Software on Other Systems</A>
</UL>
@@ -107,14 +108,7 @@ This second scheme is useful for:
Beware that if you choose to use the second scheme for configuring
the software you must not use an absolute pathname when you run configure
-(i.e. a pathname that begins with ``/'') and the make that you use
-to build the software must correctly support the VPATH facility.
-
-<P>
-<IMG SRC="images/warning.gif" ALT="NOTE: " ALIGN=left HSPACE=8>
-<B>HPUX 9.05</B>:
- <EM>The standard make incorrectly processes VPATH; either use gmake
- or configure builds in the source tree.</EM>
+(i.e. a pathname that begins with ``/'').
<A NAME="ConfigFiles"><P><HR WIDTH=65% ALIGN=right><H3>Configuration Files</H3></A>
@@ -178,7 +172,6 @@ distributed as part of the BSDI 1.1 distribution:
DIR_BIN="/usr/contrib/bin" # directory for client apps
DIR_LIB="/usr/contrib/lib" # directory for libraries
DIR_MAN="/usr/contrib/man" # directory for manual pages
-DIR_HTML="/usr/contrib/html/tiff" # directory for HTML documentation
</PRE>
<P>
@@ -211,20 +204,12 @@ If DSO support is <EM>explicitly enabled</EM> and there is no
support for using DSOs in the expected way then DSOs are not used.
<P>
-<DT><I>HTML Package</I>
-<DD>The <TT>HTML</TT> package contains this HTML documentation about TIFF.
-By default this package is not configured for installation
-since HTML documentation can be viewed directly from
-the source directory.
-You may want to configure the installation of the HTML materials
-if these documents are going to be shared by many people.
-
-<P>
<DT><I>JPEG Support</I>
<DD>The <TT>JPEG</TT> package enables support for the handling
of TIFF images with JPEG-encoded data.
Support for JPEG-encoded data requires the Independent JPEG Group (IJG)
-<TT>libjpeg</TT> distribution.
+<TT>libjpeg</TT> distribution; this software is available at
+<A HREF=ftp://ftp.uu.net/graphics/jpeg/>ftp.uu.net:/graphics/jpeg/</A>.
By default JPEG support is not configured.
<P>
@@ -232,7 +217,10 @@ By default JPEG support is not configured.
<DD>The <TT>ZIP</TT> support enables support for the handling
of TIFF images with deflate-encoded data.
Support for deflate-encoded data requires the freely available
-<TT>zlib</TT> distribution written by Jean-loup Gailly and Mark Adler.
+<TT>zlib</TT> distribution written by Jean-loup Gailly and Mark Adler;
+this software is available at
+<A HREF=ftp://ftp.uu.net/pub/archiving/zip/zlib/>ftp.uu.net:/pub/archiving/zip/zlib/</A>
+(or try <A HREF=ftp://quest.jpl.nasa.gov/beta/zlib/>quest.jpl.nasa.gov:/beta/zlib/</A>).
By default this package is not configured.
</DL>
@@ -288,12 +276,10 @@ If a C compiler requires options to enable ANSI C compilation, they
can be specified with the <TT>ENVOPTS</TT> parameter.</EM>
<P>
-Once a compiler is selected configure does several checks to see:
-<UL>
-<LI>if the compiler accepts a -g option to enable the generation
+Once a compiler is selected configure checks to see
+if the compiler accepts a -g option to enable the generation
of debugging symbols, and
-<LI>if the compiler includes an ANSI C preprocessor.
-</UL>
+if the compiler includes an ANSI C preprocessor.
<UL><PRE><TT>
Using /usr/ucb/make to configure the software.
@@ -307,20 +293,21 @@ automatically included it can be specified by setting the
<P><I>Creating port.h.</I>
The <B>port.h</B> file is included by all the C code
-in the system. It includes definitions for functions and type
+in the library (but not the tools).
+It includes definitions for functions and type
definitions that are missing from system include files, <TT>#defines</TT>
to enable or disable system-specific functionality, and other
odds and ends.
<UL><PRE><TT>
-Creating port.h with necessary definitions.
+Creating libtiff/port.h with necessary definitions.
... using LSB2MSB bit order for your i386 cpu
... using big-endian byte order for your i386 cpu
... configure use of mmap for memory-mapped files
-... O_RDONLY is in <fcntl.h>
+... O_RDONLY is in &lt;fcntl.h&gt;
... using double for promoted floating point parameters
... enabling use of inline functions
-Done creating port.h.
+Done creating libtiff/port.h.
</TT></PRE></UL>
This file can take a long time to create so configure
@@ -332,7 +319,7 @@ of the build tree will remove the <B>port.h</B> file (along
with all the other files generated by configure).
<P><I>Selecting emulated library functions.</I>
-Certain functions used by the software are not present on all systems
+Certain library functions used by the tools are not present on all systems
and can be emulated using other system functionality.
configure checks for the presence of such functions and if they are
missing, will configure emulation code from the <B>port</B> directory
@@ -394,8 +381,7 @@ TIFF configuration parameters are:
[ 2] Directory for libraries: /usr/contrib/lib
[ 3] Directory for include files: /usr/contrib/include
[ 4] Directory for manual pages: /usr/contrib/man
-[ 5] Directory for HTML documentation: /var/httpd/htdocs/tiff
-[ 6] Manual page installation scheme: bsd-nroff-gzip-0.gz
+[ 5] Manual page installation scheme: bsd-nroff-gzip-0.gz
Are these ok [yes]?
</TT></PRE></UL>
@@ -454,14 +440,6 @@ default this is <B>/usr/local/bin</B>.</TD>
</TR>
<TR>
-<TD VALIGN=top><TT>DIR_HTML</TT></TD>
-<TD>The directory where HTML-based
-documentation should be installed; by default this is
-<B>/var/httpd/htdocs/tiff</B> (usually appropriate for the
-NCSA HTTP server).</TD>
-</TR>
-
-<TR>
<TD VALIGN=top><TT>DIR_LIB</TT></TD>
<TD>The directory to install libraries and DSO's; by default
this is <B>/usr/local/lib</B>.</TD>
@@ -751,6 +729,112 @@ means that
should not be used.
+<A NAME=Acorn><P><HR><H2>Building the Software on an Acorn RISC OS system</H2></A>
+
+The directory <B>contrib/acorn</B> contains support for compiling the library
+under Acorn C/C++ under Acorn's RISC OS 3.10 or above. Subsequent pathnames
+will use the Acorn format: The full-stop or period character is a pathname
+delimeter, and the slash character is not interpreted; the reverse position
+from Unix. Thus "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
+
+<P>
+This support was contributed by Peter Greenham. (<A HREF=mailto:peter@enlarion.demon.co.uk>peter@enlarion.demon.co.uk</A>).
+
+<P>
+<H3>Installing LibTIFF:</H3>
+
+<P>
+LIBTIFF uses several files which have names longer than the normal RISC OS
+maximum of ten characters. This complicates matters. Maybe one day Acorn will
+address the problem and implement long filenames properly. Until then this
+gets messy, especially as I'm trying to do this with obeyfiles and not have
+to include binaries in this distribution.
+
+<P>
+First of all, ensure you have Truncate configured on (type <TT>*Configure
+Truncate On</TT>)
+
+<P>
+Although it is, of course, preferable to have long filenames, LIBTIFF can be
+installed with short filenames, and it will compile and link without
+problems. However, <I>getting</I> it there is more problematic.
+<B>contrib.acorn.install</B> is an installation obeyfile which will create a normal
+Acorn-style library from the source (ie: with c, h and o folders etc.), but
+needs the distribution library to have been unpacked into a location which is
+capable of supporting long filenames, even if only temporarily.
+
+<P>
+My recommendation, until Acorn address this problem properly, is to use Jason
+Tribbeck's <A
+HREF=ftp://ftp.demon.co.uk/pub/mirrors/hensa/micros/arch/riscos/c/c020/longfiles.arc>LongFilenames</A>, or any other
+working system that gives you long filenames, like a nearby NFS server for
+instance.
+
+<P>
+If you are using Longfilenames, even if only temporarily to install LIBTIFF,
+unpack the TAR into a RAMDisc which has been longfilenamed (ie: <TT>*addlongfs
+ram</TT>) and then install from there to the hard disk. Unfortunately
+Longfilenames seems a bit unhappy about copying a bunch of long-named files
+across the same filing system, but is happy going between systems. You'll
+need to create a ramdisk of about 2Mb.
+
+<P>
+Now you can run the installation script I've supplied (in contrib.acorn),
+which will automate the process of installing LIBTIFF as an Acorn-style
+library. The syntax is as follows:
+
+<P><TT>
+install &lt;source_dir&gt; &lt;dest_dir&gt;
+
+</TT><P>
+Install will then create &lt;dest_dir&gt; and put the library in there. For
+example, having used LongFilenames on the RAMDisk and unpacked the library
+into there, you can then type:
+
+<P><TT>
+Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$ ADFS::4.$.LIBTIFF
+</TT><P>
+
+It doesn't matter if the destination location can cope with long filenames or
+not. The filenames will be truncated if necessary (*Configure Truncate On if
+you get errors) and all will be well.
+
+<P>
+<H3>Compiling LibTIFF:</H3>
+
+<P>
+Once the LibTIFF folder has been created and the files put inside, making the
+library should be just a matter of running '<B>SetVars</B>' to set the
+appropriate system variables, then running '<B>Makefile</B>'.
+
+<P>
+<B>OSLib</B>
+
+<P>
+<A HREF=ftp://ftp.acorn.co.uk/pub/riscos/releases/oslib/oslib.arc>OSLib</A>
+is a comprehensive API for RISC OS machines, written by Jonathan Coxhead of
+Acorn Computers (although OSLib is not an official Acorn product). Using the
+OSLib SWI veneers produces code which is more compact and more efficient than
+code written using _kernel_swi or _swi. The Acorn port of LibTIFF can take
+advantage of this if present. Edit the Makefile and go to the Static
+dependencies section. The first entry is:
+
+<PRE>
+# Static dependencies:
+@.o.tif_acorn: @.c.tif_acorn
+ cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
+</PRE>
+<P>
+Change the cc line to:
+<PRE>
+ cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
+</PRE>
+<P>
+Remember, however, that OSLib is only <I>recommended</I> for efficiency's
+sake. It is not required.
+
+
+
<A NAME=Other><P><HR><H2>Building the Software on Other Systems</H2></A>
This section contains information that might be useful
@@ -772,19 +856,30 @@ rm -f tif_fax3sm.c
./mkg3states -c const tif_fax3sm.c
</TT></PRE></UL>
+The <TT>-c</TT> option can be used to control whether or not the
+resutling tables are generated with a <TT>const</TT> declaration.
+The <TT>-s</TT> option can be used to specify a C storage class
+for the table declarations.
+The <TT>-b</TT> option can be used to force data values to be
+explicitly bracketed with ``{}'' (apparently needed for some
+MS-Windows compilers); otherwise the structures are emitted in
+as compact a format as possible.
Consult the source code for this program if you have questions.
<P>
The second file required to build the library, <B>version.h</B>,
contains the version
information returned by the <TT>TIFFGetVersion</TT> routine.
-This file is built on a UNIX system using commands that can be found
-in the file <B>Makefile.in</B>.
-An example copy of <B>version.h</B> is:
+This file is built on most system using the
+<TT>mkversion</TT> program and the contents of the
+<TT>VERSION</TT> and <TT>tiff.alpha</TT> files; for example,
-<UL><LISTING>
-#define VERSION "LIBTIFF, Version 3.4beta015 \nCopyright (c) 1988-1995 Sam Leffler\nCopyright (c) 1991-1995 Silicon Graphics, Inc."
-</LISTING></UL>
+<UL><PRE>
+cd libtiff
+cc -o mkversion mkversion.c
+rm -f version.h
+./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
+</PRE></UL>
<P>
Otherwise, when building the library on a non-UNIX system be sure to
@@ -848,6 +943,7 @@ libtiff/tif_fax3.h CCITT Group 3/4-related definitions
libtiff/tif_predict.h private defs for Predictor tag support
libtiff/version.h version string (generated by Makefile)
+libtiff/tif_acorn.c Acorn-related OS support
libtiff/tif_apple.c Apple-related OS support
libtiff/tif_atari.c Atari-related OS support
libtiff/tif_aux.c auxilary directory-related functions
@@ -881,12 +977,14 @@ libtiff/tif_unix.c UNIX-related OS support
libtiff/tif_version.c library version support
libtiff/tif_vms.c VMS-related OS support
libtiff/tif_warning.c library warning handler
-libtiff/tif_win3.c Windows-related OS support
+libtiff/tif_win3.c Windows-3.1-related OS support
+libtiff/tif_win32.c Windows-3.2-related OS support
libtiff/tif_write.c image data writing support
libtiff/tif_zip.c Deflate codec
libtiff/mkg3states.c program to generate G3/G4 decoder state tables
libtiff/mkspans.c program to generate black-white span tables
+libtiff/mkversion.c program to generate libtiff/version.h.
</PRE>
<P>
@@ -894,7 +992,7 @@ libtiff/mkspans.c program to generate black-white span tables
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1995/07/07 02:34:32 $
+Last updated: $Date: 1995/10/16 21:46:06 $
</ADDRESS>
</BODY>
diff --git a/html/contrib.html b/html/contrib.html
index f11a7892..eaa6ce39 100644
--- a/html/contrib.html
+++ b/html/contrib.html
@@ -23,7 +23,8 @@ for viewing with version 1.1 or newer of the
<P>
The <B>contrib</B> directory has contributed software that
-uses the TIFF library.
+uses the TIFF library or which is associated with the library
+(typically glue and guidance for ports to non-UNIX platforms).
<P>
<TABLE BORDER CELLPADDING=3>
@@ -71,6 +72,26 @@ scripts and files from Niles Ritter for building
<TR>
<TD VALIGN=top>
+<B>contrib/acorn</B>
+</TD>
+<TD>
+scripts and files from Peter Greenham for building
+ the library and tools on an Acorn RISC OS system.
+</TD>
+</TR>
+
+<TR>
+<TD VALIGN=top>
+<B>contrib/win32</B>
+</TD>
+<TD>
+scripts and files from Scott Wagner for building
+ the library under Windows NT and Windows 95.
+</TD>
+</TR>
+
+<TR>
+<TD VALIGN=top>
<B>contrib/tags</B>
</TD>
<TD>
@@ -82,7 +103,8 @@ scripts and files from Niles Ritter for adding private
</TABLE>
<P>
-Don't send me mail asking about these programs. Send questions
+Don't send me mail asking about this stuff; I frequently know
+absolutely nothing about it. Send questions
and/or bug reports directly to the authors.
@@ -92,7 +114,7 @@ and/or bug reports directly to the authors.
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1995/07/07 02:34:32 $
+Last updated: $Date: 1995/10/16 21:56:24 $
</ADDRESS>
</BODY>
diff --git a/html/index.html b/html/index.html
index dc481524..a414133d 100644
--- a/html/index.html
+++ b/html/index.html
@@ -12,7 +12,7 @@ TIFF Software
</H1>
<B>Latest Release</B>: <I>None</I><BR>
-<B>Latest Software</B>: <A HREF="v3.4beta018.html">v3.4beta018</A><BR>
+<B>Latest Software</B>: <A HREF="v3.4beta024.html">v3.4beta024</A><BR>
<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<B>Home Page</B>: <A HREF="http://www-mipl.jpl.nasa.gov/~ndr/tiff/">
http://www-mipl.jpl.nasa.gov/~ndr/tiff/</A> <BR>
@@ -81,7 +81,7 @@ the master FTP site listed above.
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1995/07/19 01:54:06 $
+Last updated: $Date: 1995/10/10 16:56:09 $
</ADDRESS>
</BODY>
diff --git a/html/internals.html b/html/internals.html
index 8a9368c2..5c806c02 100644
--- a/html/internals.html
+++ b/html/internals.html
@@ -105,7 +105,7 @@ Experimental support for the deflate algorithm is controlled by
<TT>DEFLATE_SUPPORT</TT>.
The deflate codec that comes with <TT>libtiff</TT> is designed
for use with version 0.92 or later of the freely available
-<TT>libgz</TT> library written by Jean-loup Gailly and Mark Adler.
+<TT>libz</TT> library written by Jean-loup Gailly and Mark Adler.
The data format used by this library is described
in the files
<A HREF=ftp://ftp.uu.net/pub/archiving/zip/doc/zlib-3.1.doc>zlib-3.1.doc</A>,
@@ -114,7 +114,8 @@ and
available in the directory
<A HREF=ftp://ftp.uu.net/pub/archiving/zip/doc>ftp.uu.net:/pub/archiving/zip/doc</A>.</EM>
The library can be retried from the directory
-<A HREF=ftp://ftp.uu.net/graphics/jpeg>ftp.uu.net:/graphics/jpeg/</A>.
+<A HREF=ftp://ftp.uu.net/pub/archiving/zip/zlib/>ftp.uu.net:/pub/archiving/zip/zlib/</A>
+(or try <A HREF=ftp://quest.jpl.nasa.gov/beta/zlib/>quest.jpl.nasa.gov:/beta/zlib/</A>).
<P>
<IMG SRC="images/warning.gif" ALT="NOTE: " ALIGN=left HSPACE=8 VSPACE=6>
@@ -235,7 +236,7 @@ The UNIX (<B>tif_unix.c</B>),
Macintosh (<B>tif_apple.c</B>),
and VMS (<B>tif_vms.c</B>)
code has had the most use;
-the MS/DOS support (<TT>tif_msdos.c</TT>) assumes
+the MS/DOS support (<B>tif_msdos.c</B>) assumes
some level of UNIX system call emulation (i.e.
<TT>open</TT>,
<TT>read</TT>,
@@ -314,6 +315,18 @@ purely by fiddling with the following machine-dependent typedefs:
<TABLE BORDER CELLPADDING=3 WIDTH=100%>
<TR>
+<TD>uint8</TD>
+<TD>8-bit unsigned integer</TD>
+<TD>tiff.h</TD>
+</TR>
+
+<TR>
+<TD>int8</TD>
+<TD>8-bit signed integer</TD>
+<TD>tiff.h</TD>
+</TR>
+
+<TR>
<TD>uint16</TD>
<TD>16-bit unsigned integer</TD>
<TD>tiff.h</TD>
@@ -606,7 +619,7 @@ for example, to decode/encode entire strips of data.
<P>
In general, if you have a new compression algorithm to add, work from
the code for an existing routine. In particular,
-<B>libitff/tif_dumpmode.c</B>
+<B>tif_dumpmode.c</B>
has the trivial code for the "nil" compression scheme,
<B>tif_packbits.c</B> is a
simple byte-oriented scheme that has to watch out for buffer
@@ -620,7 +633,7 @@ the portability of your TIFF files.
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1995/07/07 02:34:32 $
+Last updated: $Date: 1995/10/16 21:56:24 $
</ADDRESS>
</BODY>
diff --git a/html/libtiff.html b/html/libtiff.html
index 5dd77ce5..3625dc0f 100644
--- a/html/libtiff.html
+++ b/html/libtiff.html
@@ -50,7 +50,7 @@ The material presented in this chapter is a basic introduction
to the capabilities of the library; it is not an attempt to describe
everything a developer needs to know about the library or about TIFF.
Detailed information on the interfaces to the library are given in
-the <A HREF="http://www-mipl.jpl.nasa.gov/~ndr/tiff/man/>
+the <A HREF="http://www-mipl.jpl.nasa.gov/~ndr/tiff/man/">
UNIX manual pages</A> that accompany this software.
<P>
@@ -735,7 +735,7 @@ main()
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1995/07/07 02:34:32 $
+Last updated: $Date: 1995/10/16 21:46:15 $
</ADDRESS>
</BODY>
diff --git a/html/v3.4beta024.html b/html/v3.4beta024.html
new file mode 100644
index 00000000..337962eb
--- /dev/null
+++ b/html/v3.4beta024.html
@@ -0,0 +1,138 @@
+<HTML>
+<HEAD>
+<TITLE>
+Changes in TIFF v3.4beta024
+</TITLE>
+</HEAD>
+
+<BODY>
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<UL>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+<B>Current Version</B>: v3.4beta024<BR>
+<B>Previous Version</B>: <A HREF=v3.4beta018.html>v3.4beta018</A><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+</UL>
+
+<P>
+This document describes the changes made to the software between the
+<I>previous</I> and <I>current</I> versions (see above).
+If you don't find something listed here, then it was not done in this
+timeframe, or it was not considered important enough to be mentioned.
+The following information is located here:
+<UL>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+<LI><A HREF="#tools">Changes in the tools</A>
+<LI><A HREF="#man">Changes in the manual pages</A>
+<LI><A HREF="#contrib">Changes in the contributed software</A>
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+<LI>It is now possible to setup the software to build only the
+ library; configure reconizes this is the intent when the
+ <B>VERSION</B>, <B>tiff.alpha</B>, and <B>tif_version.c</B>
+ files are in the local directory (i.e. ``.'')
+<LI>configure no longer tries to setup HTML materials
+<LI>include file directories needed in building the library are now
+ specified with a <TT>DIRS_LIBINC</TT> config parameter
+<LI>configure no longer checks for alternate compilers if <TT>CC</TT>
+ is set; if the specified compiler is not found or is not appropriate
+ the configuration procedure aborts
+<LI>the <B>port.h</B> file generated by configure is now used only by
+ the library and as such as have been moved to the <B>libtiff</B>
+ directory
+<LI>there is beginning support for building DSO's on systems other than IRIX
+<LI>configure now verifies the JPEG and zlib directory pathnames by
+ checking for well-known include files in these directories
+<LI>configure no longer creates the <B>dist</B> directory needed only
+ on SGI machines (for building SGI binary distributions)
+<LI>a bug was fixed whereby configure would incorrectly set
+ <TT>ENVOPTS</TT> when building the software with gcc under AIX
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+<LI>two new typedefs were added to <B>tiff.h</TT>: <TT>int8</TT>
+ and <TT>uint8</TT> for signed and unsigned 8-bit quantities,
+ respectively; these are currently used only by
+ programs in the <B>tools</B> directory
+<LI>the <TT>BadFaxLines</TT>, <TT>CleanFaxData</TT>, and
+ <TT>ConsecutiveBadFaxLines</B> tags are now supported with
+ Group 4 compression
+<LI>byte order is now correctly identified on 64-bit machines
+<LI>a bug was fixed in the PackBits decoder where input data would
+ appear short when a no-op run was present
+<LI>a bug was fixed in calculations with very wide strips
+<LI><TT>TIFFWriteEncodedStrip</TT> and <TT>TIFFWriteRawStrip</TT>
+ were extended to support dynamically growing the number of
+ strips in an image (must set <TT>ImageLength</TT> prior to
+ making calls though)
+<LI><TT>TIFFDefaultTileSize</TT> now rounds tile width and height
+ up to a multiple of 16 pixels, as required by the TIFF 6.0 specification
+<LI>the file <B>version.h</B> is now built by a new <B>mkversion</B>
+ program; this was done for portability to non-UNIX systems
+<LI>support was added for the Acorn RISC OS (from Peter Greenham)
+<LI>the builtin codec table is now made <TT>const</TT> when compiling
+ under VMS so that <B>libtiff</B> can be built as a shared library
+<LI>support for the PowerPC Mac (from Ruedi Boesch)
+<LI>support for Window NT/Window 95 (from Scott Wagner)
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+<LI>the tools no longer include <B>port.h</B>
+<LI>various portability fixes; mostly to eliminate implicit assumptions
+ about how long <TT>int32</TT> data types are
+<LI>PostScript Level II additions to <TT>tiff2ps</TT> from Bjorn Brox
+<LI><TT>sgi2tiff</TT> now handles RGBA images
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="man"><B><FONT SIZE=+3>C</FONT>HANGES IN THE MANUAL PAGES:</B></A>
+
+<UL>
+<LI>the documentation has been updated to reflect the current state of
+ the software
+<LI>some routines have been moved to different manual pages
+ to group like-routines together
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIBUTED SOFTWARE:</B></A>
+
+<UL>
+<LI>support was added for the Acorn RISC OS (from Peter Greenham)
+<LI>support for Windows NT/Windows 95 contributed for a previous
+ version of this software was sort of incorporated (it's broken
+ right now) (from Scott Wagner)
+</UL>
+
+<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>
+
+<HR>
+
+<ADDRESS>
+<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
+Last updated $Date: 1995/10/16 22:00:26 $.
+</ADDRESS>
+
+</BODY>
+</HTML>
diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in
index d1ce4ee2..5915b504 100644
--- a/libtiff/Makefile.in
+++ b/libtiff/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.20 1995/07/17 19:26:25 sam Exp $
+# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.24 1995/10/16 19:15:09 sam Exp $
#
# Tag Image File Format Library
#
@@ -24,13 +24,8 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
-DEPTH = ..
-SRCDIR = ${DEPTH}/@SRCDIR@/libtiff
-
-JPEGDIR = ${DEPTH}/@DIR_JPEG@
-ZIPDIR = ${DEPTH}/@DIR_LIBGZ@
-PORT = ${DEPTH}/port
+SRCDIR = @LIBSRCDIR@
#
# VERSION: @VERSION@
@@ -48,21 +43,24 @@ INSTALL = @INSTALL@
#
# If JPEG support is to be included and the Independent JPEG
-# Software distribution is not installed then INC_JPEG will
+# Software distribution is not installed then DIR_JPEG must
# refer to the directory where the include files reside.
#
-IPATH = -I. -I${DEPTH} -I${SRCDIR} -I${JPEGDIR} -I${ZIPDIR}
+# Similarly, if the libgz distribution is not installed, then
+# DIR_LIBGZ must refer to the directory where the include files
+# are located. Note that recent versions
#
-# To enable JPEG support (with the default configuration), include
-# -DJPEG_SUPPORT here, setup the include search path above, and
-# configure the tools to locate the appropriate libjpeg. Otherwise,
-# consult tiffconf.h for information on controlling the configuration
-# of optional library support.
+IPATH = -I. -I${SRCDIR} @COPT_LIBINC@
#
-CONF_LIBRARY=\
- @CONF_JPEG@ \
- @CONF_ZIP@ \
- ${NULL}
+# To enable JPEG support include -DJPEG_SUPPORT here.
+# To enable Deflate support add a -DZIP_SUPPORT here.
+# Note that where the configure script is used these defines
+# are automatically setup when JPEG/ZIP is set to "yes".
+#
+# Otherwise, consult tiffconf.h for information on controlling
+# the configuration of optional library support.
+#
+CONF_LIBRARY=@CONF_JPEG@ @CONF_ZIP@
COPTS = @GCOPTS@
OPTIMIZER=-O
CFLAGS = @ENVOPTS@ ${COPTS} ${OPTIMIZER} ${IPATH} ${CONF_LIBRARY}
@@ -136,45 +134,34 @@ OBJS = \
TARGETS = libtiff.a
all: ${TARGETS}
- if [ "@DSO@" = yes ]; then \
- ${MAKE} dso; \
+ if [ @DSO@dso != nodso ]; then \
+ ${MAKE} @DSO@dso; \
fi
libtiff.a: ${OBJS}
${AR} ${AROPTS} libtiff.a $?
${RANLIB} libtiff.a
-dso: ${OBJS}
+
+# default IRIX DSO building rule
+IRIXdso: ${OBJS}
${CC} -o libtiff.@DSOSUF@ -shared -rdata_shared ${OBJS} \
@LIBJPEG@ @LIBGZ@
- touch dso
+ touch IRIXdso
+# special rule for IRIX 5.2
+IRIX52dso: ${OBJS}
+ ${LD} -elf -o libtiff.@DSOSUF@ -shared -no_unresolved -all libtiff.a \
+ @LIBJPEG@ @LIBGZ@ -lc -lm
+ touch IRIX52dso
${OBJS}: ${SRCDIR}/tiffio.h ${SRCDIR}/tiff.h ${SRCDIR}/tif_dir.h
${OBJS}: ${SRCDIR}/tiffcomp.h ${SRCDIR}/tiffiop.h ${SRCDIR}/tiffconf.h
-tif_fax3.o: ${SRCDIR}/t4.h ${SRCDIR}/tif_fax3.h
-#
-# NB: can't use these since the software may not be configure
-# for use with JPEG support. Really need dynamic include
-# file dependency support; but that's too much effort.
-#
-#tif_jpeg.o: ${JPEGDIR}/jpeglib.h ${JPEGDIR}/jerror.h
-tif_lzw.o: ${SRCDIR}/tif_predict.h
-tif_predict.o: ${SRCDIR}/tif_predict.h
-tif_zip.o: ${SRCDIR}/tif_predict.h
-#
-# NB: can't use these since the software may not be configure
-# for use with Deflate support.
-#
-#tif_zip.o: ${ZIPDIR}/zlib.h ${ZIPDIR}/zutil.h
-
-ALPHA = ${DEPTH}/@SRCDIR@/dist/tiff.alpha
-VERSION = ${DEPTH}/@SRCDIR@/VERSION
+ALPHA = @ALPHAFILE@
+VERSION = @VERSIONFILE@
-version.h: ${VERSION} ${ALPHA}
- VERSION=`cat ${VERSION}`; \
- VERSION="$${VERSION}`awk '{print $$3}' ${ALPHA}`"; \
- rm -f version.h; \
- echo '#define VERSION "LIBTIFF, Version' $$VERSION '\\nCopyright (c) 1988-1995 Sam Leffler\\nCopyright (c) 1991-1995 Silicon Graphics, Inc."' >version.h
+version.h: ${VERSION} ${ALPHA} ${SRCDIR}/mkversion.c
+ ${CC} -o mkversion ${CFLAGS} ${SRCDIR}/mkversion.c
+ rm -f version.h; ./mkversion -v ${VERSION} -a ${ALPHA} version.h
tif_version.o: version.h
#
@@ -206,15 +193,15 @@ tif_dumpmode.o: ${SRCDIR}/tif_dumpmode.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_dumpmode.c
tif_error.o: ${SRCDIR}/tif_error.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_error.c
-tif_fax3.o: ${SRCDIR}/tif_fax3.c
+tif_fax3.o: ${SRCDIR}/tif_fax3.c ${SRCDIR}/t4.h ${SRCDIR}/tif_fax3.h
${CC} -c ${CFLAGS} ${SRCDIR}/tif_fax3.c
tif_getimage.o: ${SRCDIR}/tif_getimage.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_getimage.c
-tif_jpeg.o: ${SRCDIR}/tif_jpeg.c
+tif_jpeg.o: ${SRCDIR}/tif_jpeg.c @DEPEND_JPEGLIB@
${CC} -c ${CFLAGS} ${SRCDIR}/tif_jpeg.c
tif_flush.o: ${SRCDIR}/tif_flush.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_flush.c
-tif_lzw.o: ${SRCDIR}/tif_lzw.c
+tif_lzw.o: ${SRCDIR}/tif_lzw.c ${SRCDIR}/tif_predict.h
${CC} -c ${CFLAGS} ${SRCDIR}/tif_lzw.c
tif_next.o: ${SRCDIR}/tif_next.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_next.c
@@ -222,7 +209,7 @@ tif_open.o: ${SRCDIR}/tif_open.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_open.c
tif_packbits.o: ${SRCDIR}/tif_packbits.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_packbits.c
-tif_predict.o: ${SRCDIR}/tif_predict.c
+tif_predict.o: ${SRCDIR}/tif_predict.c ${SRCDIR}/tif_predict.h
${CC} -c ${CFLAGS} ${SRCDIR}/tif_predict.c
tif_print.o: ${SRCDIR}/tif_print.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_print.c
@@ -244,7 +231,7 @@ tif_warning.o: ${SRCDIR}/tif_warning.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_warning.c
tif_write.o: ${SRCDIR}/tif_write.c
${CC} -c ${CFLAGS} ${SRCDIR}/tif_write.c
-tif_zip.o: ${SRCDIR}/tif_zip.c
+tif_zip.o: ${SRCDIR}/tif_zip.c ${SRCDIR}/tif_predict.h @DEPEND_ZLIB@
${CC} -c ${CFLAGS} ${SRCDIR}/tif_zip.c
tif_apple.o: ${SRCDIR}/tif_apple.c
@@ -267,15 +254,15 @@ installHdrs: ${INCS}
${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_INC@ \
-src $$i -O $$f; \
done
-installDSO: dso
+installDSO: @DSO@dso
${INSTALL} -idb tiff.sw.tools -m 444 -F @DIR_LIB@ -O libtiff.@DSOSUF@
install: all installHdrs
${INSTALL} -idb tiff.sw.dev -m 755 -dir @DIR_LIB@
${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_LIB@ -O libtiff.a
- if [ "@DSO@" = yes ]; then \
+ if [ @DSO@dso != dso ]; then \
${MAKE} installDSO; \
fi
clean:
rm -f ${TARGETS} ${OBJS} core a.out mkg3states tif_fax3sm.c version.h \
- libtiff.@DSOSUF@ dso
+ libtiff.@DSOSUF@ *dso
diff --git a/libtiff/mkg3states.c b/libtiff/mkg3states.c
index f96a4fba..50ab6099 100644
--- a/libtiff/mkg3states.c
+++ b/libtiff/mkg3states.c
@@ -1,4 +1,4 @@
-/* "$Header: /usr/people/sam/tiff/libtiff/RCS/mkg3states.c,v 1.31 1995/07/17 01:27:30 sam Exp $ */
+/* "$Header: /usr/people/sam/tiff/libtiff/RCS/mkg3states.c,v 1.33 1995/10/16 19:14:33 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -333,7 +333,10 @@ FillTable(TIFFFaxTabEnt *T, int Size, struct proto *P, int State)
static char* storage_class = "";
static char* const_class = "";
static int packoutput = 1;
+static char* prebrace = "";
+static char* postbrace = "";
+void
WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name)
{
int i;
@@ -344,7 +347,8 @@ WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name)
if (packoutput) {
sep = "\n";
for (i = 0; i < Size; i++) {
- fprintf(fd, "%s%d,%d,%d", sep, T->State, T->Width, T->Param);
+ fprintf(fd, "%s%s%d,%d,%d%s",
+ sep, prebrace, T->State, T->Width, T->Param, postbrace);
if (((i+1) % 12) == 0)
sep = ",\n";
else
@@ -354,7 +358,8 @@ WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name)
} else {
sep = "\n ";
for (i = 0; i < Size; i++) {
- fprintf(fd, "%s%3d,%3d,%4d", sep, T->State, T->Width, T->Param);
+ fprintf(fd, "%s%s%3d,%3d,%4d%s",
+ sep, prebrace, T->State, T->Width, T->Param, postbrace);
if (((i+1) % 6) == 0)
sep = ",\n ";
else
@@ -366,6 +371,7 @@ WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name)
}
/* initialise the huffman code tables */
+int
main(int argc, char* argv[])
{
FILE* fd;
@@ -374,7 +380,7 @@ main(int argc, char* argv[])
extern int optind;
extern char* optarg;
- while ((c = getopt(argc, argv, "c:s:p")) != -1)
+ while ((c = getopt(argc, argv, "c:s:bp")) != -1)
switch (c) {
case 'c':
const_class = optarg;
@@ -385,17 +391,22 @@ main(int argc, char* argv[])
case 'p':
packoutput = 0;
break;
+ case 'b':
+ prebrace = "{";
+ postbrace = "}";
+ break;
case '?':
- fprintf(stderr, "usage: %s [-c const] [-s storage] [-p] file\n",
+ fprintf(stderr,
+ "usage: %s [-c const] [-s storage] [-p] [-b] file\n",
argv[0]);
- exit(-1);
+ return (-1);
}
outputfile = optind < argc ? argv[optind] : "g3states.h";
fd = fopen(outputfile, "w");
if (fd == NULL) {
fprintf(stderr, "%s: %s: Cannot create output file.\n",
argv[0], outputfile);
- exit(-2);
+ return (-2);
}
FillTable(MainTable, 7, Pass, S_Pass);
FillTable(MainTable, 7, Horiz, S_Horiz);
@@ -421,5 +432,5 @@ main(int argc, char* argv[])
WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable");
WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable");
fclose(fd);
- exit(0);
+ return (0);
}
diff --git a/libtiff/mkversion.c b/libtiff/mkversion.c
new file mode 100755
index 00000000..b31e5d87
--- /dev/null
+++ b/libtiff/mkversion.c
@@ -0,0 +1,132 @@
+/* "$Header: /usr/people/sam/tiff/libtiff/RCS/mkversion.c,v 1.2 1995/10/16 19:14:11 sam Exp $ */
+
+/*
+ * Copyright (c) 1995 Sam Leffler
+ * Copyright (c) 1995 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.
+ */
+
+/*
+ * Generate a library version string for systems that
+ * do not have a shell (by default this is done with
+ * awk and echo from the Makefile).
+ *
+ * This was written by Peter Greenham for Acorn systems.
+ *
+ * Syntax: mkversion [-v version-file] [-a alpha-file] [<outfile>]
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void
+usage(void)
+{
+ fprintf(stderr,
+ "usage: mkversion [-v version-file] [-a alpha-file] [outfile]\n");
+ exit(-1);
+}
+
+static FILE*
+openFile(char* filename)
+{
+ FILE* fd = fopen(filename, "r");
+ if (fd == NULL) {
+ fprintf(stderr, "mkversion: %s: Could not open for reading.\n",
+ filename);
+ exit(-1);
+ }
+ return (fd);
+}
+
+int
+main(int argc, char* argv[])
+{
+ char* versionFile = "../VERSION";
+ char* alphaFile = "../dist/tiff.alpha";
+ char version[128];
+ char alpha[128];
+ FILE* fd;
+ char* cp;
+
+ argc--, argv++;
+ while (argc > 0 && argv[0][0] == '-') {
+ if (strcmp(argv[0], "-v") == 0) {
+ if (argc < 1)
+ usage();
+ argc--, argv++;
+ versionFile = argv[0];
+ } else if (strcmp(argv[0], "-a") == 0) {
+ if (argc < 1)
+ usage();
+ argc--, argv++;
+ alphaFile = argv[0];
+ } else
+ usage();
+ argc--, argv++;
+ }
+ fd = openFile(versionFile);
+ if (fgets(version, sizeof (version)-1, fd) == NULL) {
+ fprintf(stderr, "mkversion: No version information in %s.\n",
+ versionFile);
+ exit(-1);
+ }
+ cp = strchr(version, '\n');
+ if (cp)
+ *cp = '\0';
+ fclose(fd);
+ fd = openFile(alphaFile);
+ if (fgets(alpha, sizeof (alpha)-1, fd) == NULL) {
+ fprintf(stderr, "mkversion: No alpha information in %s.\n", alphaFile);
+ exit(-1);
+ }
+ fclose(fd);
+ cp = strchr(alpha, ' '); /* skip to 3rd blank-separated field */
+ if (cp)
+ cp = strchr(cp+1, ' ');
+ if (cp) { /* append alpha to version */
+ char* tp;
+ for (tp = strchr(version, '\0'), cp++; *tp = *cp; tp++, cp++)
+ ;
+ if (tp[-1] == '\n')
+ tp[-1] = '\0';
+ } else {
+ fprintf(stderr, "mkversion: Malformed alpha information in %s.\n",
+ alphaFile);
+ exit(-1);
+ }
+ if (argc > 0) {
+ fd = fopen(argv[0], "w");
+ if (fd == NULL) {
+ fprintf(stderr, "mkversion: %s: Could not open for writing.\n",
+ argv[0]);
+ exit(-1);
+ }
+ } else
+ fd = stdout;
+ fprintf(fd, "#define VERSION \"LIBTIFF, Version %s\\n", version);
+ fprintf(fd, "Copyright (c) 1988-1995 Sam Leffler\\n");
+ fprintf(fd, "Copyright (c) 1991-1995 Silicon Graphics, Inc.\"\n");
+
+ if (fd != stdout)
+ fclose(fd);
+ return (0);
+}
diff --git a/libtiff/tif_apple.c b/libtiff/tif_apple.c
index b8b58ebf..c58043e6 100644
--- a/libtiff/tif_apple.c
+++ b/libtiff/tif_apple.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_apple.c,v 1.19 1995/06/06 23:49:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_apple.c,v 1.20 1995/10/12 18:29:18 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -46,7 +46,7 @@
#include <Files.h>
#include <Memory.h>
-#ifdef applec
+#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
#define CtoPstr c2pstr
#endif
diff --git a/libtiff/tif_codec.c b/libtiff/tif_codec.c
index f70510a0..bd946ff1 100644
--- a/libtiff/tif_codec.c
+++ b/libtiff/tif_codec.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_codec.c,v 1.4 1995/06/30 00:58:51 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_codec.c,v 1.5 1995/10/10 22:22:44 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -67,7 +67,11 @@ static int NotConfigured(TIFF*, int);
/*
* Compression schemes statically built into the library.
*/
+#ifdef VMS
+const TIFFCodec _TIFFBuiltinCODECS[] = {
+#else
TIFFCodec _TIFFBuiltinCODECS[] = {
+#endif
{ "Null", COMPRESSION_NONE, TIFFInitDumpMode },
{ "LZW", COMPRESSION_LZW, TIFFInitLZW },
{ "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits },
diff --git a/libtiff/tif_compress.c b/libtiff/tif_compress.c
index 63e4911b..c7a96420 100644
--- a/libtiff/tif_compress.c
+++ b/libtiff/tif_compress.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_compress.c,v 1.48 1995/07/07 02:30:16 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_compress.c,v 1.49 1995/10/12 16:41:08 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -184,7 +184,7 @@ TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init)
registeredCODECS = cd;
} else
TIFFError("TIFFRegisterCODEC",
- "No space to registere compression scheme %s", name);
+ "No space to register compression scheme %s", name);
return (cd->info);
}
diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c
index 63ff0f22..0533eb77 100644
--- a/libtiff/tif_fax3.c
+++ b/libtiff/tif_fax3.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.128 1995/07/17 01:27:30 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.129 1995/09/30 18:36:43 sam Exp $ */
/*
* Copyright (c) 1990-1995 Sam Leffler
@@ -1092,6 +1092,16 @@ static const TIFFFieldInfo fax4FieldInfo[] = {
FALSE, FALSE, "" },
{ TIFFTAG_GROUP4OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS,
FALSE, FALSE, "Group4Options" },
+ { TIFFTAG_BADFAXLINES, 1, 1, TIFF_LONG, FIELD_BADFAXLINES,
+ TRUE, FALSE, "BadFaxLines" },
+ { TIFFTAG_BADFAXLINES, 1, 1, TIFF_SHORT, FIELD_BADFAXLINES,
+ TRUE, FALSE, "BadFaxLines" },
+ { TIFFTAG_CLEANFAXDATA, 1, 1, TIFF_SHORT, FIELD_CLEANFAXDATA,
+ TRUE, FALSE, "CleanFaxData" },
+ { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_LONG, FIELD_BADFAXRUN,
+ TRUE, FALSE, "ConsecutiveBadFaxLines" },
+ { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_SHORT, FIELD_BADFAXRUN,
+ TRUE, FALSE, "ConsecutiveBadFaxLines" },
};
#define N(a) (sizeof (a) / sizeof (a[0]))
diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index 8baa9cc1..80788556 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.58 1995/07/17 01:27:01 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.59 1995/07/20 16:38:53 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -175,7 +175,7 @@ TIFFClientOpen(
tif->tif_mapproc = mapproc;
tif->tif_unmapproc = unmapproc;
- { union { int i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; }
+ { union { int32 i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; }
#ifdef ENDIANHACK_SUPPORT
/*
* Numerous vendors, typically on the PC, do not correctly
diff --git a/libtiff/tif_packbits.c b/libtiff/tif_packbits.c
index a24ec6ef..5be2071f 100644
--- a/libtiff/tif_packbits.c
+++ b/libtiff/tif_packbits.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_packbits.c,v 1.47 1995/06/30 15:29:02 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_packbits.c,v 1.48 1995/09/06 00:43:11 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -205,14 +205,13 @@ PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
{
char *bp;
tsize_t cc;
+ long n;
+ int b;
(void) s;
bp = (char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
while (cc > 0 && (long)occ > 0) {
- long n;
- int b;
-
n = (long) *bp++, cc--;
/*
* Watch out for compilers that
@@ -221,12 +220,12 @@ PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
if (n >= 128)
n -= 256;
if (n < 0) { /* replicate next byte -n+1 times */
- cc--;
if (n == -128) /* nop */
continue;
n = -n + 1;
occ -= n;
- for (b = *bp++; n-- > 0;)
+ b = *bp++, cc--;
+ while (n-- > 0)
*op++ = b;
} else { /* copy next n+1 bytes literally */
_TIFFmemcpy(op, bp, ++n);
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index 5bbbb061..6f126015 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.64 1995/07/19 00:39:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.65 1995/10/10 00:12:55 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -72,7 +72,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
uint16 i;
long l, n;
- fprintf(fd, "TIFF Directory at offset 0x%x\n", tif->tif_diroff);
+ fprintf(fd, "TIFF Directory at offset 0x%lx\n", (long) tif->tif_diroff);
td = &tif->tif_dir;
if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) {
fprintf(fd, " Subfile Type:");
@@ -87,8 +87,8 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
}
if (td->td_subfiletype & FILETYPE_MASK)
fprintf(fd, "%stransparency mask", sep);
- fprintf(fd, " (%u = 0x%x)\n",
- td->td_subfiletype, td->td_subfiletype);
+ fprintf(fd, " (%lu = 0x%lx)\n",
+ (long) td->td_subfiletype, (long) td->td_subfiletype);
}
if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) {
fprintf(fd, " Image Width: %lu Image Length: %lu",
@@ -441,7 +441,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if (TIFFFieldSet(tif, FIELD_SUBIFD)) {
fprintf(fd, " SubIFD Offsets:");
for (i = 0; i < td->td_nsubifd; i++)
- fprintf(fd, " %5u", td->td_subifd[i]);
+ fprintf(fd, " %5lu", (long) td->td_subifd[i]);
fputc('\n', fd);
}
#endif
@@ -451,8 +451,8 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) {
tstrip_t s;
- fprintf(fd, " %u %s:\n",
- td->td_nstrips,
+ fprintf(fd, " %lu %s:\n",
+ (long) td->td_nstrips,
isTiled(tif) ? "Tiles" : "Strips");
for (s = 0; s < td->td_nstrips; s++)
fprintf(fd, " %3lu: [%8lu, %8lu]\n",
diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
index 33389486..41879ce0 100644
--- a/libtiff/tif_strip.c
+++ b/libtiff/tif_strip.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_strip.c,v 1.23 1995/06/06 23:49:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_strip.c,v 1.24 1995/08/03 20:54:54 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -146,6 +146,8 @@ _TIFFDefaultStripSize(TIFF* tif, uint32 s)
*/
tsize_t scanline = TIFFScanlineSize(tif);
s = (uint32)(8*1024) / (scanline == 0 ? 1 : scanline);
+ if (s == 0) /* very wide images */
+ s = 1;
}
return (s);
}
diff --git a/libtiff/tif_tile.c b/libtiff/tif_tile.c
index 40224c0d..b7e0a405 100644
--- a/libtiff/tif_tile.c
+++ b/libtiff/tif_tile.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_tile.c,v 1.24 1995/06/06 23:49:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_tile.c,v 1.26 1995/10/11 23:47:23 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -71,6 +71,7 @@ TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s)
* Check an (x,y,z,s) coordinate
* against the image bounds.
*/
+int
TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s)
{
TIFFDirectory *td = &tif->tif_dir;
@@ -210,4 +211,9 @@ _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
*tw = 256;
if (*(int32*) th < 1)
*th = 256;
+ /* roundup to a multiple of 16 per the spec */
+ if (*tw & 0xf)
+ *tw = TIFFroundup(*tw, 16);
+ if (*th & 0xf)
+ *th = TIFFroundup(*th, 16);
}
diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c
new file mode 100644
index 00000000..3811fcb6
--- /dev/null
+++ b/libtiff/tif_win32.c
@@ -0,0 +1,295 @@
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_win32.c,v 1.2 1995/10/16 19:15:00 sam Exp $ */
+
+/*
+ * Copyright (c) 1988-1995 Sam Leffler
+ * Copyright (c) 1991-1995 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.
+ */
+
+/*
+ * TIFF Library Win32-specific Routines. Adapted from tif_unix.c 4/5/95 by
+ * Scott Wagner (wagner@itek.com), Itek Graphix, Rochester, NY USA
+ */
+#include <windows.h>
+#include "tiffiop.h"
+
+static tsize_t
+_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+ DWORD dwSizeRead;
+ if (!ReadFile(fd, buf, size, &dwSizeRead, NULL))
+ return(0);
+ return ((tsize_t) dwSizeRead);
+}
+
+static tsize_t
+_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+ DWORD dwSizeWritten;
+ if (!WriteFile(fd, buf, size, &dwSizeWritten, NULL))
+ return(0);
+ return ((tsize_t) dwSizeWritten);
+}
+
+static toff_t
+_tiffSeekProc(thandle_t fd, toff_t off, int whence)
+{
+ DWORD dwMoveMethod;
+ switch(whence)
+ {
+ case 0:
+ dwMoveMethod = FILE_BEGIN;
+ break;
+ case 1:
+ dwMoveMethod = FILE_CURRENT;
+ break;
+ case 2:
+ dwMoveMethod = FILE_END;
+ break;
+ default:
+ dwMoveMethod = FILE_BEGIN;
+ break;
+ }
+ return ((toff_t)SetFilePointer(fd, off, NULL, dwMoveMethod));
+}
+
+static int
+_tiffCloseProc(thandle_t fd)
+{
+ return (CloseHandle(fd) ? 0 : -1);
+}
+
+static toff_t
+_tiffSizeProc(thandle_t fd)
+{
+ return ((toff_t)GetFileSize(fd, NULL));
+}
+
+/*
+ * Because Windows uses both a handle and a pointer for file mapping, and only
+ * the pointer is returned, the handle must be saved for later use (by the
+ * unmap function). To do this, the tiff structure has an extra member,
+ * pv_map_handle, which is contiguous with (4 bytes or one 32-bit word above)
+ * the tif_base parameter which is passed as *pbase to the map function.
+ * pv_map_handle is then accessed indirectly (and perhaps somewhat unsafely)
+ * as an offset from the *pbase parameter by _tiffMapProc. The handle thus
+ * created and saved is destroyed by _tiffUnmapProc, which does not need size
+ * in Win32 but receives the map handle value in the size parameter instead.
+ */
+
+#pragma argsused
+static int
+_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+ return(0);
+}
+
+static int
+_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+ toff_t size;
+ HANDLE *phMapFile;
+ if ((size = _tiffSizeProc(fd)) == (toff_t)-1)
+ return(0);
+ phMapFile = (HANDLE *)(((BYTE *)pbase) + 4);
+ if ((*phMapFile = CreateFileMapping(fd, NULL, PAGE_READONLY, 0, size, NULL))
+ == NULL)
+ return(0);
+ if ((*pbase = MapViewOfFile(*phMapFile, FILE_MAP_READ, 0, 0, 0)) ==
+ NULL)
+ {
+ CloseHandle(*phMapFile);
+ *phMapFile = NULL;
+ return(0);
+ }
+ *psize = size;
+ return(1);
+}
+
+#pragma argsused
+static void
+_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+ return;
+}
+
+static void
+_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t map_handle)
+{
+ UnmapViewOfFile(base);
+ CloseHandle((HANDLE)map_handle);
+ return;
+}
+
+/*
+ * Open a TIFF file descriptor for read/writing.
+ * Note that TIFFFdOpen and TIFFOpen recognise the character 'u' in the mode
+ * string, which forces the file to be opened unmapped.
+ */
+TIFF*
+TIFFFdOpen(int ifd, const char* name, const char* mode)
+{
+ TIFF* tif;
+ BOOL fSuppressMap = (mode[1] == 'u' || mode[2] == 'u');
+
+ tif = TIFFClientOpen(name, mode,
+ (thandle_t)ifd,
+ _tiffReadProc, _tiffWriteProc,
+ _tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
+ fSuppressMap ? _tiffDummyMapProc : _tiffMapProc,
+ fSuppressMap ? _tiffDummyUnmapProc : _tiffUnmapProc);
+ if (tif)
+ tif->tif_fd = ifd;
+ return (tif);
+}
+
+/*
+ * Open a TIFF file for read/writing.
+ */
+TIFF*
+TIFFOpen(const char* name, const char* mode)
+{
+ static const char module[] = "TIFFOpen";
+ thandle_t fd;
+ int m;
+ DWORD dwMode;
+
+ m = _TIFFgetMode(mode, module);
+
+ switch(m)
+ {
+ case O_RDONLY:
+ dwMode = OPEN_EXISTING;
+ break;
+ case O_RDWR:
+ dwMode = OPEN_ALWAYS;
+ break;
+ case O_RDWR|O_CREAT:
+ dwMode = CREATE_NEW;
+ break;
+ case O_RDWR|O_TRUNC:
+ dwMode = CREATE_ALWAYS;
+ break;
+ case O_RDWR|O_CREAT|O_TRUNC:
+ dwMode = CREATE_ALWAYS;
+ break;
+ default:
+ return ((TIFF*)0);
+ }
+ fd = (thandle_t)CreateFile(name, (m == O_RDONLY) ? GENERIC_READ :
+ (GENERIC_READ | GENERIC_WRITE), FILE_SHARE_READ, NULL, dwMode,
+ (m == O_RDONLY) ? FILE_ATTRIBUTE_READONLY : FILE_ATTRIBUTE_NORMAL, NULL);
+ if (fd == INVALID_HANDLE_VALUE) {
+ TIFFError(module, "%s: Cannot open", name);
+ return ((TIFF *)0);
+ }
+ return (TIFFFdOpen((int)fd, name, mode));
+}
+
+tdata_t
+_TIFFmalloc(tsize_t s)
+{
+ return ((tdata_t)GlobalAlloc(GMEM_FIXED, s));
+}
+
+void
+_TIFFfree(tdata_t p)
+{
+ GlobalFree(p);
+ return;
+}
+
+tdata_t
+_TIFFrealloc(tdata_t p, tsize_t s)
+{
+ void* pvTmp;
+ if ((pvTmp = GlobalReAlloc(p, s, 0)) == NULL) {
+ if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {
+ CopyMemory(pvTmp, p, s);
+ GlobalFree(p);
+ }
+ }
+ return ((tdata_t)pvTmp);
+}
+
+void
+_TIFFmemset(void* p, int v, tsize_t c)
+{
+ FillMemory(p, c, (BYTE)v);
+}
+
+void
+_TIFFmemcpy(void* d, const tdata_t s, tsize_t c)
+{
+ CopyMemory(d, s, c);
+}
+
+int
+_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
+{
+ register const BYTE *pb1 = p1;
+ register const BYTE *pb2 = p2;
+ register DWORD dwTmp = c;
+ register int iTmp;
+ for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++)
+ ;
+ return (iTmp);
+}
+
+static void
+Win32WarningHandler(const char* module, const char* fmt, va_list ap)
+{
+ LPTSTR szTitle;
+ LPTSTR szTmp;
+ LPCTSTR szTitleText = "%s Warning";
+ LPCTSTR szDefaultModule = "TIFFLIB";
+ szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module;
+ if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) +
+ lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL)
+ return;
+ wsprintf(szTitle, szTitleText, szTmp);
+ szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR);
+ wvsprintf(szTmp, fmt, ap);
+ MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
+ LocalFree(szTitle);
+ return;
+}
+TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
+
+static void
+Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+ LPTSTR szTitle;
+ LPTSTR szTmp;
+ LPCTSTR szTitleText = "%s Error";
+ LPCTSTR szDefaultModule = "TIFFLIB";
+ szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module;
+ if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) +
+ lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL)
+ return;
+ wsprintf(szTitle, szTitleText, szTmp);
+ szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR);
+ wvsprintf(szTmp, fmt, ap);
+ MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
+ LocalFree(szTitle);
+ return;
+}
+TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
diff --git a/libtiff/tif_write.c b/libtiff/tif_write.c
index 439348f3..3fee6f75 100644
--- a/libtiff/tif_write.c
+++ b/libtiff/tif_write.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_write.c,v 1.70 1995/07/18 17:55:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_write.c,v 1.71 1995/09/30 18:36:18 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -163,9 +163,7 @@ TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
* specified strip. There must be space for the
* data; we don't check if strips overlap!
*
- * NB: Image length must be setup before writing; this
- * interface does not support automatically growing
- * the image on each write (as TIFFWriteScanline does).
+ * NB: Image length must be setup before writing.
*/
tsize_t
TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
@@ -176,10 +174,25 @@ TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
if (!WRITECHECKSTRIPS(tif, module))
return ((tsize_t) -1);
+ /*
+ * Check strip array to make sure there's space.
+ * We don't support dynamically growing files that
+ * have data organized in separate bitplanes because
+ * it's too painful. In that case we require that
+ * the imagelength be set properly before the first
+ * write (so that the strips array will be fully
+ * allocated above).
+ */
if (strip >= td->td_nstrips) {
- TIFFError(module, "%s: Strip %lu out of range, max %lu",
- tif->tif_name, (u_long) strip, (u_long) td->td_nstrips);
- return ((tsize_t) -1);
+ if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+ TIFFError(tif->tif_name,
+ "Can not grow image by strips when using separate planes");
+ return ((tsize_t) -1);
+ }
+ if (!TIFFGrowStrips(tif, 1, module))
+ return ((tsize_t) -1);
+ td->td_stripsperimage =
+ TIFFhowmany(td->td_imagelength, td->td_rowsperstrip);
}
/*
* Handle delayed allocation of data buffer. This
@@ -219,23 +232,44 @@ TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
* There must be space for the data; we don't check
* if strips overlap!
*
- * NB: Image length must be setup before writing; this
- * interface does not support automatically growing
- * the image on each write (as TIFFWriteScanline does).
+ * NB: Image length must be setup before writing.
*/
tsize_t
TIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
{
static const char module[] = "TIFFWriteRawStrip";
+ TIFFDirectory *td = &tif->tif_dir;
if (!WRITECHECKSTRIPS(tif, module))
return ((tsize_t) -1);
- if (strip >= tif->tif_dir.td_nstrips) {
- TIFFError(module, "%s: Strip %lu out of range, max %lu",
- tif->tif_name, (u_long) strip,
- (u_long) tif->tif_dir.td_nstrips);
- return ((tsize_t) -1);
+ /*
+ * Check strip array to make sure there's space.
+ * We don't support dynamically growing files that
+ * have data organized in separate bitplanes because
+ * it's too painful. In that case we require that
+ * the imagelength be set properly before the first
+ * write (so that the strips array will be fully
+ * allocated above).
+ */
+ if (strip >= td->td_nstrips) {
+ if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+ TIFFError(tif->tif_name,
+ "Can not grow image by strips when using separate planes");
+ return ((tsize_t) -1);
+ }
+ /*
+ * Watch out for a growing image. The value of
+ * strips/image will initially be 1 (since it
+ * can't be deduced until the imagelength is known).
+ */
+ if (strip >= td->td_stripsperimage)
+ td->td_stripsperimage =
+ TIFFhowmany(td->td_imagelength,td->td_rowsperstrip);
+ if (!TIFFGrowStrips(tif, 1, module))
+ return ((tsize_t) -1);
}
+ tif->tif_curstrip = strip;
+ tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
return (TIFFAppendToStrip(tif, strip, (tidata_t) data, cc) ?
cc : (tsize_t) -1);
}
diff --git a/libtiff/tiff.h b/libtiff/tiff.h
index 2ca4c341..6a5e134c 100644
--- a/libtiff/tiff.h
+++ b/libtiff/tiff.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiff.h,v 1.58 1995/06/30 21:08:31 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiff.h,v 1.60 1995/10/12 16:25:42 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -45,14 +45,16 @@
/*
* Intrinsic data types required by the file format:
*
- * 8-bit quantities char/unsigned char
+ * 8-bit quantities int8/uint8
* 16-bit quantities int16/uint16
* 32-bit quantities int32/uint32
* strings unsigned char*
*/
+typedef signed char int8; /* NB: non-ANSI compilers may not grok */
+typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16; /* sizeof (uint16) must == 2 */
-#if defined(__alpha) || _MIPS_SZLONG == 64
+#if defined(__alpha) || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64)
typedef int int32;
typedef unsigned int uint32; /* sizeof (uint32) must == 4 */
#else
diff --git a/libtiff/tiffcomp.h b/libtiff/tiffcomp.h
index 45b8a6e8..700bcc1b 100644
--- a/libtiff/tiffcomp.h
+++ b/libtiff/tiffcomp.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffcomp.h,v 1.44 1995/06/06 17:00:43 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffcomp.h,v 1.46 1995/10/12 18:26:54 sam Exp $ */
/*
* Copyright (c) 1990-1995 Sam Leffler
@@ -38,46 +38,74 @@
/*
* Setup basic type definitions and function declaratations.
*/
+
+/*
+ * Simplify Acorn RISC OS identifier (to avoid confusion with Acorn RISC iX
+ * and with defunct Unix Risc OS)
+ * No need to specify __arm - hey, Acorn might port the OS, no problem here!
+ */
+#ifdef __acornriscos
+#undef __acornriscos
+#endif
+#if defined(__acorn) && defined(__riscos)
+#define __acornriscos
+#endif
+
#if defined(__MWERKS__) || defined(THINK_C)
#include <unix.h>
#include <math.h>
#endif
+
#include <stdio.h>
-#ifdef applec
+
+#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
#include <types.h>
-#else
-#if !defined(__MWERKS__) && !defined(THINK_C)
+#elif !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acornriscos)
#include <sys/types.h>
#endif
-#endif
-#ifdef VMS
+
+#if defined(VMS)
#include <file.h>
#include <unixio.h>
-#else
+#elif !defined(__acornriscos)
#include <fcntl.h>
#endif
-#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
+
+/*
+ * This maze of checks controls defines or not the
+ * target system has BSD-style typdedefs declared in
+ * an include file and/or whether or not to include
+ * <unistd.h> to get the SEEK_* definitions. Some
+ * additional includes are also done to pull in the
+ * appropriate definitions we're looking for.
+ */
+#if defined(__MWERKS__) || defined(THINK_C) || defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
#include <stdlib.h>
#define BSDTYPES
-#endif
-#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
+#define HAVE_UNISTD_H 0
+#elif defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
#define BSDTYPES
-#endif
-#if defined(OS2_16) || defined(OS2_32)
+#elif defined(OS2_16) || defined(OS2_32)
#define BSDTYPES
+#elif defined(__acornriscos)
+#include <stdlib.h>
+#define BSDTYPES
+#define HAVE_UNISTD_H 0
+#elif defined(VMS)
+#define HAVE_UNISTD_H 0
+#else
+#define HAVE_UNISTD_H 1
#endif
/*
* The library uses the ANSI C/POSIX SEEK_*
* definitions that should be defined in unistd.h
- * (except on VMS or the Mac, where they are in stdio.h and
+ * (except on system where they are in stdio.h and
* there is no unistd.h).
*/
-#ifndef SEEK_SET
-#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
+#if !defined(SEEK_SET) && HAVE_UNISTD_H
#include <unistd.h>
#endif
-#endif
/*
* The library uses memset, memcpy, and memcmp.
@@ -90,7 +118,7 @@
* If your system doesn't have them in <sys/types.h>,
* then define BSDTYPES in your Makefile.
*/
-#ifdef BSDTYPES
+#if defined(BSDTYPES)
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
@@ -102,7 +130,8 @@ typedef unsigned long u_long;
* floating point value will have on the parameter
* stack (when coerced by the compiler).
*/
-#ifdef applec
+/* Note: on MacPowerPC "extended" is undefined. So only use it for 68K-Macs */
+#if defined(__SC__) || defined(THINK_C)
typedef extended dblparam_t;
#else
typedef double dblparam_t;
@@ -113,8 +142,8 @@ typedef double dblparam_t;
* set INLINE appropriately to get the known hotspots
* in the library expanded inline.
*/
-#ifdef __GNUC__
-#ifdef __STRICT_ANSI__
+#if defined(__GNUC__)
+#if defined(__STRICT_ANSI__)
#define INLINE __inline__
#else
#define INLINE inline
@@ -136,14 +165,41 @@ typedef double dblparam_t;
* The GNU C variant is untested.
*/
#if defined(VAX) && defined(VMS)
-#ifdef VAXC
+#if defined(VAXC)
#define GLOBALDATA(TYPE,NAME) extern noshare TYPE NAME
#endif
-#ifdef __GNUC__
+#if defined(__GNUC__)
#define GLOBALDATA(TYPE,NAME) extern TYPE NAME \
asm("_$$PsectAttributes_NOSHR$$" #NAME)
#endif
#else /* !VAX/VMS */
#define GLOBALDATA(TYPE,NAME) extern TYPE NAME
#endif
+
+#if defined(__acornriscos)
+/*
+ * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
+ * on C alone. For that reason, the relevant functions are
+ * implemented in tif_acorn.c, and the elements from the header
+ * file are included here.
+ */
+#if defined(__cplusplus)
+#include <osfcn.h>
+#else
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR 2
+#define O_APPEND 8
+#define O_CREAT 0x200
+#define O_TRUNC 0x400
+typedef long off_t;
+extern int open(const char *name, int flags, int mode);
+extern int close(int fd);
+extern int write(int fd, const char *buf, int nbytes);
+extern int read(int fd, char *buf, int nbytes);
+extern off_t lseek(int fd, off_t offset, int whence);
+extern int creat(const char *path, int mode);
+#endif /* __cplusplus */
+#endif /* __acornriscos */
+
#endif /* _COMPAT_ */
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 84668660..de612ff7 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffio.h,v 1.90 1995/06/27 00:54:10 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffio.h,v 1.91 1995/10/16 19:14:51 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -64,7 +64,11 @@ typedef uint32 ttile_t; /* tile number */
typedef int32 tsize_t; /* i/o size in bytes */
#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
#include <windows.h>
+#ifdef __WIN32__
+DECLARE_HANDLE(thandle_t); /* Win32 file handle */
+#else
typedef HFILE thandle_t; /* client data handle */
+#endif
#else
typedef void* thandle_t; /* client data handle */
#endif
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index af0ef954..6b9c90aa 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffiop.h,v 1.73 1995/07/07 02:30:23 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffiop.h,v 1.75 1995/10/12 18:45:02 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -133,6 +133,13 @@ struct tiff {
tsize_t tif_rawcc; /* bytes unread from raw buffer */
/* memory-mapped file support */
tidata_t tif_base; /* base of mapped file */
+#ifdef WIN32
+ void* pv_map_handle; /* WIN32 file mapping handle;
+ * must be contiguous with tif_base
+ * since map & unmap only get tif_base
+ * and assume 4 byte offset to
+ * pv_map_handle. */
+#endif
toff_t tif_size; /* size of mapped file region (bytes) */
TIFFMapFileProc tif_mapproc; /* map file method */
TIFFUnmapFileProc tif_unmapproc;/* unmap file method */
@@ -169,8 +176,14 @@ struct tiff {
((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
#define TIFFMapFileContents(tif, paddr, psize) \
((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize))
+#ifdef WIN32
+#define TIFFUnmapFileContents(tif, addr, dummy) \
+ ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,\
+ (toff_t)(tif)->pv_map_handle))
+#else
#define TIFFUnmapFileContents(tif, addr, size) \
((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size))
+#endif
/*
* Default Read/Seek/Write definitions.
@@ -256,7 +269,11 @@ extern int TIFFInitJBIG(TIFF*, int);
#ifdef ZIP_SUPPORT
extern int TIFFInitZIP(TIFF*, int);
#endif
+#ifdef VMS
+extern const TIFFCodec _TIFFBuiltinCODECS[];
+#else
extern TIFFCodec _TIFFBuiltinCODECS[];
+#endif
#if defined(__cplusplus)
}
diff --git a/man/Makefile.in b/man/Makefile.in
index c1dbf473..14138d27 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/man/RCS/Makefile.in,v 1.4 1995/06/28 04:40:37 sam Exp $
+# $Header: /usr/people/sam/tiff/man/RCS/Makefile.in,v 1.10 1995/10/16 22:50:32 sam Exp $
#
# @WARNING@
#
@@ -27,11 +27,7 @@
# OF THIS SOFTWARE.
#
DEPTH = ..
-
SRCDIR = ${DEPTH}/@SRCDIR@/man
-VPATH = ../@SRCDIR@/man
-
-PORT = ${DEPTH}/port
#
# VERSION: @VERSION@
@@ -47,30 +43,42 @@ RM = rm -f
INSTALL = @INSTALL@
MAN = @DIR_MAN@
+#
+# Set this up if your manual system requires a
+# pathname prefix in the .so commands when setting
+# up alternate files for multi-function manual pages.
+#
+#MANDIR = man3/
MANTOOLS=\
- fax2tiff.1 \
- fax2ps.1 \
- gif2tiff.1 \
- pal2rgb.1 \
- ppm2tiff.1 \
- ras2tiff.1 \
- rgb2ycbcr.1 \
- sgi2tiff.1 \
- thumbnail.1 \
- tiff2bw.1 \
- tiff2ps.1 \
- tiffcmp.1 \
- tiffcp.1 \
- tiffdither.1 \
- tiffdump.1 \
- tiffgt.1 \
- tiffinfo.1 \
- tiffmedian.1 \
- tiffsplit.1 \
- tiffsv.1 \
+ ${SRCDIR}/fax2tiff.1 \
+ ${SRCDIR}/fax2ps.1 \
+ ${SRCDIR}/gif2tiff.1 \
+ ${SRCDIR}/pal2rgb.1 \
+ ${SRCDIR}/ppm2tiff.1 \
+ ${SRCDIR}/ras2tiff.1 \
+ ${SRCDIR}/rgb2ycbcr.1 \
+ ${SRCDIR}/sgi2tiff.1 \
+ ${SRCDIR}/thumbnail.1 \
+ ${SRCDIR}/tiff2bw.1 \
+ ${SRCDIR}/tiff2ps.1 \
+ ${SRCDIR}/tiffcmp.1 \
+ ${SRCDIR}/tiffcp.1 \
+ ${SRCDIR}/tiffdither.1 \
+ ${SRCDIR}/tiffdump.1 \
+ ${SRCDIR}/tiffgt.1 \
+ ${SRCDIR}/tiffinfo.1 \
+ ${SRCDIR}/tiffmedian.1 \
+ ${SRCDIR}/tiffsplit.1 \
+ ${SRCDIR}/tiffsv.1 \
${NULL}
MANDEVLINKS=\
+ TIFFmalloc.3t \
+ TIFFrealloc.3t \
+ TIFFfree.3t \
+ TIFFmemset.3t \
+ TIFFmemcpy.3t \
+ TIFFmemcmp.3t \
TIFFComputeTile.3t \
TIFFCheckTile.3t \
TIFFNumberOfTiles.3t \
@@ -83,52 +91,77 @@ MANDEVLINKS=\
TIFFFdOpen.3t \
TIFFFileName.3t \
TIFFFileno.3t \
+ TIFFFindCODEC.3t \
TIFFFlushData.3t \
TIFFGetMode.3t \
TIFFIsTiled.3t \
+ TIFFIsByteSwapped.3t \
+ TIFFIsUpSampled.3t \
+ TIFFIsMSB2LSB.3t \
+ TIFFLastDirectory.3t \
+ TIFFRegisterCODEC.3t \
TIFFReverseBits.3t \
+ TIFFRGBAImageOK.3t \
+ TIFFRGBAImageBegin.3t \
+ TIFFRGBAImageGet.3t \
+ TIFFRGBAImageEnd.3t \
TIFFSetErrorHandler.3t \
+ TIFFSetSubDirectory.3t \
TIFFSetWarningHandler.3t \
TIFFSwabArrayOfLong.3t \
TIFFSwabArrayOfShort.3t \
TIFFSwabLong.3t \
TIFFSwabShort.3t \
TIFFScanlineSize.3t \
+ TIFFDefaultStripSize.3t \
+ TIFFVStripSize.3t \
TIFFStripSize.3t \
+ TIFFDefaultTileSize.3t \
+ TIFFVTileSize.3t \
TIFFTileSize.3t \
+ TIFFTileRowSize.3t \
+ TIFFUnRegisterCODEC.3t \
TIFFVGetField.3t \
TIFFVSetField.3t \
+ TIFFReadBufferSetup.3t \
+ TIFFWriteBufferSetup.3t \
${NULL}
MANDEV=\
- TIFFClose.3t \
- TIFFError.3t \
- TIFFFlush.3t \
- TIFFGetField.3t \
- TIFFOpen.3t \
- TIFFPrintDirectory.3t \
- TIFFReadDirectory.3t \
- TIFFReadEncodedStrip.3t \
- TIFFReadEncodedTile.3t \
- TIFFReadRGBAImage.3t \
- TIFFReadRawStrip.3t \
- TIFFReadRawTile.3t \
- TIFFReadScanline.3t \
- TIFFReadTile.3t \
- TIFFSetDirectory.3t \
- TIFFSetField.3t \
- TIFFWarning.3t \
- TIFFWriteDirectory.3t \
- TIFFWriteEncodedStrip.3t \
- TIFFWriteEncodedTile.3t \
- TIFFWriteRawStrip.3t \
- TIFFWriteRawTile.3t \
- TIFFWriteScanline.3t \
- intro.3t \
- query.3t \
- size.3t \
- strip.3t \
- swab.3t \
- tile.3t \
+ ${SRCDIR}/libtiff.3t \
+ \
+ ${SRCDIR}/TIFFClose.3t \
+ ${SRCDIR}/TIFFError.3t \
+ ${SRCDIR}/TIFFFlush.3t \
+ ${SRCDIR}/TIFFGetField.3t \
+ ${SRCDIR}/TIFFOpen.3t \
+ ${SRCDIR}/TIFFPrintDirectory.3t \
+ ${SRCDIR}/TIFFReadDirectory.3t \
+ ${SRCDIR}/TIFFReadEncodedStrip.3t \
+ ${SRCDIR}/TIFFReadEncodedTile.3t \
+ ${SRCDIR}/TIFFReadRGBAImage.3t \
+ ${SRCDIR}/TIFFReadRawStrip.3t \
+ ${SRCDIR}/TIFFReadRawTile.3t \
+ ${SRCDIR}/TIFFReadScanline.3t \
+ ${SRCDIR}/TIFFReadTile.3t \
+ ${SRCDIR}/TIFFRGBAImage.3t \
+ ${SRCDIR}/TIFFSetDirectory.3t \
+ ${SRCDIR}/TIFFSetField.3t \
+ ${SRCDIR}/TIFFWarning.3t \
+ ${SRCDIR}/TIFFWriteDirectory.3t \
+ ${SRCDIR}/TIFFWriteEncodedStrip.3t \
+ ${SRCDIR}/TIFFWriteEncodedTile.3t \
+ ${SRCDIR}/TIFFWriteRawStrip.3t \
+ ${SRCDIR}/TIFFWriteRawTile.3t \
+ ${SRCDIR}/TIFFWriteScanline.3t \
+ \
+ ${SRCDIR}/TIFFbuffer.3t \
+ ${SRCDIR}/TIFFcodec.3t \
+ ${SRCDIR}/TIFFmemory.3t \
+ ${SRCDIR}/TIFFquery.3t \
+ ${SRCDIR}/TIFFsize.3t \
+ ${SRCDIR}/TIFFstrip.3t \
+ ${SRCDIR}/TIFFswab.3t \
+ ${SRCDIR}/TIFFtile.3t \
${NULL}
TARGETS = ${MANTOOLS} ${MANDEV} ${MANDEVLINKS}
@@ -138,46 +171,74 @@ install: all
${INSTALL} -m 755 -dir -idb tiff.man.tools ${MAN}
${INSTALL} -m 755 -dir -idb tiff.man.tools ${MAN}/man1
for i in ${MANTOOLS}; do \
+ f=`basename $$i`; \
${INSTALL} -idb tiff.man.tools -m 444 -F ${MAN}/man1 \
- -src ${SRCDIR}/$$i -O $$i; \
+ -src $$i -O $$f; \
done
${INSTALL} -m 755 -dir -idb tiff.man.dev ${MAN}/man3
for i in ${MANDEV}; do \
+ f=`basename $$i`; \
${INSTALL} -idb tiff.man.dev -m 444 -F ${MAN}/man3 \
- -src ${SRCDIR}/$$i -O $$i; \
+ -src $$i -O $$f; \
done
${INSTALL} -idb tiff.man.dev -m 444 -F ${MAN}/man3 -O ${MANDEVLINKS}
clean:
${RM} ${MANDEVLINKS}
-TIFFComputeTile.3t:; ${ECHO} ".so tile.3t" > $@
-TIFFCheckTile.3t:; ${ECHO} ".so tile.3t" > $@
-TIFFNumberOfTiles.3t:; ${ECHO} ".so tile.3t" > $@
-TIFFComputeStrip.3t:; ${ECHO} ".so strip.3t" > $@
-TIFFNumberOfStrips.3t:; ${ECHO} ".so strip.3t" > $@
-TIFFCurrentDirectory.3t:; ${ECHO} ".so query.3t" > $@
-TIFFCurrentRow.3t:; ${ECHO} ".so query.3t" > $@
-TIFFCurrentStrip.3t:; ${ECHO} ".so query.3t" > $@
-TIFFCurrentTile.3t:; ${ECHO} ".so query.3t" > $@
-TIFFFdOpen.3t:; ${ECHO} ".so TIFFOpen.3t" > $@
-TIFFFileName.3t:; ${ECHO} ".so query.3t" > $@
-TIFFFileno.3t:; ${ECHO} ".so query.3t" > $@
-TIFFFlushData.3t:; ${ECHO} ".so TIFFFlush.3t" > $@
-TIFFGetMode.3t:; ${ECHO} ".so query.3t" > $@
-TIFFIsTiled.3t:; ${ECHO} ".so query.3t" > $@
-TIFFReverseBits.3t:; ${ECHO} ".so swab.3t" > $@
-TIFFSetErrorHandler.3t:; ${ECHO} ".so TIFFError.3t" > $@
-TIFFSetWarningHandler.3t:; ${ECHO} ".so TIFFWarning.3t" > $@
-TIFFSwabArrayOfLong.3t:; ${ECHO} ".so swab.3t" > $@
-TIFFSwabArrayOfShort.3t:; ${ECHO} ".so swab.3t" > $@
-TIFFSwabLong.3t:; ${ECHO} ".so swab.3t" > $@
-TIFFSwabShort.3t:; ${ECHO} ".so swab.3t" > $@
-TIFFScanlineSize.3t:; ${ECHO} ".so size.3t" > $@
-TIFFStripSize.3t:; ${ECHO} ".so size.3t" > $@
-TIFFTileSize.3t:; ${ECHO} ".so size.3t" > $@
-TIFFVGetField.3t:; ${ECHO} ".so TIFFGetField.3t" > $@
-TIFFVSetField.3t:; ${ECHO} ".so TIFFSetField.3t" > $@
+TIFFComputeTile.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFCheckTile.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFNumberOfTiles.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFComputeStrip.3t:; ${ECHO} ".so ${MANDIR}TIFFstrip.3t" > $@
+TIFFNumberOfStrips.3t:; ${ECHO} ".so ${MANDIR}TIFFstrip.3t" > $@
+TIFFCurrentDirectory.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFCurrentRow.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFCurrentStrip.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFCurrentTile.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFFdOpen.3t:; ${ECHO} ".so ${MANDIR}TIFFOpen.3t" > $@
+TIFFFileName.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFFileno.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFFlushData.3t:; ${ECHO} ".so ${MANDIR}TIFFFlush.3t" > $@
+TIFFGetMode.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFIsTiled.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFIsByteSwapped.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFIsUpSampled.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFIsMSB2LSB.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFLastDirectory.3t:; ${ECHO} ".so ${MANDIR}TIFFquery.3t" > $@
+TIFFReverseBits.3t:; ${ECHO} ".so ${MANDIR}TIFFswab.3t" > $@
+TIFFRGBAImageOK.3t:; ${ECHO} ".so ${MANDIR}TIFFRGBAImage.3t" > $@
+TIFFRGBAImageBegin.3t:; ${ECHO} ".so ${MANDIR}TIFFRGBAImage.3t" > $@
+TIFFRGBAImageGet.3t:; ${ECHO} ".so ${MANDIR}TIFFRGBAImage.3t" > $@
+TIFFRGBAImageEnd.3t:; ${ECHO} ".so ${MANDIR}TIFFRGBAImage.3t" > $@
+TIFFSetErrorHandler.3t:; ${ECHO} ".so ${MANDIR}TIFFError.3t" > $@
+TIFFSetSubDirectory.3t:; ${ECHO} ".so ${MANDIR}TIFFSetDirectory.3t" > $@
+TIFFSetWarningHandler.3t:; ${ECHO} ".so ${MANDIR}TIFFWarning.3t" > $@
+TIFFSwabArrayOfLong.3t:; ${ECHO} ".so ${MANDIR}TIFFswab.3t" > $@
+TIFFSwabArrayOfShort.3t:; ${ECHO} ".so ${MANDIR}TIFFswab.3t" > $@
+TIFFSwabLong.3t:; ${ECHO} ".so ${MANDIR}TIFFswab.3t" > $@
+TIFFSwabShort.3t:; ${ECHO} ".so ${MANDIR}TIFFswab.3t" > $@
+TIFFScanlineSize.3t:; ${ECHO} ".so ${MANDIR}TIFFsize.3t" > $@
+TIFFRasterScanlineSize.3t:; ${ECHO} ".so ${MANDIR}TIFFsize.3t" > $@
+TIFFDefaultStripSize.3t:; ${ECHO} ".so ${MANDIR}TIFFstrip.3t" > $@
+TIFFStripSize.3t:; ${ECHO} ".so ${MANDIR}TIFFstrip.3t" > $@
+TIFFVStripSize.3t:; ${ECHO} ".so ${MANDIR}TIFFstrip.3t" > $@
+TIFFTileSize.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFVTileSize.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFDefaultTileSize.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFTileRowSize.3t:; ${ECHO} ".so ${MANDIR}TIFFtile.3t" > $@
+TIFFVGetField.3t:; ${ECHO} ".so ${MANDIR}TIFFGetField.3t" > $@
+TIFFVSetField.3t:; ${ECHO} ".so ${MANDIR}TIFFSetField.3t" > $@
+TIFFFindCODEC.3t:; ${ECHO} ".so ${MANDIR}TIFFcodec.3t" > $@
+TIFFRegisterCODEC.3t:; ${ECHO} ".so ${MANDIR}TIFFcodec.3t" > $@
+TIFFUnRegisterCODEC.3t:; ${ECHO} ".so ${MANDIR}TIFFcodec.3t" > $@
+TIFFmalloc.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFrealloc.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFfree.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFmemset.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFmemcpy.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFmemcmp.3t:; ${ECHO} ".so ${MANDIR}TIFFmemory.3t" > $@
+TIFFReadBufferSetup.3t:; ${ECHO} ".so ${MANDIR}TIFFbuffer.3t" > $@
+TIFFWriteBufferSetup.3t:; ${ECHO} ".so ${MANDIR}TIFFbuffer.3t" > $@
links: ${MANDEVLINKS}
@@ -193,8 +254,10 @@ short:
${MV} TIFFReadRawStrip.3t rdrstrip.3t
${MV} TIFFReadRawTile.3t rdrtile.3t
${MV} TIFFReadDirectory.3t readdir.3t
+ ${MV} TIFFReadRGBAImage.3t rdimage.3t
${MV} TIFFReadScanline.3t readline.3t
${MV} TIFFReadTile.3t readtile.3t
+ ${MV} TIFFRGBAImage.3t rgbaimage.3t
${MV} TIFFSetDirectory.3t setdir.3t
${MV} TIFFSetField.3t setfield.3t
${MV} TIFFWarning.3t warning.3t
@@ -204,3 +267,11 @@ short:
${MV} TIFFWriteRawStrip.3t wrrstrip.3t
${MV} TIFFWriteRawTile.3t wrrtile.3t
${MV} TIFFWriteScanline.3t writeline.3t
+ ${MV} TIFFtile.3t tile.3t
+ ${MV} TIFFstrip.3t strip.3t
+ ${MV} TIFFquery.3t query.3t
+ ${MV} TIFFswab.3t swab.3t
+ ${MV} TIFFsize.3t size.3t
+ ${MV} TIFFcodec.3t codec.3t
+ ${MV} TIFFmemory.3t memory.3t
+ ${MV} TIFFbuffer.3t buffer.3t
diff --git a/man/TIFFClose.3t b/man/TIFFClose.3t
index cda9983b..7c89f9d8 100644
--- a/man/TIFFClose.3t
+++ b/man/TIFFClose.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFClose.3t,v 1.9 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFClose.3t,v 1.11 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -47,5 +47,5 @@ Likewise, warning messages are directed to the
.IR TIFFWarning (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T)
diff --git a/man/TIFFError.3t b/man/TIFFError.3t
index 7c1a78c7..17fd33a4 100644
--- a/man/TIFFError.3t
+++ b/man/TIFFError.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFError.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFError.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFError 3T "December 2, 1991"
+.TH TIFFError 3T "October 15, 1995"
.SH NAME
TIFFError, TIFFSetErrorHandler \- library error handling interface
.SH SYNOPSIS
@@ -31,9 +31,9 @@ TIFFError, TIFFSetErrorHandler \- library error handling interface
.br
.B "void TIFFError(const char* module, const char* fmt, ...)"
.sp .5
-.B "#include <stdargh.h>"
+.B "#include <stdarg.h>"
.br
-.B "typedef void (*TIFFErrorHandler)(char* module, char* fmt, va_list ap);"
+.B "typedef void (*TIFFErrorHandler)(const char* module, const char* fmt, va_list ap);"
.br
.B "TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler handler);"
.SH DESCRIPTION
@@ -64,6 +64,6 @@ suppress error messages.
.IR TIFFSetErrorHandler
returns a reference to the previous error handling function.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFWarning (3T),
.IR printf (3S)
diff --git a/man/TIFFFlush.3t b/man/TIFFFlush.3t
index 210391c3..23bbec15 100644
--- a/man/TIFFFlush.3t
+++ b/man/TIFFFlush.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFFlush.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFFlush.3t,v 1.12 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -54,7 +54,7 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteEncodedStrip (3T),
.IR TIFFWriteEncodedTile (3T),
diff --git a/man/TIFFGetField.3t b/man/TIFFGetField.3t
index 4725cc88..fa8f8ec5 100644
--- a/man/TIFFGetField.3t
+++ b/man/TIFFGetField.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFGetField.3t,v 1.13 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFGetField.3t,v 1.16 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFGetField 3T "February 14, 1992"
+.TH TIFFGetField 3T "October 15, 1995"
.SH NAME
TIFFGetField, TIFFVGetField \- get the value(s) of a tag in an open
.SM TIFF
@@ -42,11 +42,16 @@ file
.B "int TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap)"
.SH DESCRIPTION
.IR TIFFGetField
-returns the value of a tag in the current directory associated with
-the open
+returns the value of a tag or pseudo-tag associated with the
+the current directory of the open
.SM TIFF
file
.IR tif .
+(A
+.I pseudo-tag
+is a parameter that is used to control the operation of the
+.SM TIFF
+library but whose value is not read or written to the underlying file.)
The file must have been previously opened with
.IR TIFFOpen (3T).
The tag is identified by
@@ -59,10 +64,7 @@ on the tag being requested.
The programming interface uses a variable argument list
as prescribed by the
.IR stdarg (3)
-interface (\c
-or, on some machines, the
-.IR varargs (3)
-interface.)
+interface.
The returned values should only be interpreted if
.IR TIFFGetField
returns 1.
@@ -101,10 +103,11 @@ data types are pointers to storage where values
should be returned.
Consult the
.SM TIFF
-specification for information on the meaning of each tag and their possible values.
+specification for information on the meaning of
+each tag and their possible values.
.PP
.nf
-.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'uint16*,uint16**'u+2n
+.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc*'u+2n
\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP
.sp 5p
TIFFTAG_ARTIST 1 char**
@@ -119,6 +122,8 @@ TIFFTAG_DATETIME 1 char**
TIFFTAG_DOCUMENTNAME 1 char**
TIFFTAG_DOTRANGE 2 uint16*
TIFFTAG_EXTRASAMPLES 2 uint16*,uint16** count & types array
+TIFFTAG_FAXMODE 1 int* G3/G4 compression pseudo-tag
+TIFFTAG_FAXFILLFUNC 1 TIFFFaxFillFunc* G3/G4 compression pseudo-tag
TIFFTAG_FILLORDER 1 uint16*
TIFFTAG_GROUP3OPTIONS 1 uint32*
TIFFTAG_GROUP4OPTIONS 1 uint32*
@@ -130,11 +135,10 @@ TIFFTAG_IMAGELENGTH 1 uint32*
TIFFTAG_IMAGEWIDTH 1 uint32*
TIFFTAG_INKNAMES 1 char**
TIFFTAG_INKSET 1 uint16*
-TIFFTAG_JPEGACTABLES 1 u_char*** SamplesPerPixel arrays
-TIFFTAG_JPEGDCTABLES 1 u_char*** SamplesPerPixel arrays
-TIFFTAG_JPEGPROC 1 uint16*
-TIFFTAG_JPEGRESTARTINTERVAL 1 uint16*
-TIFFTAG_JPEGQTABLES 1 u_char*** SamplesPerPixel 64-entry arrays
+TIFFTAG_JPEGTABLES 2 u_short*,void** count & tables
+TIFFTAG_JPEGQUALITY 1 int* JPEG pseudo-tag
+TIFFTAG_JPEGCOLORMODE 1 int* JPEG pseudo-tag
+TIFFTAG_JPEGTABLESMODE 1 int* JPEG pseudo-tag
TIFFTAG_MAKE 1 char**
TIFFTAG_MATTEING 1 uint16*
TIFFTAG_MAXSAMPLEVALUE 1 uint16*
@@ -152,10 +156,13 @@ TIFFTAG_RESOLUTIONUNIT 1 uint16*
TIFFTAG_ROWSPERSTRIP 1 uint32*
TIFFTAG_SAMPLEFORMAT 1 uint16*
TIFFTAG_SAMPLESPERPIXEL 1 uint16*
+TIFFTAG_SMAXSAMPLEVALUE 1 double*
+TIFFTAG_SMINSAMPLEVALUE 1 double*
TIFFTAG_SOFTWARE 1 char**
TIFFTAG_STRIPBYTECOUNTS 1 uint32**
TIFFTAG_STRIPOFFSETS 1 uint32**
TIFFTAG_SUBFILETYPE 1 uint32*
+TIFFTAG_SUBIFD 2 uint16*,uint32** count & offsets array
TIFFTAG_TARGETPRINTER 1 char**
TIFFTAG_THRESHHOLDING 1 uint16*
TIFFTAG_TILEBYTECOUNTS 1 uint32**
@@ -173,10 +180,10 @@ TIFFTAG_YCBCRSUBSAMPLING 2 uint16*
TIFFTAG_YPOSITION 1 float*
TIFFTAG_YRESOLUTION 1 float*
.fi
-(\(dg If
+\(dg If
.I SamplesPerPixel
is one, then a single array is returned; otherwise three arrays are
-returned.)
+returned.
.SH "RETURN VALUES"
1 is returned if the tag is defined in the current
directory; otherwise a 0 is returned.
@@ -188,7 +195,7 @@ routine.
.BR "Unknown field, tag 0x%x" .
An unknown tag was supplied.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFSetField (3T),
.IR TIFFSetDirectory (3T),
diff --git a/man/TIFFOpen.3t b/man/TIFFOpen.3t
index 9606b00e..6446ff03 100644
--- a/man/TIFFOpen.3t
+++ b/man/TIFFOpen.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFOpen.3t,v 1.11 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFOpen.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -185,5 +185,5 @@ A file with a byte ordering opposite to the native byte
ordering of the current machine was opened for appending (``a'').
This is a limitation of the library.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFClose (3T)
diff --git a/man/TIFFPrintDirectory.3t b/man/TIFFPrintDirectory.3t
index 395a7fbb..cf96701f 100644
--- a/man/TIFFPrintDirectory.3t
+++ b/man/TIFFPrintDirectory.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFPrintDirectory.3t,v 1.5 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFPrintDirectory.3t,v 1.7 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -65,7 +65,7 @@ None.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadDirectory (3T),
.IR TIFFSetDirectory (3T)
diff --git a/man/TIFFRGBAImage.3t b/man/TIFFRGBAImage.3t
new file mode 100644
index 00000000..1a7090c7
--- /dev/null
+++ b/man/TIFFRGBAImage.3t
@@ -0,0 +1,275 @@
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFRGBAImage.3t,v 1.1 1995/10/11 22:53:37 sam Exp $
+.\"
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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.
+.\"
+.if n .po 0
+.TH TIFFRGBAImage 3T "October 15, 1995"
+.SH NAME
+TIFFRGBAImage \- read and decode an image into a raster
+.SH SYNOPSIS
+.nf
+.B "#include <tiffio.h>"
+.B "typedef unsigned char TIFFRGBValue;"
+.B "typedef struct _TIFFRGBAImage TIFFRGBAImage;"
+.B "int TIFFRGBAImageOK(TIFF* tif, char emsg[1024]);"
+.B "int TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stopOnError, char emsg[1024]);"
+.B "int TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 width, uint32 height);"
+.B "void TIFFRGBAImageEnd(TIFFRGBAImage* img);"
+.SH DESCRIPTION
+The routines described here provide a high-level interface
+through which
+.SM TIFF
+images may be read into memory.
+Images may be strip- or tile-based and have a variety of different
+characteristics: bits/sample, samples/pixel, photometric, etc.
+Decoding state is encapsulated in a
+.I TIFFRGBAImage
+structure making it possible to capture state for multiple images
+and quickly switch between them.
+The target raster format can be customized to a particular application's
+needs by installing custom routines that manipulate image data
+according to application requirements.
+.PP
+The default usage for these routines is: check if an image can
+be processed using
+.IR TIFFRGBAImageOK ,
+construct a decoder state block using
+.IR TIFFRGBAImageBegin ,
+read and decode an image into a target raster using
+.IR TIFFRGBAImageGet ,
+and then
+release resources using
+.IR TIFFRGBAImageEnd .
+.I TIFFRGBAImageGet
+can be called multiple times to decode an image using different
+state parameters.
+If multiple images are to be displayed and there is not enough
+space for each of the decoded rasters, multiple state blocks can
+be managed and then calls can be made to
+.I TIFFRGBAImageGet
+as needed to display an image.
+.PP
+The generated raster is assumed to be an array of
+.I width
+times
+.I height
+32-bit entries, where
+.I width
+must be less than or equal to the width of the image (\c
+.I height
+may be any non-zero size).
+If the raster dimensions are smaller than the image, the image data
+is cropped to the raster bounds.
+If the raster height is greater than that of the image, then the
+image data are placed in the lower part of the raster.
+(Note that the raster is assume to be organized such that the pixel
+at location (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP];
+with the raster origin in the lower-left hand corner.)
+.PP
+Raster pixels are 8-bit packed red, green, blue, alpha samples.
+The macros
+.IR TIFFGetR ,
+.IR TIFFGetG ,
+.IR TIFFGetB ,
+and
+.I TIFFGetA
+should be used to access individual samples.
+Images without Associated Alpha matting information have a constant
+Alpha of 1.0 (255).
+.PP
+.I TIFFRGBAImageGet
+converts non-8-bit images by scaling sample values.
+Palette, grayscale, bilevel,
+.SM CMYK\c
+, and YCbCr images are converted to
+.SM RGB
+transparently.
+Raster pixels are returned uncorrected by any colorimetry information
+present in the directory.
+.PP
+The paramater
+.I stopOnError
+specifies how to act if an error is encountered while reading
+the image.
+If
+.I stopOnError
+is non-zero, then an error will terminate the operation; otherwise
+.I TIFFRGBAImageGet
+will continue processing data until all the possible data in the
+image have been requested.
+.SH "ALTERNATE RASTER FORMATS"
+To use the core support for reading and processing
+.SM TIFF
+images, but write the resulting raster data in a different format
+one need only override the ``\fIput methods\fP'' used to store raster data.
+These methods are are defined in the
+.I TIFFRGBAImage
+structure and initially setup by
+.I TIFFRGBAImageBegin
+to point to routines that pack raster data in the default
+.SM ABGR
+pixel format.
+Two different routines are used according to the physical organization
+of the image data in the file:
+.IR PlanarConfiguration =1
+(packed samples),
+and
+.IR PlanarConfiguration =2
+(separated samples).
+Note that this mechanism can be used to transform the data before
+storing it in the raster.
+For example one can convert data
+to colormap indices for display on a colormap display.
+.SH "SIMULTANEOUS RASTER STORE AND DISPLAY"
+It is simple to display an image as it is being read into memory
+by overriding the put methods as described above for supporting
+alternate raster formats.
+Simply keep a reference to the default put methods setup by
+.I TIFFRGBAImageBegin
+and then invoke them before or after each display operation.
+For example, the
+.IR tiffgt (1)
+utility uses the following put method to update the display as
+the raster is being filled:
+.sp
+.nf
+.ft C
+static void
+putContigAndDraw(TIFFRGBAImage* img, uint32* raster,
+ uint32 x, uint32 y, uint32 w, uint32 h,
+ int32 fromskew, int32 toskew,
+ unsigned char* cp)
+{
+ (*putContig)(img, raster, x, y, w, h, fromskew, toskew, cp);
+ if (x+w == width) {
+ w = width;
+ if (img->orientation == ORIENTATION_TOPLEFT)
+ lrectwrite(0, y-(h-1), w-1, y, raster-x-(h-1)*w);
+ else
+ lrectwrite(0, y, w-1, y+h-1, raster);
+ }
+}
+.ft R
+.fi
+.sp
+(the original routine provided by the library is saved in the
+variable
+.IR putContig .)
+.SH "SUPPORTING ADDITIONAL TIFF FORMATS"
+The
+.I TIFFRGBAImage
+routines support the most commonly encountered flavors of
+.SM TIFF.
+It is possible to extend this support by overriding the ``\fIget method\fP''
+invoked by
+.I TIFFRGBAImageGet
+to read
+.SM TIFF
+image data.
+Details of doing this are a bit involved, it is best to make a copy
+of an existing get method and modify it to suit the needs of an
+application.
+.SH NOTES
+Samples must be either 1, 2, 4, 8, or 16 bits.
+Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
+.I SamplesPerPixel
+minus
+.IR ExtraSamples ).
+.PP
+Palettte image colormaps that appear to be incorrectly written
+as 8-bit values are automatically scaled to 16-bits.
+.SH "RETURN VALUES"
+All routines return
+1 if the operation was successful.
+Otherwise, 0 is returned if an error was encountered and
+.I stopOnError
+is zero.
+.SH DIAGNOSTICS
+All error messages are directed to the
+.IR TIFFError (3T)
+routine.
+.PP
+.BR "Sorry, can not handle %d-bit pictures" .
+The image had
+.I BitsPerSample
+other than 1, 2, 4, 8, or 16.
+.PP
+.BR "Sorry, can not handle %d-channel images" .
+The image had
+.I SamplesPerPixel
+other than 1, 3, or 4.
+.PP
+\fBMissing needed "PhotometricInterpretation" tag\fP.
+The image did not have a tag that describes how to display
+the data.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
+The image was missing a tag that describes how to display it,
+but because it has 3 or 4 samples/pixel, it is assumed to be
+.SM RGB.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP.
+The image was missing a tag that describes how to display it,
+but because it has 1 sample/pixel, it is assumed to be a grayscale
+or bilevel image.
+.PP
+.BR "No space for photometric conversion table" .
+There was insufficient memory for a table used to convert
+image samples to 8-bit
+.SM RGB.
+.PP
+\fBMissing required "Colormap" tag\fP.
+A Palette image did not have a required
+.I Colormap
+tag.
+.PP
+.BR "No space for tile buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "No space for strip buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "Can not handle format" .
+The image has a format (combination of
+.IR BitsPerSample ,
+.IR SamplesPerPixel ,
+and
+.IR PhotometricInterpretation )
+that can not be handled.
+.PP
+.BR "No space for B&W mapping table" .
+There was insufficient memory to allocate a table used to map
+grayscale data to
+.SM RGB.
+.PP
+.BR "No space for Palette mapping table" .
+There was insufficient memory to allocate a table used to map
+data to 8-bit
+.SM RGB.
+.SH BUGS
+Orientations other than bottom-left, or top-left are
+not handled correctly.
+.SH "SEE ALSO"
+.IR libtiff (3T),
+.IR TIFFOpen (3T),
+.IR TIFFReadRGBAImage (3T)
diff --git a/man/TIFFReadDirectory.3t b/man/TIFFReadDirectory.3t
index b0fe4ba6..d124018d 100644
--- a/man/TIFFReadDirectory.3t
+++ b/man/TIFFReadDirectory.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadDirectory.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadDirectory.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadDirectory 3T "December 16, 1991"
+.TH TIFFReadDirectory 3T "October 15, 1995"
.SH NAME
TIFFReadDirectory \- get the contents of the next directory in an open
.SM TIFF
@@ -52,7 +52,11 @@ up of multiple strips or tiles of approximately 8 kilobytes each.
This operation is done only in-memory; it does not alter the
contents of the file.
However, the construction of the ``chopped strips'' is visible
-to the application through the number of strips/tiles.
+to the application through the number of strips [tiles]
+returned by
+.I TIFFNumberOfStrips
+[\c
+.IR TIFFNumberOfTiles ].
.SH "RETURN VALUES"
If the next directory was successfully read, 1 is returned.
Otherwise, 0 is returned if an error was encountered,
@@ -153,7 +157,8 @@ unspecified.
If the image has a single strip, the library will estimate
the missing value based on the file size.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteDirectory (3T),
-.IR TIFFSetDirectory (3T)
+.IR TIFFSetDirectory (3T),
+.IR TIFFSetSubDirectory (3T)
diff --git a/man/TIFFReadEncodedStrip.3t b/man/TIFFReadEncodedStrip.3t
index 0f51f8dd..ce4ccc2d 100644
--- a/man/TIFFReadEncodedStrip.3t
+++ b/man/TIFFReadEncodedStrip.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadEncodedStrip.3t,v 1.12 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadEncodedStrip.3t,v 1.15 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadEncodedStrip 3T "December 16, 1991"
+.TH TIFFReadEncodedStrip 3T "October 15, 1995"
.SH NAME
TIFFReadEncodedStrip \- read and decode a strip of data from an open
.SM TIFF
@@ -33,7 +33,7 @@ file
.br
.B "tsize_t TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)"
.SH DESCRIPTION
-Read the specified strip of data and place
+Read the specified strip of data and place up to
.I size
bytes of decompressed information in the (user supplied) data buffer.
.SH NOTES
@@ -67,7 +67,7 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadRawStrip (3T),
.IR TIFFReadScanline (3T)
diff --git a/man/TIFFReadEncodedTile.3t b/man/TIFFReadEncodedTile.3t
index c42474ec..f865654b 100644
--- a/man/TIFFReadEncodedTile.3t
+++ b/man/TIFFReadEncodedTile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadEncodedTile.3t,v 1.8 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadEncodedTile.3t,v 1.11 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadEncodedTile 3T "December 16, 1991"
+.TH TIFFReadEncodedTile 3T "October 15, 1995"
.SH NAME
TIFFReadEncodedTile \- read and decode a tile of data from an open
.SM TIFF
@@ -33,7 +33,7 @@ file
.br
.B "int TIFFReadEncodedTile(TIFF* tif, u_long tile, u_char* buf, u_long size)"
.SH DESCRIPTION
-Read the specified tile of data and place
+Read the specified tile of data and place up to
.I size
bytes of decompressed information in the (user supplied) data buffer.
.SH NOTES
@@ -70,7 +70,7 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadRawTile (3T),
.IR TIFFReadTile (3T)
diff --git a/man/TIFFReadRGBAImage.3t b/man/TIFFReadRGBAImage.3t
index f215aa92..9c1b5e4d 100644
--- a/man/TIFFReadRGBAImage.3t
+++ b/man/TIFFReadRGBAImage.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRGBAImage.3t,v 1.6 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRGBAImage.3t,v 1.10 1995/10/11 22:53:44 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -71,7 +71,9 @@ Alpha of 1.0 (255).
.PP
.I TIFFReadRGBAImage
converts non-8-bit images by scaling sample values.
-Palette, grayscale, bilevel, CMYK, and YCbCr images are converted to
+Palette, grayscale, bilevel,
+.SM CMYK\c
+, and YCbCr images are converted to
.SM RGB
transparently.
Raster pixels are returned uncorrected by any colorimetry information
@@ -93,12 +95,20 @@ In C++ the
parameter defaults to 0.
.PP
Samples must be either 1, 2, 4, 8, or 16 bits.
-Samples/pixel must be either 1, 3, or 4.
+Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
+.I SamplesPerPixel
+minus
+.IR ExtraSamples ).
.PP
Palettte image colormaps that appear to be incorrectly written
as 8-bit values are automatically scaled to 16-bits.
+.PP
+.I TIFFReadRGBAImage
+is just a wrapper around the more general
+.IR TIFFRGBAImage (3T)
+facilities.
.SH "RETURN VALUES"
-1 is returned 1 if the image was successfully read and converted.
+1 is returned if the image was successfully read and converted.
Otherwise, 0 is returned if an error was encountered and
.I stopOnError
is zero.
@@ -167,11 +177,9 @@ There was insufficient memory to allocate a table used to map
data to 8-bit
.SM RGB.
.SH BUGS
-Alpha is not currently returned or set to 1.0.
Orientations other than bottom-left, or top-left are
not handled correctly.
-The pixel packing organization is optimized for a specific machine
-architecture.
.SH "SEE ALSO"
-.IR intro (3T),
-.IR TIFFOpen (3T)
+.IR libtiff (3T),
+.IR TIFFOpen (3T),
+.IR TIFFRGBAImage (3T)
diff --git a/man/TIFFReadRawStrip.3t b/man/TIFFReadRawStrip.3t
index 41209ce3..3c237b46 100644
--- a/man/TIFFReadRawStrip.3t
+++ b/man/TIFFReadRawStrip.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRawStrip.3t,v 1.9 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRawStrip.3t,v 1.12 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadRawStrip 3T "December 16, 1991"
+.TH TIFFReadRawStrip 3T "October 15, 1995"
.SH NAME
TIFFReadRawStrip \- return the undecoded contents
of a strip of data from an open
@@ -56,7 +56,8 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadEncodedStrip (3T),
-.IR TIFFReadScanline (3T)
+.IR TIFFReadScanline (3T),
+.IR TIFFStripSize (3T)
diff --git a/man/TIFFReadRawTile.3t b/man/TIFFReadRawTile.3t
index 5cdec031..23a5e7da 100644
--- a/man/TIFFReadRawTile.3t
+++ b/man/TIFFReadRawTile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRawTile.3t,v 1.8 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadRawTile.3t,v 1.11 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadRawTile 3T "December 16, 1991"
+.TH TIFFReadRawTile 3T "October 15, 1995"
.SH NAME
TIFFReadRawTile \- return an undecoded tile of data from an open
.SM TIFF
@@ -41,12 +41,12 @@ is a ``raw tile number.''
That is, the caller must take into account whether or not the
data is organized in separate planes (\c
.IR PlanarConfiguration =2).
-.IR TIFFComputeTile ()
+.I TIFFComputeTile
automatically does this when converting an (x,y,z,sample)
coordinate quadruple to a tile number.
To read a full tile of data the data buffer should typically be
at least as large as the value returned by
-.IR TIFFTileSize ().
+.IR TIFFTileSize .
.SH "RETURN VALUES"
The actual number of bytes of data that were placed in
.I buf
@@ -58,7 +58,8 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadEncodedTile (3T),
-.IR TIFFReadTile (3T)
+.IR TIFFReadTile (3T),
+.IR TIFFTileSize (3T)
diff --git a/man/TIFFReadScanline.3t b/man/TIFFReadScanline.3t
index 2466af88..7abad14b 100644
--- a/man/TIFFReadScanline.3t
+++ b/man/TIFFReadScanline.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadScanline.3t,v 1.12 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadScanline.3t,v 1.15 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFReadScanline 3T "December 16, 1991"
+.TH TIFFReadScanline 3T "October 15, 1995"
.SH NAME
TIFFReadScanline \- read and decode a scanline of data from an open
.SM TIFF
@@ -90,9 +90,10 @@ because, for
the size of a scanline is not calculated on a per-sample basis,
and for
.IR PlanarConfiguration =1
-the library does not unpack the block-interleaved samples.
+the library does not unpack the block-interleaved samples; use
+the strip- and tile-based interfaces to read these formats.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFReadEncodedStrip (3T),
.IR TIFFReadRawStrip (3T)
diff --git a/man/TIFFReadTile.3t b/man/TIFFReadTile.3t
index 4e2e4200..d8c116a9 100644
--- a/man/TIFFReadTile.3t
+++ b/man/TIFFReadTile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadTile.3t,v 1.9 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFReadTile.3t,v 1.11 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -77,7 +77,7 @@ All error messages are directed to the
.IR TIFFError (3T)
routine.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFCheckTile (3T),
.IR TIFFComputeTile (3T),
.IR TIFFOpen (3T),
diff --git a/man/TIFFSetDirectory.3t b/man/TIFFSetDirectory.3t
index 35711a58..5eab2796 100644
--- a/man/TIFFSetDirectory.3t
+++ b/man/TIFFSetDirectory.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetDirectory.3t,v 1.9 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetDirectory.3t,v 1.12 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,27 +23,40 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFSetDirectory 3T "December 16, 1991"
+.TH TIFFSetDirectory 3T "October 15, 1995"
.SH NAME
-TIFFSetDirectory \- set the current directory for an open
+TIFFSetDirectory, TIFFSetSubDirectory \- set the current directory for an open
.SM TIFF
file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.br
.B "int TIFFSetDirectory(TIFF* tif, tdir_t dirnum)"
+.br
+.B "int TIFFSetSubDirectory(TIFF* tif, uint32 diroff)"
.SH DESCRIPTION
-Set the specified directory to be the current directory
-and read the directory's contents with
+.I TIFFSetDirectory
+changes the current directory and reads its contents with
.IR TIFFReadDirectory .
The parameter
.I dirnum
specifies the subfile/directory as an integer number, with
the first directory numbered zero.
+.PP
+.I TIFFSetSubDirectory
+acts like
+.IR TIFFSetDirectory ,
+except the directory is specified as a
+file offset instead of an index; this is required for accessing
+subdirectories linked through a
+.I SubIFD
+tag.
.SH "RETURN VALUES"
On successful return 1 is returned.
Otherwise, 0 is returned if
.I dirnum
+or
+.I diroff
specifies a non-existent directory, or if an error was
encountered while reading the directory's contents.
.SH DIAGNOSTICS
@@ -58,7 +71,7 @@ An error was encountered while reading the ``directory count'' field.
An error was encountered while reading the ``link value'' that
points to the next directory in a file.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFCurrentDirectory (3T),
.IR TIFFOpen (3T),
.IR TIFFReadDirectory (3T),
diff --git a/man/TIFFSetField.3t b/man/TIFFSetField.3t
index 973ffeaf..f292733a 100644
--- a/man/TIFFSetField.3t
+++ b/man/TIFFSetField.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetField.3t,v 1.12 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetField.3t,v 1.15 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFSetField 3T "February 14, 1992"
+.TH TIFFSetField 3T "October 15, 1995"
.SH NAME
TIFFSetField \- set the value(s) of a tag in a
.SM TIFF
@@ -38,11 +38,17 @@ file open for writing
.B "int TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)"
.SH DESCRIPTION
.IR TIFFSetField
-sets the value of a field in the current directory associated with
+sets the value of a field
+or pseudo-tag in the current directory associated with
the open
.SM TIFF
file
.IR tif .
+(A
+.I pseudo-tag
+is a parameter that is used to control the operation of the
+.SM TIFF
+library but whose value is not read or written to the underlying file.)
The file must have been previously opened for writing with
.IR TIFFOpen (3T).
The field is identified by
@@ -88,7 +94,7 @@ Consult the
specification for information on the meaning of each tag.
.PP
.nf
-.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'uint16,uint16* \(dg'u+2n
+.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc \(dg'u+2n
\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP
.sp 5p
TIFFTAG_ARTIST 1 char*
@@ -101,7 +107,9 @@ TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32
TIFFTAG_DATETIME 1 char*
TIFFTAG_DOCUMENTNAME 1 char*
TIFFTAG_DOTRANGE 2 uint16
-TIFFTAG_EXTRASAMPLES 2 uint16,uint16* \(dg count & types array
+TIFFTAG_EXTRASAMPLES 2 uint16,uint16* \(dg count & types array
+TIFFTAG_FAXMODE 1 int \(dg G3/G4 compression pseudo-tag
+TIFFTAG_FAXFILLFUNC 1 TIFFFaxFillFunc G3/G4 compression pseudo-tag
TIFFTAG_FILLORDER 1 uint16 \(dg
TIFFTAG_GROUP3OPTIONS 1 uint32 \(dg
TIFFTAG_GROUP4OPTIONS 1 uint32 \(dg
@@ -113,11 +121,10 @@ TIFFTAG_IMAGELENGTH 1 uint32
TIFFTAG_IMAGEWIDTH 1 uint32 \(dg
TIFFTAG_INKNAMES 1 char*
TIFFTAG_INKSET 1 uint16 \(dg
-TIFFTAG_JPEGPROC 1 uint16 \(dg
-TIFFTAG_JPEGRESTARTINTERVAL 1 uint16 \(dg
-TIFFTAG_JPEGACTABLES 1 u_char** \(dg SamplesPerPixel arrays
-TIFFTAG_JPEGDCTABLES 1 u_char** \(dg SamplesPerPixel arrays
-TIFFTAG_JPEGQTABLES 1 uint16** \(dg SamplesPerPixel 64-entry arrays
+TIFFTAG_JPEGTABLES 2 uint32*,void* \(dg count & tables
+TIFFTAG_JPEGQUALITY 1 int JPEG pseudo-tag
+TIFFTAG_JPEGCOLORMODE 1 int \(dg JPEG pseudo-tag
+TIFFTAG_JPEGTABLESMODE 1 int \(dg JPEG pseudo-tag
TIFFTAG_MAKE 1 char*
TIFFTAG_MATTEING 1 uint16 \(dg
TIFFTAG_MAXSAMPLEVALUE 1 uint16
@@ -135,8 +142,11 @@ TIFFTAG_RESOLUTIONUNIT 1 uint16
TIFFTAG_ROWSPERSTRIP 1 uint32 \(dg must be > 0
TIFFTAG_SAMPLEFORMAT 1 uint16 \(dg
TIFFTAG_SAMPLESPERPIXEL 1 uint16 \(dg value must be <= 4
+TIFFTAG_SMAXSAMPLEVALUE 1 double
+TIFFTAG_SMINSAMPLEVALUE 1 double
TIFFTAG_SOFTWARE 1 char*
TIFFTAG_SUBFILETYPE 1 uint32
+TIFFTAG_SUBIFD 2 uint16,uint32* count & offsets array
TIFFTAG_TARGETPRINTER 1 char*
TIFFTAG_THRESHHOLDING 1 uint16
TIFFTAG_TILEDEPTH 1 uint32 \(dg
@@ -153,12 +163,16 @@ TIFFTAG_YPOSITION 1 float
TIFFTAG_YRESOLUTION 1 float
.fi
.sp 5p
-(\(dg Tag may not have its values changed once data is written.)
-(\(dd
+\(dg Tag may not have its values changed once data is written.
+.br
+\(dd
If
.I SamplesPerPixel
is one, then a single array is passed; otherwise three arrays should be
-passed.)
+passed.
+.SH "RETURN VALUES"
+1 is returned if the tag is defined in the current
+directory; otherwise a 0 is returned.
.SH "RETURN VALUES"
1 is returned if the operation was successful.
Otherwise, 0 is returned if an error was detected.
@@ -176,7 +190,7 @@ the format of written data.
\fB%d: Bad value for "%s"\fP.
An invalid value was supplied for the named tag.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFGetField (3T),
.IR TIFFSetDirectory (3T),
diff --git a/man/TIFFWarning.3t b/man/TIFFWarning.3t
index 344a6899..a3e59902 100644
--- a/man/TIFFWarning.3t
+++ b/man/TIFFWarning.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWarning.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWarning.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFWarning 3T "December 16, 1991"
+.TH TIFFWarning 3T "October 15, 1995"
.SH NAME
TIFFWarning, TIFFSetWarningHandler \- library warning interface
.SH SYNOPSIS
@@ -33,7 +33,7 @@ TIFFWarning, TIFFSetWarningHandler \- library warning interface
.sp .5
.B "#include <stdargh.h>"
.br
-.B "typedef void (*TIFFWarningHandler)(char* module, char* fmt, va_list ap);"
+.B "typedef void (*TIFFWarningHandler)(const char* module, const char* fmt, va_list ap);"
.br
.B "TIFFWarningHandler TIFFSetWarningHandler(TIFFWarningHandler handler);"
.SH DESCRIPTION
@@ -65,6 +65,6 @@ suppress error messages.
.IR TIFFSetWarningHandler
returns a reference to the previous error handling function.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFError (3T),
.IR printf (3S)
diff --git a/man/TIFFWriteDirectory.3t b/man/TIFFWriteDirectory.3t
index 61c94be8..f390737d 100644
--- a/man/TIFFWriteDirectory.3t
+++ b/man/TIFFWriteDirectory.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteDirectory.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteDirectory.3t,v 1.12 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -97,7 +97,7 @@ a previous directory.
This can occur when setting up a link to the directory that is being
written.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFError (3T),
.IR TIFFReadDirectory (3T),
diff --git a/man/TIFFWriteEncodedStrip.3t b/man/TIFFWriteEncodedStrip.3t
index a7a24e73..6be98cc2 100644
--- a/man/TIFFWriteEncodedStrip.3t
+++ b/man/TIFFWriteEncodedStrip.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteEncodedStrip.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteEncodedStrip.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFWriteEncodedStrip 3T "December 16, 1991"
+.TH TIFFWriteEncodedStrip 3T "October 15, 1995"
.SH NAME
TIFFWritedEncodedStrip \- compress and write a strip of data to an open
.SM TIFF
@@ -37,9 +37,8 @@ Compress
.I size
bytes of raw data from
.I buf
-and
-.B append
-the result to the end of the specified strip.
+and write the result to the specified strip; replacing
+any previously written data.
Note that the value of
.I strip
is a ``raw strip number.''
@@ -52,6 +51,17 @@ Correctly implemented
.SM TIFF
readers are expected to do any necessary byte-swapping to
correctly process image data with BitsPerSample greater than 8.
+.PP
+The strip number must be valid according to the current settings
+of the
+.I ImageLength
+and
+.I RowsPerStrip
+tags.
+An image may be dynamically grown by increasing the value of
+.I ImageLength
+prior to each call to
+.IR TIFFWriteEncodedStrip .
.SH "RETURN VALUES"
\-1 is returned if an error was encountered.
Otherwise, the value of
@@ -89,7 +99,7 @@ for information on how to do this.
There was not enough space for the arrays that hold strip
offsets and byte counts.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteScanline (3T),
.IR TIFFWriteRawStrip (3T)
diff --git a/man/TIFFWriteEncodedTile.3t b/man/TIFFWriteEncodedTile.3t
index e256bb29..9decae89 100644
--- a/man/TIFFWriteEncodedTile.3t
+++ b/man/TIFFWriteEncodedTile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteEncodedTile.3t,v 1.8 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteEncodedTile.3t,v 1.10 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -92,7 +92,7 @@ for information on how to do this.
There was not enough space for the arrays that hold tile
offsets and byte counts.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteTile (3T),
.IR TIFFWriteRawTile (3T)
diff --git a/man/TIFFWriteRawStrip.3t b/man/TIFFWriteRawStrip.3t
index 920534bc..ba6d489c 100644
--- a/man/TIFFWriteRawStrip.3t
+++ b/man/TIFFWriteRawStrip.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteRawStrip.3t,v 1.9 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteRawStrip.3t,v 1.12 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFWriteRawstrip 3T "December 16, 1991"
+.TH TIFFWriteRawstrip 3T "October 15, 1995"
.SH NAME
TIFFWriteRawStrip \- write a strip of raw data to an open
.SM TIFF
@@ -36,6 +36,17 @@ file
Append
.I size
bytes of raw data to the specified strip.
+.SH NOTES
+The strip number must be valid according to the current settings
+of the
+.I ImageLength
+and
+.I RowsPerStrip
+tags.
+An image may be dynamically grown by increasing the value of
+.I ImageLength
+prior to each call to
+.IR TIFFWriteRawStrip .
.SH "RETURN VALUES"
\-1 is returned if an error occurred.
Otherwise, the value of
@@ -77,7 +88,7 @@ offsets and byte counts.
The specified strip is not a valid strip according to the
currently specified image dimensions.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteEncodedStrip (3T),
.IR TIFFWriteScanline (3T)
diff --git a/man/TIFFWriteRawTile.3t b/man/TIFFWriteRawTile.3t
index a3149f7f..441cd9e3 100644
--- a/man/TIFFWriteRawTile.3t
+++ b/man/TIFFWriteRawTile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteRawTile.3t,v 1.8 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteRawTile.3t,v 1.10 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -77,7 +77,7 @@ offsets and byte counts.
The specified tile is not valid according to the currently
specified image dimensions.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteEncodedTile (3T),
.IR TIFFWriteScanline (3T)
diff --git a/man/TIFFWriteScanline.3t b/man/TIFFWriteScanline.3t
index 6fc8fb4a..a09beecf 100644
--- a/man/TIFFWriteScanline.3t
+++ b/man/TIFFWriteScanline.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteScanline.3t,v 1.11 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFWriteScanline.3t,v 1.13 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -156,7 +156,7 @@ and for
.IR PlanarConfiguration =1
the library does not pack the block-interleaved samples.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFWriteEncodedStrip (3T),
.IR TIFFWriteRawStrip (3T)
diff --git a/man/TIFFbuffer.3t b/man/TIFFbuffer.3t
new file mode 100644
index 00000000..bb80474a
--- /dev/null
+++ b/man/TIFFbuffer.3t
@@ -0,0 +1,77 @@
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFbuffer.3t,v 1.1 1995/10/12 00:43:54 sam Exp $
+.\"
+.\" Copyright (c) 1995 Sam Leffler
+.\" Copyright (c) 1995 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.
+.\"
+.if n .po 0
+.TH TIFFBUFFER 3T "October 15, 1995"
+.SH NAME
+TIFFReadBufferSetup,
+TIFFWriteBufferSetup
+\- I/O buffering control routines
+.SH SYNOPSIS
+.nf
+.B "#include <tiffio.h>"
+.B "int TIFFReadBufferSetup(TIFF*, tdata_t buffer, tsize_t size);"
+.B "int TIFFWriteBufferSetup(TIFF*, tdata_t buffer, tsize_t size);"
+.fi
+.SH DESCRIPTION
+The following routines are provided for client-control of the
+I/O buffers used by the library.
+Applications need never use these routines; they are provided only
+for ``intelligent clients'' that wish to optimize memory usage and/or
+eliminate potential copy operations that can occur when working with
+images that have data stored without compression.
+.PP
+.I TIFFReadBufferSetup
+sets up the data buffer used to read raw (encoded) data from a file.
+If the specified pointer is
+.SM NULL
+(zero), then a buffer of the appropriate size is allocated.
+Otherwise the caller must guarantee that the buffer is large
+enough to hold any individual strip of raw data.
+.I TIFFReadBufferSetup
+returns a non-zero value if the setup was successful and zero otherwise.
+.PP
+.I TIFFWriteBufferSetup
+sets up the data buffer used to write raw (encoded) data to a file.
+If the specified
+.I size
+is \-1 then the buffer size is selected to hold a complete
+tile or strip, or at least 8 kilobytes, whichever is greater.
+If the specified
+.I buffer
+is
+.SM NULL
+(zero), then a buffer of the appropriate size is dynamically allocated.
+.I TIFFWriteBufferSetup
+returns a non-zero value if the setup was successful and zero otherwise.
+.SH DIAGNOSTICS
+.BR "%s: No space for data buffer at scanline %ld" .
+.I TIFFReadBufferSetup
+was unable to dynamically allocate space for a data buffer.
+.PP
+.BR "%s: No space for output buffer" .
+.I TIFFWriteBufferSetup
+was unable to dynamically allocate space for a data buffer.
+.SH "SEE ALSO"
+.IR libtiff (3T)
diff --git a/man/TIFFcodec.3t b/man/TIFFcodec.3t
new file mode 100644
index 00000000..9c0a753c
--- /dev/null
+++ b/man/TIFFcodec.3t
@@ -0,0 +1,73 @@
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFcodec.3t,v 1.1 1995/10/12 00:04:30 sam Exp $
+.\"
+.\" Copyright (c) 1995 Sam Leffler
+.\" Copyright (c) 1995 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.
+.\"
+.if n .po 0
+.TH CODEC 3T "October 15, 1995"
+.SH NAME
+TIFFFindCODEC, TIFFRegisterCODEC, TIFFUnRegisterCODEC \- codec-related utility routines
+.SH SYNOPSIS
+.B "#include <tiffio.h>"
+.br
+.B "const TIFFCodec* TIFFFindCODEC(uint16 scheme);"
+.br
+.B "TIFFCodec* TIFFRegisterCODEC(uint16 scheme, const char* method, TIFFInitMethod init);"
+.br
+.B "void TIFFUnRegisterCODEC(TIFFCodec* codec);"
+.SH DESCRIPTION
+.I libtiff
+supports a variety of compression schemes implemented by software
+.IR codecs .
+Each codec adheres to a modular interface that provides for
+the decoding and encoding of image data; as well as some other
+methods for initialization, setup, cleanup, and the control
+of default strip and tile sizes.
+Codecs are identified by the associated value of the
+.SM TIFF
+.I Compression
+tag; e.g. 5 for
+.SM LZW
+compression.
+.PP
+The
+.I TIFFRegisterCODEC
+routine can be used to
+augment or override the set of codecs available to an application.
+If the specified
+.I scheme
+already has a registered codec then it is
+.I overridden
+and any images with data encoded with this
+compression scheme will be decoded using the supplied coded.
+.SH DIAGNOSTICS
+.BR "No space to register compression scheme %s" .
+.I TIFFRegisterCODEC
+was unable to allocate memory for the data structures needed
+to register a codec.
+.PP
+.BR "Cannot remove compression scheme %s; not registered" .
+.I TIFFUnRegisterCODEC
+did not locate the specified codec in the table of registered
+compression schemes.
+.SH "SEE ALSO"
+.IR libtiff (3T)
diff --git a/man/TIFFmemory.3t b/man/TIFFmemory.3t
new file mode 100644
index 00000000..69464c84
--- /dev/null
+++ b/man/TIFFmemory.3t
@@ -0,0 +1,84 @@
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFmemory.3t,v 1.1 1995/10/12 00:04:21 sam Exp $
+.\"
+.\" Copyright (c) 1995 Sam Leffler
+.\" Copyright (c) 1995 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.
+.\"
+.if n .po 0
+.TH MEMORY 3T "October 15, 1995"
+.SH NAME
+_TIFFmalloc, \c
+_TIFFrealloc, \c
+_TIFFfree, \c
+_TIFFmemset, \c
+_TIFFmemcpy, \c
+_TIFFmemcmp, \c
+\- memory management-related functions for use with
+.SM TIFF
+files
+.SH SYNOPSIS
+.nf
+.B "#include <tiffio.h>"
+.B "tdata_t _TIFFmalloc(tsize_t);"
+.B "tdata_t _TIFFrealloc(tdata_t, tsize_t);"
+.B "void _TIFFfree(tdata_t);"
+.B "void _TIFFmemset(tdata_t, int, tsize_t);"
+.B "void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);"
+.B "int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);"
+.fi
+.SH DESCRIPTION
+These routines are provided for writing portable software that uses
+.IR libtiff ;
+they hide any memory-management related issues, such as dealing with
+segmented architectures found on 16-bit machines.
+.PP
+.I _TIFFmalloc
+and
+.I _TIFFrealloc
+are used to dynamically allocate and reallocate memory used by
+.IR libtiff ;
+such as memory passed into the I/O routines.
+Memory allocated through these interfaces is released back to the
+system using the
+.I _TIFFfree
+routine.
+.PP
+Memory allocated through one of the above interfaces can be set to
+a known value using
+.IR _TIFFmemset ,
+copied to another memory location using
+.IR _TIFFmemcpy ,
+or compared for equality using
+.IR _TIFFmemcmp .
+These routines conform to the equivalent
+.SM ANSI
+C routines:
+.IR memset ,
+.IR memcpy ,
+and
+.IR memcmp ,
+repsectively.
+.SH DIAGNOSTICS
+None.
+.SH "SEE ALSO"
+.IR libtiff (3T),
+.IR malloc (3C),
+.IR memory (3C)
diff --git a/man/query.3t b/man/TIFFquery.3t
index 33faf544..a37ab86d 100644
--- a/man/query.3t
+++ b/man/TIFFquery.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/query.3t,v 1.11 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFquery.3t,v 1.14 1995/10/12 00:44:17 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,31 +23,38 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH QUERY 3T "December 16, 1991"
+.TH QUERY 3T "October 15, 1995"
.SH NAME
-TIFFCurrentRow, TIFFCurrentStrip, TIFFCurrentTile, TIFFCurrentDirectory, TIFFFileno, TIFFFileName, TIFFGetMode, TIFFIsTiled, TIFFIsByteSwapped \- query routines
+TIFFCurrentRow,
+TIFFCurrentStrip,
+TIFFCurrentTile,
+TIFFCurrentDirectory,
+TIFFLastDirectory,
+TIFFFileno,
+TIFFFileName,
+TIFFGetMode,
+TIFFIsTiled,
+TIFFIsByteSwapped,
+TIFFIsUpSampled,
+TIFFIsMSB2LSB
+\- query routines
.SH SYNOPSIS
+.nf
.B "#include <tiffio.h>"
-.br
.B "uint32 TIFFCurrentRow(TIFF* tif)"
-.br
.B "tstrip_t TIFFCurrentStrip(TIFF* tif)"
-.br
.B "ttile_t TIFFCurrentTile(TIFF* tif)"
-.br
.B "tdir_t TIFFCurrentDirectory(TIFF* tif)"
-.br
+.B "int TIFFLastDirectory(TIFF* tif)"
.B "int TIFFFileno(TIFF* tif)"
-.br
.B "char* TIFFFileName(TIFF* tif)"
-.br
.B "int TIFFGetMode(TIFF* tif)"
-.br
.B "int TIFFIsTiled(TIFF* tif)"
-.br
.B "int TIFFIsByteSwapped(TIFF* tif)"
-.br
+.B "int TIFFIsUpSampled(TIFF* tif)"
+.B "int TIFFIsMSB2LSB(TIFF* tif)"
.B "const char* TIFFGetVersion(void)"
+.fi
.SH DESCRIPTION
The following routines return status information about an open
.SM TIFF
@@ -60,6 +67,11 @@ This number is suitable for use with the
.IR TIFFSetDirectory
routine.
.PP
+.IR TIFFLastDirectory
+returns a non-zero value if the current directory is the
+last directory in the file;
+otherwise zero is returned.
+.PP
.IR TIFFCurrentRow ,
.IR TIFFCurrentStrip ,
and
@@ -100,6 +112,17 @@ are the same.
Data samples that are more than 8 bits wide must be byte-swapped
by the application.
.PP
+.I TIFFIsUpSampled
+returns a non-zero value if image data returned through the
+read interface routines is being up-sampled.
+This can be useful to applications that want to calculate
+I/O buffer sizes to reflect this usage (though the usual
+strip and tile size routines already do this).
+.PP
+.I TIFFIsMSB2LSB
+returns a non-zero value if the image data is being returned with
+bit 0 as the most significant bit.
+.PP
.IR TIFFGetVersion
returns an
.SM ASCII
@@ -109,6 +132,6 @@ library software.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
.IR TIFFFdOpen (3T)
diff --git a/man/size.3t b/man/TIFFsize.3t
index cfe705af..f5db2664 100644
--- a/man/size.3t
+++ b/man/TIFFsize.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/size.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFsize.3t,v 1.13 1995/10/12 00:44:17 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,61 +23,35 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH SIZE 3T "December 16, 1991"
+.TH TIFFSIZE 3T "October 15, 1995"
.SH NAME
-TIFFScanlineSize, TIFFStripSize, TIFFTileSize \- return the size (in bytes) of a scanline, strip, or tile for an open
+TIFFScanlineSize,
+TIFFRasterScanlineSize,
+\- return the size of various items associated with an open
.SM TIFF
file
.SH SYNOPSIS
.nf
.B "#include <tiffio.h>"
+.B "tsize_t TIFFRasterScanlineSize(TIFF* tif)"
.B "tsize_t TIFFScanlineSize(TIFF* tif)"
-.B "tsize_t TIFFStripSize(TIFF* tif)"
-.B "tsize_t TIFFVStripSize(TIFF* tif, uint32 nrows)"
-.B "tsize_t TIFFTileSize(TIFF* tif)"
-.B "tsize_t TIFFVTileSize(TIFF* tif, uint32 nrows)"
.SH DESCRIPTION
-.IR TIFFScanlineSize
+.I TIFFScanlineSize
returns the size in bytes of a row of data as it would be
returned in a call to
.IR TIFFReadScanline ,
or as it would be expected in a call to
.IR TIFFWriteScanline .
.PP
-.IR TIFFStripSize
-returns the equivalent size for a strip of data as it would
-be returned in a call to
-.IR TIFFReadEncodedStrip
-or as it would be expected in a call to
-.IR TIFFWriteEncodedStrip .
-.PP
-.IR TIFFTileSize
-returns the equivalent size for a tile of data as it would
-be returned in a call to
-.IR TIFFReadTile
-or as it would be expected in a call to
-.IR TIFFWriteTile .
-.PP
-.IR TIFFVStripSize
-returns the number of bytes in a strip with
-.I nrows
-rows of data.
-Likewise,
-.IR TIFFVTileSize
-returns the number of bytes in a row-aligned tile with
-.I nrows
-of data.
-.PP
-These sizes are typically used when dynamically allocating
-I/O buffers.
+.I TIFFRasterScanlineSize
+returns the size in bytes of a complete decoded and packed
+raster scanline.
+Note that this value may be different from the value returned by
+.I TIFFScanlineSize
+if data is stored as separate planes.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFOpen (3T),
-.IR TIFFReadScanline (3T),
-.IR TIFFReadEncodedStrip (3T),
-.IR TIFFReadTile (3T),
-.IR TIFFWriteScanline (3T),
-.IR TIFFWriteEncodedStrip (3T),
-.IR TIFFWriteTile (3T)
+.IR TIFFReadScanline (3T)
diff --git a/man/strip.3t b/man/TIFFstrip.3t
index 44b8672e..506c399b 100644
--- a/man/strip.3t
+++ b/man/TIFFstrip.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/strip.3t,v 1.4 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFstrip.3t,v 1.7 1995/10/12 00:44:17 sam Exp $
.\"
-.\" Copyright (c) 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1992-1995 Sam Leffler
+.\" Copyright (c) 1992-1995 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
@@ -23,16 +23,55 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFComputeStrip 3T "February 14, 1992"
+.TH TIFFSTRIP 3T "October 15, 1995"
.SH NAME
-TIFFComputeStrip, TIFFNumberOfStrips \- strip-related utility routines
+TIFFDefaultStripSize,
+TIFFStripSize,
+TIFFVStripSize,
+TIFFComputeStrip,
+TIFFNumberOfStrips
+\- strip-related utility routines
.SH SYNOPSIS
+.nf
.B "#include <tiffio.h>"
-.br
+.B "uint32 TIFFDefaultStripSize(TIFF* tif, uint32 estimate)"
+.B "tsize_t TIFFStripSize(TIFF* tif)"
+.B "tsize_t TIFFVStripSize(TIFF* tif, uint32 nrows)"
.B "tstrip_t TIFFComputeStrip(TIFF* tif, uint32 row, tsample_t sample)"
-.br
.B "tstrip_t TIFFNumberOfStrips(TIFF* tif)"
+.fi
.SH DESCRIPTION
+.I TIFFDefaultStripSize
+returns the number of rows for a reasonable-sized strip according
+to the current settings of the
+.IR ImageWidth ,
+.IR BitsPerSample ,
+.IR SamplesPerPixel ,
+tags and any compression-specific requirements.
+If the
+.I estimate
+parameter, if non-zero, then it is taken as an estimate of the desired
+strip size and adjusted according to any compression-specific requirements.
+The value returned by this function is typically used to define the
+.I RowsPerStrip
+tag.
+In lieu of any unusual requirements
+.I TIFFDefaultStripSize
+tries to create strips that have approximately
+8 kilobytes of uncompressed data.
+.PP
+.IR TIFFStripSize
+returns the equivalent size for a strip of data as it would
+be returned in a call to
+.IR TIFFReadEncodedStrip
+or as it would be expected in a call to
+.IR TIFFWriteEncodedStrip .
+.PP
+.I TIFFVStripSize
+returns the number of bytes in a strip with
+.I nrows
+rows of data.
+.PP
.IR TIFFComputeStrip
returns the strip that contains the specified coordinates.
A valid strip is always returned;
@@ -50,7 +89,7 @@ returns the number of strips in the image.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFReadEncodedStrip (3T),
.IR TIFFReadRawStrip (3T),
.IR TIFFWriteEncodedStrip (3T),
diff --git a/man/swab.3t b/man/TIFFswab.3t
index 8f4f81e9..dfb8d56a 100644
--- a/man/swab.3t
+++ b/man/TIFFswab.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/swab.3t,v 1.8 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFswab.3t,v 1.10 1995/10/11 19:45:29 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -70,4 +70,4 @@ i.e.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
diff --git a/man/tile.3t b/man/TIFFtile.3t
index b282620b..d9f555c5 100644
--- a/man/tile.3t
+++ b/man/TIFFtile.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tile.3t,v 1.10 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFtile.3t,v 1.13 1995/10/12 00:44:17 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,18 +23,61 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFComputeTile 3T "February 14, 1992"
+.TH TIFFTILE 3T "February 14, 1992"
.SH NAME
-TIFFComputeTile, TIFFCheckTile, TIFFNumberOfTiles \- tile-related utility routines
+TIFFTileSize,
+TIFFTileRowSize,
+TIFFVTileSize,
+TIFFDefaultTileSize,
+TIFFComputeTile,
+TIFFCheckTile,
+TIFFNumberOfTiles
+\- tile-related utility routines
.SH SYNOPSIS
+.nf
.B "#include <tiffio.h>"
-.br
+.B "void TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)"
+.B "tsize_t TIFFTileSize(TIFF* tif)"
+.B "tsize_t TIFFTileRowSize(TIFF* tif)"
+.B "tsize_t TIFFVTileSize(TIFF* tif, uint32 nrows)"
.B "ttile_t TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t sample)"
-.br
.B "int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t sample)"
-.br
.B "ttile_t TIFFNumberOfTiles(TIFF* tif)"
+.fi
.SH DESCRIPTION
+.I TIFFDefaultTileSize
+returns the pixel width and height of a reasonable-sized tile;
+suitable for setting up the
+.I TileWidth
+and
+.I TileLength
+tags.
+If the
+.I tw
+and
+.I th
+values passed in are non-zero, then they are adjusted to reflect
+any compression-specific requirements.
+The returned width and height are constrained to be a multiple
+of 16 pixels to conform with the
+.SM TIFF
+specification.
+.PP
+.I TIFFTileSize
+returns the equivalent size for a tile of data as it would
+be returned in a call to
+.I TIFFReadTile
+or as it would be expected in a call to
+.IR TIFFWriteTile .
+.PP
+.I TIFFVTileSize
+returns the number of bytes in a row-aligned tile with
+.I nrows
+of data.
+.PP
+.I TIFFTileRowSize
+returns the number of bytes of a row of data in a tile.
+.PP
.IR TIFFComputeTile
returns the tile that contains the specified coordinates.
A valid tile is always returned;
@@ -82,7 +125,7 @@ returns the number of tiles in the image.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
-.IR intro (3T),
+.IR libtiff (3T),
.IR TIFFReadEncodedTile (3T),
.IR TIFFReadRawTile (3T),
.IR TIFFReadTile (3T),
diff --git a/man/fax2tiff.1 b/man/fax2tiff.1
index 6596d19b..65965c28 100644
--- a/man/fax2tiff.1
+++ b/man/fax2tiff.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/fax2tiff.1,v 1.16 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/fax2tiff.1,v 1.17 1995/10/11 19:41:58 sam Exp $
.\"
-.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1990-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
diff --git a/man/gif2tiff.1 b/man/gif2tiff.1
index 0e260749..352dd5e8 100644
--- a/man/gif2tiff.1
+++ b/man/gif2tiff.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/gif2tiff.1,v 1.6 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/gif2tiff.1,v 1.8 1995/10/11 19:41:58 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH GIF2TIFF 1 "September 26, 1994"
+.TH GIF2TIFF 1 "October 15, 1995"
.SH NAME
gif2tiff \- create a
.SM TIFF
@@ -53,7 +53,9 @@ Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
-for the PackBits compression algorithm),
+for the PackBits compression algorithm,
+.B "-c zip"
+for the Deflate compression algorithm,
and
.B "\-c lzw"
for Lempel-Ziv & Welch (the default).
diff --git a/man/intro.3t b/man/libtiff.3t
index 85b2c1a2..97adbb4f 100644
--- a/man/intro.3t
+++ b/man/libtiff.3t
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/intro.3t,v 1.17 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/libtiff.3t,v 1.21 1995/10/12 00:44:17 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,9 +23,9 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH INTRO 3T "February 14, 1992"
+.TH INTRO 3T "October 15, 1995"
.SH NAME
-intro \- introduction to
+libtiff \- introduction to
.IR libtiff ,
a library for reading and writing
.SM TIFF
@@ -36,7 +36,7 @@ files
cc file.c
.B -ltiff
.SH DESCRIPTION
-.I Libtiff
+.I libtiff
is a library for reading and writing data files encoded with the
.I "Tag Image File"
format, Revision 6.0 (or revision 5.0 or revision 4.0).
@@ -55,14 +55,17 @@ Group 3 Facsimile compression (3),
.SM CCITT
Group 4 Facsimile compression (4),
Lempel-Ziv & Welch compression (5),
-word-aligned 1D Huffman compression (32771), and
+baseline JPEG compression (7),
+word-aligned 1D Huffman compression (32771),
+and
PackBits compression (32773).
In addition, several nonstandard compression algorithms are supported:
the 4-bit compression algorithm used
by the
.I ThunderScan
program (32809) (decompression only),
-and NeXT's 2-bit compression algorithm (32766) (decompression only).
+NeXT's 2-bit compression algorithm (32766) (decompression only), and
+an experimental LZ-style algorithm known as Deflate (32946).
Directory information may be in either little- or big-endian byte
order\-byte swapping is automatically done by the library.
Data bit ordering may be either Most Significant Bit (\c
@@ -94,10 +97,10 @@ function definitions or through parameters passed through the
varargs interfaces.
.in +.5i
.sp 5p
-.ta +\w'typedef unsigned <thing> uint32; 'u
+.ta +\w'typedef unsigned <\fIthing\fP> uint32; 'u
.nf
typedef unsigned short uint16; 16-bit unsigned integer
-typedef unsigned <thing> uint32; 32-bit unsigned integer
+typedef unsigned <\fIthing\fP> uint32; 32-bit unsigned integer
.sp 5p
typedef unsigned int ttag_t; directory tag
typedef uint16 tdir_t; directory index
@@ -143,11 +146,11 @@ Finally, note that user-specified data references are
passed as opaque handles and only cast at the lowest layers where
their type is presumed.
.SH "LIST OF ROUTINES"
-The following routines are available.
+The following routines are part of the library.
Consult specific manual pages for details on their operation.
-(The manual page names give here are for systems
+The manual page names listed below are for systems
where the full function names can not be encoded in the filesystem;
-on most systems doing ``man function-name'' will work.)
+on most systems doing ``man function-name'' will work.
.sp 5p
.nf
.ta \w'TIFFWriteEncodedStrip'u+2n +\w'Appears on Page'u+2n
@@ -189,8 +192,13 @@ TIFFReadRGBAImage rdimage.3t read an image into a fixed format raster
TIFFReadScanline readline.3t read and decode a row of data
TIFFReadTile readtile.3t read and decode a tile of data
TIFFReverseBits swab.3t reverse bits in an array of bytes
+TIFFRGBAImageBegin rgbaimage.3t setup decoder state for TIFFRGBAImageGet
+TIFFRGBAImageEnd rgbaimage.3t release TIFFRGBAImage decoder state
+TIFFRGBAImageGet rgbaimage.3t read and decode an image
+TIFFRGBAImageOK rgbaimage.3t is image readable by TIFFRGBAImageGet
TIFFScanlineSize size.3t return size of a scanline
TIFFSetDirectory setdir.3t set the current directory
+TIFFSetSubDirectory setdir.3t set the current directory
TIFFSetErrorHandler error.3t set error handler function
TIFFSetField setfield.3t set a tag's value in the current directory
TIFFSetWarningHandler error.3t set warning handler function
@@ -219,33 +227,46 @@ The table below lists the
tags that are recognized and handled by the library.
If no use is indicated in the table, then the library
reads and writes the tag, but does not use it internally.
+Note that some tags are meaningful only when a particular
+compression scheme is being used; e.g.
+.I Group3Options
+is only useful if
+.I Compression
+is set to
+.SM CCITT
+Group 3 encoding.
+Tags of this sort are considered
+.I codec-specific
+tags and the library does not recognize them except when the
+.I Compression
+tag has been previously set to the relevant compression scheme.
.sp 5p
.nf
-.ta \w'PhotometricInterpretation'u+2n +\w'Value'u+2n +\w'R/W'u+2n
-\fITag Name\fP \fIValue\fP \fIR/W\fP \fILibrary's Use\fP
+.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Value'u+2n +\w'R/W'u+2n
+\fITag Name\fP \fIValue\fP \fIR/W\fP \fILibrary Use/Notes\fP
.sp 5p
.nf
Artist 315 R/W
BadFaxLines 326 R/W
BitsPerSample 258 R/W lots
-CellLength 265 parsed but ignored
-CellWidth 264 parsed but ignored
+CellLength 265 parsed but ignored
+CellWidth 264 parsed but ignored
CleanFaxData 327 R/W
ColorMap 320 R/W
-ColorResponseUnit 300 parsed but ignored
-Compression 259 R/W choosing compression routines
+ColorResponseUnit 300 parsed but ignored
+Compression 259 R/W choosing codec
ConsecutiveBadFaxLines 328 R/W
-DataType 32996 R
+DataType 32996 R obsoleted by SampleFormat tag
DateTime 306 R/W
DocumentName 269 R/W
DotRange 336 R/W
ExtraSamples 338 R/W lots
FillOrder 266 R/W control bit order
-FreeByteCounts 289 parsed but ignored
-FreeOffsets 288 parsed but ignored
-GrayResponseCurve 291 parsed but ignored
-GrayResponseUnit 290 parsed but ignored
-Group3Options 292 R/W used by Group 3 code
+FreeByteCounts 289 parsed but ignored
+FreeOffsets 288 parsed but ignored
+GrayResponseCurve 291 parsed but ignored
+GrayResponseUnit 290 parsed but ignored
+Group3Options 292 R/W used by Group 3 codec
Group4Options 293 R/W
HostComputer 316 R/W
ImageDepth 32997 R/W tile/strip calculations
@@ -254,33 +275,31 @@ ImageLength 257 R/W lots
ImageWidth 256 R/W lots
InkNames 333 R/W
InkSet 332 R/W
-JPEGACTables 521 R/W JPEG code
-JPEGDCTables 520 R/W JPEG code
-JPEGProc 512 R/W JPEG code
-JPEGQRestartInterval 515 R/W JPEG code
-JPEGQTables 519 R/W JPEG code
+JPEGTables 347 R/W used by JPEG codec
Make 271 R/W
-Matteing 32995 R
+Matteing 32995 R obsoleted by ExtraSamples tag
MaxSampleValue 281 R/W
MinSampleValue 280 R/W
Model 272 R/W
-NewSubFileType 254 R/W (called SubFileType)
+NewSubFileType 254 R/W called SubFileType in spec
Orientation 274 R/W
PageName 285 R/W
PageNumber 297 R/W
-PhotometricInterpretation 262 R/W Group 3 and JPEG code
+PhotometricInterpretation 262 R/W used by Group 3 and JPEG codecs
PlanarConfiguration 284 R/W data i/o
-Predictor 317 R/W used by LZW code
+Predictor 317 R/W used by LZW and Deflate codecs
PrimaryChromacities 319 R/W
ReferenceBlackWhite 532 R/W
-ResolutionUnit 296 R/W
+ResolutionUnit 296 R/W used by Group 3 codec
RowsPerStrip 278 R/W data i/o
SampleFormat 339 R/W
SamplesPerPixel 277 R/W lots
+SMinSampleValue 340 R/W
+SMaxSampleValue 341 R/W
Software 305 R/W
StripByteCounts 279 R/W data i/o
StripOffsets 273 R/W data i/o
-SubFileType 255 R/W (called OSubFileType)
+SubFileType 255 R/W called OSubFileType in spec
TargetPrinter 337 R/W
Thresholding 263 R/W
TileByteCounts 324 R/W data i/o
@@ -292,11 +311,94 @@ TransferFunction 301 R/W
WhitePoint 318 R/W
XPosition 286 R/W
XResolution 282 R/W
-YCbCrCoefficients 529 R/W used by TIFFReadRGBAImage
+YCbCrCoefficients 529 R/W used by TIFFRGBAImage support
YCbCrPositioning 531 R/W tile/strip size calulcations
YCbCrSubsampling 530 R/W
YPosition 286 R/W
-YResolution 283 R/W used by Group 3 2d encoding
+YResolution 283 R/W used by Group 3 codec
+.SH "PSEUDO TAGS"
+In addition to the normal
+.SM TIFF
+tags the library supports a collection of
+tags whose values lie in a range outside the valid range of
+.SM TIFF
+tags.
+These tags are termed
+.I pseud-tags
+and are used to control various codec-specific functions within the library.
+The table below summarizes the defined pseudo-tags.
+.sp 5p
+.nf
+.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Codec'u+2n +\w'R/W'u+2n
+\fITag Name\fP \fICodec\fP \fIR/W\fP \fILibrary Use/Notes\fP
+.sp 5p
+.nf
+TIFFTAG_FAXMODE G3 R/W general codec operation
+TIFFTAG_FAXFILLFUNC G3/G4 R/W bitmap fill function
+TIFFTAG_JPEGQUALITY JPEG R/W compression quality control
+TIFFTAG_JPEGCOLORMODE JPEG R/W control colorspace conversions
+TIFFTAG_JPEGTABLESMODE JPEG R/W control contents of \fIJPEGTables\fP tag
+.fi
+.TP
+.B TIFFTAG_FAXMODE
+Control the operation of the Group 3 codec.
+Possible values (independent bits that can be combined by
+or'ing them together) are:
+FAXMODE_CLASSIC
+(enable old-style format in which the
+.SM RTC
+is written at the end of the last strip),
+FAXMODE_NORTC
+(opposite of
+FAXMODE_CLASSIC;
+also called
+FAXMODE_CLASSF),
+FAXMODE_NOEOL
+(do not write
+.SM EOL
+codes at the start of each row of data),
+FAXMODE_BYTEALIGN
+(align each encoded row to an 8-bit boundary),
+FAXMODE_WORDALIGN
+(align each encoded row to an 16-bit boundary),
+The default value is dependent on the compression scheme; this
+pseudo-tag is used by the various G3 and G4 codecs to share code.
+.TP
+.B TIFFTAG_FAXFILLFUNC
+Control the function used to convert arrays of black and white
+runs to packed bit arrays.
+This hook can be used to image decoded scanlines in multi-bit
+depth rasters (e.g. for display in colormap mode)
+or for other purposes.
+The default value is a pointer to a builtin function that images
+packed bilevel data.
+.TP
+.B TIFFTAG_JPEGQUALITY
+Control the compression quality level used in the baseline algorithm.
+Note that quality levels are in the range 0-100 with a default value of 75.
+.TP
+.B TIFFTAG_JPEGCOLORMODE
+Control whether or not conversion is done between
+RGB and YCbCr colorspaces.
+Possible values are:
+JPEGCOLORMODE_RAW
+(do not convert), and
+JPEGCOLORMODE_RGB
+(convert to/from RGB)
+The default value is JPEGCOLORMODE_RAW.
+.TP
+.B TIFFTAG_JPEGTABLESMODE
+Control the information written in the
+.I JPEGTables
+tag.
+Possible values (independent bits that can be combined by
+or'ing them together) are:
+JPEGTABLESMODE_QUANT
+(include quantization tables),
+and
+JPEGTABLESMODE_HUFF
+(include Huffman encoding tables).
+The default value is JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF.
.SH DIAGNOSTICS
All error messages are directed through the
.IR TIFFError
@@ -328,31 +430,14 @@ routine.
.IR tiffsv (1),
.PP
.IR "Tag Image File Format Specification \(em Revision 6.0" ,
-an Aldus Technical Memorandum,
-to be released.
+an Aldus Technical Memorandum.
.PP
.IR "The Spirit of TIFF Class F" ,
an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies.
-.PP
-.IR "Appendix ALPHA: Associated Alpha Information" ,
-a proposed appendix to the TIFF 6.0 specification.
.SH BUGS
The library does not support multi-sample images
where some samples have different bits/sample.
.PP
-It is not possible to overwrite the contents of a strip with
-.IR TIFFWriteEncodedStrip
-or
-.IR TIFFWriteRawStrip
-since they
-.I append
-to a strip.
-Likewise,
-.IR TIFFWriteEncodedTile
-and
-.IR TIFFWriteRawTile
-append to a tile.
-.PP
The library does not support random access to compressed data
that is organized with more than one row per tile or strip.
The library discards unknown tags.
diff --git a/man/pal2rgb.1 b/man/pal2rgb.1
index 2ea5008c..2b55beb2 100644
--- a/man/pal2rgb.1
+++ b/man/pal2rgb.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/pal2rgb.1,v 1.11 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/pal2rgb.1,v 1.13 1995/10/11 19:41:59 sam Exp $
.\"
-.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1990-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH PAL2RGB 1 "September 26, 1994"
+.TH PAL2RGB 1 "October 15, 1995"
.SH NAME
pal2rgb \- convert a palette color
.SM TIFF
@@ -85,6 +85,8 @@ in the output file:
for Macintosh Packbits,
.B "\-c lzw"
for Lempel-Ziv & Welch,
+.B "\-c zip"
+for Deflate,
.B "\-c none"
for no compression.
If no compression-related option is specified, the input
diff --git a/man/ppm2tiff.1 b/man/ppm2tiff.1
index 8554cb74..4ea052b5 100644
--- a/man/ppm2tiff.1
+++ b/man/ppm2tiff.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/ppm2tiff.1,v 1.7 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/ppm2tiff.1,v 1.10 1995/10/11 19:42:00 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH PPM2TIFF 1 "September 26, 1994"
+.TH PPM2TIFF 1 "October 15, 1995"
.SH NAME
ppm2tiff \- create a
.SM TIFF
@@ -34,7 +34,6 @@ image file
.B ppm2tiff
[
.I options
-]
] [
.I input.ppm
]
@@ -74,10 +73,14 @@ Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
-for the PackBits compression algorithm),
+for the PackBits compression algorithm,
+.B "-c jpeg"
+for the baseline JPEG compression algorithm,
+.B "-c zip
+for the Deflate compression algorithm,
and
.B "\-c lzw"
-for Lempel-Ziv & Welch (the default).
+for Lempel-Ziv & Welch compression (the default).
.TP
.B \-r
Write data with a specified number of rows per strip;
diff --git a/man/ras2tiff.1 b/man/ras2tiff.1
index 05758c50..77f090d0 100644
--- a/man/ras2tiff.1
+++ b/man/ras2tiff.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/ras2tiff.1,v 1.11 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/ras2tiff.1,v 1.13 1995/10/11 19:42:00 sam Exp $
.\"
-.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1990-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH RAS2TIFF 1 "May 2, 1989"
+.TH RAS2TIFF 1 "October 15, 1995"
.SH NAME
ras2tiff \- create a
.SM TIFF
@@ -32,6 +32,7 @@ file from a Sun rasterfile
.B ras2tiff
[
.I options
+]
.I input.ras
.I output.tif
.SH DESCRIPTION
@@ -65,7 +66,11 @@ Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
-for the PackBits compression algorithm),
+for the PackBits compression algorithm,
+.B "-c jpeg"
+for the baseline JPEG compression algorithm,
+.B "-c zip
+for the Deflate compression algorithm,
and
.B "\-c lzw"
for Lempel-Ziv & Welch (the default).
diff --git a/man/rgb2ycbcr.1 b/man/rgb2ycbcr.1
index 7b5087de..029253c4 100644
--- a/man/rgb2ycbcr.1
+++ b/man/rgb2ycbcr.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/rgb2ycbcr.1,v 1.5 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/rgb2ycbcr.1,v 1.7 1995/10/11 19:42:01 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH RGB2YCBCR 1 "September 26, 1994"
+.TH RGB2YCBCR 1 "October 15, 1995"
.SH NAME
rgb2ycbcr \- convert non-YCbCr
.SM TIFF
@@ -33,66 +33,65 @@ image
.SH SYNOPSIS
.B rgb2ycbcr
[
-.B \-c
-.I compression
-] [
-.B \-h
-.I hsample
-] [
-.B \-v
-.I vsample
-] [
-.B \-r
-.I rows/strip
+.I options
]
.I "src1.tif src2.tif ... dst.tif"
.SH DESCRIPTION
-.I Rgb2ycbcr
+.I rgb2ycbcr
converts
.SM RGB
color, greyscale, or bi-level
.SM TIFF
images to YCbCr images by
transforming and sampling pixel data.
-If multiple files are specified on the command line,
-.I rgb2ycbcr
-converts all but the last file, writing a
-separate directory for each source
+If multiple files are specified on the command line
+each source file is converted to a separate directory
in the destination file.
.PP
By default, chrominance samples are created by sampling
-2 by 2 blocks of luminance values.
-The
+2 by 2 blocks of luminance values; this can be changed with
+the
.B \-h
and
.B \-v
-options can be used to specify alternate horizontal
-and vertical sampling dimensions, respectively.
-Note that only 1, 2, and 4 should be used for portability.
-.PP
-By default, output data are compressed with the
+options.
+Output data are compressed with the
.SM LZW
-compression scheme.
-A different scheme can be selected with the
+compression scheme, by default; an alternate scheme can be
+selected with the
.B \-c
-option; one of:
-.I none
-(for no compression),
-.I packbits
-(for PackBits compression),
-and
-.I lzw
-(for
-.SM LZW
-compression).
-.PP
+option.
By default, output data are compressed in strips with
the number of rows in each strip selected so that the
-size of a strip is never more than 8 kilobytes.
-The
+size of a strip is never more than 8 kilobytes;
+the
.B \-r
option can be used to explicitly set the number of
rows per strip.
+.SH OPTIONS
+.TP
+.B \-c
+Specify a compression scheme to use when writing image data:
+.B "\-c none"
+for no compression,
+.B "-c packbits"
+for the PackBits compression algorithm,
+.B "-c jpeg"
+for the JPEG compression algorithm,
+and
+.B "\-c lzw"
+for Lempel-Ziv & Welch (the default).
+.TP
+.B \-h
+Set the horizontal sampling dimension to one of: 1, 2 (default), or 4.
+.TP
+.B \-r
+Write data with a specified number of rows per strip;
+by default the number of rows/strip is selected so that each strip
+is approximately 8 kilobytes.
+.TP
+.B \-v
+Set the vertical sampling dimension to one of: 1, 2 (default), or 4.
.SH "SEE ALSO"
.IR tiffinfo (1),
.IR tiffcp (1),
diff --git a/man/sgi2tiff.1 b/man/sgi2tiff.1
index e7eab097..e40a2a3b 100644
--- a/man/sgi2tiff.1
+++ b/man/sgi2tiff.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/sgi2tiff.1,v 1.6 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/sgi2tiff.1,v 1.8 1995/10/11 19:42:02 sam Exp $
.\"
-.\" Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1991-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH SGI2TIFF 1 "September 26, 1994"
+.TH SGI2TIFF 1 "October 15, 1995"
.SH NAME
sgi2tiff \- create a
.SM TIFF
@@ -60,6 +60,10 @@ Specify a compression scheme to use when writing image data:
for no compression,
.B "-c packbits"
for the PackBits compression algorithm),
+.B "-c jpeg"
+for the baseline JPEG compression algorithm,
+.B "-c zip
+for the Deflate compression algorithm,
and
.B "\-c lzw"
for Lempel-Ziv & Welch (the default).
diff --git a/man/thumbnail.1 b/man/thumbnail.1
index 5a22ab55..26cbbebc 100644
--- a/man/thumbnail.1
+++ b/man/thumbnail.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/thumbnail.1,v 1.2 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/thumbnail.1,v 1.3 1995/10/11 19:42:36 sam Exp $
.\"
-.\" Copyright (c) 1994 Sam Leffler
-.\" Copyright (c) 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1994-1995 Sam Leffler
+.\" Copyright (c) 1994-1995 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
diff --git a/man/tiff2bw.1 b/man/tiff2bw.1
index 0bf3cb40..a1f454f5 100644
--- a/man/tiff2bw.1
+++ b/man/tiff2bw.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiff2bw.1,v 1.12 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiff2bw.1,v 1.14 1995/10/11 19:42:03 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFF2BW 1 "September 26, 1994"
+.TH TIFF2BW 1 "October 15, 1995"
.SH NAME
tiff2bw \- convert a color
.SM TIFF
@@ -59,7 +59,13 @@ Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
-for the PackBits compression algorithm),
+for the PackBits compression algorithm,
+.B "-c zip
+for the Deflate compression algorithm,
+.B "-c g3
+for the CCITT Group 3 compression algorithm,
+.B "-c g4
+for the CCITT Group 4 compression algorithm,
and
.B "\-c lzw"
for Lempel-Ziv & Welch (the default).
diff --git a/man/tiff2ps.1 b/man/tiff2ps.1
index 12015ce3..5085ec5d 100644
--- a/man/tiff2ps.1
+++ b/man/tiff2ps.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiff2ps.1,v 1.16 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiff2ps.1,v 1.18 1995/10/11 19:42:04 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFF2PS 1 "September 26, 1994"
+.TH TIFF2PS 1 "October 15, 1995"
.SH NAME
tiff2ps \- convert a
.SM TIFF
@@ -33,12 +33,12 @@ image to PostScript\(tm
[
.I options
]
-.I input.tif
+.I "input.tif ..."
.SH DESCRIPTION
.I tiff2ps
-reads a
+reads
.SM TIFF
-image and writes PostScript or Encapsulated PostScript (EPS)
+images and writes PostScript or Encapsulated PostScript (EPS)
on the standard output.
By default,
.I tiff2ps
@@ -155,9 +155,7 @@ bigger than the original image and which takes a long time
to send to a printer over a serial line.
Matters are even worse for 4-, 2-, and 1-bit palette images.
.SH BUGS
-Does not use PostScript Level II support for printing color images
-(only bilevel and greyscale images).
-Does not handle tiled images.
+Does not handle tiled images when generating PS Level I output.
.SH "SEE ALSO"
.IR pal2rgb (1),
.IR tiffinfo (1),
diff --git a/man/tiffcmp.1 b/man/tiffcmp.1
index 568a94ef..2cc3059c 100644
--- a/man/tiffcmp.1
+++ b/man/tiffcmp.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffcmp.1,v 1.17 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffcmp.1,v 1.18 1995/10/11 19:42:04 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
diff --git a/man/tiffcp.1 b/man/tiffcp.1
index c3150e5c..2dee5d9f 100644
--- a/man/tiffcp.1
+++ b/man/tiffcp.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffcp.1,v 1.20 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffcp.1,v 1.22 1995/10/11 19:42:05 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFCP 1 "September 26, 1994"
+.TH TIFFCP 1 "October 15, 1995"
.SH NAME
tiffcp \- copy (and possibly convert) a
.SM TIFF
@@ -68,8 +68,13 @@ for no compression,
for PackBits compression,
.B lzw
for Lempel-Ziv & Welch compression,
+.B jpeg
+for baseline JPEG compression,
+.B zip
+for Deflate compression,
.B g3
for CCITT Group 3 (T.4) compression,
+and
.B g4
for CCITT Group 4 (T.6) compression.
By default
diff --git a/man/tiffdither.1 b/man/tiffdither.1
index 43f546d6..f8765deb 100644
--- a/man/tiffdither.1
+++ b/man/tiffdither.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffdither.1,v 1.14 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffdither.1,v 1.16 1995/10/11 19:42:06 sam Exp $
.\"
-.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1990-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFDITHER 1 "September 26, 1994"
+.TH TIFFDITHER 1 "October 15, 1995"
.SH NAME
tiffdither \- convert a greyscale image to bilevel using dithering
.SH SYNOPSIS
@@ -47,8 +47,11 @@ for no compression,
for PackBits compression,
.B lzw
for Lempel-Ziv & Welch compression,
+.B zip
+for Deflate compression,
.B g3
for CCITT Group 3 (T.4) compression,
+and
.B g4
for CCITT Group 4 (T.6) compression.
By default
diff --git a/man/tiffdump.1 b/man/tiffdump.1
index 3475a4b0..bdbb7013 100644
--- a/man/tiffdump.1
+++ b/man/tiffdump.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffdump.1,v 1.12 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffdump.1,v 1.14 1995/10/11 19:42:06 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFDUMP 1 "September 26, 1994"
+.TH TIFFDUMP 1 "October 15, 1995"
.SH NAME
tiffdump \- print verbatim information about
.SM TIFF
@@ -51,7 +51,7 @@ For example, an
.I ImageWidth
tag might be displayed as ``ImageWidth (256) SHORT (3) 1<800>''.
.PP
-.I Tiffdump
+.I tiffdump
is particularly useful for investigating the contents of
.SM TIFF
files that
diff --git a/man/tiffgt.1 b/man/tiffgt.1
index 52bd0e61..f4e548ab 100644
--- a/man/tiffgt.1
+++ b/man/tiffgt.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffgt.1,v 1.18 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffgt.1,v 1.20 1995/10/11 19:42:07 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFGT 1 "September 26, 1994"
+.TH TIFFGT 1 "October 15, 1995"
.SH NAME
tiffgt \- display an image stored in a
.SM TIFF
@@ -33,13 +33,14 @@ file (Silicon Graphics version)
[
.I options
]
-.I input.tif
+.I "input.tif ..."
.SH DESCRIPTION
.I tiffgt
-displays an image stored in a file with the
+displays one or more images stored using the
Tag Image File Format, Revision 6.0.
-The image is placed in a fixed size window that the
-user must position on the display.
+Each image is placed in a fixed size window that the
+user must position on the display (unless configured
+otherwise through X defaults).
If the display has fewer than 24 bitplanes, or if the
image does not warrant full color, then
.SM RGB
@@ -81,6 +82,74 @@ it assumes 16-bit values.
This inspection is done to handle old images written by
previous (incorrect) versions of
.IR libtiff .
+.PP
+.I tiffgt
+can be used to display multiple images one-at-a-time.
+The left mouse button switches the display to the first image in the
+.I next
+file in the list of files specified on the command line.
+The right mouse button switches to the first image in the
+.I previous
+file in the list.
+The middle mouse button causes the first image in the first file
+specified on the command line to be displayed.
+In addition the following keyboard commands are recognized:
+.TP
+.B b
+Use a
+.I PhotometricIntepretation
+of MinIsBlack in displaying the current image.
+.TP
+.B l
+Use a
+.I FillOrder
+of lsb-to-msb in decoding the current image.
+.TP
+.B m
+Use a
+.I FillOrder
+of msb-tolmsb in decoding the current image.
+.TP
+.B c
+Use a colormap visual to display the current image.
+.TP
+.B r
+Use a true color (24-bit RGB) visual to display the current image.
+.TP
+.B w
+Use a
+.I PhotometricIntepretation
+of MinIsWhite in displaying the current image.
+.TP
+.B W
+Toggle (enable/disable) display of warning messages from the
+.SM TIFF
+library when decoding images.
+.TP
+.B E
+Toggle (enable/disable) display of error messages from the
+.SM TIFF
+library when decoding images.
+.TP
+.B z
+Reset all parameters to their default settings (\c
+.IR FillOrder ,
+.IR PhotometricInterpretation ,
+handling of warnings and errors).
+.TP
+.B PageUp
+Display the previous image in the current file or the last
+image in the previous file.
+.TP
+.B PageDown
+Display the next image in the current file or the first image
+in the next file.
+.TP
+.B Home
+Display the first image in the current file.
+.TP
+.B End
+Display the last image in the current file (unimplemented).
.SH OPTIONS
.TP
.B \-c
@@ -91,6 +160,14 @@ Specify an image to display by directory number.
By default the first image in the file is displayed.
Directories are numbered starting at zero.
.TP
+.B \-e
+Enable reporting of error messages from the
+.SM TIFF
+library.
+By default
+.I tiffgt
+silently ignores images that cannot be read.
+.TP
.B \-f
Force
.I tiffgt
@@ -118,6 +195,20 @@ By default the first image in the file is displayed.
Directories offsets may be specified using C-style syntax;
i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal.
.TP
+.B \-p
+Override the value of the
+.I PhotometricInterpretation
+tag; the parameter may be one of:
+.IR miniswhite ,
+.IR minisblack ,
+.IR rgb ,
+.IR palette ,
+.IR mask ,
+.IR separated ,
+.IR ycbcr ,
+and
+.IR cielab .
+.TP
.B \-r
Force image display in a full color window.
.TP
@@ -127,6 +218,14 @@ By default all errors in the input data are ignored and
.I tiffgt
does it's best to display as much of an image as possible.
.TP
+.B \-w
+Enable reporting of warning messages from the
+.SM TIFF
+library.
+By default
+.I tiffgt
+ignores warning messages generated when reading an image.
+.TP
.B \-v
Place information in the title bar describing
what type of window (full color or colormap) is being
diff --git a/man/tiffinfo.1 b/man/tiffinfo.1
index f9929de6..b46ab504 100644
--- a/man/tiffinfo.1
+++ b/man/tiffinfo.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffinfo.1,v 1.15 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffinfo.1,v 1.17 1995/10/11 19:42:08 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -68,7 +68,7 @@ i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal.
.TP
.B \-s
Display the offsets and byte counts for each data strip in a directory.
-.PP
+.TP
.B \-#
Set the initial
.SM TIFF
diff --git a/man/tiffmedian.1 b/man/tiffmedian.1
index 81ac0872..3f3bb2f2 100644
--- a/man/tiffmedian.1
+++ b/man/tiffmedian.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffmedian.1,v 1.16 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffmedian.1,v 1.18 1995/10/11 19:42:09 sam Exp $
.\"
-.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1990-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFMEDIAN 1 "September 26, 1994"
+.TH TIFFMEDIAN 1 "October 15, 1995"
.SH NAME
tiffmedian \- apply the median cut algorithm to data in a
.SM TIFF
@@ -56,6 +56,9 @@ for no compression,
for PackBits compression,
.B lzw
for Lempel-Ziv & Welch compression,
+and
+.B zip
+for Deflate compression.
By default
.I tiffmedian
will compress data according to the value of the
diff --git a/man/tiffsplit.1 b/man/tiffsplit.1
index 8eff671b..e42a0357 100644
--- a/man/tiffsplit.1
+++ b/man/tiffsplit.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffsplit.1,v 1.4 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffsplit.1,v 1.5 1995/10/11 19:42:09 sam Exp $
.\"
-.\" Copyright (c) 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1992-1995 Sam Leffler
+.\" Copyright (c) 1992-1995 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
diff --git a/man/tiffsv.1 b/man/tiffsv.1
index 6b540303..3adeeeb8 100644
--- a/man/tiffsv.1
+++ b/man/tiffsv.1
@@ -1,7 +1,7 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffsv.1,v 1.14 1995/07/07 23:29:04 sam Exp $
+.\" $Header: /usr/people/sam/tiff/man/RCS/tiffsv.1,v 1.16 1995/10/11 19:42:10 sam Exp $
.\"
-.\" Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
-.\" Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
+.\" Copyright (c) 1988-1995 Sam Leffler
+.\" Copyright (c) 1991-1995 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
@@ -23,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFSV 1 "September 26, 1994"
+.TH TIFFSV 1 "October 15, 1995"
.SH NAME
tiffsv \- save an image from the framebuffer in a
.SM TIFF
@@ -64,6 +64,11 @@ Specify the compression to use for data written to the output file:
for no compression,
.B packbits
for PackBits compression,
+.B jpeg
+for baseline JPEG compression,
+.B zip
+for Deflate compression,
+and
.B lzw
for Lempel-Ziv & Welch compression (default).
.IP
diff --git a/port/Makefile.in b/port/Makefile.in
index 8f37bb98..c69820eb 100644
--- a/port/Makefile.in
+++ b/port/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/people/sam/tiff/port/RCS/Makefile.in,v 1.2 1995/05/24 01:54:38 sam Exp $
+# $Header: /usr/people/sam/tiff/port/RCS/Makefile.in,v 1.3 1995/10/10 00:38:52 sam Exp $
#
# @WARNING@
#
@@ -29,7 +29,7 @@
#
DEPTH = ..
-SRCDIR = ${DEPTH}/${TOPSRCDIR}/port
+SRCDIR = ${DEPTH}/@SRCDIR@/port
VPATH = ../@SRCDIR@/port
#
@@ -46,7 +46,7 @@ AR = @AR@
AROPTS = @AROPTS@
RANLIB = @RANLIB@
-IPATH = -I. -I${DEPTH} -I${SRCDIR}
+IPATH = -I. -I${SRCDIR}
COPTS = @GCOPTS@
OPTIMIZER=-O
CFLAGS = @ENVOPTS@ ${COPTS} ${OPTIMIZER} ${IPATH}
diff --git a/port/strcasecmp.c b/port/strcasecmp.c
index d95b78d8..96784029 100644
--- a/port/strcasecmp.c
+++ b/port/strcasecmp.c
@@ -1,4 +1,3 @@
-#include "port.h"
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
@@ -17,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-
+#include <sys/types.h>
#include <string.h>
#if defined(LIBC_SCCS) && !defined(lint)
@@ -29,7 +28,7 @@ static const char sccsid[] = "@(#)strcasecmp.c 5.9 (Berkeley) 6/1/90";
* together for a case independent comparison. The mappings are
* based upon ascii character sequences.
*/
-static const u_char charmap[] = {
+static const unsigned char charmap[] = {
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
@@ -68,9 +67,9 @@ int
strcasecmp(s1, s2)
const char *s1, *s2;
{
- register const u_char *cm = charmap,
- *us1 = (const u_char *)s1,
- *us2 = (const u_char *)s2;
+ register const unsigned char *cm = charmap,
+ *us1 = (const unsigned char *)s1,
+ *us2 = (const unsigned char *)s2;
while (cm[*us1] == cm[*us2++])
if (*us1++ == '\0')
@@ -84,9 +83,9 @@ strncasecmp(s1, s2, n)
register size_t n;
{
if (n != 0) {
- register const u_char *cm = charmap,
- *us1 = (const u_char *)s1,
- *us2 = (const u_char *)s2;
+ register const unsigned char *cm = charmap,
+ *us1 = (const unsigned char *)s1,
+ *us2 = (const unsigned char *)s2;
do {
if (cm[*us1] != cm[*us2++])
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 83273541..e0e8b6d9 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.13 1995/07/05 21:09:52 sam Exp $
+# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.15 1995/10/10 01:45:08 sam Exp $
#
# @WARNING@
#
@@ -27,12 +27,8 @@
# OF THIS SOFTWARE.
#
DEPTH = ..
-
SRCDIR = ${DEPTH}/@SRCDIR@/tools
-
-JPEGDIR = ${DEPTH}/@DIR_JPEG@
-ZIPDIR = ${DEPTH}/@DIR_LIBGZ@
-PORT = ${DEPTH}/port
+LIBDIR = ${DEPTH}/@SRCDIR@/libtiff
#
# VERSION: @VERSION@
@@ -47,10 +43,10 @@ INSTALL = @INSTALL@
#
COPTS = @GCOPTS@
OPTIMIZER=-O
-IPATH = -I. -I${DEPTH} -I${SRCDIR} -I${DEPTH}/@SRCDIR@/libtiff
+IPATH = -I. -I${SRCDIR} -I${LIBDIR}
CFLAGS = @ENVOPTS@ ${COPTS} ${OPTIMIZER} ${IPATH}
#
-LIBTIFF = ../libtiff/libtiff.@DSOSUF@
+LIBTIFF = ${DEPTH}/libtiff/libtiff.@DSOSUF@
LIBJPEG = @LIBJPEG@
LIBGZ = @LIBGZ@
LIBS = ${LIBTIFF} ${LIBJPEG} ${LIBGZ} @LIBPORT@ @MACHDEPLIBS@
@@ -192,7 +188,7 @@ ppm2tiff.o: ${SRCDIR}/ppm2tiff.c
fax2tiff: fax2tiff.o ${LIBTIFF}
${CC} -o fax2tiff ${CFLAGS} fax2tiff.o ${LIBS}
fax2tiff.o: ${SRCDIR}/fax2tiff.c
- ${CC} -c ${CFLAGS} ${SRCDIR}/fax2tiff.c
+ ${CC} -c -I${LIBDIR} -I${DEPTH}/libtiff ${CFLAGS} ${SRCDIR}/fax2tiff.c
# Group 3/4 FAX to encoded PS converter
fax2ps: fax2ps.o ${LIBTIFF}
diff --git a/tools/fax2ps.c b/tools/fax2ps.c
index 707848d2..13482949 100644
--- a/tools/fax2ps.c
+++ b/tools/fax2ps.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/fax2ps.c,v 1.2 1995/06/06 23:21:41 sam Exp $" */
+/* $Header: /usr/people/sam/tiff/tools/RCS/fax2ps.c,v 1.6 1995/10/16 22:32:45 sam Exp $" */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -26,10 +26,18 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
#include "tiffio.h"
float defxres = 204.; /* default x resolution (pixels/inch) */
float defyres = 98.; /* default y resolution (lines/inch) */
+const float basePageWidth = 8.5;
+const float basePageHeight = 11.0;
+const float half = 0.5;
+const float points = 72.0;
float pageWidth = 8.5; /* image page width (inches) */
float pageHeight = 11.0; /* image page length (inches) */
int scaleToPage = 0; /* if true, scale raster to page dimensions */
@@ -165,10 +173,16 @@ printTIF(TIFF* tif, int pageNumber)
if (scaleToPage) {
float yscale = pageHeight / (h/yres);
float xscale = pageWidth / (w/xres);
- printf("0 %d translate\n", (int)(yscale*(h/yres)*72.));
+ printf("%d %d translate\n",
+ (int) (((basePageWidth - pageWidth) * points) * half),
+ (int)((yscale*(h/yres)*points) +
+ (basePageHeight - pageHeight) * points * half) );
printf("%g %g scale\n", (72.*xscale)/xres, -(72.*yscale)/yres);
} else {
- printf("0 %d translate\n", (int)(72.*h/yres));
+ printf("%d %d translate\n",
+ (int) ((basePageWidth - pageWidth) * points * half),
+ (int)((72.*h/yres) +
+ (basePageHeight - pageHeight) * points * half) );
printf("%g %g scale\n", 72./xres, -72./yres);
}
printf("0 setgray\n");
@@ -262,16 +276,17 @@ emitFont(FILE* fd)
}
static int
-pcompar(void* va, void* vb)
+pcompar(const void* va, const void* vb)
{
- int* pa = (int*) va;
- int* pb = (int*) vb;
+ const int* pa = (const int*) va;
+ const int* pb = (const int*) vb;
return (*pa - *pb);
}
extern double atof();
static void usage(int code);
+int
main(int argc, char** argv)
{
extern int optind;
@@ -279,7 +294,7 @@ main(int argc, char** argv)
int c, pageNumber;
int* pages = 0, npages = 0;
int dowarnings = 0; /* if 1, enable library warnings */
- long t;
+ time_t t;
TIFF* tif;
while ((c = getopt(argc, argv, "l:p:x:y:W:H:wS")) != -1)
@@ -355,17 +370,19 @@ main(int argc, char** argv)
argv[optind]);
} while (++optind < argc);
} else {
- int n, fd;
+ int n;
+ FILE* fd;
char temp[1024], buf[16*1024];
strcpy(temp, "/tmp/fax2psXXXXXX");
- fd = mkstemp(temp);
- if (fd == -1) {
+ (void) mktemp(temp);
+ fd = fopen(temp, "w");
+ if (fd == NULL) {
fprintf(stderr, "Could not create temp file \"%s\"\n", temp);
exit(-2);
}
while ((n = read(fileno(stdin), buf, sizeof (buf))) > 0)
- write(fd, buf, n);
+ write(fileno(fd), buf, n);
tif = TIFFOpen(temp, "r");
unlink(temp);
if (tif) {
@@ -373,13 +390,13 @@ main(int argc, char** argv)
TIFFClose(tif);
} else
fprintf(stderr, "%s: Can not open, or not a TIFF file.\n", temp);
- close(fd);
+ fclose(fd);
}
printf("%%%%Trailer\n");
printf("%%%%Pages: %u\n", totalPages);
printf("%%%%EOF\n");
- exit(0);
+ return (0);
}
char* stuff[] = {
diff --git a/tools/fax2tiff.c b/tools/fax2tiff.c
index 582ccb3a..1642b9df 100644
--- a/tools/fax2tiff.c
+++ b/tools/fax2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/fax2tiff.c,v 1.37 1995/07/17 01:36:52 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/fax2tiff.c,v 1.39 1995/10/12 16:40:06 sam Exp $ */
/*
* Copyright (c) 1990-1995 Sam Leffler
@@ -27,12 +27,8 @@
/*
* Convert a CCITT Group 3 FAX file to TIFF Group 3 format.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h> /* should have atof & getopt */
-#endif
#include "tiffiop.h"
#ifndef BINMODE
@@ -48,8 +44,8 @@
TIFF *faxTIFF;
#define XSIZE 1728
-u_char rowbuf[TIFFhowmany(XSIZE,8)];
-u_char refbuf[TIFFhowmany(XSIZE,8)];
+char rowbuf[TIFFhowmany(XSIZE,8)];
+char refbuf[TIFFhowmany(XSIZE,8)];
int verbose;
int stretch;
@@ -249,7 +245,8 @@ main(int argc, char* argv[])
if (verbose) {
fprintf(stderr, "%s:\n", argv[optind]);
fprintf(stderr, "%d rows in input\n", rows);
- fprintf(stderr, "%d total bad rows\n", badfaxlines);
+ fprintf(stderr, "%ld total bad rows\n",
+ (long) badfaxlines);
fprintf(stderr, "%d max consecutive bad rows\n", badfaxrun);
}
if (compression == COMPRESSION_CCITTFAX3 &&
@@ -307,14 +304,14 @@ copyFaxFile(TIFF* tifin, TIFF* tifout)
if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) {
fprintf(stderr, "%s: Write error at row %ld.\n",
- tifout->tif_name, row);
+ tifout->tif_name, (long) row);
break;
}
row++;
if (stretch) {
if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) {
fprintf(stderr, "%s: Write error at row %ld.\n",
- tifout->tif_name, row);
+ tifout->tif_name, (long) row);
break;
}
row++;
diff --git a/tools/gif2tiff.c b/tools/gif2tiff.c
index 052b66a2..ddd0847d 100644
--- a/tools/gif2tiff.c
+++ b/tools/gif2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/gif2tiff.c,v 1.24 1995/06/30 00:27:07 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/gif2tiff.c,v 1.25 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1990-1995 Sam Leffler
@@ -33,13 +33,9 @@
* if input is 640 350 pixel aspect is probably 1.37
*
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <math.h>
#include "tiffio.h"
diff --git a/tools/pal2rgb.c b/tools/pal2rgb.c
index b18d7c02..ed6cce4e 100644
--- a/tools/pal2rgb.c
+++ b/tools/pal2rgb.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/pal2rgb.c,v 1.27 1995/06/30 00:27:07 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/pal2rgb.c,v 1.28 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#endif
#include <ctype.h>
#include "tiffio.h"
diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c
index 0eb422cc..ad493f6a 100644
--- a/tools/ppm2tiff.c
+++ b/tools/ppm2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/ppm2tiff.c,v 1.22 1995/07/01 01:16:55 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/ppm2tiff.c,v 1.23 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <ctype.h>
#include "tiffio.h"
@@ -128,7 +124,7 @@ main(int argc, char* argv[])
default:
BadPPM(infile);
}
- if (fscanf(in, " %ld %d %d", &w, &h, &prec) != 3)
+ if (fscanf(in, " %ld %ld %d", &w, &h, &prec) != 3)
BadPPM(infile);
if (getc(in) != '\n' || w <= 0 || h <= 0 || prec != 255)
BadPPM(infile);
diff --git a/tools/ras2tiff.c b/tools/ras2tiff.c
index 7794bf9d..009b4f1f 100644
--- a/tools/ras2tiff.c
+++ b/tools/ras2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/ras2tiff.c,v 1.26 1995/07/01 01:16:55 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/ras2tiff.c,v 1.27 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <ctype.h>
#include "rasterfile.h"
diff --git a/tools/rgb2ycbcr.c b/tools/rgb2ycbcr.c
index a0786ec2..37e3c803 100644
--- a/tools/rgb2ycbcr.c
+++ b/tools/rgb2ycbcr.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/rgb2ycbcr.c,v 1.25 1995/06/06 23:45:26 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/rgb2ycbcr.c,v 1.26 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#endif
#include "tiffio.h"
diff --git a/tools/sgi2tiff.c b/tools/sgi2tiff.c
index a4fa16fa..240eae2d 100644
--- a/tools/sgi2tiff.c
+++ b/tools/sgi2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/sgi2tiff.c,v 1.23 1995/07/01 01:16:55 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/sgi2tiff.c,v 1.25 1995/10/12 17:57:38 sam Exp $ */
/*
* Copyright (c) 1991-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <gl/image.h>
#include <ctype.h>
@@ -130,6 +126,11 @@ main(int argc, char* argv[])
TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, in->zsize);
+ if (in->zsize > 3) {
+ uint16 v[1];
+ v[0] = EXTRASAMPLE_UNASSALPHA;
+ TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v);
+ }
TIFFSetField(out, TIFFTAG_MINSAMPLEVALUE, (uint16) in->min);
TIFFSetField(out, TIFFTAG_MAXSAMPLEVALUE, (uint16) in->max);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
@@ -181,7 +182,7 @@ processCompressOptions(char* opt)
static int
cpContig(IMAGE* in, TIFF* out)
{
- unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+ tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
short *r = NULL;
int x, y;
@@ -192,25 +193,52 @@ cpContig(IMAGE* in, TIFF* out)
g = r + in->xsize;
b = g + in->xsize;
for (y = in->ysize-1; y >= 0; y--) {
- unsigned char* pp = buf;
+ uint8* pp = (uint8*) buf;
+
+ getrow(in, r, y, 0);
+ getrow(in, g, y, 1);
+ getrow(in, b, y, 2);
+ for (x = 0; x < in->xsize; x++) {
+ pp[0] = r[x];
+ pp[1] = g[x];
+ pp[2] = b[x];
+ pp += 3;
+ }
+ if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
+ goto bad;
+ }
+ } else if (in->zsize == 4) {
+ short *g, *b, *a;
+
+ r = (short *)_TIFFmalloc(4 * in->xsize * sizeof (short));
+ g = r + in->xsize;
+ b = g + in->xsize;
+ a = b + in->xsize;
+ for (y = in->ysize-1; y >= 0; y--) {
+ uint8* pp = (uint8*) buf;
getrow(in, r, y, 0);
getrow(in, g, y, 1);
getrow(in, b, y, 2);
+ getrow(in, a, y, 3);
for (x = 0; x < in->xsize; x++) {
- *pp++ = r[x];
- *pp++ = g[x];
- *pp++ = b[x];
+ pp[0] = r[x];
+ pp[1] = g[x];
+ pp[2] = b[x];
+ pp[3] = a[x];
+ pp += 4;
}
if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
goto bad;
}
} else {
+ uint8* pp = (uint8*) buf;
+
r = (short *)_TIFFmalloc(in->xsize * sizeof (short));
for (y = in->ysize-1; y >= 0; y--) {
getrow(in, r, y, 0);
- for (x = 0; x < in->xsize; x++)
- buf[x] = r[x];
+ for (x = in->xsize-1; x >= 0; x--)
+ pp[x] = r[x];
if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
goto bad;
}
@@ -229,15 +257,16 @@ bad:
static int
cpSeparate(IMAGE* in, TIFF* out)
{
- unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+ tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
short *r = (short *)_TIFFmalloc(in->xsize * sizeof (short));
+ uint8* pp = (uint8*) buf;
int x, y, z;
for (z = 0; z < in->zsize; z++) {
for (y = in->ysize-1; y >= 0; y--) {
getrow(in, r, y, z);
for (x = 0; x < in->xsize; x++)
- buf[x] = r[x];
+ pp[x] = r[x];
if (TIFFWriteScanline(out, buf, in->ysize-y-1, z) < 0)
goto bad;
}
diff --git a/tools/sgigt.c b/tools/sgigt.c
index 5ebc7e24..161c5cc4 100644
--- a/tools/sgigt.c
+++ b/tools/sgigt.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/sgigt.c,v 1.64 1995/06/21 15:40:54 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/sgigt.c,v 1.65 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,15 +24,11 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
-typedef unsigned char u_char;
-#endif
#include <gl.h>
#include <device.h>
@@ -66,6 +62,9 @@ static void usage(void);
static uint16 photoArg(const char*);
static void beep(void);
+extern char* optarg;
+extern int optind;
+
int
main(int argc, char* argv[])
{
@@ -869,7 +868,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
{
YCbCrSetup;
uint32* cp1 = cp+w+toskew;
- u_int incr = 2*toskew+w;
+ unsigned int incr = 2*toskew+w;
(void) y;
/* XXX adjust fromskew */
diff --git a/tools/sgisv.c b/tools/sgisv.c
index 8bc1dc80..ad48038d 100644
--- a/tools/sgisv.c
+++ b/tools/sgisv.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/sgisv.c,v 1.22 1995/06/06 23:45:26 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/sgisv.c,v 1.24 1995/10/10 23:53:58 sam Exp $ */
/*
* Copyright (c) 1990-1995 Sam Leffler
@@ -24,21 +24,18 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-typedef unsigned char u_char;
-typedef unsigned long u_long;
-#endif
#include <gl.h>
#include <ctype.h>
#include "tiffio.h"
+typedef unsigned char u_char;
+typedef unsigned long u_long;
+
#define streq(a,b) (strcmp(a,b) == 0)
#define strneq(a,b,n) (strncmp(a,b,n) == 0)
@@ -129,8 +126,6 @@ char* stuff[] = {
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c jpeg[:opts]compress output with JPEG encoding",
" -c packbits compress output with packbits encoding",
-" -c g3[:opts] compress output with CCITT Group 3 encoding",
-" -c g4 compress output with CCITT Group 4 encoding",
" -c none use no compression algorithm on output",
"",
"JPEG options:",
diff --git a/tools/thumbnail.c b/tools/thumbnail.c
index 1eb0c152..31b72295 100644
--- a/tools/thumbnail.c
+++ b/tools/thumbnail.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/thumbnail.c,v 1.8 1995/06/06 23:45:26 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/thumbnail.c,v 1.10 1995/10/12 16:40:49 sam Exp $ */
/*
* Copyright (c) 1994-1995 Sam Leffler
@@ -23,13 +23,9 @@
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <math.h>
#include "tiffio.h"
@@ -53,13 +49,14 @@ typedef enum {
static uint32 tnw = 216; /* thumbnail width */
static uint32 tnh = 274; /* thumbnail height */
static Contrast contrast = LINEAR; /* current contrast */
-static u_char* thumbnail;
+static uint8* thumbnail;
static int cpIFD(TIFF*, TIFF*);
static int generateThumbnail(TIFF*, TIFF*);
static void initScale();
static void usage(void);
+extern char* optarg;
extern int optind;
int
@@ -87,7 +84,7 @@ main(int argc, char* argv[])
}
if (argc-optind != 2)
usage();
- thumbnail = (u_char*) _TIFFmalloc(tnw * tnh);
+ thumbnail = (uint8*) _TIFFmalloc(tnw * tnh);
out = TIFFOpen(argv[optind+1], "w");
if (out == NULL)
return (-2);
@@ -295,15 +292,15 @@ cpIFD(TIFF* in, TIFF* out)
}
static uint16 photometric; /* current photometric of raster */
-static u_short filterWidth; /* filter width in pixels */
-static u_short stepSrcWidth; /* src image stepping width */
-static u_short stepDstWidth; /* dest stepping width */
-static u_char* src0; /* horizontal bit stepping (start) */
-static u_char* src1; /* horizontal bit stepping (middle) */
-static u_char* src2; /* horizontal bit stepping (end) */
-static u_short* rowoff; /* row offset for stepping */
-static u_char cmap[256]; /* colormap indexes */
-static u_char bits[256]; /* count of bits set */
+static uint16 filterWidth; /* filter width in pixels */
+static uint16 stepSrcWidth; /* src image stepping width */
+static uint16 stepDstWidth; /* dest stepping width */
+static uint8* src0; /* horizontal bit stepping (start) */
+static uint8* src1; /* horizontal bit stepping (middle) */
+static uint8* src2; /* horizontal bit stepping (end) */
+static uint16* rowoff; /* row offset for stepping */
+static uint8 cmap[256]; /* colormap indexes */
+static uint8 bits[256]; /* count of bits set */
static void
setupBitsTables()
@@ -331,10 +328,10 @@ static int clamp(float v, int low, int high)
#endif
static void
-expFill(float pct[], u_int p, u_int n)
+expFill(float pct[], uint32 p, uint32 n)
{
- u_int i;
- u_int c = (p * n) / 100;
+ uint32 i;
+ uint32 c = (p * n) / 100;
for (i = 1; i < c; i++)
pct[i] = 1-exp(i/((double)(n-1)))/ M_E;
for (; i < n; i++)
@@ -345,7 +342,7 @@ static void
setupCmap()
{
float pct[256]; /* known to be large enough */
- u_int i;
+ uint32 i;
pct[0] = 1; /* force white */
switch (contrast) {
case EXP50: expFill(pct, 50, 256); break;
@@ -374,10 +371,10 @@ setupCmap()
static void
initScale()
{
- src0 = (u_char*) _TIFFmalloc(sizeof (u_char) * tnw);
- src1 = (u_char*) _TIFFmalloc(sizeof (u_char) * tnw);
- src2 = (u_char*) _TIFFmalloc(sizeof (u_char) * tnw);
- rowoff = (u_short*) _TIFFmalloc(sizeof (u_short) * tnw);
+ src0 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
+ src1 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
+ src2 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
+ rowoff = (uint16*) _TIFFmalloc(sizeof (uint16) * tnw);
filterWidth = 0;
stepDstWidth = stepSrcWidth = 0;
setupBitsTables();
@@ -388,18 +385,18 @@ initScale()
* according to the widths of the src and dst images.
*/
static void
-setupStepTables(u_short sw)
+setupStepTables(uint16 sw)
{
if (stepSrcWidth != sw || stepDstWidth != tnw) {
int step = sw;
int limit = tnw;
int err = 0;
- u_int sx = 0;
- u_int x;
+ uint32 sx = 0;
+ uint32 x;
int fw;
- u_char b;
+ uint8 b;
for (x = 0; x < tnw; x++) {
- u_int sx0 = sx;
+ uint32 sx0 = sx;
err += step;
while (err >= limit) {
err -= limit;
@@ -422,19 +419,19 @@ setupStepTables(u_short sw)
}
static void
-setrow(u_char* row, int nrows, const u_char* rows[])
+setrow(uint8* row, int nrows, const uint8* rows[])
{
- u_int x;
- u_int area = nrows * filterWidth;
+ uint32 x;
+ uint32 area = nrows * filterWidth;
for (x = 0; x < tnw; x++) {
- u_int mask0 = src0[x];
- u_int fw = src1[x];
- u_int mask1 = src1[x];
- u_int off = rowoff[x];
- u_int acc = 0;
- u_int y, i;
+ uint32 mask0 = src0[x];
+ uint32 fw = src1[x];
+ uint32 mask1 = src1[x];
+ uint32 off = rowoff[x];
+ uint32 acc = 0;
+ uint32 y, i;
for (y = 0; y < nrows; y++) {
- const u_char* src = rows[y] + off;
+ const uint8* src = rows[y] + off;
acc += bits[*src++ & mask0];
switch (fw) {
default:
@@ -464,17 +461,17 @@ setrow(u_char* row, int nrows, const u_char* rows[])
* with a user-selectable contrast curve.
*/
static void
-setImage1(const u_char* br, u_int rw, u_int rh)
+setImage1(const uint8* br, uint32 rw, uint32 rh)
{
int step = rh;
int limit = tnh;
int err = 0;
int bpr = howmany(rw,8);
- u_int sy = 0;
- u_char* row = thumbnail;
- u_int dy;
+ uint32 sy = 0;
+ uint8* row = thumbnail;
+ uint32 dy;
for (dy = 0; dy < tnh; dy++) {
- const u_char* rows[256];
+ const uint8* rows[256];
int nrows = 1;
rows[0] = br + bpr*sy;
err += step;
@@ -490,9 +487,9 @@ setImage1(const u_char* br, u_int rw, u_int rh)
}
static void
-setImage(const u_char* br, u_int rw, u_int rh)
+setImage(const uint8* br, uint32 rw, uint32 rh)
{
- filterWidth = (u_short) ceil((double) rw / (double) tnw);
+ filterWidth = (uint16) ceil((double) rw / (double) tnw);
setupStepTables(rw);
setImage1(br, rw, rh);
}
diff --git a/tools/tiff2bw.c b/tools/tiff2bw.c
index 87d503eb..04871360 100644
--- a/tools/tiff2bw.c
+++ b/tools/tiff2bw.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiff2bw.c,v 1.19 1995/07/19 00:39:51 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiff2bw.c,v 1.20 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include <ctype.h>
#include "tiffio.h"
diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c
index 389dd4f7..9d41c87c 100644
--- a/tools/tiff2ps.c
+++ b/tools/tiff2ps.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiff2ps.c,v 1.45 1995/06/06 23:45:26 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiff2ps.c,v 1.47 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,12 +24,8 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h> /* for atof */
-#endif
#include <math.h>
#include <time.h>
@@ -38,10 +34,13 @@
/*
* NB: this code assumes uint32 works with printf's %l[ud].
*/
+#ifndef TRUE
#define TRUE 1
#define FALSE 0
+#endif
int ascii85 = FALSE; /* use ASCII85 encoding */
+int interpolate = TRUE; /* interpolate level2 image */
int level2 = FALSE; /* generate PostScript level 2 */
int printAll = FALSE; /* print all images in file */
int generateEPSF = TRUE; /* generate Encapsulated PostScript */
@@ -49,6 +48,13 @@ int PSduplex = FALSE; /* enable duplex printing */
int PStumble = FALSE; /* enable top edge binding */
char *filename; /* input filename */
+/*
+ * ASCII85 Encoding Support.
+ */
+unsigned char ascii85buf[10];
+int ascii85count;
+int ascii85breaklen;
+
int TIFF2PS(FILE*, TIFF*, float, float);
void PSpage(FILE*, TIFF*, uint32, uint32);
void PSColorContigPreamble(FILE*, uint32, uint32, int);
@@ -182,8 +188,10 @@ checkImage(TIFF* tif)
JPEGCOLORMODE_RGB);
photometric = PHOTOMETRIC_RGB;
} else {
- TIFFError(filename,
- "Can not handle image with PhotometricInterpretation=YCbCr");
+ if (level2)
+ break;
+ TIFFError(filename, "Can not handle image with %s",
+ "PhotometricInterpretation=YCbCr");
return (0);
}
/* fall thru... */
@@ -200,6 +208,8 @@ checkImage(TIFF* tif)
case PHOTOMETRIC_MINISBLACK:
case PHOTOMETRIC_MINISWHITE:
break;
+ case PHOTOMETRIC_CIELAB:
+ /* fall thru... */
default:
TIFFError(filename,
"Can not handle image with PhotometricInterpretation=%d",
@@ -247,7 +257,7 @@ static void
PhotoshopBanner(FILE* fd, uint32 w, uint32 h, int bs, int nc, char* startline)
{
fprintf(fd, "%%ImageData: %ld %ld %d %d 0 %d 2 \"",
- w, h, bitspersample, nc, bs);
+ (long) w, (long) h, bitspersample, nc, bs);
fprintf(fd, startline, nc);
fprintf(fd, "\"\n");
}
@@ -280,6 +290,17 @@ setupPageState(TIFF* tif, uint32* pw, uint32* ph, float* pprw, float* pprh)
*pprw = PSUNITS(*pw, xres);
}
+static int
+isCCITTCompression(TIFF* tif)
+{
+ uint16 compress;
+ TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
+ return (compress == COMPRESSION_CCITTFAX3 ||
+ compress == COMPRESSION_CCITTFAX4 ||
+ compress == COMPRESSION_CCITTRLE ||
+ compress == COMPRESSION_CCITTRLEW);
+}
+
static tsize_t tf_bytesperrow;
static tsize_t ps_bytesperrow;
static tsize_t tf_rowsperstrip;
@@ -305,7 +326,8 @@ TIFF2PS(FILE* fd, TIFF* tif, float pw, float ph)
do {
tf_numberstrips = TIFFNumberOfStrips(tif);
- TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &tf_rowsperstrip);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP,
+ &tf_rowsperstrip);
setupPageState(tif, &w, &h, &prw, &prh);
if (!npages)
PSHead(fd, tif, w, h, prw, prh, ox, oy);
@@ -314,13 +336,26 @@ TIFF2PS(FILE* fd, TIFF* tif, float pw, float ph)
&bitspersample);
TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL,
&samplesperpixel);
- TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planarconfiguration);
- TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG,
+ &planarconfiguration);
TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression);
TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES,
&extrasamples, &sampleinfo);
alpha = (extrasamples == 1 &&
sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA);
+ if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) {
+ switch (samplesperpixel - extrasamples) {
+ case 1:
+ if (isCCITTCompression(tif))
+ photometric = PHOTOMETRIC_MINISWHITE;
+ else
+ photometric = PHOTOMETRIC_MINISBLACK;
+ break;
+ case 3:
+ photometric = PHOTOMETRIC_RGB;
+ break;
+ }
+ }
if (checkImage(tif)) {
npages++;
fprintf(fd, "%%%%Page: %d %d\n", npages, npages);
@@ -368,9 +403,9 @@ end\n\
%%EndFeature\n\
";
-void
-PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph,
- float ox, float oy)
+void
+PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph,
+ float ox, float oy)
{
time_t t;
@@ -380,10 +415,12 @@ PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph,
fprintf(fd, "%%%%Creator: tiff2ps\n");
fprintf(fd, "%%%%Title: %s\n", filename);
fprintf(fd, "%%%%CreationDate: %s", ctime(&t));
+ fprintf(fd, "%%%%DocumentData: Clean7Bit\n");
fprintf(fd, "%%%%Origin: %ld %ld\n", (long) ox, (long) oy);
/* NB: should use PageBoundingBox */
fprintf(fd, "%%%%BoundingBox: 0 0 %ld %ld\n",
(long) ceil(pw), (long) ceil(ph));
+ fprintf(fd, "%%%%LanguageLevel: %d\n", level2 ? 2 : 1);
fprintf(fd, "%%%%Pages: (atend)\n");
fprintf(fd, "%%%%EndComments\n");
fprintf(fd, "%%%%BeginSetup\n");
@@ -397,50 +434,477 @@ PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph,
void
PSTail(FILE *fd, int npages)
{
+ fprintf(fd, "%%%%Trailer\n");
fprintf(fd, "%%%%Pages: %d\n", npages);
- fprintf(fd, "%%%%Trailer\n%%%%EOF\n");
+ fprintf(fd, "%%%%EOF\n");
+}
+
+static int
+checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
+{
+ (void) tif;
+ while (n-- > 0)
+ if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
+ return (16);
+ TIFFWarning(filename, "Assuming 8-bit colormap");
+ return (8);
+}
+
+static void
+PS_Lvl2colorspace(FILE* fd, TIFF* tif)
+{
+ uint16 *rmap, *gmap, *bmap;
+ int i, num_colors;
+
+ /*
+ * Set up PostScript Level 2 colorspace according to
+ * section 4.8 in the PostScript refenence manual.
+ */
+ fputs("% PostScript Level 2 only.\n", fd);
+ if (photometric != PHOTOMETRIC_PALETTE) {
+ if (photometric == PHOTOMETRIC_YCBCR) {
+ /* MORE CODE HERE */
+ }
+ fprintf(fd, "/Device%s",
+ samplesperpixel > 2 ? "RGB" : "Gray");
+ fputs(" setcolorspace\n", fd);
+ return;
+ }
+
+ /*
+ * Set up an indexed/palette colorspace
+ */
+ num_colors = (1 << bitspersample);
+ if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) {
+ TIFFError(filename,
+ "Palette image w/o \"Colormap\" tag");
+ return;
+ }
+ if (checkcmap(tif, num_colors, rmap, gmap, bmap) == 16) {
+ /*
+ * Convert colormap to 8-bits values.
+ */
+#define CVT(x) (((x) * 255) / ((1L<<16)-1))
+ for (i = 0; i < num_colors; i++) {
+ rmap[i] = CVT(rmap[i]);
+ gmap[i] = CVT(gmap[i]);
+ bmap[i] = CVT(bmap[i]);
+ }
+#undef CVT
+ }
+ fprintf(fd, "[ /Indexed /DeviceRGB %d", num_colors - 1);
+ if (ascii85) {
+ Ascii85Init();
+ fputs("\n<~", fd);
+ ascii85breaklen -= 2;
+ } else
+ fputs(" <", fd);
+ for (i = 0; i < num_colors; i++) {
+ if (ascii85) {
+ Ascii85Put(rmap[i], fd);
+ Ascii85Put(gmap[i], fd);
+ Ascii85Put(bmap[i], fd);
+ } else {
+ fputs((i % 8) ? " " : "\n ", fd);
+ fprintf(fd, "%02x%02x%02x",
+ rmap[i], gmap[i], bmap[i]);
+ }
+ }
+ if (ascii85)
+ Ascii85Flush(fd);
+ else
+ fputs(">\n", fd);
+ fputs("] setcolorspace\n", fd);
}
static int
-emitPSLevel2FilterFunction(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
{
- uint32 group3opts;
- int K;
-
-#define P(a,b) (((a)<<4)|((b)&0xf))
- switch (P(compression, photometric)) {
- case P(COMPRESSION_CCITTRLE, PHOTOMETRIC_MINISBLACK):
- case P(COMPRESSION_CCITTRLE, PHOTOMETRIC_MINISWHITE):
- K = 0;
+ int use_rawdata;
+ uint32 tile_width, tile_height;
+ uint16 predictor, minsamplevalue, maxsamplevalue;
+ int repeat_count;
+ char im_h[64], im_x[64], im_y[64];
+
+ (void)strcpy(im_x, "0");
+ (void)sprintf(im_y, "%lu", (long) h);
+ (void)sprintf(im_h, "%lu", (long) h);
+ tile_width = w;
+ tile_height = h;
+ if (TIFFIsTiled(tif)) {
+ repeat_count = TIFFNumberOfTiles(tif);
+ TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tile_width);
+ TIFFGetField(tif, TIFFTAG_TILELENGTH, &tile_height);
+ if (tile_width > w || tile_height > h ||
+ (w % tile_width) != 0 || (h % tile_height != 0)) {
+ /*
+ * The tiles does not fit image width and height.
+ * Set up a clip rectangle for the image unit square.
+ */
+ fputs("0 0 1 1 rectclip\n", fd);
+ }
+ if (tile_width < w) {
+ fputs("/im_x 0 def\n", fd);
+ (void)strcpy(im_x, "im_x neg");
+ }
+ if (tile_height < h) {
+ fputs("/im_y 0 def\n", fd);
+ (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
+ }
+ } else {
+ repeat_count = tf_numberstrips;
+ tile_height = tf_rowsperstrip;
+ if (tile_height > h)
+ tile_height = h;
+ if (repeat_count > 1) {
+ fputs("/im_y 0 def\n", fd);
+ fprintf(fd, "/im_h %lu def\n",
+ (unsigned long) tile_height);
+ (void)strcpy(im_h, "im_h");
+ (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
+ }
+ }
+
+ /*
+ * Output start of exec block
+ */
+ fputs("{ % exec\n", fd);
+
+ if (repeat_count > 1)
+ fprintf(fd, "%d { %% repeat\n", repeat_count);
+
+ /*
+ * Output filter options and image dictionary.
+ */
+ if (ascii85)
+ fputs(" /im_stream currentfile /ASCII85Decode filter def\n",
+ fd);
+ fputs(" <<\n", fd);
+ fputs(" /ImageType 1\n", fd);
+ fprintf(fd, " /Width %lu\n", (unsigned long) tile_width);
+ fprintf(fd, " /Height %lu\n", (unsigned long) tile_height);
+ if (planarconfiguration == PLANARCONFIG_SEPARATE)
+ fputs(" /MultipleDataSources true\n", fd);
+ fprintf(fd, " /ImageMatrix [ %lu 0 0 %ld %s %s ]\n",
+ (unsigned long) w, - (long)h, im_x, im_y);
+ fprintf(fd, " /BitsPerComponent %d\n", bitspersample);
+ fprintf(fd, " /Interpolate %s\n", interpolate ? "true" : "false");
+
+ switch (samplesperpixel) {
+ case 1:
+ switch (photometric) {
+ case PHOTOMETRIC_MINISBLACK:
+ fputs(" /Decode [0 1]\n", fd);
+ break;
+ case PHOTOMETRIC_MINISWHITE:
+ switch (compression) {
+ case COMPRESSION_CCITTRLE:
+ case COMPRESSION_CCITTRLEW:
+ case COMPRESSION_CCITTFAX3:
+ case COMPRESSION_CCITTFAX4:
+ /*
+ * Manage inverting with /Blackis1 flag
+ * since there migth be uncompressed parts
+ */
+ fputs(" /Decode [0 1]\n", fd);
+ break;
+ default:
+ /*
+ * ERROR...
+ */
+ fputs(" /Decode [1 0]\n", fd);
+ break;
+ }
+ break;
+ case PHOTOMETRIC_PALETTE:
+ TIFFGetFieldDefaulted(tif, TIFFTAG_MINSAMPLEVALUE,
+ &minsamplevalue);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_MAXSAMPLEVALUE,
+ &maxsamplevalue);
+ fprintf(fd, " /Decode [%u %u]\n",
+ minsamplevalue, maxsamplevalue);
+ break;
+ default:
+ /*
+ * ERROR ?
+ */
+ fputs(" /Decode [0 1]\n", fd);
+ break;
+ }
+ break;
+ case 3:
+ switch (photometric) {
+ case PHOTOMETRIC_RGB:
+ fputs(" /Decode [0 1 0 1 0 1]\n", fd);
+ break;
+ case PHOTOMETRIC_MINISWHITE:
+ case PHOTOMETRIC_MINISBLACK:
+ default:
+ /*
+ * ERROR??
+ */
+ fputs(" /Decode [0 1 0 1 0 1]\n", fd);
+ break;
+ }
+ break;
+ case 4:
+ /*
+ * ERROR??
+ */
+ fputs(" /Decode [0 1 0 1 0 1 0 1]\n", fd);
+ break;
+ }
+ fputs(" /DataSource", fd);
+ if (planarconfiguration == PLANARCONFIG_SEPARATE &&
+ samplesperpixel > 1)
+ fputs(" [", fd);
+ if (ascii85)
+ fputs(" im_stream", fd);
+ else
+ fputs(" currentfile /ASCIIHexDecode filter", fd);
+
+ use_rawdata = TRUE;
+ switch (compression) {
+ case COMPRESSION_NONE: /* 1: uncompressed */
+ break;
+ case COMPRESSION_CCITTRLE: /* 2: CCITT modified Huffman RLE */
+ case COMPRESSION_CCITTRLEW: /* 32771: #1 w/ word alignment */
+ case COMPRESSION_CCITTFAX3: /* 3: CCITT Group 3 fax encoding */
+ case COMPRESSION_CCITTFAX4: /* 4: CCITT Group 4 fax encoding */
+ fputs("\n\t<<\n", fd);
+ if (compression == COMPRESSION_CCITTFAX3) {
+ uint32 g3_options;
+
+ fputs("\t /EndOfLine true\n", fd);
+ fputs("\t /EndOfBlock false\n", fd);
+ if (!TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS,
+ &g3_options))
+ g3_options = 0;
+ if (g3_options & GROUP3OPT_2DENCODING)
+ fprintf(fd, "\t /K %s\n", im_h);
+ if (g3_options & GROUP3OPT_UNCOMPRESSED)
+ fputs("\t /Uncompressed true\n", fd);
+ if (g3_options & GROUP3OPT_FILLBITS)
+ fputs("\t /EncodedByteAlign true\n", fd);
+ }
+ if (compression == COMPRESSION_CCITTFAX4) {
+ uint32 g4_options;
+
+ fputs("\t /K -1\n", fd);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_GROUP4OPTIONS,
+ &g4_options);
+ if (g4_options & GROUP4OPT_UNCOMPRESSED)
+ fputs("\t /Uncompressed true\n", fd);
+ }
+ if (!(tile_width == w && w == 1728U))
+ fprintf(fd, "\t /Columns %lu\n",
+ (unsigned long) tile_width);
+ fprintf(fd, "\t /Rows %s\n", im_h);
+ if (compression == COMPRESSION_CCITTRLE ||
+ compression == COMPRESSION_CCITTRLEW) {
+ fputs("\t /EncodedByteAlign true\n", fd);
+ fputs("\t /EndOfBlock false\n", fd);
+ }
+ if (photometric == PHOTOMETRIC_MINISBLACK)
+ fputs("\t /BlackIs1 true\n", fd);
+ fprintf(fd, "\t>> /CCITTFaxDecode filter");
+ break;
+ case COMPRESSION_LZW: /* 5: Lempel-Ziv & Welch */
+ TIFFGetFieldDefaulted(tif, TIFFTAG_PREDICTOR, &predictor);
+ if (predictor == 2) {
+ fputs("\n\t<<\n", fd);
+ fprintf(fd, "\t /Predictor %u\n", predictor);
+ fprintf(fd, "\t /Columns %lu\n",
+ (unsigned long) tile_width);
+ fprintf(fd, "\t /Colors %u\n", samplesperpixel);
+ fprintf(fd, "\t /BitsPerComponent %u\n",
+ bitspersample);
+ fputs("\t>>", fd);
+ }
+ fputs(" /LZWDecode filter", fd);
break;
- case P(COMPRESSION_CCITTFAX3, PHOTOMETRIC_MINISBLACK):
- case P(COMPRESSION_CCITTFAX3, PHOTOMETRIC_MINISWHITE):
- TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &group3opts);
- K = group3opts&GROUP3OPT_2DENCODING;
+ case COMPRESSION_PACKBITS: /* 32773: Macintosh RLE */
+ fputs(" /RunLengthDecode filter", fd);
+ use_rawdata = TRUE;
+ break;
+ case COMPRESSION_OJPEG: /* 6: !6.0 JPEG */
+ case COMPRESSION_JPEG: /* 7: %JPEG DCT compression */
+#ifdef notdef
+ /*
+ * Code not tested yet
+ */
+ fputs(" /DCTDecode filter", fd);
+ use_rawdata = TRUE;
+#else
+ use_rawdata = FALSE;
+#endif
break;
- case P(COMPRESSION_CCITTFAX4, PHOTOMETRIC_MINISBLACK):
- case P(COMPRESSION_CCITTFAX4, PHOTOMETRIC_MINISWHITE):
- K = -1;
+ case COMPRESSION_NEXT: /* 32766: NeXT 2-bit RLE */
+ case COMPRESSION_THUNDERSCAN: /* 32809: ThunderScan RLE */
+ case COMPRESSION_PIXARFILM: /* 32908: Pixar companded 10bit LZW */
+ case COMPRESSION_DEFLATE: /* 32946: Deflate compression */
+ case COMPRESSION_JBIG: /* 34661: ISO JBIG */
+ use_rawdata = FALSE;
break;
- case P(COMPRESSION_LZW, PHOTOMETRIC_MINISBLACK):
- fprintf(fd, " /LZWDecode filter\n");
- return (TRUE);
default:
- return (FALSE);
- }
-#undef P
- fprintf(fd, " <<");
- fprintf(fd, "/K %d", K);
- fprintf(fd, " /Columns %d /Rows %d", w, h);
- fprintf(fd, " /EndOfBlock false /BlackIs1 %s",
- (photometric == PHOTOMETRIC_MINISBLACK) ? "true" : "false");
- fprintf(fd, ">>\n /CCITTFaxDecode filter\n");
- return (TRUE);
+ /*
+ * ERROR...
+ */
+ use_rawdata = FALSE;
+ break;
+ }
+ if (planarconfiguration == PLANARCONFIG_SEPARATE &&
+ samplesperpixel > 1) {
+ uint16 i;
+
+ /*
+ * NOTE: This code does not work yet...
+ */
+ for (i = 1; i < samplesperpixel; i++)
+ fputs(" dup", fd);
+ fputs(" ]", fd);
+ }
+ fputs("\n >> image\n", fd);
+ if (ascii85)
+ fputs(" im_stream flushfile\n", fd);
+ if (repeat_count > 1) {
+ if (tile_width < w) {
+ fprintf(fd, " /im_x im_x %lu add def\n",
+ (unsigned long) tile_width);
+ if (tile_height < h) {
+ fprintf(fd, " im_x %lu ge {\n",
+ (unsigned long) w);
+ fputs(" /im_x 0 def\n", fd);
+ fprintf(fd, " /im_y im_y %lu add def\n",
+ (unsigned long) tile_height);
+ fputs(" } if\n", fd);
+ }
+ }
+ if (tile_height < h) {
+ if (tile_width >= w) {
+ fprintf(fd, " /im_y im_y %lu add def\n",
+ (unsigned long) tile_height);
+ if (!TIFFIsTiled(tif)) {
+ fprintf(fd, " /im_h %lu im_y sub",
+ (unsigned long) h);
+ fprintf(fd, " dup %lu gt { pop",
+ (unsigned long) tile_height);
+ fprintf(fd, " %lu } if def\n",
+ (unsigned long) tile_height);
+ }
+ }
+ }
+ fputs("} repeat\n", fd);
+ }
+ /*
+ * End of exec function
+ */
+ fputs("}\n", fd);
+
+ return(use_rawdata);
+}
+
+int
+PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+{
+ uint16 fillorder;
+ int use_rawdata, tiled_image, breaklen;
+ uint32 chunk_no, num_chunks, *bc;
+ unsigned char *buf_data, *cp;
+ tsize_t chunk_size, byte_count;
+
+ PS_Lvl2colorspace(fd, tif);
+ use_rawdata = PS_Lvl2ImageDict(fd, tif, w, h);
+
+ fputs("%%BeginData:\n", fd);
+ fputs("exec\n", fd);
+
+ tiled_image = TIFFIsTiled(tif);
+ if (tiled_image) {
+ num_chunks = TIFFNumberOfTiles(tif);
+ TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc);
+ } else {
+ num_chunks = TIFFNumberOfStrips(tif);
+ TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
+ }
+
+ if (use_rawdata) {
+ chunk_size = bc[0];
+ for (chunk_no = 1; chunk_no < num_chunks; chunk_no++)
+ if (bc[chunk_no] > chunk_size)
+ chunk_size = bc[chunk_no];
+ } else {
+ if (tiled_image)
+ chunk_size = TIFFTileSize(tif);
+ else
+ chunk_size = TIFFStripSize(tif);
+ }
+ buf_data = (unsigned char *)_TIFFmalloc(chunk_size);
+ if (!buf_data) {
+ TIFFError(filename, "Can't alloc %u bytes for %s.",
+ chunk_size, tiled_image ? "tiles" : "strips");
+ return(FALSE);
+ }
+
+ TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
+ for (chunk_no = 0; chunk_no < num_chunks; chunk_no++) {
+ if (ascii85)
+ Ascii85Init();
+ else
+ breaklen = 36;
+ if (use_rawdata) {
+ if (tiled_image)
+ byte_count = TIFFReadRawTile(tif, chunk_no,
+ buf_data, chunk_size);
+ else
+ byte_count = TIFFReadRawStrip(tif, chunk_no,
+ buf_data, chunk_size);
+ if (fillorder == FILLORDER_LSB2MSB)
+ TIFFReverseBits(buf_data, byte_count);
+ } else {
+ if (tiled_image)
+ byte_count = TIFFReadEncodedTile(tif,
+ chunk_no, buf_data,
+ chunk_size);
+ else
+ byte_count = TIFFReadEncodedStrip(tif,
+ chunk_no, buf_data,
+ chunk_size);
+ }
+ if (byte_count < 0) {
+ TIFFError(filename, "Can't read %s %d.",
+ tiled_image ? "tile" : "strip", chunk_no);
+ if (ascii85)
+ Ascii85Put('\0', fd);
+ }
+ for (cp = buf_data; byte_count > 0; byte_count--) {
+ if (ascii85)
+ Ascii85Put(*cp++, fd);
+ else {
+ if (--breaklen <= 0) {
+ putc('\n', fd);
+ breaklen = 36;
+ }
+ putc(hex[((*cp)>>4)&0xf], fd);
+ putc(hex[(*cp)&0xf], fd);
+ cp++;
+ }
+ }
+ if (ascii85)
+ Ascii85Flush(fd);
+ else
+ putc('\n', fd);
+ }
+ _TIFFfree(buf_data);
+ fputs("%%EndData\n", fd);
+ return(TRUE);
}
void
PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
{
+ if (level2 && PS_Lvl2page(fd, tif, w, h))
+ return;
ps_bytesperrow = tf_bytesperrow;
switch (photometric) {
case PHOTOMETRIC_RGB:
@@ -466,51 +930,29 @@ PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case PHOTOMETRIC_PALETTE:
fprintf(fd, "%s", RGBcolorimage);
PhotoshopBanner(fd, w, h, 1, 3, "false 3 colorimage");
- fprintf(fd, "/scanLine %d string def\n", ps_bytesperrow);
- fprintf(fd, "%lu %lu 8\n", w, h);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", w, h, h);
+ fprintf(fd, "/scanLine %ld string def\n",
+ (long) ps_bytesperrow);
+ fprintf(fd, "%lu %lu 8\n",
+ (unsigned long) w, (unsigned long) h);
+ fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
+ (unsigned long) w, (unsigned long) h, (unsigned long) h);
fprintf(fd, "{currentfile scanLine readhexstring pop} bind\n");
fprintf(fd, "false 3 colorimage\n");
PSDataPalette(fd, tif, w, h);
break;
case PHOTOMETRIC_MINISBLACK:
case PHOTOMETRIC_MINISWHITE:
- if (level2) {
- int rawdata;
- fprintf(fd, "{ %lu { %lu %lu %d\n", tf_numberstrips,
- w, tf_rowsperstrip, bitspersample);
- fprintf(fd, " [%lu 0 0 -%lu 0 %lu]\n", w, h, h);
- fprintf(fd, " currentfile /ASCII%sDecode filter\n",
- ascii85 ? "85" : "Hex");
- rawdata = emitPSLevel2FilterFunction(fd, tif, w, h);
- fprintf(fd, " image\n");
- fprintf(fd, " 0 -%f translate\n",
- (float)tf_rowsperstrip/(float)h);
- fprintf(fd, " } repeat\n}\n");
- PhotoshopBanner(fd, w, h, 1, 1, "image");
- fprintf(fd, "%%%%BeginData\nexec\n");
- if (ascii85) {
- if (rawdata)
- PSRawDataBW(fd, tif, w, tf_rowsperstrip);
- else
- PSDataBW(fd, tif, w, h);
- } else {
- if (rawdata)
- PSRawDataBW(fd, tif, w, h);
- else
- PSDataBW(fd, tif, w, h);
- }
- fprintf(fd, "%%%%EndData\n");
- } else {
- PhotoshopBanner(fd, w, h, 1, 1, "image");
- fprintf(fd, "/scanLine %d string def\n",ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n", w, h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", w, h, h);
- fprintf(fd,
- "{currentfile scanLine readhexstring pop} bind\n");
- fprintf(fd, "image\n");
- PSDataBW(fd, tif, w, h);
- }
+ PhotoshopBanner(fd, w, h, 1, 1, "image");
+ fprintf(fd, "/scanLine %ld string def\n",
+ (long) ps_bytesperrow);
+ fprintf(fd, "%lu %lu %d\n",
+ (unsigned long) w, (unsigned long) h, bitspersample);
+ fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
+ (unsigned long) w, (unsigned long) h, (unsigned long) h);
+ fprintf(fd,
+ "{currentfile scanLine readhexstring pop} bind\n");
+ fprintf(fd, "image\n");
+ PSDataBW(fd, tif, w, h);
break;
}
putc('\n', fd);
@@ -521,9 +963,11 @@ PSColorContigPreamble(FILE* fd, uint32 w, uint32 h, int nc)
{
ps_bytesperrow = nc * (tf_bytesperrow / samplesperpixel);
PhotoshopBanner(fd, w, h, 1, nc, "false %d colorimage");
- fprintf(fd, "/line %d string def\n", ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n", w, h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", w, h, h);
+ fprintf(fd, "/line %ld string def\n", (long) ps_bytesperrow);
+ fprintf(fd, "%lu %lu %d\n",
+ (unsigned long) w, (unsigned long) h, bitspersample);
+ fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
+ (unsigned long) w, (unsigned long) h, (unsigned long) h);
fprintf(fd, "{currentfile line readhexstring pop} bind\n");
fprintf(fd, "false %d colorimage\n", nc);
}
@@ -535,9 +979,12 @@ PSColorSeparatePreamble(FILE* fd, uint32 w, uint32 h, int nc)
PhotoshopBanner(fd, w, h, ps_bytesperrow, nc, "true %d colorimage");
for (i = 0; i < nc; i++)
- fprintf(fd, "/line%d %d string def\n", i, ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n", w, h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu] \n", w, h, h);
+ fprintf(fd, "/line%d %ld string def\n",
+ i, (long) ps_bytesperrow);
+ fprintf(fd, "%lu %lu %d\n",
+ (unsigned long) w, (unsigned long) h, bitspersample);
+ fprintf(fd, "[%lu 0 0 -%lu 0 %lu] \n",
+ (unsigned long) w, (unsigned long) h, (unsigned long) h);
for (i = 0; i < nc; i++)
fprintf(fd, "{currentfile line%d readhexstring pop}bind\n", i);
fprintf(fd, "true %d colorimage\n", nc);
@@ -638,17 +1085,6 @@ PSDataColorSeparate(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
#define PUTRGBHEX(c,fd) \
PUTHEX(rmap[c],fd); PUTHEX(gmap[c],fd); PUTHEX(bmap[c],fd)
-static int
-checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
-{
- (void) tif;
- while (n-- > 0)
- if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
- return (16);
- TIFFWarning(filename, "Assuming 8-bit colormap");
- return (8);
-}
-
void
PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
{
@@ -678,7 +1114,7 @@ PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
if (checkcmap(tif, 1<<bitspersample, rmap, gmap, bmap) == 16) {
int i;
-#define CVT(x) (((x) * 255L) / ((1L<<16)-1))
+#define CVT(x) (((x) * 255) / ((1U<<16)-1))
for (i = (1<<bitspersample)-1; i >= 0; i--) {
rmap[i] = CVT(rmap[i]);
gmap[i] = CVT(gmap[i]);
@@ -780,7 +1216,7 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
tstrip_t s;
(void) w; (void) h;
- TIFFGetField(tif, TIFFTAG_FILLORDER, &fillorder);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
bufsize = bc[0];
tf_buf = (unsigned char*) _TIFFmalloc(bufsize);
@@ -823,13 +1259,6 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
_TIFFfree((char *) tf_buf);
}
-/*
- * ASCII85 Encoding Support.
- */
-unsigned char ascii85buf[10];
-int ascii85count;
-int ascii85breaklen;
-
void
Ascii85Init(void)
{
diff --git a/tools/tiffcmp.c b/tools/tiffcmp.c
index a6a4cfde..e1130e24 100644
--- a/tools/tiffcmp.c
+++ b/tools/tiffcmp.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffcmp.c,v 1.27 1995/07/19 00:39:51 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffcmp.c,v 1.28 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include "tiffio.h"
@@ -318,7 +314,8 @@ PrintDiff(uint32 row, int sample, uint32 pix, int w1, int w2)
if ((w1 & mask2) ^ (w2 & mask2)) {
printf(
"Scanline %lu, pixel %lu, sample %d: %01x %01x\n",
- row, pix, sample, (w1 >> s) & mask1,
+ (long) row, (long) pix,
+ sample, (w1 >> s) & mask1,
(w2 >> s) & mask1 );
if (--stopondiff == 0)
exit(1);
@@ -327,13 +324,13 @@ PrintDiff(uint32 row, int sample, uint32 pix, int w1, int w2)
break;
case 8:
printf("Scanline %lu, pixel %lu, sample %d: %02x %02x\n",
- row, pix, sample, w1, w2);
+ (long) row, (long) pix, sample, w1, w2);
if (--stopondiff)
exit(1);
break;
case 16:
printf("Scanline %lu, pixel %lu, sample %d: %04x %04x\n",
- row, pix, sample, w1, w2);
+ (long) row, (long) pix, sample, w1, w2);
if (--stopondiff)
exit(1);
break;
@@ -349,8 +346,8 @@ SeparateCompare(int reversed, int sample, uint32 row, unsigned char* cp1, unsign
cp1 += sample;
for (pixel = 0; npixels-- > 0; pixel++, cp1 += samplesperpixel, p2++)
if (*cp1 != *p2) {
- printf("Scanline %lu, pixel %lu, sample %d: ",
- row, pixel, sample);
+ printf("Scanline %lu, pixel %lu, sample %ld: ",
+ (long) row, (long) pixel, (long) sample);
if (reversed)
printf("%02x %02x\n", *p2, *cp1);
else
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
index b8d01eef..0222c37c 100644
--- a/tools/tiffcp.c
+++ b/tools/tiffcp.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffcp.c,v 1.43 1995/06/30 05:37:07 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffcp.c,v 1.45 1995/10/12 16:40:49 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,15 +24,10 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-typedef unsigned char u_char;
-#endif
#include <ctype.h>
#include "tiffio.h"
@@ -511,20 +506,20 @@ static int x(TIFF* in, TIFF* out, \
#define DECLAREreadFunc(x) \
static void x(TIFF* in, \
- u_char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef void (*readFunc)(TIFF*, u_char*, uint32, uint32, tsample_t);
+ uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
+typedef void (*readFunc)(TIFF*, uint8*, uint32, uint32, tsample_t);
#define DECLAREwriteFunc(x) \
static int x(TIFF* out, \
- u_char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef int (*writeFunc)(TIFF*, u_char*, uint32, uint32, tsample_t);
+ uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
+typedef int (*writeFunc)(TIFF*, uint8*, uint32, uint32, tsample_t);
/*
* Contig -> contig by scanline for rows/strip change.
*/
DECLAREcpFunc(cpContig2ContigByRow)
{
- u_char *buf = (u_char *)_TIFFmalloc(TIFFScanlineSize(in));
+ tdata_t buf = _TIFFmalloc(TIFFScanlineSize(in));
uint32 row;
(void) imagewidth; (void) spp;
@@ -548,7 +543,7 @@ bad:
DECLAREcpFunc(cpDecodedStrips)
{
tsize_t stripsize = TIFFStripSize(in);
- u_char *buf = (u_char *)_TIFFmalloc(stripsize);
+ tdata_t buf = _TIFFmalloc(stripsize);
(void) imagewidth; (void) spp;
if (buf) {
@@ -576,7 +571,7 @@ DECLAREcpFunc(cpDecodedStrips)
*/
DECLAREcpFunc(cpSeparate2SeparateByRow)
{
- u_char *buf = (u_char *)_TIFFmalloc(TIFFScanlineSize(in));
+ tdata_t buf = _TIFFmalloc(TIFFScanlineSize(in));
uint32 row;
tsample_t s;
@@ -602,9 +597,9 @@ bad:
*/
DECLAREcpFunc(cpContig2SeparateByRow)
{
- u_char *inbuf = (u_char *)_TIFFmalloc(TIFFScanlineSize(in));
- u_char *outbuf = (u_char *)_TIFFmalloc(TIFFScanlineSize(out));
- register u_char *inp, *outp;
+ tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
+ tdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));
+ register uint8 *inp, *outp;
register uint32 n;
uint32 row;
tsample_t s;
@@ -614,8 +609,8 @@ DECLAREcpFunc(cpContig2SeparateByRow)
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, inbuf, row, 0) < 0 && !ignore)
goto done;
- inp = inbuf + s;
- outp = outbuf;
+ inp = ((uint8*)inbuf) + s;
+ outp = (uint8*)outbuf;
for (n = imagewidth; n-- > 0;) {
*outp++ = *inp;
inp += spp;
@@ -639,9 +634,9 @@ bad:
*/
DECLAREcpFunc(cpSeparate2ContigByRow)
{
- u_char *inbuf = (u_char *)_TIFFmalloc(TIFFScanlineSize(in));
- u_char *outbuf = (u_char *)_TIFFmalloc(TIFFScanlineSize(out));
- register u_char *inp, *outp;
+ tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
+ tdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));
+ register uint8 *inp, *outp;
register uint32 n;
uint32 row;
tsample_t s;
@@ -651,8 +646,8 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
for (s = 0; s < spp; s++) {
if (TIFFReadScanline(in, inbuf, row, s) < 0 && !ignore)
goto done;
- inp = inbuf;
- outp = outbuf + s;
+ inp = (uint8*)inbuf;
+ outp = ((uint8*)outbuf) + s;
for (n = imagewidth; n-- > 0;) {
*outp = *inp++;
outp += spp;
@@ -672,7 +667,7 @@ bad:
}
static void
-cpStripToTile(u_char* out, u_char* in,
+cpStripToTile(uint8* out, uint8* in,
uint32 rows, uint32 cols, int outskew, int inskew)
{
while (rows-- > 0) {
@@ -685,7 +680,7 @@ cpStripToTile(u_char* out, u_char* in,
}
static void
-cpContigBufToSeparateBuf(u_char* out, u_char* in,
+cpContigBufToSeparateBuf(uint8* out, uint8* in,
uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
{
while (rows-- > 0) {
@@ -698,7 +693,7 @@ cpContigBufToSeparateBuf(u_char* out, u_char* in,
}
static void
-cpSeparateBufToContigBuf(u_char* out, u_char* in,
+cpSeparateBufToContigBuf(uint8* out, uint8* in,
uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
{
while (rows-- > 0) {
@@ -715,11 +710,10 @@ cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
uint32 imagelength, uint32 imagewidth, tsample_t spp)
{
int status = FALSE;
- u_char* buf = (u_char *)
- _TIFFmalloc(TIFFRasterScanlineSize(in) * imagelength);
+ tdata_t buf = _TIFFmalloc(TIFFRasterScanlineSize(in) * imagelength);
if (buf) {
- (*fin)(in, buf, imagelength, imagewidth, spp);
- status = (fout)(out, buf, imagelength, imagewidth, spp);
+ (*fin)(in, (uint8*)buf, imagelength, imagewidth, spp);
+ status = (fout)(out, (uint8*)buf, imagelength, imagewidth, spp);
_TIFFfree(buf);
}
return (status);
@@ -728,12 +722,12 @@ cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
DECLAREreadFunc(readContigStripsIntoBuffer)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
- u_char *bufp = buf;
+ uint8* bufp = buf;
uint32 row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
- if (TIFFReadScanline(in, bufp, row, 0) < 0 && !ignore)
+ if (TIFFReadScanline(in, (tdata_t) bufp, row, 0) < 0 && !ignore)
break;
bufp += scanlinesize;
}
@@ -742,22 +736,21 @@ DECLAREreadFunc(readContigStripsIntoBuffer)
DECLAREreadFunc(readSeparateStripsIntoBuffer)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
- u_char* scanline = (u_char *) _TIFFmalloc(scanlinesize);
+ tdata_t scanline = _TIFFmalloc(scanlinesize);
(void) imagewidth;
if (scanline) {
- u_char *bufp = buf;
+ uint8* bufp = (uint8*) buf;
uint32 row;
tsample_t s;
for (row = 0; row < imagelength; row++) {
/* merge channels */
for (s = 0; s < spp; s++) {
- u_char* sp = scanline;
- u_char* bp = bufp + s;
+ uint8* bp = bufp + s;
tsize_t n = scanlinesize;
- if (TIFFReadScanline(in, sp, row, s) < 0 && !ignore)
+ if (TIFFReadScanline(in, scanline, row, s) < 0 && !ignore)
goto done;
while (n-- > 0)
*bp = *bufp++, bp += spp;
@@ -771,11 +764,11 @@ done:
DECLAREreadFunc(readContigTilesIntoBuffer)
{
- u_char* tilebuf = (u_char *) _TIFFmalloc(TIFFTileSize(in));
+ tdata_t tilebuf = _TIFFmalloc(TIFFTileSize(in));
uint32 imagew = TIFFScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
- u_char *bufp = buf;
+ uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
@@ -816,8 +809,8 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
uint32 imagew = TIFFScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
- u_char* tilebuf = (u_char *) _TIFFmalloc(TIFFTileSize(in));
- u_char *bufp = buf;
+ tdata_t tilebuf = _TIFFmalloc(TIFFTileSize(in));
+ uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
@@ -875,7 +868,7 @@ DECLAREwriteFunc(writeBufferToContigStrips)
DECLAREwriteFunc(writeBufferToSeparateStrips)
{
- u_char *obuf = (u_char *) _TIFFmalloc(TIFFScanlineSize(out));
+ tdata_t obuf = _TIFFmalloc(TIFFScanlineSize(out));
tsample_t s;
if (obuf == NULL)
@@ -883,8 +876,8 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
for (s = 0; s < spp; s++) {
uint32 row;
for (row = 0; row < imagelength; row++) {
- u_char* inp = buf + s;
- u_char* outp = obuf;
+ uint8* inp = ((uint8*) buf) + s;
+ uint8* outp = (uint8*) obuf;
uint32 n = imagewidth;
while (n-- > 0)
@@ -905,8 +898,8 @@ DECLAREwriteFunc(writeBufferToContigTiles)
uint32 imagew = TIFFScanlineSize(out);
uint32 tilew = TIFFTileRowSize(out);
int iskew = imagew - tilew;
- u_char* obuf = (u_char *) _TIFFmalloc(TIFFTileSize(out));
- u_char* bufp = buf;
+ tdata_t obuf = _TIFFmalloc(TIFFTileSize(out));
+ uint8* bufp = (uint8*) buf;
uint32 tl, tw;
uint32 row;
@@ -950,8 +943,8 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
uint32 imagew = TIFFScanlineSize(out);
tsize_t tilew = TIFFTileRowSize(out);
int iskew = imagew - tilew;
- u_char *obuf = (u_char*) _TIFFmalloc(TIFFTileSize(out));
- u_char *bufp = buf;
+ tdata_t obuf = _TIFFmalloc(TIFFTileSize(out));
+ uint8* bufp = (uint8*) buf;
uint32 tl, tw;
uint32 row;
diff --git a/tools/tiffdither.c b/tools/tiffdither.c
index 6634b1b8..1a478b97 100644
--- a/tools/tiffdither.c
+++ b/tools/tiffdither.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffdither.c,v 1.24 1995/06/30 00:27:07 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffdither.c,v 1.25 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include "tiffio.h"
diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index 28db9651..4e0d1312 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.44 1995/07/19 00:39:51 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.46 1995/10/10 23:24:44 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#if defined(VMS)
#include <unixio.h>
@@ -61,7 +57,8 @@ typedef unsigned int off_t;
#include "tiffio.h"
-char *curfile;
+char* appname;
+char* curfile;
int swabflag;
int bigendian;
int typeshift[13]; /* data type shift counts */
@@ -82,6 +79,13 @@ static void dump(int, uint32);
extern int optind;
extern char* optarg;
+void
+usage()
+{
+ fprintf(stderr, "usage: %s [-h] [-o offset] file.tif ...\n", appname);
+ exit(-1);
+}
+
int
main(int argc, char* argv[])
{
@@ -91,6 +95,7 @@ main(int argc, char* argv[])
uint32 diroff = (uint32) 0;
bigendian = (*(char *)&one == 0);
+ appname = argv[0];
while ((c = getopt(argc, argv, "o:h")) != -1) {
switch (c) {
case 'h': /* print values in hex */
@@ -103,10 +108,11 @@ main(int argc, char* argv[])
diroff = (uint32) strtoul(optarg, NULL, 0);
break;
default:
- fprintf(stderr, "usage: %s [-h] [files]\n", argv[0]);
- return (-1);
+ usage();
}
}
+ if (optind >= argc)
+ usage();
for (; optind < argc; optind++) {
fd = open(argv[optind], O_RDONLY|O_BINARY, 0);
if (fd < 0) {
@@ -286,7 +292,8 @@ ReadDirectory(int fd, unsigned ix, uint32 off)
if (swabflag)
TIFFSwabLong(&nextdiroff);
printf("Directory %u: offset %lu (%#lx) next %lu (%#lx)\n", ix,
- off, off, nextdiroff, nextdiroff);
+ (unsigned long) off, (unsigned long) off,
+ (unsigned long) nextdiroff, (unsigned long) nextdiroff);
for (dp = dir, n = dircount; n > 0; n--, dp++) {
if (swabflag) {
TIFFSwabArrayOfShort(&dp->tdir_tag, 2);
@@ -296,7 +303,7 @@ ReadDirectory(int fd, unsigned ix, uint32 off)
putchar(' ');
PrintType(stdout, dp->tdir_type);
putchar(' ');
- printf("%u<", dp->tdir_count);
+ printf("%lu<", (unsigned long) dp->tdir_count);
if (dp->tdir_type >= NWIDTHS) {
printf(">\n");
continue;
@@ -614,7 +621,8 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
while (count-- > 0) {
if (lp[1] == 0)
fprintf(fd, "%sNan (%lu/%lu)", sep,
- lp[0], lp[1]);
+ (unsigned long) lp[0],
+ (unsigned long) lp[1]);
else
fprintf(fd, rationalfmt, sep,
(double)lp[0] / (double)lp[1]);
@@ -628,7 +636,7 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
while (count-- > 0) {
if (lp[1] == 0)
fprintf(fd, "%sNan (%ld/%ld)", sep,
- lp[0], lp[1]);
+ (long) lp[0], (long) lp[1]);
else
fprintf(fd, srationalfmt, sep,
(double)lp[0] / (double)lp[1]);
diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
index 7851dde0..05b8462c 100644
--- a/tools/tiffinfo.c
+++ b/tools/tiffinfo.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffinfo.c,v 1.24 1995/06/12 15:43:49 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffinfo.c,v 1.25 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1988-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include "tiffio.h"
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
index b44c8656..967bb185 100644
--- a/tools/tiffmedian.c
+++ b/tools/tiffmedian.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffmedian.c,v 1.17 1995/07/01 01:16:55 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffmedian.c,v 1.18 1995/10/10 00:35:22 sam Exp $ */
/*
* Apply median cut on an image.
@@ -40,13 +40,9 @@
* Siggraph '82 proceedings, pp. 297-307
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include "tiffio.h"
diff --git a/tools/tiffsplit.c b/tools/tiffsplit.c
index 4a976794..88821715 100644
--- a/tools/tiffsplit.c
+++ b/tools/tiffsplit.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffsplit.c,v 1.11 1995/06/06 23:45:26 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/tools/RCS/tiffsplit.c,v 1.12 1995/10/10 00:35:22 sam Exp $ */
/*
* Copyright (c) 1992-1995 Sam Leffler
@@ -24,13 +24,9 @@
* OF THIS SOFTWARE.
*/
-#if defined(unix) || defined(__unix)
-#include "port.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
#include "tiffio.h"