Merged main branch with current DEVEL_1_9.

DEVEL_2_0_BRANCH-1 RELEASE_1_0_2
Petter Reinholdtsen 2000-03-05 13:57:25 +00:00
rodzic a0fdbdeda3
commit 760423d864
158 zmienionych plików z 34220 dodań i 7438 usunięć

31
AUTHORS
Wyświetl plik

@ -11,18 +11,20 @@ Backends:
abaton: David Huggins-Daines
agfa: Karl Anders Øygard
apple: Milon Firikis
artec: Chris Pinkham
canon: Helmut Koeberle, Manuel Panea, and Markus Mertinat
artec: Chris Pinkham (*)
avision: Meino Christian Cramer, Rene Rebe(*)
canon: Helmut Koeberle, Manuel Panea (*), and Markus Mertinat
coolscan: Didier Carlier
dc25: Peter Fales
dc25: Peter Fales (*)
dc210: Brian J. Murrell
dll: David Mosberger
dmc: David F. Skoll
epson: Kazuhiro Sasayama
hp: Peter Kirchgessner
epson: Karl Heinz Kremer(*)
hp: Peter Kirchgessner (*)
Geoffrey Dairiki
microtek: Matthew Marjanovic
microtek2: Bernd Schroeder
m3096g: Randolph Bentson (*)
microtek: Matthew Marjanovic (*)
microtek2: Bernd Schroeder (*)
mustek: Andreas Bolsch, David Mosberger and Andreas Czechanowski
net: Andreas Beck and David Mosberger
pnm: Andreas Beck, Gordon Matzigkeit, and David Mosberger
@ -31,10 +33,14 @@ Backends:
despeckling filter by Patrick Reynolds,
B&W fixes by Andrew Kuchling
ricoh: Feico W. Dillema
sharp: FUKUDA Kazuya and Abel Deuring
s9036: Ingo Schneider
sharp: FUKUDA Kazuya (*) and Abel Deuring (*)
snapscan: Kevin Charter, Franck Schneider, and Michel Roelofs
sp15c: Randolph Bentson (*)
tamarack: Roger Wolff
umax: Oliver Rauch and Michael K. Johnson
umax: Oliver Rauch (*) and Michael K. Johnson
(*) Current active maintainer(s).
Frontends:
@ -64,15 +70,16 @@ Feico W. Dillema <dillema@acm.org>
Franck Schneider <schnefra@hol.fr>
Gordon Matzigkeit <gord@gnu.ai.mit.edu>
Helmut Koeberle <helmut.koeberle@bytec.de>
Helmut Koeberle <helmut.koeberle@bytec.de>
Ingo Schneider <schneidi@informatik.tu-muenchen.de>
Jeff Freedman <jsf@hevanet.com>
Karl Anders Oygard <karlo@opera.no>
Karl Anders Øygard <karlo@opera.no>
Karl Heinz Kremer <khk@khk.net>
Kazuhiro Sasayama <kaz@hypercore.co.jp>
Kevin Charter <charter@cs.rice.edu>
Manuel Panea <Manuel.Panea@rzg.mpg.de>
Markus Mertinat <Markus.Mertinat@Physik.Uni-Augsburg.DE>
Matthew Marjanovic <maddog@mir.com>
Meino Christian Cramer <mccramer@s.netic.de>
Michael K. Johnson <johnsonm@redhat.com>
Michel Roelofs <michelr@stack.nl>
Milon Firikis <milonf@ariadne-t.gr>
@ -80,5 +87,7 @@ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
Patrick Reynolds <patrickr@virginia.edu>
Peter Fales <psfales@earthling.net>
Peter Kirchgessner <peter@kirchgessner.net>
Randolph Bentson <bentson@grieg.holmsjoen.com>
Rene Rebe <rene.rebe@myokay.net>
Roger Wolff <R.E.Wolff@BitWizard.nl>
Tristan Tarrant <ttarrant@etnoteam.it>

87
README.unixware7 100644
Wyświetl plik

@ -0,0 +1,87 @@
SANE on UnixWare 7
==================
The easiest way to get SANE working on a UnixWare 7.1.X system (UW 7.0.0
and 7.0.1 are not supported) is to download and install the SANE binary
distribution from SCOs Skunkware web site. The URL is:
ftp://ftp.sco.com/skunkware/uw7/Packages
Use the pkgadd command to install the files, e.g.:
# pkgadd -d `pwd`/sane-1.0.2.pkg
A web page with further information specific to SANE on UnixWare 7 can be
found here:
http://www.sco.com/skunkware/sane/index.html
However, please note that the SANE package that is available from the
Skunkware server will most likely contain the latest stable version of
SANE. Since SANE is continously being worked on, you might want to download
the latest source from the CVS repository and build the source yourself.
To build SANE on a UnixWare 7.1.X system the following packages are required:
* make (GNU make)
* glibs (contains gtk, glib, libjpeg, libpnm, libtiff etc.)
The packages can be downloaded from the Skunkware ftp server (see URL above).
I've used the following versions to build sane-1.0.2:
* make-3.78.1.pkg
* glibs-2.0.3.pkg
If you want to include support for The Gimp (this is optional), you need to
install the gimp package, too. This is the version I've used:
* gimp-1.0.4.pkg
GCC is not required. SANE compiles quite happily (and faster) with UnixWares
native C compiler.
You also need a utility called 'rev' which isn't part of UnixWare 7. This
tool is used by the backend Makefile to give the SANE libraries in their
target locations the proper names. You can find the rev source at the end
of the README.unixware2 file. Save the code as rev.c, compile it and copy
the binary to a location that is in your $PATH, e.g. /usr/local/bin:
(save code as rev.c)
# cc -o rev rev.c
# cp rev.c /usr/local/bin
Set the LD_RUN_PATH variable to add /usr/local/lib to the list of directories
to be searched by the dynamic linker:
$ LD_RUN_PATH=/usr/local/lib
$ export LD_RUN_PATH
Run the configure script as following:
$ LIBS="-lsdi" ./configure
(The sdi library contains the SCSI passthrough functions the UW7 port of SANE
uses to access the scanner from user space.)
Run gmake to build SANE:
$ gmake
SCSI access from user space requires special privileges. If you want users
without root perms to be able to use the scanner you can use the filepriv
command to change the privileges that are associated with the SANE
applications:
# /sbin/filepriv -f driver -f sysops /usr/local/bin/scanimage
# /sbin/filepriv -f driver -f sysops /usr/local/bin/xscanimage
# /sbin/filepriv -f sysops /usr/local/bin/xcam
If you have built SANE with support for The Gimp you might want to create
a symlink from the plug-in directory to the xscanimage and xcam binaries,
e.g.:
# ln -s /usr/local/bin/xscanimage \
/usr/local/lib/gimp/1.0/plug-ins/xscanimage
# ln -s /usr/local/bin/xcam /usr/local/lib/gimp/1.0/plug-ins/xcam
Questions? Comments? Please send e-mail to jenss@sco.com or skunkware@sco.com!

22
acinclude.m4 100644
Wyświetl plik

@ -0,0 +1,22 @@
#
# Separate LIBS from LDFLAGS to link correctly on HP/UX (and other
# platforms who care about the order of params to ld. It removes all
# non '-l..'-params from $2(LIBS), and appends them to $1(LDFLAGS)
#
# Use like this: SANE_EXTRACT_LDFLAGS(LDFLAGS, LIBS)
AC_DEFUN(SANE_EXTRACT_LDFLAGS,
[tmp_LIBS=""
for param in ${$2}; do
case "${param}" in
-l*)
tmp_LIBS="${tmp_LIBS} ${param}"
;;
*)
$1="${$1} ${param}"
;;
esac
done
$2="${tmp_LIBS}"
unset tmp_LIBS
unset param
])

829
aclocal.m4 vendored
Wyświetl plik

@ -1,7 +1,536 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
#
# Separate LIBS from LDFLAGS to link correctly on HP/UX (and other
# platforms who care about the order of params to ld. It removes all
# non '-l..'-params from $2(LIBS), and appends them to $1(LDFLAGS)
#
# Use like this: SANE_EXTRACT_LDFLAGS(LDFLAGS, LIBS)
AC_DEFUN(SANE_EXTRACT_LDFLAGS,
[tmp_LIBS=""
for param in ${$2}; do
case "${param}" in
-l*)
tmp_LIBS="${tmp_LIBS} ${param}"
;;
*)
$1="${$1} ${param}"
;;
esac
done
$2="${tmp_LIBS}"
unset tmp_LIBS
unset param
])
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($am_cv_prog_cc_stdc)
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])
# Configure paths for GTK+
# Owen Taylor 97-11-3
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
@ -15,6 +544,15 @@ AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
, enable_gtktest=yes)
for module in . $4
do
case "$module" in
gthread)
gtk_config_args="$gtk_config_args gthread"
;;
esac
done
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
@ -47,7 +585,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
LIBS="$GTK_LIBS $LIBS"
dnl
dnl Now check if the installed GTK is sufficiently new. (Also sanity
dnl checks the results of gtk-config to some extent
@ -56,15 +594,19 @@ dnl
AC_TRY_RUN([
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gtktest");
if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
exit(1);
}
@ -85,6 +627,17 @@ main ()
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||
@ -169,273 +722,3 @@ main ()
rm -f conf.gtktest
])
######################################################################
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1998 Free Software Foundation, Inc.
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 24 AM_PROG_LIBTOOL
AC_DEFUN(AM_PROG_LIBTOOL,
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
AC_REQUIRE([AM_ENABLE_STATIC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AM_PROG_LD])dnl
AC_REQUIRE([AM_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Check for any special flags to pass to ltconfig.
libtool_flags=
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
CFLAGS="$CFLAGS -belf"
;;
esac
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
])
# AM_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_SHARED,
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
changequote([, ])dnl
[ --enable-shared=PKGS only build shared libraries if the current package
appears as an element in the PKGS list],
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
])
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AM_DISABLE_SHARED,
[AM_ENABLE_SHARED(no)])
# AM_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AM_DISABLE_STATIC,
[AM_ENABLE_STATIC(no)])
# AM_ENABLE_STATIC - implement the --enable-static flag
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_STATIC,
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
changequote([, ])dnl
[ --enable-static=PKGS only build shared libraries if the current package
appears as an element in the PKGS list],
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
])
# AM_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AM_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
/* | [A-Za-z]:\\*)
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AM_PROG_LD_GNU
])
AC_DEFUN(AM_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AM_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AM_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[case "$NM" in
/* | [A-Za-z]:\\*)
ac_cv_path_NM="$NM" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
else
ac_cv_path_NM="$ac_dir/nm"
fi
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
;;
esac])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
##### end of libtool.m4
dnl AM_FUNC_ALLOCA
AC_DEFUN(AM_FUNC_ALLOCA,
[AC_REQUIRE([AC_FUNC_ALLOCA])dnl
test $ac_cv_func_alloca_works = no && LTALLOCA=alloca.lo
AC_SUBST(LTALLOCA)dnl
])

Wyświetl plik

@ -51,9 +51,9 @@ COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES) $(CPPFLAGS)
@SET_MAKE@
PRELOADABLE_BACKENDS = abaton agfafocus apple artec canon coolscan \
dc25 @DC210@ dmc epson hp microtek microtek2 mustek @NET@ @PINT@ \
pnm @QCAM@ ricoh s9036 sharp snapscan tamarack umax
PRELOADABLE_BACKENDS = abaton agfafocus apple artec avision canon coolscan \
dc25 @DC210@ dmc epson hp m3096g microtek microtek2 mustek @NET@ \
@PINT@ pnm @QCAM@ ricoh s9036 sharp snapscan sp15c tamarack umax
ALL_BACKENDS = $(PRELOADABLE_BACKENDS) dll
LIBS = $(addprefix libsane-,$(addsuffix .la,$(ALL_BACKENDS)))
@ -94,21 +94,26 @@ install:
|| exit 1; \
done
@$(LIBTOOL) $(MINST) --finish $(libsanedir)
@list="$(ALL_BACKENDS)"; cd $(libsanedir) && for be in $$list; do \
file=libsane-$${be}.so.$(V_MAJOR); \
@# Assume the dll name without any versions is last
@dllend=`grep library_names= libsane-dll.la |rev|cut -d" " -f1|rev|sed 's/libsane-dll.//'|cut -d\' -f1`; \
list="$(ALL_BACKENDS)"; cd $(libsanedir) && for be in $$list; do \
file=libsane-$${be}.$$dllend.$(V_MAJOR); \
lib=`grep dlname= libsane-$${be}.la | cut -f2 -d"'"`; \
if test ! -f $${file} -a -n "$${lib}"; then \
$(LN_S) $${lib} $${file}; \
fi; \
done
rm -f $(libdir)/libsane.a $(libdir)/libsane.so \
$(libdir)/libsane.so.$(V_MAJOR)*
$(LN_S) sane/libsane-dll.a $(libdir)/libsane.a
$(LN_S) sane/libsane-dll.so $(libdir)/libsane.so
@cd $(libsanedir) && for n in libsane-dll.so.$(V_MAJOR)*; do \
@# Assume the dll name without any versions is last
@dllend=`grep library_names= libsane-dll.la |rev|cut -f1 -d" "|rev|sed 's/libsane-dll.//'|cut -f1 -d\'`; \
rm -f $(libdir)/libsane.a $(libdir)/libsane.$$dllend \
$(libdir)/libsane.$$dllend.$(V_MAJOR)*; \
$(LN_S) sane/libsane-dll.a $(libdir)/libsane.a; \
$(LN_S) sane/libsane-dll.$$dllend $(libdir)/libsane.$$dllend ; \
cd $(libsanedir) && for n in libsane-dll.$$dllend.$(V_MAJOR)*; do \
nn=`echo $$n | sed 's,^libsane-dll,libsane,'`; \
(cd ..; $(LN_S) sane/$$n $$nn); \
done || exit 1
$(INSTALL_PROGRAM) libsane.la $(libdir)/libsane.la
@list="$(CONFIGS)"; for cfg in $$list; do \
if test ! -r $(srcdir)/$${cfg}; then continue; fi; \
if test -f $(configdir)/$${cfg}; then \
@ -169,6 +174,9 @@ libsane-apple.la: ../sanei/sanei_scsi.lo
libsane-artec.la: ../sanei/sanei_config2.lo
libsane-artec.la: ../sanei/sanei_constrain_value.lo
libsane-artec.la: ../sanei/sanei_scsi.lo
libsane-avision.la: ../sanei/sanei_config2.lo
libsane-avision.la: ../sanei/sanei_constrain_value.lo
libsane-avision.la: ../sanei/sanei_scsi.lo
libsane-canon.la: ../sanei/sanei_config2.lo
libsane-canon.la: ../sanei/sanei_constrain_value.lo
libsane-canon.la: ../sanei/sanei_scsi.lo
@ -189,6 +197,9 @@ libsane-hp.la: ../sanei/sanei_constrain_value.lo
libsane-hp.la: ../sanei/sanei_scsi.lo
libsane-hp.la: $(addsuffix .lo,$(EXTRA_hp))
libsane-hp.la: ../sanei/sanei_pio.lo
libsane-m3096g.la: ../sanei/sanei_config2.lo
libsane-m3096g.la: ../sanei/sanei_constrain_value.lo
libsane-m3096g.la: ../sanei/sanei_scsi.lo
libsane-microtek.la: ../sanei/sanei_config2.lo
libsane-microtek.la: ../sanei/sanei_constrain_value.lo
libsane-microtek.la: ../sanei/sanei_scsi.lo
@ -217,6 +228,9 @@ libsane-sharp.la: ../sanei/sanei_scsi.lo
libsane-snapscan.la: ../sanei/sanei_config2.lo
libsane-snapscan.la: ../sanei/sanei_constrain_value.lo
libsane-snapscan.la: ../sanei/sanei_scsi.lo
libsane-sp15c.la: ../sanei/sanei_config2.lo
libsane-sp15c.la: ../sanei/sanei_constrain_value.lo
libsane-sp15c.la: ../sanei/sanei_scsi.lo
libsane-tamarack.la: ../sanei/sanei_config2.lo
libsane-tamarack.la: ../sanei/sanei_constrain_value.lo
libsane-tamarack.la: ../sanei/sanei_scsi.lo

Plik diff jest za duży Load Diff

Wyświetl plik

@ -9,10 +9,10 @@
; All other information is optional (but what good is the file without it?).
;
:backend "artec" ; name of backend
:version "0.4" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;:manpage "?" ; name of manpage (if it exists)
:backend "artec" ; name of backend
:version "0.5.13" ; version of backend
:status :stable ; :alpha, :beta, :stable, :new
:manpage "sane-artec" ; name of manpage (if it exists)
:url "http://www4.infi.net/~cpinkham/sane/sane-artec-doc.html" ; backend's web page
:devicetype :scanner ; start of a list of devices....
@ -21,21 +21,33 @@
:mfg "Artec/Ultima" ; name a manufacturer
:url "http://www.artecusa.com/"
:model "AT3" ; name models for above-specified mfg.
:comment "works (author's model)"
;; name models for above-specified mfg.
:model "AT3"
:comment "all modes working"
:model "A6000C"
:comment "very alpha"
:comment "all modes working"
:model "A6000C PLUS"
:comment "testing in progress"
:comment "f/w <= v1.92 alpha, f/w >= v1.93 OK"
:model "AT6"
:comment "testing in progress"
:comment "Unknown - please try"
:model "AT12"
:comment "testing in progress"
:comment "all modes working"
:model "AM12S"
:comment "all modes working"
:model "parallel models"
:comment "Unsupported, see <a href='http://as6edriver.sourceforge.net/'>http://as6edriver.sourceforge.net</a>"
:model "USB models"
:comment "Unsupported."
:mfg "BlackWidow"
:url "http://www.blackwidow.co.uk/"
:model "BW4800SP"
:comment "rebadged Artec AT3"
:mfg "Plustek"
:url "http://www.plustek.com/"
:model "OpticPro 19200S"
:comment "rebadged Artec AM12S"
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

Wyświetl plik

@ -38,17 +38,16 @@
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
This file implements a SANE backend for the Ultima/Artec AT3 and
A6000C scanners.
This file implements a SANE backend for the Artec/Ultima scanners.
Copyright (C) 1998, Chris Pinkham
Copyright (C) 1998,1999 Chris Pinkham
Released under the terms of the GPL.
*NO WARRANTY*
*********************************************************************
For feedback/information:
cpinkham@sh001.infi.net
cpinkham@infi.net
http://www4.infi.net/~cpinkham/sane/sane-artec-doc.html
*********************************************************************
*/
@ -61,6 +60,17 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define ARTEC_MIN_X( hw ) ( hw->horz_resolution_list[ 0 ] ? \
hw->horz_resolution_list[ 1 ] : 0 )
#define ARTEC_MAX_X( hw ) ( hw->horz_resolution_list[ 0 ] ? \
hw->horz_resolution_list[ \
hw->horz_resolution_list[ 0 ] ] : 0 )
#define ARTEC_MIN_Y( hw ) ( hw->vert_resolution_list[ 0 ] ? \
hw->vert_resolution_list[ 1 ] : 0 )
#define ARTEC_MAX_Y( hw ) ( hw->vert_resolution_list[ 0 ] ? \
hw->vert_resolution_list[ \
hw->vert_resolution_list[ 0 ] ] : 0 )
typedef enum
{
OPT_NUM_OPTS = 0,
@ -81,18 +91,57 @@ typedef enum
OPT_BR_Y, /* bottom-right y */
OPT_ENHANCEMENT_GROUP,
OPT_QUALITY_CAL,
OPT_CONTRAST,
OPT_THRESHOLD,
OPT_BRIGHTNESS,
OPT_THRESHOLD,
OPT_HALFTONE_PATTERN,
OPT_FILTER_TYPE,
OPT_PIXEL_AVG,
OPT_EDGE_ENH,
OPT_CUSTOM_GAMMA, /* use custom gamma table */
OPT_GAMMA_VECTOR,
OPT_GAMMA_VECTOR_R,
OPT_GAMMA_VECTOR_G,
OPT_GAMMA_VECTOR_B,
OPT_TRANSPARENCY,
OPT_ADF,
OPT_CALIBRATION_GROUP,
OPT_QUALITY_CAL,
OPT_SOFTWARE_CAL,
/* must come last */
NUM_OPTIONS
}
ARTEC_Option;
/* Some FLAGS */
#define ARTEC_FLAG_CALIBRATE 0x00000001 /* supports hardware calib */
#define ARTEC_FLAG_CALIBRATE_RGB 0x00000003 /* yes 3, set CALIB. also */
#define ARTEC_FLAG_CALIBRATE_DARK_WHITE 0x00000005 /* yes 5, set CALIB. also */
#define ARTEC_FLAG_RGB_LINE_OFFSET 0x00000008 /* need line offset buffer */
#define ARTEC_FLAG_RGB_CHAR_SHIFT 0x00000010 /* RRRRGGGGBBBB line fmt */
#define ARTEC_FLAG_OPT_CONTRAST 0x00000020 /* supports set contrast */
#define ARTEC_FLAG_ONE_PASS_SCANNER 0x00000040 /* single pass scanner */
#define ARTEC_FLAG_GAMMA 0x00000080 /* supports set gamma */
#define ARTEC_FLAG_GAMMA_SINGLE 0x00000180 /* yes 180, implies GAMMA */
#define ARTEC_FLAG_SEPARATE_RES 0x00000200 /* separate x & y scan res */
#define ARTEC_FLAG_IMAGE_REV_LR 0x00000400 /* reversed left-right */
#define ARTEC_FLAG_ENHANCE_LINE_EDGE 0x00000800 /* line edge enhancement */
#define ARTEC_FLAG_HALFTONE_PATTERN 0x00001000 /* > 1 halftone pattern */
#define ARTEC_FLAG_REVERSE_WINDOW 0x00002000 /* reverse selected area */
#define ARTEC_FLAG_SC_BUFFERS_LINES 0x00004000 /* scanner has line buffer */
#define ARTEC_FLAG_SC_HANDLES_OFFSET 0x00008000 /* sc. handles line offset */
#define ARTEC_FLAG_SENSE_HANDLER 0x00010000 /* supports sense handler */
#define ARTEC_FLAG_SENSE_ENH_18 0x00020000 /* supports enh. byte 18 */
#define ARTEC_FLAG_SENSE_BYTE_19 0x00040000 /* supports sense byte 19 */
#define ARTEC_FLAG_SENSE_BYTE_22 0x00080000 /* supports sense byte 22 */
#define ARTEC_FLAG_PIXEL_AVERAGING 0x00100000 /* supports pixel avg-ing */
#define ARTEC_FLAG_ADF 0x00200000 /* auto document feeder */
#define ARTEC_FLAG_OPT_BRIGHTNESS 0x00400000 /* supports set brightness */
typedef enum
{
ARTEC_COMP_LINEART = 0,
@ -140,6 +189,14 @@ typedef enum
}
ARTEC_Filter_Type;
typedef enum
{
ARTEC_SOFT_CALIB_RED = 0,
ARTEC_SOFT_CALIB_GREEN,
ARTEC_SOFT_CALIB_BLUE
}
ARTEC_Software_Calibrate;
typedef union
{
SANE_Word w;
@ -154,23 +211,29 @@ typedef struct ARTEC_Device
SANE_Device sane;
double width;
SANE_Range x_range;
SANE_Range x_dpi_range;
SANE_Word *horz_resolution_list;
double height;
SANE_Range y_range;
SANE_Range y_dpi_range;
SANE_Word *vert_resolution_list;
SANE_Range threshold_range;
SANE_Range contrast_range;
SANE_Range brightness_range;
SANE_Word setwindow_cmd_size;
SANE_Word calibrate_method;
SANE_Word max_read_size;
long flags;
SANE_Bool support_cap_data_retrieve;
SANE_Bool req_shading_calibrate;
SANE_Bool req_rgb_line_offset;
SANE_Bool req_rgb_char_shift;
SANE_Bool opt_brightness;
/* info for 1-pass vs. 3-pass */
SANE_Bool onepass;
SANE_Bool support_gamma;
SANE_Bool single_gamma;
SANE_Int gamma_length;
}
ARTEC_Device;
@ -182,6 +245,12 @@ typedef struct ARTEC_Scanner
SANE_Option_Descriptor opt[NUM_OPTIONS];
Option_Value val[NUM_OPTIONS];
SANE_Int gamma_table[4][4096];
double soft_calibrate_data[3][2592];
SANE_Int halftone_pattern[64];
SANE_Range gamma_range;
int gamma_length;
int scanning;
SANE_Parameters params;
size_t bytes_to_read;
@ -194,6 +263,11 @@ typedef struct ARTEC_Scanner
int tl_x;
int tl_y;
/* info for 1-pass vs. 3-pass */
int this_pass;
SANE_Bool onepasscolor;
SANE_Bool threepasscolor;
int fd; /* SCSI filedescriptor */
/* scanner dependent/low-level state: */

1875
backend/avision.c 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,3 @@
scsi AVISION
/dev/scanner

Wyświetl plik

@ -0,0 +1,26 @@
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "avision" ; name of backend
:version "0.2" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:url "http://www.rene.rebe.myokay.net/avision/index.html" ; backend's web page
;
; Sorry, no manpage yet. Anybody want to write one?
;:manpage "sane-avision" ; name of manpage (if it exists)
:devicetype :scanner
:mfg "Avision" ; name a manufacturer
:url "http://www.avision.com/"
:model "AV 630 CS" ; name models for above-specified mfg.
:comment "1 pass, 1200*600 DPI" ;

381
backend/avision.h 100644
Wyświetl plik

@ -0,0 +1,381 @@
/*******************************************************************************
* SANE - Scanner Access Now Easy.
avision.h
This file (C) 1999 Meino Christian Cramer and Rene Rebe
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
*****************************************************************************
This file implements a SANE backend for the Avision AV 630CS scanner with
SCSI-2 command set.
(feedback to: mccramer@s.netic.de and rene.rebe@myokay.net)
Very much thanks to Avision INC for the documentation we got! ;-)
*****************************************************************************/
#ifndef avision_h
#define avision_h
#include <sys/types.h>
enum Avision_Option
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_MODE,
#define OPT_MODE_DEFAULT 3
OPT_RESOLUTION,
#define OPT_RESOLUTION_DEFAULT 300
OPT_SPEED,
OPT_PREVIEW,
OPT_GEOMETRY_GROUP,
OPT_TL_X, /* top-left x */
OPT_TL_Y, /* top-left y */
OPT_BR_X, /* bottom-right x */
OPT_BR_Y, /* bottom-right y */
OPT_ENHANCEMENT_GROUP,
OPT_BRIGHTNESS,
OPT_CONTRAST,
OPT_THRESHOLD,
OPT_QSCAN,
OPT_QCALIB,
#if 0
OPT_CUSTOM_GAMMA, /* use custom gamma tables? */
/* The gamma vectors MUST appear in the order gray, red, green,
blue. */
OPT_GAMMA_VECTOR,
OPT_GAMMA_VECTOR_R,
OPT_GAMMA_VECTOR_G,
OPT_GAMMA_VECTOR_B,
OPT_HALFTONE_DIMENSION,
OPT_HALFTONE_PATTERN,
#endif
/* must come last: */
NUM_OPTIONS
};
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Option_Value;
typedef struct Avision_Dimensions
{
long tlx;
long tly;
long brx;
long bry;
long wid;
long len;
long pixelnum;
long linenum;
int resx;
int rexy;
int res;
} Avision_Dimensions;
typedef struct Avision_Device
{
struct Avision_Device *next;
SANE_Device sane;
SANE_Range dpi_range;
SANE_Range x_range;
SANE_Range y_range;
SANE_Range speed_range;
unsigned flags;
} Avision_Device;
typedef struct Avision_Scanner
{
/* all the state needed to define a scan request: */
struct Avision_Scanner *next;
SANE_Option_Descriptor opt[NUM_OPTIONS];
Option_Value val[NUM_OPTIONS];
SANE_Int gamma_table[4][256];
int scanning;
int pass; /* pass number */
int line; /* current line number */
SANE_Parameters params;
/* Parsed option values and variables that are valid only during
actual scanning: */
int mode;
Avision_Dimensions avdimen; /* Used for internal calculationg */
int fd; /* SCSI filedescriptor */
pid_t reader_pid; /* process id of reader */
int pipe; /* pipe to reader process */
/* scanner dependent/low-level state: */
Avision_Device *hw;
} Avision_Scanner;
#define AV_ADF_ON 0x80
#define AV_DOUBLE_ON 0x40
#define AV_TRANS_ON 0x20
#define AV_INVERSE_ON 0x20
#define THRESHOLDED 0
#define DITHERED 1
#define GREYSCALE 2
#define TRUECOLOR 3
/* request sense */
#define VALID (SANE_Byte) (0x01<<7)
#define VALID_BYTE (SANE_Int ) (0x00)
#define ERRCODESTND (SANE_Byte) (0x70)
#define ERRCODEAV (SANE_Byte) (0x7F)
#define ERRCODEMASK (SANE_Byte) (0x7F)
#define ERRCODE_BYTE (SANE_Int ) (0x00)
#define FILMRK (SANE_Byte) (0x00)
#define EOSMASK (SANE_Byte) (0x01<<6)
#define EOS_BYTE (SANE_Int ) (0x02)
#define INVALIDLOGICLEN (SANE_Byte) (0x01<<5)
#define ILI_BYTE (SANE_Int ) (0x02)
#define SKSVMASK (SANE_Byte) (0x01<<7)
#define SKSV_BYTE (SANE_Int ) (0x0F)
#define BPVMASK (SANE_Byte) (0x01<<3)
#define BPV_BYTE (SANE_Int ) (0x0F)
#define CDMASK (SANE_Byte) (0x01<<6)
#define CD_ERRINDATA (SANE_Byte) (0x00)
#define CD_ERRINPARAM (SANE_Byte) (0x01)
#define CD_BYTE (SANE_Int ) (0x0F)
#define BITPOINTERMASK (SANE_Byte) (0x07)
#define BITPOINTER_BYTE (SANE_Int ) (0x0F)
#define BYTEPOINTER_BYTE1 (SANE_Int ) (0x10)
#define BYTEPOINTER_BYTE2 (SANE_Int ) (0x11)
#define SENSEKEY_BYTE (SANE_Int ) (0x02)
#define SENSEKEY_MASK (SANE_Byte) (0x02)
#define NOSENSE (SANE_Byte) (0x00)
#define NOTREADY (SANE_Byte) (0x02)
#define MEDIUMERROR (SANE_Byte) (0x03)
#define HARDWAREERROR (SANE_Byte) (0x04)
#define ILLEGALREQUEST (SANE_Byte) (0x05)
#define UNIT_ATTENTION (SANE_Byte) (0x06)
#define VENDORSPEC (SANE_Byte) (0x09)
#define ABORTEDCOMMAND (SANE_Byte) (0x0B)
#define ASC_BYTE (SANE_Int ) (0x0C)
#define ASCQ_BYTE (SANE_Int ) (0x0D)
#define ASCFILTERPOSERR (SANE_Byte) (0xA0)
#define ASCQFILTERPOSERR (SANE_Byte) (0x01)
#define ASCADFPAPERJAM (SANE_Byte) (0x80)
#define ASCQADFPAPERJAM (SANE_Byte) (0x01)
#define ASCADFCOVEROPEN (SANE_Byte) (0x80)
#define ASCQADFCOVEROPEN (SANE_Byte) (0x02)
#define ASCADFPAPERCHUTEEMPTY (SANE_Byte) (0x80)
#define ASCQADFPAPERCHUTEEMPTY (SANE_Byte) (0x03)
#define ASCINTERNALTARGETFAIL (SANE_Byte) (0x44)
#define ASCQINTERNALTARGETFAIL (SANE_Byte) (0x00)
#define ASCSCSIPARITYERROR (SANE_Byte) (0x47)
#define ASCQSCSIPARITYERROR (SANE_Byte) (0x00)
#define ASCINVALIDCOMMANDOPCODE (SANE_Byte) (0x20)
#define ASCQINVALIDCOMMANDOPCODE (SANE_Byte) (0x00)
#define ASCINVALIDFIELDCDB (SANE_Byte) (0x24)
#define ASCQINVALIDFIELDCDB (SANE_Byte) (0x00)
#define ASCLUNNOTSUPPORTED (SANE_Byte) (0x25)
#define ASCQLUNNOTSUPPORTED (SANE_Byte) (0x00)
#define ASCINVALIDFIELDPARMLIST (SANE_Byte) (0x26)
#define ASCQINVALIDFIELDPARMLIST (SANE_Byte) (0x00)
#define ASCINVALIDCOMBINATIONWIN (SANE_Byte) (0x2C)
#define ASCQINVALIDCOMBINATIONWIN (SANE_Byte) (0x02)
#define ASCMSGERROR (SANE_Byte) (0x43)
#define ASCQMSGERROR (SANE_Byte) (0x00)
#define ASCCOMMCLREDANOTHINITIATOR (SANE_Byte) (0x2F)
#define ASCQCOMMCLREDANOTHINITIATOR (SANE_Byte) (0x00)
#define ASCIOPROCTERMINATED (SANE_Byte) (0x00)
#define ASCQIOPROCTERMINATED (SANE_Byte) (0x06)
#define ASCINVBITIDMSG (SANE_Byte) (0x3D)
#define ASCQINVBITIDMSG (SANE_Byte) (0x00)
#define ASCINVMSGERROR (SANE_Byte) (0x49)
#define ASCQINVMSGERROR (SANE_Byte) (0x00)
#define ASCLAMPFAILURE (SANE_Byte) (0x60)
#define ASCQLAMPFAILURE (SANE_Byte) (0x00)
#define ASCMECHPOSERROR (SANE_Byte) (0x15)
#define ASCQMECHPOSERROR (SANE_Byte) (0x01)
#define ASCPARAMLISTLENERROR (SANE_Byte) (0x1A)
#define ASCQPARAMLISTLENERROR (SANE_Byte) (0x00)
#define ASCPARAMNOTSUPPORTED (SANE_Byte) (0x26)
#define ASCQPARAMNOTSUPPORTED (SANE_Byte) (0x01)
#define ASCPARAMVALINVALID (SANE_Byte) (0x26)
#define ASCQPARAMVALINVALID (SANE_Byte) (0x02)
#define ASCPOWERONRESET (SANE_Byte) (0x26)
#define ASCQPOWERONRESET (SANE_Byte) (0x03)
#define ASCSCANHEADPOSERROR (SANE_Byte) (0x62)
#define ASCQSCANHEADPOSERROR (SANE_Byte) (0x00)
/* Some Avision driver internal defines */
#define WINID 0
/* SCSI commands that the Avision scanners understand: */
#define AVISION_SCSI_TEST_UNIT_READY 0x00
#define AVISION_SCSI_INQUIRY 0x12
#define AVISION_SCSI_MODE_SELECT 0x15
#define AVISION_SCSI_START_STOP 0x1b
#define AVISION_SCSI_AREA_AND_WINDOWS 0x24
#define AVISION_SCSI_READ_SCANNED_DATA 0x28
#define AVISION_SCSI_GET_DATA_STATUS 0x34
/* The structures that you have to send to the avision to get it to
do various stuff... */
struct win_desc_header {
unsigned char pad0[6];
unsigned char wpll[2];
};
struct win_desc_block {
unsigned char winid;
unsigned char pad0;
unsigned char xres[2];
unsigned char yres[2];
unsigned char ulx[4];
unsigned char uly[4];
unsigned char width[4];
unsigned char length[4];
unsigned char brightness;
unsigned char thresh;
unsigned char contrast;
unsigned char image_comp;
unsigned char bpp;
unsigned char halftone[2];
unsigned char pad_type;
unsigned char bitordering[2];
unsigned char compr_type;
unsigned char compr_arg;
unsigned char pad4[6];
unsigned char vendor_specid;
unsigned char paralen;
unsigned char bitset1;
unsigned char highlight;
unsigned char shadow;
unsigned char linewidth[2];
unsigned char linecount[2];
unsigned char bitset2;
unsigned char pad5;
#if 1
unsigned char r_exposure_time[2];
unsigned char g_exposure_time[2];
unsigned char b_exposure_time[2];
#endif
};
struct command_header {
unsigned char opc;
unsigned char pad0[3];
unsigned char len;
unsigned char pad1;
};
struct command_header_10 {
unsigned char opc;
unsigned char pad0[5];
unsigned char len[3];
unsigned char pad1;
};
struct command_read {
unsigned char opc;
unsigned char bitset1;
unsigned char datatypecode;
unsigned char calibchn;
unsigned char datatypequal[2];
unsigned char transferlen[3];
unsigned char pad0;
};
struct command_scan {
unsigned char opc;
unsigned char pad0[3];
unsigned char transferlen;
unsigned char bitset1;
};
struct def_win_par {
struct command_header_10 dwph;
struct win_desc_header wdh;
struct win_desc_block wdb;
};
struct page_header{
char pad0[4];
char code;
char length;
};
struct avision_page {
char gamma;
char thresh;
char masks;
char delay;
char features;
char pad0;
};
/* set SCSI highended variables. Declare them as an array of chars */
/* endianness-safe, int-size safe... */
#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
var[1] = ((val) ) & 0xff;
#define set_triple(var,val) var[0] = ((val) >> 16) & 0xff; \
var[1] = ((val) >> 8 ) & 0xff; \
var[2] = ((val) ) & 0xff;
#define set_quad(var,val) var[0] = ((val) >> 24) & 0xff; \
var[1] = ((val) >> 16) & 0xff; \
var[2] = ((val) >> 8 ) & 0xff; \
var[3] = ((val) ) & 0xff;
#endif /* avision_h */

Wyświetl plik

@ -1,72 +1,5 @@
/**************************************************************************/
static char *option_name[]=
{
"OPT_NUM_OPTS",
"OPT_PAGE",
"OPT_MODE_GROUP",
"OPT_MODE",
"OPT_NEGATIVE",
"OPT_RESOLUTION_BIND",
"OPT_X_RESOLUTION",
"OPT_Y_RESOLUTION",
"OPT_ENHANCEMENT_GROUP",
"OPT_BRIGHTNESS",
"OPT_CONTRAST",
"OPT_THRESHOLD",
"OPT_MIRROR",
"OPT_CUSTOM_GAMMA",
"OPT_CUSTOM_GAMMA_BIND",
"OPT_GAMMA_VECTOR",
"OPT_GAMMA_VECTOR_R",
"OPT_GAMMA_VECTOR_G",
"OPT_GAMMA_VECTOR_B",
"OPT_AE",
"OPT_EJECT_GROUP",
"OPT_EJECT_AFTERSCAN",
"OPT_EJECT_BEFOREEXIT",
"OPT_EJECT_NOW",
"OPT_FOCUS_GROUP",
"OPT_AF",
"OPT_AF_ONCE",
"OPT_FOCUS",
"OPT_MARGINS_GROUP",
"OPT_TL_X",
"OPT_TL_Y",
"OPT_BR_X",
"OPT_BR_Y",
"OPT_COLORS_GROUP",
"OPT_HNEGATIVE",
"OPT_BIND_HILO",
"OPT_HILITE_R",
"OPT_SHADOW_R",
"OPT_HILITE_G",
"OPT_SHADOW_G",
"OPT_HILITE_B",
"OPT_SHADOW_B",
"OPT_TPU_GROUP",
"OPT_TPU_ON",
"OPT_TPU_PN",
"OPT_TPU_DCM",
"OPT_TPU_TRANSPARENCY",
"OPT_TPU_FILMTYPE",
"OPT_PREVIEW",
"NUM_OPTIONS"
};
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
@ -278,14 +211,14 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
size_t buf_size;
int i, neg, gamma_component;
DBG (1, ">> sane_control_option %s\n", option_name[option]);
DBG (21, ">> sane_control_option %s\n", option_name[option]);
if (info)
*info = 0;
if (s->scanning == SANE_TRUE)
{
DBG (1, ">> sane_control_option: device is busy scanning\n");
DBG (21, ">> sane_control_option: device is busy scanning\n");
return (SANE_STATUS_DEVICE_BUSY);
}
if (option >= NUM_OPTIONS)
@ -297,14 +230,16 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
if (action == SANE_ACTION_GET_VALUE)
{
DBG (1, "sane_control_option get value of %s\n", option_name[option]);
DBG (21, "sane_control_option get value of %s\n", option_name[option]);
switch (option)
{
/* word options: */
case OPT_FLATBED_ONLY:
case OPT_TPU_ON:
case OPT_TPU_PN:
case OPT_TPU_TRANSPARENCY:
case OPT_RESOLUTION_BIND:
case OPT_HW_RESOLUTION_ONLY: /* 990320, ss */
case OPT_X_RESOLUTION:
case OPT_Y_RESOLUTION:
case OPT_TL_X:
@ -336,11 +271,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
case OPT_FOCUS:
if ( (option >= OPT_NEGATIVE) && (option <= OPT_SHADOW_B) )
{
DBG(7, "GET_VALUE for %s: s->val[%s].w = %d\n",
DBG(21, "GET_VALUE for %s: s->val[%s].w = %d\n",
option_name[option], option_name[option], s->val[option].w);
}
*(SANE_Word *) val = s->val[option].w;
DBG(1, "value for option %s: %d\n", option_name[option], s->val[option].w);
DBG(21, "value for option %s: %d\n", option_name[option], s->val[option].w);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS;
return (SANE_STATUS_GOOD);
@ -354,7 +289,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
buf_size = sizeof (gbuf);
sanei_scsi_open (s->hw->sane.name, &s->fd, sense_handler, 0);
DBG (7, "sending GET_DENSITY_CURVE\n");
DBG (21, "sending GET_DENSITY_CURVE\n");
if (s->val[OPT_CUSTOM_GAMMA_BIND].w == SANE_TRUE)
{
/* If using bind analog gamma, option will be OPT_GAMMA_VECTOR.
@ -374,7 +309,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
s->fd = -1;
if (status != SANE_STATUS_GOOD)
{
DBG (7, "GET_DENSITY_CURVE\n");
DBG (21, "GET_DENSITY_CURVE\n");
return (SANE_STATUS_INVAL);
}
@ -394,7 +329,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
memcpy (val, s->val[option].wa, s->opt[option].size);
DBG(1, "value for option %s: %d\n", option_name[option], s->val[option].w);
DBG(21, "value for option %s: %d\n", option_name[option], s->val[option].w);
return (SANE_STATUS_GOOD);
/* string options: */
@ -404,22 +339,37 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
strcpy (val, s->val[option].s);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS;
DBG(1, "value for option %s: %s\n", option_name[option], s->val[option].s);
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
return (SANE_STATUS_GOOD);
case OPT_PAGE:
strcpy (val, s->val[option].s);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
DBG(1, "value for option %s: %s\n", option_name[option], s->val[option].s);
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
return (SANE_STATUS_GOOD);
case OPT_NEGATIVE:
strcpy (val, s->val[option].s);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
DBG(1, "value for option %s: %s\n", option_name[option], s->val[option].s);
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
return (SANE_STATUS_GOOD);
case OPT_NEGATIVE_TYPE:
strcpy (val, s->val[option].s);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
return (SANE_STATUS_GOOD);
case OPT_SCANNING_SPEED:
strcpy (val, s->val[option].s);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
return (SANE_STATUS_GOOD);
default:
val = 0;
return (SANE_STATUS_GOOD);
@ -427,7 +377,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
else if (action == SANE_ACTION_SET_VALUE)
{
DBG (1, "sane_control_option set value for %s\n", option_name[option]);
DBG (21, "sane_control_option set value for %s\n", option_name[option]);
if (!SANE_OPTION_IS_SETTABLE (cap))
return (SANE_STATUS_INVAL);
@ -470,7 +420,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
case OPT_EJECT_AFTERSCAN:
case OPT_EJECT_BEFOREEXIT:
s->val[option].w = *(SANE_Word *) val;
DBG(7, "SET_VALUE for %s: s->val[%s].w = %d\n",
DBG(21, "SET_VALUE for %s: s->val[%s].w = %d\n",
option_name[option], option_name[option], s->val[option].w);
return (SANE_STATUS_GOOD);
@ -497,6 +447,55 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
return SANE_STATUS_GOOD;
/* 990320, ss: switch between slider and option menue for resolution */
case OPT_HW_RESOLUTION_ONLY:
if (s->val[option].w != *(SANE_Word *) val)
{
int iPos, xres, yres;
s->val[option].w = *(SANE_Word *) val;
if (info) { *info |= SANE_INFO_RELOAD_OPTIONS; }
if (s->val[option].w == SANE_FALSE)
{
/* use complete range */
s->opt[OPT_X_RESOLUTION].constraint_type = SANE_CONSTRAINT_RANGE;
s->opt[OPT_X_RESOLUTION].constraint.range = &s->hw->info.xres_range;
s->opt[OPT_Y_RESOLUTION].constraint_type = SANE_CONSTRAINT_RANGE;
s->opt[OPT_Y_RESOLUTION].constraint.range = &s->hw->info.yres_range;
}
else
{
/* use only hardware resolutions */
s->opt[OPT_X_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST;
s->opt[OPT_X_RESOLUTION].constraint.word_list = s->xres_word_list;
s->opt[OPT_Y_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST;
s->opt[OPT_Y_RESOLUTION].constraint.word_list = s->yres_word_list;
/* adjust resolutions */
xres = s->xres_word_list[1];
for (iPos = 0; iPos < s->xres_word_list[0]; iPos++)
{
if (s->val[OPT_X_RESOLUTION].w >= s->xres_word_list[iPos+1])
{
xres = s->xres_word_list[iPos+1];
}
}
s->val[OPT_X_RESOLUTION].w = xres;
yres = s->yres_word_list[1];
for (iPos = 0; iPos < s->yres_word_list[0]; iPos++)
{
if (s->val[OPT_Y_RESOLUTION].w >= s->yres_word_list[iPos+1])
{
yres = s->yres_word_list[iPos+1];
}
}
s->val[OPT_Y_RESOLUTION].w = yres;
}
}
return (SANE_STATUS_GOOD);
case OPT_BIND_HILO:
if (s->val[option].w != *(SANE_Word *) val)
{
@ -553,6 +552,28 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
return (SANE_STATUS_GOOD);
case OPT_FLATBED_ONLY:
switch (action)
{
case SANE_ACTION_SET_VALUE:
s->val[option].w = *(SANE_Word *) val;
if (s->hw->adf.Status != ADF_STAT_NONE &&
s->val[option].w == SANE_TRUE) /* switch on */
{
s->hw->adf.Priority |= 0x03; /* flatbed mode */
s->hw->adf.Feeder &= 0x00; /* no autofeed mode (default)*/
s->hw->adf.Status = ADF_STAT_DISABLED;
s->val[option].w = SANE_TRUE;
} /* if it isn't connected, don't bother fixing */
break;
case SANE_ACTION_GET_VALUE:
val = &s->val[option].w;
break;
default:
break;
}
return SANE_STATUS_GOOD;
case OPT_TPU_ON:
if ( s->val[OPT_TPU_ON].w == TPU_STAT_INACTIVE ) /* switch on */
{
@ -681,13 +702,39 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
if (!strcmp(val, "Negatives"))
{
s->RIF = 0;
s->opt[OPT_NEGATIVE_TYPE].cap &= ~SANE_CAP_INACTIVE;
s->opt[OPT_SCANNING_SPEED].cap &= ~SANE_CAP_INACTIVE;
s->opt[OPT_AE].cap |= SANE_CAP_INACTIVE;
}
else
{
s->RIF = 1;
s->opt[OPT_NEGATIVE_TYPE].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_SCANNING_SPEED].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_AE].cap &= ~SANE_CAP_INACTIVE;
}
return (SANE_STATUS_GOOD);
case OPT_NEGATIVE_TYPE:
if (info && strcmp (s->val[option].s, (SANE_String) val))
*info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS;
if (s->val[option].s)
free (s->val[option].s);
s->val[option].s = strdup (val);
for(i = 0; strcmp(val, negative_filmtype_list[i]); i++);
s->negative_filmtype = i;
return (SANE_STATUS_GOOD);
case OPT_SCANNING_SPEED:
if (info && strcmp (s->val[option].s, (SANE_String) val))
*info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS;
if (s->val[option].s)
free (s->val[option].s);
s->val[option].s = strdup (val);
for(i = 0; strcmp(val, scanning_speed_list[i]); i++);
s->scanning_speed = i;
return (SANE_STATUS_GOOD);
case OPT_PAGE:
if (info && strcmp (s->val[option].s, (SANE_String) val))
*info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS;
@ -696,13 +743,15 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
s->val[option].s = strdup (val);
if (info)
*info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
DBG(1, "value for option %s: %s\n", option_name[option], s->val[option].s);
DBG(21, "value for option %s: %s\n", option_name[option], s->val[option].s);
if (!strcmp(val, "Show normal options"))
{
DBG(1,"setting OPT_PAGE to 'Normal options'\n");
DBG(21,"setting OPT_PAGE to 'Normal options'\n");
s->opt[OPT_MODE_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_RESOLUTION_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_ENHANCEMENT_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_EJECT_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_ADF_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_FOCUS_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_MARGINS_GROUP].cap |= SANE_CAP_ADVANCED;
@ -710,10 +759,12 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
else if (!strcmp(val, "Show advanced options"))
{
DBG(1,"setting OPT_PAGE to 'Advanced options'\n");
DBG(21,"setting OPT_PAGE to 'Advanced options'\n");
s->opt[OPT_MODE_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_RESOLUTION_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_ENHANCEMENT_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_EJECT_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_ADF_GROUP].cap |= SANE_CAP_ADVANCED;
s->opt[OPT_FOCUS_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_MARGINS_GROUP].cap &= ~SANE_CAP_ADVANCED;
@ -722,8 +773,10 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
else
{
s->opt[OPT_MODE_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_RESOLUTION_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_ENHANCEMENT_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_EJECT_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_ADF_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_FOCUS_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_MARGINS_GROUP].cap &= ~SANE_CAP_ADVANCED;
s->opt[OPT_COLORS_GROUP].cap &= ~SANE_CAP_ADVANCED;
@ -735,14 +788,14 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
status = medium_position(s->fd);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "MEDIUM POSTITION failed\n");
DBG (21, "MEDIUM POSTITION failed\n");
sanei_scsi_close (s->fd);
s->fd = -1;
return (SANE_STATUS_INVAL);
}
DBG(1, "AF_NOW before = '%d'\n", s->AF_NOW);
DBG(21, "AF_NOW before = '%d'\n", s->AF_NOW);
s->AF_NOW = SANE_TRUE;
DBG(1, "AF_NOW after = '%d'\n", s->AF_NOW);
DBG(21, "AF_NOW after = '%d'\n", s->AF_NOW);
sanei_scsi_close (s->fd);
s->fd = -1;
return status;
@ -830,7 +883,7 @@ DBG(1, "AF_NOW after = '%d'\n", s->AF_NOW);
case OPT_GAMMA_VECTOR_G:
case OPT_GAMMA_VECTOR_B:
memcpy (s->val[option].wa, val, s->opt[option].size);
DBG(1, "setting gamma vector\n");
DBG(21, "setting gamma vector\n");
/* if (info) */
/* *info |= SANE_INFO_RELOAD_OPTIONS; */
return (SANE_STATUS_GOOD);
@ -926,14 +979,43 @@ sane_start (SANE_Handle handle)
char *mode_str;
CANON_Scanner *s = handle;
SANE_Status status;
u_char wbuf[72], dbuf[28];
u_char wbuf[72], dbuf[28], ebuf[64];
size_t buf_size;
int i;
DBG (1, ">> sane_start\n");
s->scanning = SANE_FALSE;
if( (s->val[OPT_AE].w == SANE_TRUE)
if( (s->hw->adf.Status == SANE_TRUE)
&& (s->val[OPT_FLATBED_ONLY].w != SANE_TRUE)
&& (s->hw->adf.Problem != 0))
{
DBG (3, "SCANNER ADF HAS A PROBLEM\n");
if (s->hw->adf.Problem & 0x08)
{
status = SANE_STATUS_COVER_OPEN;
DBG (3, "ADF Cover Open\n");
}
else if (s->hw->adf.Problem & 0x04)
{
status = SANE_STATUS_JAMMED;
DBG (3, "ADF Paper Jam\n");
}
else /* adf.Problem = 0x02 */
{
status = SANE_STATUS_NO_DOCS;
DBG (3, "ADF No More Documents\n");
}
return status;
}
else if( (s->hw->adf.Status == SANE_TRUE)
&& (s->val[OPT_FLATBED_ONLY].w == SANE_TRUE))
{
set_adf_mode(s->fd, s->hw->adf.Priority);
/* 2.23 define ADF Mode */
}
else if( (s->val[OPT_AE].w == SANE_TRUE)
&& (!strcmp(s->val[OPT_NEGATIVE].s, "Slides"))
&& (s->val[OPT_PREVIEW].w == SANE_FALSE))
{
@ -973,7 +1055,7 @@ sane_start (SANE_Handle handle)
do_gamma(s);
}
#if 0
#if 1
DBG (3, "attach: sending GET SCAN MODE for scan control conditions\n");
memset (ebuf, 0, sizeof (ebuf));
buf_size = 20;
@ -995,16 +1077,17 @@ sane_start (SANE_Handle handle)
buf_size = 12;
status = get_scan_mode (s->fd, (u_char)TRANSPARENCY_UNIT,
ebuf, &buf_size);
/* if (status != SANE_STATUS_GOOD) */
/* { */
/* DBG (1, "attach: GET SCAN MODE for scan control conditions failed\n"); */
/* sanei_scsi_close (s->fd); */
/* return (SANE_STATUS_INVAL); */
/* } */
if (status != SANE_STATUS_GOOD)
{
DBG (1, "attach: GET SCAN MODE for transparency unit failed\n");
sanei_scsi_close (s->fd);
return (SANE_STATUS_INVAL);
}
for (i=0; i<buf_size; i++)
{
DBG(3, "scan mode control byte[%d] = %d\n", i, ebuf[i]);
}
#endif
@ -1034,8 +1117,9 @@ sane_start (SANE_Handle handle)
(strcmp (mode_str, "Halftone") == 0))
? s->val[OPT_HNEGATIVE].w : !s->val[OPT_HNEGATIVE].w;
s->brightness = (s->RIF == 1) ?
s->val[OPT_BRIGHTNESS].w : (255 - s->val[OPT_BRIGHTNESS].w);
/* s->brightness = (s->RIF == 0) ? */
/* s->val[OPT_BRIGHTNESS].w : (255 - s->val[OPT_BRIGHTNESS].w); */
s->brightness = s->val[OPT_BRIGHTNESS].w;
s->contrast = s->val[OPT_CONTRAST].w;
s->threshold = s->val[OPT_THRESHOLD].w;
s->bpp = s->params.depth;
@ -1112,13 +1196,14 @@ sane_start (SANE_Handle handle)
wbuf[33] = s->image_composition;
wbuf[34] = s->bpp;
wbuf[36] = 1;
wbuf[37] = (s->RIF << 7) + 3;
/* wbuf[50] = (s->GRC << 3) | (s->Mirror << 2) | (s->AE); */
wbuf[50] = (s->GRC << 3) | (s->Mirror << 2) ;
if(s->RIF == 1)
{
wbuf[50] |= s->AE;
}
/* wbuf[37] = (s->RIF << 7) + 3; */
wbuf[37] = (1 << 7) + 3;
wbuf[50] = (s->GRC << 3) | (s->Mirror << 2) | (s->AE);
/* wbuf[50] = (s->GRC << 3) | (s->Mirror << 2) ; */
/* if(s->RIF == 1) */
/* { */
/* wbuf[50] |= s->AE; */
/* } */
wbuf[54] = 2;
wbuf[57] = 1;
@ -1165,6 +1250,55 @@ sane_start (SANE_Handle handle)
DBG (5, "length=%d\n", (wbuf[26] * 256 * 256 * 256)
+ (wbuf[27] * 256 * 256) + (wbuf[28] * 256) + wbuf[29]);
#if 1
DBG (3, "sane_start: sending DEFINE SCAN MODE for transparency unit, NP=%d, Negative film type=%d\n", !s->RIF, s->negative_filmtype);
memset (wbuf, 0, sizeof (wbuf));
wbuf[0] = 0x02;
wbuf[1] = 6;
wbuf[2] = 0x80;
wbuf[3] = 0x05;
wbuf[4] = 39;
wbuf[5] = 16;
wbuf[6] = !s->RIF;
wbuf[7] = s->negative_filmtype;
status = define_scan_mode (s->fd, TRANSPARENCY_UNIT, wbuf);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "define scan mode failed: %s\n", sane_strstatus (status));
return (status);
}
#endif
#if 1
DBG (3, "sane_start: sending DEFINE SCAN MODE for scan control conditions\n");
memset (wbuf, 0, sizeof (wbuf));
wbuf[0] = 0x20;
wbuf[1] = 14;
wbuf[11] = s->scanning_speed;
status = define_scan_mode (s->fd, SCAN_CONTROL_CONDITIONS, wbuf);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "define scan mode failed: %s\n", sane_strstatus (status));
return (status);
}
DBG (3, "sane_start: sending GET SCAN MODE for scan control conditions\n");
memset (ebuf, 0, sizeof (ebuf));
buf_size = sizeof (ebuf);
status = get_scan_mode (s->fd, SCAN_CONTROL_CONDITIONS, ebuf, &buf_size);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "sane_start: GET SCAN MODE for scan control conditions failed\n");
sanei_scsi_close (s->fd);
return (SANE_STATUS_INVAL);
}
for (i=0; i<buf_size; i++)
{
DBG(3, "scan mode byte[%d] = %d\n", i, ebuf[i]);
}
#endif
status = scan (s->fd);
if (status != SANE_STATUS_GOOD)
{
@ -1208,10 +1342,12 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
CANON_Scanner *s = handle;
SANE_Status status;
size_t nread;
DBG (21, ">> sane_read\n");
*len = 0;
DBG(21, " sane_read: nread=%d, bytes_to_read=%d\n", nread, s->bytes_to_read);
if (s->bytes_to_read == 0)
{
do_cancel (s);
@ -1234,6 +1370,8 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
*len = nread;
s->bytes_to_read -= nread;
DBG(21, " sane_read: nread=%d, bytes_to_read=%d\n", nread, s->bytes_to_read);
DBG (21, "<< sane_read\n");
return (SANE_STATUS_GOOD);
}

Wyświetl plik

@ -58,9 +58,9 @@ test_unit_ready (int fd)
return (status);
}
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
request_sense (int fd, void *buf, size_t * buf_size)
request_sense (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[6];
int status;
@ -74,9 +74,10 @@ request_sense (int fd, void *buf, size_t * buf_size)
DBG (31, "<< request_sense\n");
return (status);
}
#endif
static SANE_Status
inquiry (int fd, int evpd, void *buf, size_t * buf_size)
inquiry (int fd, int evpd, void *buf, size_t *buf_size)
{
static u_char cmd[6];
int status;
@ -134,7 +135,7 @@ reserve_unit (int fd)
return (status);
}
#if 0
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
release_unit (int fd)
{
@ -153,7 +154,7 @@ release_unit (int fd)
#endif
static SANE_Status
mode_sense (int fd, void *buf, size_t * buf_size)
mode_sense (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[6];
@ -186,7 +187,7 @@ scan (int fd)
return (status);
}
#if 0
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
send_diagnostic (int fd)
{
@ -222,7 +223,7 @@ set_window (int fd, void *data)
}
static SANE_Status
get_window (int fd, void *buf, size_t * buf_size)
get_window (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;
@ -239,7 +240,7 @@ get_window (int fd, void *buf, size_t * buf_size)
}
static SANE_Status
read_data (int fd, void *buf, size_t * buf_size)
read_data (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;
@ -271,7 +272,7 @@ medium_position (int fd)
return (status);
}
#if 0
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
execute_shading (int fd)
{
@ -290,11 +291,13 @@ execute_shading (int fd)
static SANE_Status
execute_auto_focus (int fd, int mode, int speed, int AE, int count,
void *buf, size_t * buf_size)
void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;
DBG (31, ">> execute auto focus\n");
DBG (7, ">> execute auto focus\n");
DBG (7, ">> focus: mode='%d', speed='%d', AE='%d', count='%d'\n",
mode, speed, AE, count);
memset (cmd, 0, sizeof (cmd));
cmd[0] = 0xe0;
@ -303,25 +306,55 @@ execute_auto_focus (int fd, int mode, int speed, int AE, int count,
cmd[4] = count;
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
DBG (31, "<< execute auto focus\n");
DBG (7, "<< execute auto focus\n");
return (status);
}
static SANE_Status
get_scan_mode (int fd, u_char page, void *buf, size_t * buf_size)
set_adf_mode (int fd, u_char priority)
{
static u_char cmd[6+4];
/* static u_char cmd[6]; */
static u_char cmd[6];
int status;
/* DBG (31, ">> get scan mode, page='%d'\n", page); */
DBG (11, ">> get scan mode, page='%d', buf_size='%lu'\n",
page, (unsigned long) *buf_size);
memset (cmd, 0, sizeof (cmd));
cmd[0] = 0xd4;
cmd[4] = 0x01;
status = sanei_scsi_cmd (fd, cmd, 6, 0, 0);
if (status == SANE_STATUS_GOOD)
{
status = sanei_scsi_cmd (fd, &priority, 1, 0, 0);
}
return (status);
}
static SANE_Status
get_scan_mode (int fd, u_char page, void *buf, size_t *buf_size)
{
static u_char cmd[6];
int status;
int PageLen = 0x00;
memset (cmd, 0, sizeof (cmd));
cmd[0] = 0xd5;
cmd[2] = page;
cmd[4] = (page == TRANSPARENCY_UNIT) ? 0x0c :
(page == SCAN_CONTROL_CONDITIONS) ? 0x14 : 0x24;
switch (page)
{
case AUTO_DOC_FEEDER_UNIT:
case TRANSPARENCY_UNIT:
cmd[4] = 0x0C + PageLen;
break;
case SCAN_CONTROL_CONDITIONS :
cmd[4] = 0x14 + PageLen;
break;
default:
cmd[4] = 0x24 + PageLen;
break;
}
DBG (31, "get scan mode: cmd[4]='0x%0X'\n", cmd[4]);
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
@ -329,24 +362,34 @@ get_scan_mode (int fd, u_char page, void *buf, size_t * buf_size)
return (status);
}
#if 0
static SANE_Status
define_scan_mode (int fd, void *buf, size_t * buf_size)
define_scan_mode (int fd, u_char page, void *data)
{
static u_char cmd[6];
int status;
static u_char cmd[6+20];
int status, i, cmdlen;
DBG (31, ">> define scan mode\n");
memset (cmd, 0, sizeof (cmd));
cmd[0] = 0xd6;
cmd[1] = 16;
/* cmd[4] = count; */
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
cmd[1] = 0x10;
cmd[4] = (page == TRANSPARENCY_UNIT) ? 0x0c :
(page == SCAN_CONTROL_CONDITIONS) ? 0x14 : 0x24;
memcpy (cmd + 10, data, (page == TRANSPARENCY_UNIT) ? 8 :
(page == SCAN_CONTROL_CONDITIONS) ? 16 : 24);
for(i = 0; i < sizeof(cmd); i++)
{
DBG (31, "define scan mode: cmd[%d]='0x%0X'\n", i, cmd[i]);
}
cmdlen = (page == TRANSPARENCY_UNIT) ? 18 :
(page == SCAN_CONTROL_CONDITIONS) ? 26 : 34;
status = sanei_scsi_cmd (fd, cmd, cmdlen, 0, 0);
DBG (31, "<< define scan mode\n");
return (status);
}
#endif
static SANE_Status
get_density_curve (int fd, int component, void *buf, size_t *buf_size)
@ -375,7 +418,7 @@ get_density_curve (int fd, int component, void *buf, size_t *buf_size)
return (status);
}
#if 0
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
get_density_curve_data_format (int fd, void *buf, size_t *buf_size)
{
@ -446,9 +489,9 @@ set_density_curve (int fd, int component, void *buf, size_t *buf_size)
/* return (status); */
/* } */
#if 0
#ifdef IMPLEMENT_ALL_SCANNER_SCSI_COMMANDS
static SANE_Status
get_power_on_timer (int fd, void *buf, size_t * buf_size)
get_power_on_timer (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;
@ -467,7 +510,7 @@ get_power_on_timer (int fd, void *buf, size_t * buf_size)
#endif
static SANE_Status
get_film_status (int fd, void *buf, size_t * buf_size)
get_film_status (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;
@ -485,7 +528,7 @@ get_film_status (int fd, void *buf, size_t * buf_size)
}
static SANE_Status
get_data_status (int fd, void *buf, size_t * buf_size)
get_data_status (int fd, void *buf, size_t *buf_size)
{
static u_char cmd[10];
int status;

Wyświetl plik

@ -146,6 +146,18 @@ static const SANE_String_Const filmtype_list[] =
0
};
static const SANE_String_Const negative_filmtype_list[] =
{
"Film type 0", "Film type 1", "Film type 2", "Film type 3",
0
};
static const SANE_String_Const scanning_speed_list[] =
{
"Automatic", "Normal speed", "1/2 normal speed", "1/3 normal speed",
0
};
static const SANE_String_Const tpu_filmtype_list[] =
{
"Film 0", "Film 1", "Film 2", "Film 3",
@ -245,6 +257,67 @@ get_tpu_stat(int fd, CANON_Device *dev)
/**************************************************************************/
static void
get_adf_stat(int fd, CANON_Device *dev)
{
unsigned char abuf[0x0C];
size_t buf_size = sizeof(abuf);
SANE_Status status;
int i;
DBG(3, ">> get adf stat\n");
if ( strncmp(dev->sane.model, FB620S, 9) == 0 )
{
dev->adf.Status = ADF_STAT_NONE;
return;
}
memset (abuf, 0, buf_size);
status = get_scan_mode (fd, AUTO_DOC_FEEDER_UNIT, abuf, &buf_size);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "get scan mode failed: %s\n", sane_strstatus (status));
perror("get scan mode failed");
return;
}
for (i=0; i<buf_size; i++)
{
DBG(3, "scan mode control byte[%d] = %d\n", i, abuf[i]);
/* printf("scan mode control byte[%d] = %d\n", i, abuf[i]); */
}
dev->adf.Status = ( abuf[ADF_Status] & ADF_NOT_PRESENT) ?
ADF_STAT_NONE : ADF_STAT_INACTIVE;
if ( dev->adf.Status == SANE_TRUE ) /* ADF available / INACTIVE */
{
dev->adf.Status = ( abuf[ADF_Status] & ADF_PROBLEM) ?
ADF_STAT_INACTIVE : ADF_STAT_ACTIVE;
}
dev->adf.Problem = (abuf[ADF_Status] & ADF_PROBLEM);
dev->adf.Priority = (abuf[ADF_Settings] & ADF_PRIORITY);
dev->adf.Feeder = (abuf[ADF_Settings] & ADF_FEEDER);
/*#ifndef NDEBUG
printf("ADF Status: %d\n", dev->adf.Status);
printf("ADF Priority: %d\n", dev->adf.Priority);
printf("ADF Problem: %d\n", dev->adf.Problem);
printf("ADF Feeder: %d\n", dev->adf.Feeder);
# else */
DBG(11, "ADF Status: %d\n", dev->adf.Status);
DBG(11, "ADF Priority: %d\n", dev->adf.Priority);
DBG(11, "ADF Problem: %d\n", dev->adf.Problem);
DBG(11, "ADF Feeder: %d\n", dev->adf.Feeder);
DBG(3, "<< get adf stat\n");
/* # endif */
return;
}
/**************************************************************************/
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
@ -404,9 +477,10 @@ attach (const char *devnam, CANON_Device ** devp)
CANON_Device *dev;
int fd;
u_char ibuf[36], ebuf[74], mbuf[12], sbuf[14];
u_char ibuf[36], ebuf[74], mbuf[12];
size_t buf_size;
char *str;
int i;
DBG (1, ">> attach\n");
@ -461,7 +535,7 @@ attach (const char *devnam, CANON_Device ** devp)
return (status);
}
#if 0
DBG (3, "attach: sending REQUEST SENSE\n");
memset (sbuf, 0, sizeof (sbuf));
buf_size = sizeof (sbuf);
@ -484,6 +558,7 @@ attach (const char *devnam, CANON_Device ** devp)
return (SANE_STATUS_INVAL);
}
/* s->val[OPT_AF_NOW].w == SANE_TRUE; */
#endif
DBG (3, "attach: sending RESERVE UNIT\n");
status = reserve_unit(fd);
@ -511,21 +586,20 @@ attach (const char *devnam, CANON_Device ** devp)
/* DBG(3, "scan mode trans byte[%d] = %d\n", i, ebuf[i]); */
/* } */
/* DBG (3, "attach: sending GET SCAN MODE for scan control conditions\n"); */
/* memset (ebuf, 0, sizeof (ebuf)); */
/* buf_size = sizeof (ebuf); */
/* buf_size = 20; */
/* status = get_scan_mode (fd, SCAN_CONTROL_CONDITIONS, ebuf, &buf_size); */
/* if (status != SANE_STATUS_GOOD) */
/* { */
/* DBG (1, "attach: GET SCAN MODE for scan control conditions failed\n"); */
/* sanei_scsi_close (fd); */
/* return (SANE_STATUS_INVAL); */
/* } */
/* for (i=0; i<buf_size; i++) */
/* { */
/* DBG(3, "scan mode byte[%d] = %d\n", i, ebuf[i]); */
/* } */
DBG (3, "attach: sending GET SCAN MODE for scan control conditions\n");
memset (ebuf, 0, sizeof (ebuf));
buf_size = sizeof (ebuf);
status = get_scan_mode (fd, SCAN_CONTROL_CONDITIONS, ebuf, &buf_size);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "attach: GET SCAN MODE for scan control conditions failed\n");
sanei_scsi_close (fd);
return (SANE_STATUS_INVAL);
}
for (i=0; i<buf_size; i++)
{
DBG(3, "scan mode byte[%d] = %d\n", i, ebuf[i]);
}
DBG (3, "attach: sending (extended) INQUIRY\n");
memset (ebuf, 0, sizeof (ebuf));
@ -539,6 +613,26 @@ attach (const char *devnam, CANON_Device ** devp)
return (SANE_STATUS_INVAL);
}
#if 0
DBG (3, "attach: sending GET SCAN MODE for transparency unit\n");
memset (ebuf, 0, sizeof (ebuf));
buf_size = 64;
status = get_scan_mode (fd, ALL_SCAN_MODE_PAGES,/* TRANSPARENCY_UNIT,*/
ebuf, &buf_size);
if (status != SANE_STATUS_GOOD)
{
DBG (1, "attach: GET SCAN MODE for scan control conditions failed\n");
sanei_scsi_close (fd);
return (SANE_STATUS_INVAL);
}
for (i=0; i<buf_size; i++)
{
DBG(3, "scan mode control byte[%d] = %d\n", i, ebuf[i]);
}
#endif
/* DBG (3, "attach: sending GET SCAN MODE for all scan mode pages\n"); */
/* memset (ebuf, 0, sizeof (ebuf)); */
/* buf_size = 32; */
@ -583,7 +677,8 @@ attach (const char *devnam, CANON_Device ** devp)
memset (str, 0, sizeof (str));
strncpy (str, ibuf + 16, 16);
dev->sane.model = str;
if (!strncmp(str, "IX-27015", 5))
/* if (!strncmp(str, "IX-27015", 5)) */
if (strncmp(str, "IX-27015", 8) == 0)
{
dev->info.model = CS2700;
dev->sane.type = "film scanner";
@ -601,6 +696,7 @@ attach (const char *devnam, CANON_Device ** devp)
DBG (5, "dev->sane.type = '%s'\n", dev->sane.type);
get_tpu_stat(fd, dev); /* Query TPU */
get_adf_stat(fd, dev); /* Query ADF */
dev->info.bmu = mbuf[6];
DBG (5, "bmu=%d\n", dev->info.bmu);
@ -781,7 +877,7 @@ adjust_hilo_points(CANON_Scanner *s)
{
for (j=0; j<256; j++)
{
/* Use a straight intensity curve for all colors */
/* Use a straight intensity curve for all colors */
gbuf[j] = (u_char)j;
DBG (22, "set_density %d: gbuf[%d] = [%d]\n", i, j, gbuf[j]);
}
@ -827,8 +923,9 @@ adjust_hilo_points(CANON_Scanner *s)
s->RIF :
s->val[OPT_HNEGATIVE].w;
s->brightness = (s->RIF == 1) ?
s->val[OPT_BRIGHTNESS].w : (255 - s->val[OPT_BRIGHTNESS].w);
/* s->brightness = (s->RIF == 0) ? */
/* s->val[OPT_BRIGHTNESS].w : (255 - s->val[OPT_BRIGHTNESS].w); */
s->brightness = s->val[OPT_BRIGHTNESS].w;
s->contrast = s->val[OPT_CONTRAST].w;
s->threshold = s->val[OPT_THRESHOLD].w;
s->bpp = s->params.depth;
@ -895,7 +992,8 @@ adjust_hilo_points(CANON_Scanner *s)
wbuf[33] = s->image_composition;
wbuf[34] = s->bpp;
wbuf[36] = 1;
wbuf[37] = (s->RIF << 7) + 3;
/* wbuf[37] = (s->RIF << 7) + 3; */
wbuf[37] = (1 << 7) + 3;
/* wbuf[50] = (s->GRC << 3) | (s->Mirror << 2) | (s->AE); */
wbuf[50] = (s->GRC << 3) | (s->Mirror << 2);
wbuf[54] = 2;
@ -947,6 +1045,7 @@ adjust_hilo_points(CANON_Scanner *s)
DBG (5, "ahl: length=%d\n", (wbuf[26] * 256 * 256 * 256)
+ (wbuf[27] * 256 * 256) + (wbuf[28] * 256) + wbuf[29]);
status = scan (s->fd);
if (status != SANE_STATUS_GOOD)
{
@ -1016,6 +1115,10 @@ adjust_hilo_points(CANON_Scanner *s)
if (status != SANE_STATUS_GOOD)
return status;
/* Negative film color: Red 71, Green 164, Blue 180 (inverted) */
/* Negative film color: Red 184, Green 91, Blue 74 (not inverted) */
DBG(7, "adjust_hilo: building histograms\n");
/* Build the histograms */
@ -1024,8 +1127,21 @@ adjust_hilo_points(CANON_Scanner *s)
for(i=0; i<bread; i+=3)
{
/* j = (int)adjbuf[i] - 71; */
/* j = (j<0) ? -j : j; */
/* ++histo[RED][j]; */
++histo[RED][(int)adjbuf[i]];
/* j = (int)adjbuf[i+1] - 164; */
/* j = (j<0) ? -j : j; */
/* ++histo[GREEN][j]; */
/* ++histo[GREEN][(int)adjbuf[i+1]-164]; */
++histo[GREEN][(int)adjbuf[i+1]];
/* j = (int)adjbuf[i] - 180; */
/* j = (j<0) ? -j : j; */
/* ++histo[BLUE][j]; */
/* ++histo[BLUE][(int)adjbuf[i+2]-180]; */
++histo[BLUE][(int)adjbuf[i+2]];
}
@ -1064,12 +1180,6 @@ adjust_hilo_points(CANON_Scanner *s)
DBG(1, "adjust_hilo: gamma[%d] = '%f'\n", i, gamma[i]);
/* Find the shadow point */
/* j = 0; */
/* while( (histo[i][j] == 0) && (j<256) ) */
/* j++; */
/* if (j < minlo) */
/* minlo = j; */
newsum = 0.0;
for (j = 0; j < 255; j++)
{
@ -1077,27 +1187,14 @@ adjust_hilo_points(CANON_Scanner *s)
percentage = newsum / sum[i];
next_percentage = (newsum + histo[i][j+1]) / sum[i];
if ( fabs(percentage - 0.006) < fabs(next_percentage - 0.006) )
if ( fabs(percentage - 0.004) < fabs(next_percentage - 0.004) )
{
minlo = j+1;
break;
}
}
s->val[OPT_SHADOW_R+i*2].w = *((SANE_Word *)&minlo);
DBG(1, "adjust_hilo: lo[%d]='%d'\n", i, minlo);
DBG(1, "adjust_hilo: s->val[OPT_SHADOW_R+%d*2]='%d'\n",
i, s->val[OPT_SHADOW_R+i*2].w);
/* Find the hilight point */
/* j = 255; */
/* while( (histo[i][j] == 0) && (j>0) ) */
/* j--; */
/* if (j > maxhi) */
/* maxhi = j; */
newsum = 0.0;
for (j = 255; j > 0; j--)
{
@ -1105,14 +1202,22 @@ adjust_hilo_points(CANON_Scanner *s)
percentage = newsum / sum[i];
next_percentage = (newsum + histo[i][j-1]) / sum[i];
if ( fabs(percentage - 0.006) < fabs(next_percentage - 0.006) )
if ( fabs(percentage - 0.004) < fabs(next_percentage - 0.004) )
{
maxhi = j-1;
maxhi = j+32;
break;
}
}
/* minlo = 255 - maxhi; */
/* maxhi = 255 - minlo; */
s->val[OPT_SHADOW_R+i*2].w = *((SANE_Word *)&minlo);
DBG(1, "adjust_hilo: lo[%d]='%d'\n", i, minlo);
DBG(1, "adjust_hilo: s->val[OPT_SHADOW_R+%d*2]='%d'\n",
i, s->val[OPT_SHADOW_R+i*2].w);
s->val[OPT_HILITE_R+i*2].w = *((SANE_Word *)&maxhi);
DBG(1, "adjust_hilo: hi[%d]='%d'\n", i, maxhi);
DBG(1, "adjust_hilo: s->val[OPT_HILITE_R+%d*2]='%d'\n",
@ -1153,7 +1258,7 @@ init_options (CANON_Scanner * s)
s->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT;
s->val[OPT_NUM_OPTS].w = NUM_OPTIONS;
s->opt[OPT_PAGE].name = "options page";
s->opt[OPT_PAGE].name = "options-page";
s->opt[OPT_PAGE].title = "";
s->opt[OPT_PAGE].desc = "Selects the options page to show";
s->opt[OPT_PAGE].type = SANE_TYPE_STRING;
@ -1180,7 +1285,7 @@ init_options (CANON_Scanner * s)
s->val[OPT_MODE].s = strdup (mode_list[3]);
/* Slides or negatives */
s->opt[OPT_NEGATIVE].name = SANE_NAME_NEGATIVE;
s->opt[OPT_NEGATIVE].name = "film-type";
s->opt[OPT_NEGATIVE].title = "Film type";
s->opt[OPT_NEGATIVE].desc = "Selects the film type, i.e. negatives or slides";
s->opt[OPT_NEGATIVE].type = SANE_TYPE_STRING;
@ -1191,6 +1296,39 @@ init_options (CANON_Scanner * s)
(s->hw->info.model == CS2700) ? 0: SANE_CAP_INACTIVE;
s->val[OPT_NEGATIVE].s = strdup(filmtype_list[0]);
/* Negative film type */
s->opt[OPT_NEGATIVE_TYPE].name = "negative-film-type";
s->opt[OPT_NEGATIVE_TYPE].title = "Negative film type";
s->opt[OPT_NEGATIVE_TYPE].desc = "Selects the negative film type";
s->opt[OPT_NEGATIVE_TYPE].type = SANE_TYPE_STRING;
s->opt[OPT_NEGATIVE_TYPE].size = max_string_size (negative_filmtype_list);
s->opt[OPT_NEGATIVE_TYPE].constraint_type = SANE_CONSTRAINT_STRING_LIST;
s->opt[OPT_NEGATIVE_TYPE].constraint.string_list = negative_filmtype_list;
/* s->opt[OPT_NEGATIVE_TYPE].cap |= SANE_CAP_INACTIVE; */
s->opt[OPT_NEGATIVE_TYPE].cap |=
(s->hw->info.model == CS2700) ? 0: SANE_CAP_INACTIVE;
s->val[OPT_NEGATIVE_TYPE].s = strdup(negative_filmtype_list[0]);
/* Scanning speed */
s->opt[OPT_SCANNING_SPEED].name = "scanning-speed";
s->opt[OPT_SCANNING_SPEED].title = "Scanning speed";
s->opt[OPT_SCANNING_SPEED].desc = "Selects the scanning speed";
s->opt[OPT_SCANNING_SPEED].type = SANE_TYPE_STRING;
s->opt[OPT_SCANNING_SPEED].size = max_string_size (scanning_speed_list);
s->opt[OPT_SCANNING_SPEED].constraint_type = SANE_CONSTRAINT_STRING_LIST;
s->opt[OPT_SCANNING_SPEED].constraint.string_list = scanning_speed_list;
/* s->opt[OPT_SCANNING_SPEED].cap |= SANE_CAP_INACTIVE; */
s->opt[OPT_SCANNING_SPEED].cap |=
(s->hw->info.model == CS2700) ? 0: SANE_CAP_INACTIVE;
s->val[OPT_SCANNING_SPEED].s = strdup(scanning_speed_list[0]);
/* "Resolution" group: */
s->opt[OPT_RESOLUTION_GROUP].title = "Scan Resolution";
s->opt[OPT_RESOLUTION_GROUP].desc = "";
s->opt[OPT_RESOLUTION_GROUP].type = SANE_TYPE_GROUP;
s->opt[OPT_RESOLUTION_GROUP].cap = 0;;
s->opt[OPT_RESOLUTION_GROUP].constraint_type = SANE_CONSTRAINT_NONE;
/* bind resolution */
s->opt[OPT_RESOLUTION_BIND].name = SANE_NAME_RESOLUTION_BIND;
s->opt[OPT_RESOLUTION_BIND].title = SANE_TITLE_RESOLUTION_BIND;
@ -1198,6 +1336,15 @@ init_options (CANON_Scanner * s)
s->opt[OPT_RESOLUTION_BIND].type = SANE_TYPE_BOOL;
s->val[OPT_RESOLUTION_BIND].w = SANE_TRUE;
/* hardware resolution only */
s->opt[OPT_HW_RESOLUTION_ONLY].name = "hw-resolution-only";
s->opt[OPT_HW_RESOLUTION_ONLY].title = "Hardware resolution";
s->opt[OPT_HW_RESOLUTION_ONLY].desc = "Use only hardware resolutions";
s->opt[OPT_HW_RESOLUTION_ONLY].type = SANE_TYPE_BOOL;
s->val[OPT_HW_RESOLUTION_ONLY].w = SANE_TRUE;
s->opt[OPT_HW_RESOLUTION_ONLY].cap |=
(s->hw->info.model == CS2700) ? 0: SANE_CAP_INACTIVE;
/* x-resolution */
s->opt[OPT_X_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION;
s->opt[OPT_X_RESOLUTION].title = SANE_TITLE_SCAN_RESOLUTION;
@ -1208,6 +1355,35 @@ init_options (CANON_Scanner * s)
s->opt[OPT_X_RESOLUTION].constraint.range = &s->hw->info.xres_range;
s->val[OPT_X_RESOLUTION].w = (s->hw->info.model == CS2700) ? 340 : 300;
/* 990320, ss: use only hardware resolutions */
/* to get option menue instead of slider in xscanimage */
if (s->hw->info.model == CS2700)
{
int iCnt, iNum, iRes;
s->opt[OPT_X_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST;
iNum = 0;
iCnt = 0;
iRes = s->hw->info.xres_range.max;
s->opt[OPT_X_RESOLUTION].constraint.word_list = s->xres_word_list;
/* go to minimum resolution by dividing by 2 */
while (iRes >= s->hw->info.xres_range.min)
{
iRes /= 2;
}
/* fill array upto maximum resolution */
while (iRes < s->hw->info.xres_range.max)
{
iCnt++;
iRes *= 2;
s->xres_word_list[iCnt] = iRes;
}
s->xres_word_list[0] = iCnt;
s->val[OPT_X_RESOLUTION].w = s->xres_word_list[2]; /* 340 */
}
/* y-resolution */
s->opt[OPT_Y_RESOLUTION].name = SANE_NAME_SCAN_Y_RESOLUTION;
s->opt[OPT_Y_RESOLUTION].title = SANE_TITLE_SCAN_Y_RESOLUTION;
@ -1219,6 +1395,34 @@ init_options (CANON_Scanner * s)
s->val[OPT_Y_RESOLUTION].w = (s->hw->info.model == CS2700) ? 340 : 300;
s->opt[OPT_Y_RESOLUTION].cap |= SANE_CAP_INACTIVE;
/* 990320, ss: use only hardware resolutions */
/* to get option menue instead of slider in xscanimage */
if (s->hw->info.model == CS2700)
{
int iCnt, iNum, iRes;
s->opt[OPT_Y_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST;
iNum = 0;
iCnt = 0;
iRes = s->hw->info.yres_range.max;
s->opt[OPT_Y_RESOLUTION].constraint.word_list = s->yres_word_list;
/* go to minimum resolution by dividing by 2 */
while (iRes >= s->hw->info.yres_range.min)
{
iRes /= 2;
}
/* fill array upto maximum resolution */
while (iRes < s->hw->info.yres_range.max)
{
iCnt++;
iRes *= 2;
s->yres_word_list[iCnt] = iRes;
}
s->yres_word_list[0] = iCnt;
s->val[OPT_Y_RESOLUTION].w = s->yres_word_list[2]; /* 340 */
}
/* Focus group: */
s->opt[OPT_FOCUS_GROUP].title = "Focus";
@ -1316,10 +1520,10 @@ init_options (CANON_Scanner * s)
s->opt[OPT_HNEGATIVE].type = SANE_TYPE_BOOL;
s->opt[OPT_HNEGATIVE].cap |=
(s->hw->info.model == CS2700) ? SANE_CAP_INACTIVE : 0;
s->val[OPT_HNEGATIVE].w = SANE_TRUE;
s->val[OPT_HNEGATIVE].w = SANE_FALSE;
/* Same values vor highlight and shadow points for red, green, blue */
s->opt[OPT_BIND_HILO].name = SANE_NAME_RGB_BIND;
s->opt[OPT_BIND_HILO].name = "bind-highlight-shadow-points";
s->opt[OPT_BIND_HILO].title = SANE_TITLE_RGB_BIND;
s->opt[OPT_BIND_HILO].desc = SANE_DESC_RGB_BIND;
s->opt[OPT_BIND_HILO].type = SANE_TYPE_BOOL;
@ -1442,17 +1646,17 @@ init_options (CANON_Scanner * s)
s->val[OPT_CUSTOM_GAMMA].w = SANE_FALSE;
/* bind analog-gamma */
s->opt[OPT_CUSTOM_GAMMA_BIND].name = SANE_NAME_ANALOG_GAMMA_BIND;
s->opt[OPT_CUSTOM_GAMMA_BIND].title = SANE_TITLE_ANALOG_GAMMA_BIND;
s->opt[OPT_CUSTOM_GAMMA_BIND].desc = SANE_DESC_ANALOG_GAMMA_BIND;
s->opt[OPT_CUSTOM_GAMMA_BIND].name = "bind-custom-gamma";
s->opt[OPT_CUSTOM_GAMMA_BIND].title = SANE_TITLE_RGB_BIND;
s->opt[OPT_CUSTOM_GAMMA_BIND].desc = SANE_DESC_RGB_BIND;
s->opt[OPT_CUSTOM_GAMMA_BIND].type = SANE_TYPE_BOOL;
s->opt[OPT_CUSTOM_GAMMA_BIND].cap |= SANE_CAP_INACTIVE;
s->val[OPT_CUSTOM_GAMMA_BIND].w = SANE_TRUE;
/* grayscale gamma vector */
s->opt[OPT_GAMMA_VECTOR].name = SANE_NAME_ANALOG_GAMMA;
s->opt[OPT_GAMMA_VECTOR].title = SANE_TITLE_ANALOG_GAMMA;
s->opt[OPT_GAMMA_VECTOR].desc = SANE_DESC_ANALOG_GAMMA;
s->opt[OPT_GAMMA_VECTOR].name = SANE_NAME_GAMMA_VECTOR;
s->opt[OPT_GAMMA_VECTOR].title = SANE_TITLE_GAMMA_VECTOR;
s->opt[OPT_GAMMA_VECTOR].desc = SANE_DESC_GAMMA_VECTOR;
s->opt[OPT_GAMMA_VECTOR].type = SANE_TYPE_INT;
s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_GAMMA_VECTOR].unit = SANE_UNIT_NONE;
@ -1462,9 +1666,9 @@ init_options (CANON_Scanner * s)
s->val[OPT_GAMMA_VECTOR].wa = &s->gamma_table[0][0];
/* red gamma vector */
s->opt[OPT_GAMMA_VECTOR_R].name = SANE_NAME_ANALOG_GAMMA_R;
s->opt[OPT_GAMMA_VECTOR_R].title = SANE_TITLE_ANALOG_GAMMA_R;
s->opt[OPT_GAMMA_VECTOR_R].desc = SANE_DESC_ANALOG_GAMMA_R;
s->opt[OPT_GAMMA_VECTOR_R].name = SANE_NAME_GAMMA_VECTOR_R;
s->opt[OPT_GAMMA_VECTOR_R].title = SANE_TITLE_GAMMA_VECTOR_R;
s->opt[OPT_GAMMA_VECTOR_R].desc = SANE_DESC_GAMMA_VECTOR_R;
s->opt[OPT_GAMMA_VECTOR_R].type = SANE_TYPE_INT;
s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_GAMMA_VECTOR_R].unit = SANE_UNIT_NONE;
@ -1474,9 +1678,9 @@ init_options (CANON_Scanner * s)
s->val[OPT_GAMMA_VECTOR_R].wa = &s->gamma_table[1][0];
/* green gamma vector */
s->opt[OPT_GAMMA_VECTOR_G].name = SANE_NAME_ANALOG_GAMMA_G;
s->opt[OPT_GAMMA_VECTOR_G].title = SANE_TITLE_ANALOG_GAMMA_G;
s->opt[OPT_GAMMA_VECTOR_G].desc = SANE_DESC_ANALOG_GAMMA_G;
s->opt[OPT_GAMMA_VECTOR_G].name = SANE_NAME_GAMMA_VECTOR_G;
s->opt[OPT_GAMMA_VECTOR_G].title = SANE_TITLE_GAMMA_VECTOR_G;
s->opt[OPT_GAMMA_VECTOR_G].desc = SANE_DESC_GAMMA_VECTOR_G;
s->opt[OPT_GAMMA_VECTOR_G].type = SANE_TYPE_INT;
s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_GAMMA_VECTOR_G].unit = SANE_UNIT_NONE;
@ -1486,9 +1690,9 @@ init_options (CANON_Scanner * s)
s->val[OPT_GAMMA_VECTOR_G].wa = &s->gamma_table[2][0];
/* blue gamma vector */
s->opt[OPT_GAMMA_VECTOR_B].name = SANE_NAME_ANALOG_GAMMA_B;
s->opt[OPT_GAMMA_VECTOR_B].title = SANE_TITLE_ANALOG_GAMMA_B;
s->opt[OPT_GAMMA_VECTOR_B].desc = SANE_DESC_ANALOG_GAMMA_B;
s->opt[OPT_GAMMA_VECTOR_B].name = SANE_NAME_GAMMA_VECTOR_B;
s->opt[OPT_GAMMA_VECTOR_B].title = SANE_TITLE_GAMMA_VECTOR_B;
s->opt[OPT_GAMMA_VECTOR_B].desc = SANE_DESC_GAMMA_VECTOR_B;
s->opt[OPT_GAMMA_VECTOR_B].type = SANE_TYPE_INT;
s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_GAMMA_VECTOR_B].unit = SANE_UNIT_NONE;
@ -1500,6 +1704,8 @@ init_options (CANON_Scanner * s)
s->opt[OPT_AE].name = "ae";
s->opt[OPT_AE].title = "Auto Exposure";
s->opt[OPT_AE].desc = "Enable/disable the Auto Exposure feature";
s->opt[OPT_AE].cap |=
(s->hw->info.model == CS2700) ? SANE_CAP_INACTIVE : 0;
s->opt[OPT_AE].type = SANE_TYPE_BOOL;
s->val[OPT_AE].w = SANE_FALSE;
@ -1543,6 +1749,23 @@ init_options (CANON_Scanner * s)
s->opt[OPT_EJECT_NOW].constraint_type = SANE_CONSTRAINT_NONE;
s->opt[OPT_EJECT_NOW].constraint.range = NULL;
/* "NO-ADF" option: */
s->opt[OPT_ADF_GROUP].title = "Document Feeder Extras";
s->opt[OPT_ADF_GROUP].desc = "";
s->opt[OPT_ADF_GROUP].type = SANE_TYPE_GROUP;
s->opt[OPT_ADF_GROUP].cap = 0;
s->opt[OPT_ADF_GROUP].constraint_type = SANE_CONSTRAINT_NONE;
s->opt[OPT_FLATBED_ONLY].name = "noadf";
s->opt[OPT_FLATBED_ONLY].title = "Flatbed Only";
s->opt[OPT_FLATBED_ONLY].desc = "Disable Auto Document Feeder and use Flatbed only";
s->opt[OPT_FLATBED_ONLY].type = SANE_TYPE_BOOL;
s->opt[OPT_FLATBED_ONLY].unit = SANE_UNIT_NONE;
s->opt[OPT_FLATBED_ONLY].size = sizeof(SANE_Word);
s->opt[OPT_FLATBED_ONLY].cap |=
(s->hw->adf.Status == ADF_STAT_NONE) ? SANE_CAP_INACTIVE : 0;
s->val[OPT_FLATBED_ONLY].w = SANE_FALSE;
/* "TPU" group: */
s->opt[OPT_TPU_GROUP].title = "Transparency Unit";
s->opt[OPT_TPU_GROUP].desc = "";
@ -1666,14 +1889,24 @@ do_focus(CANON_Scanner *s)
if (s->val[OPT_AF].w == SANE_TRUE)
{
/* Auto-Focus */
status = execute_auto_focus (s->fd, AUTO_FOCUS, NO_AUTO_SCAN_SPEED,
NO_AUTO_EXPOSURE, 0, NULL, 0);
/* status = execute_auto_focus (s->fd, AUTO_FOCUS, NO_AUTO_SCAN_SPEED, */
/* NO_AUTO_EXPOSURE, 0, NULL, 0); */
/* status = execute_auto_focus (s->fd, AUTO_FOCUS, NO_AUTO_SCAN_SPEED, */
/* AUTO_EXPOSURE, 0, NULL, 0); */
status = execute_auto_focus (s->fd, AUTO_FOCUS,
(s->scanning_speed == 0) ? AUTO_SCAN_SPEED : NO_AUTO_SCAN_SPEED,
(s->AE == 0) ? NO_AUTO_EXPOSURE : AUTO_EXPOSURE,
0, NULL, 0);
}
else
{
/* Manual Focus */
status = execute_auto_focus (s->fd, MANUAL_FOCUS, NO_AUTO_SCAN_SPEED,
NO_AUTO_EXPOSURE, s->val[OPT_FOCUS].w, NULL, 0);
/* status = execute_auto_focus (s->fd, MANUAL_FOCUS, NO_AUTO_SCAN_SPEED, */
/* NO_AUTO_EXPOSURE, s->val[OPT_FOCUS].w, NULL, 0); */
status = execute_auto_focus (s->fd, MANUAL_FOCUS,
(s->scanning_speed == 0) ? AUTO_SCAN_SPEED : NO_AUTO_SCAN_SPEED,
(s->AE == 0) ? NO_AUTO_EXPOSURE : AUTO_EXPOSURE,
s->val[OPT_FOCUS].w, NULL, 0);
}
if (status != SANE_STATUS_GOOD)
{

Wyświetl plik

@ -12,6 +12,8 @@
:version "0.1" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
:url "http://www.rzg.mpg.de/~mpd/sane/" ; backend home page
:devicetype :scanner
:mfg "Canon" ; name a manufacturer

Wyświetl plik

@ -45,6 +45,16 @@
#ifndef canon_h
#define canon_h 1
/* all the different possible model names. */
#define FB1200S "IX-12015E "
#define FB620S "IX-06035E "
#define CS300 "IX-03035B "
#define CS600 "IX-06015C "
#define CS2700F "IX-27015C "
#define IX_4025 "IX-4025 "
#define IX_4015 "IX-4015 "
#define IX_3010 "IX-3010 "
#include <sys/types.h>
#define NO_FOCUS 0
@ -57,6 +67,7 @@
#define NO_AUTO_EXPOSURE 0
#define AUTO_EXPOSURE 1
#define AUTO_DOC_FEEDER_UNIT 0x01
#define TRANSPARENCY_UNIT 0x02
#define SCAN_CONTROL_CONDITIONS 0x20
#define ALL_SCAN_MODE_PAGES 0x3F
@ -65,6 +76,19 @@
#define GREEN 1
#define BLUE 2
#define ADF_STAT_NONE 0
#define ADF_STAT_INACTIVE 1
#define ADF_STAT_ACTIVE 2
#define ADF_STAT_DISABLED 3
#define ADF_Status (4+2) /* byte positioning */
#define ADF_Settings (4+3) /* in data block */
#define ADF_NOT_PRESENT 0x01 /* bit selection */
#define ADF_PROBLEM 0x0E /* from bytes in */
#define ADF_PRIORITY 0x03 /* data block. */
#define ADF_FEEDER 0x04 /* */
#define TPU_STAT_NONE 0
#define TPU_STAT_INACTIVE 1
#define TPU_STAT_ACTIVE 2
@ -72,6 +96,16 @@
#define CS3_600 0 /* CanoScan 300/600 */
#define CS2700 1 /* CanoScan 2700F */
typedef struct
{
SANE_Int Status; /* Auto Document Feeder Unit Status */
SANE_Int Problem; /* ADF Problems list */
SANE_Int Priority; /* ADF Priority setting */
SANE_Int Feeder; /* ADF Feeder setting */
} CANON_ADF;
typedef struct
{
SANE_Int Status; /* Transparency Unit Status */
@ -92,7 +126,11 @@ typedef enum
OPT_MODE_GROUP,
OPT_MODE,
OPT_NEGATIVE, /* Reverse image format */
OPT_NEGATIVE_TYPE, /* Negative film type */
OPT_SCANNING_SPEED,
OPT_RESOLUTION_GROUP,
OPT_RESOLUTION_BIND,
OPT_HW_RESOLUTION_ONLY,
OPT_X_RESOLUTION,
OPT_Y_RESOLUTION,
@ -105,8 +143,7 @@ typedef enum
OPT_CUSTOM_GAMMA, /* use custom gamma tables? */
OPT_CUSTOM_GAMMA_BIND,
/* The gamma vectors MUST appear in the order gray, red, green,
blue. */
/* The gamma vectors MUST appear in the order gray, red, green, blue. */
OPT_GAMMA_VECTOR,
OPT_GAMMA_VECTOR_R,
OPT_GAMMA_VECTOR_G,
@ -140,6 +177,10 @@ typedef enum
OPT_HILITE_B, /* highlight point for blue */
OPT_SHADOW_B, /* shadow point for blue */
OPT_ADF_GROUP, /* to allow display of options. */
OPT_FLATBED_ONLY, /* in case you have a sheetfeeder
but don't want to use it. */
OPT_TPU_GROUP,
OPT_TPU_ON,
OPT_TPU_PN,
@ -199,6 +240,7 @@ typedef struct CANON_Device
struct CANON_Device *next;
SANE_Device sane;
CANON_Info info;
CANON_ADF adf;
CANON_TPU tpu;
}
CANON_Device;
@ -227,6 +269,8 @@ typedef struct CANON_Scanner
SANE_Int image_composition;
SANE_Int bpp;
SANE_Bool RIF; /* Reverse Image Format */
SANE_Int negative_filmtype;
SANE_Int scanning_speed;
SANE_Bool GRC; /* Gray Response Curve */
SANE_Bool Mirror;
SANE_Bool AE; /* Auto Exposure */
@ -237,9 +281,88 @@ typedef struct CANON_Scanner
SANE_Int HiliteB;
SANE_Int ShadowB;
/* 990320, ss: array for fixed resolutions */
SANE_Word xres_word_list [8];
SANE_Word yres_word_list [8];
size_t bytes_to_read;
int scanning;
}
CANON_Scanner;
char *option_name[]=
{
"OPT_NUM_OPTS",
"OPT_PAGE",
"OPT_MODE_GROUP",
"OPT_MODE",
"OPT_NEGATIVE",
"OPT_NEGATIVE_TYPE",
"OPT_SCANNING_SPEED",
"OPT_RESOLUTION_GROUP",
"OPT_RESOLUTION_BIND",
"OPT_HW_RESOLUTION_ONLY",
"OPT_X_RESOLUTION",
"OPT_Y_RESOLUTION",
"OPT_ENHANCEMENT_GROUP",
"OPT_BRIGHTNESS",
"OPT_CONTRAST",
"OPT_THRESHOLD",
"OPT_MIRROR",
"OPT_CUSTOM_GAMMA",
"OPT_CUSTOM_GAMMA_BIND",
"OPT_GAMMA_VECTOR",
"OPT_GAMMA_VECTOR_R",
"OPT_GAMMA_VECTOR_G",
"OPT_GAMMA_VECTOR_B",
"OPT_AE",
"OPT_EJECT_GROUP",
"OPT_EJECT_AFTERSCAN",
"OPT_EJECT_BEFOREEXIT",
"OPT_EJECT_NOW",
"OPT_FOCUS_GROUP",
"OPT_AF",
"OPT_AF_ONCE",
"OPT_FOCUS",
"OPT_MARGINS_GROUP",
"OPT_TL_X",
"OPT_TL_Y",
"OPT_BR_X",
"OPT_BR_Y",
"OPT_COLORS_GROUP",
"OPT_HNEGATIVE",
"OPT_BIND_HILO",
"OPT_HILITE_R",
"OPT_SHADOW_R",
"OPT_HILITE_G",
"OPT_SHADOW_G",
"OPT_HILITE_B",
"OPT_SHADOW_B",
"OPT_TPU_GROUP",
"OPT_TPU_ON",
"OPT_TPU_PN",
"OPT_TPU_DCM",
"OPT_TPU_TRANSPARENCY",
"OPT_TPU_FILMTYPE",
"OPT_PREVIEW",
"NUM_OPTIONS"
};
#endif /* not canon_h */

Wyświetl plik

@ -347,7 +347,7 @@ init_dc210 (DC210 * camera)
/*
We need the device to be raw. 8 bits even parity on 9600 baud to start.
*/
#ifdef HAVE_cfmakeraw
#ifdef HAVE_CFMAKERAW
cfmakeraw (&tty_new);
#else
tty_new.c_lflag &= ~(ICANON | ECHO | ISIG);

Wyświetl plik

@ -99,6 +99,7 @@
#include <sane/sane.h>
#include <sane/sanei.h>
#include <sane/saneopts.h>
#include <sane/config.h>
#define BACKEND_NAME dc25
#include <sane/sanei_backend.h>
@ -343,15 +344,21 @@ static SANE_Parameters parms =
static unsigned char init_pck[] = INIT_PCK;
/*
* List of speeds to try to establish connection with the camera.
* Check 9600 first, as it's the speed the camera comes up in, then
* 115200, as that is the one most likely to be configured from a
* previous run
*/
static struct pkt_speed speeds[] = { { B9600, { 0x96, 0x00 } },
{ B19200, { 0x19, 0x20 } },
{ B38400, { 0x38, 0x40 } },
#ifdef B115200
{ B115200, { 0x11, 0x52 } },
#endif
#ifdef B57600
{ B57600, { 0x57, 0x60 } },
#endif
#ifdef B115200
{ B115200, { 0x11, 0x52 } }
#endif
{ B38400, { 0x38, 0x40 } },
{ B19200, { 0x19, 0x20 } },
};
#define NUM_OF_SPEEDS (sizeof(speeds) / sizeof(struct pkt_speed))
@ -423,7 +430,7 @@ init_dc20 (char *device, speed_t speed)
/*
We need the device to be raw. 8 bits even parity on 9600 baud to start.
*/
#ifdef HAVE_cfmakeraw
#ifdef HAVE_CFMAKERAW
cfmakeraw (&tty_new);
#else
tty_new.c_lflag &= ~(ICANON | ECHO | ISIG);
@ -432,7 +439,7 @@ init_dc20 (char *device, speed_t speed)
tty_new.c_cflag |= PARENB;
tty_new.c_cflag &= ~PARODD;
tty_new.c_cc[VMIN] = 0;
tty_new.c_cc[VTIME] = 10;
tty_new.c_cc[VTIME] = 50;
cfsetospeed (&tty_new, B9600);
cfsetispeed (&tty_new, B9600);
@ -582,29 +589,52 @@ read_data (int fd, unsigned char *buf, int sz)
unsigned char ccsum;
unsigned char rcsum;
unsigned char c;
int retries=0;
int n;
int r = 0;
int i;
for (n = 0; n < sz && (r = read (fd, (char *)&buf[n], sz - n)) > 0; n += r)
;
while ( retries++ < 5 ) {
/*
* If this is not the first time through, then it must be
* a retry - signal the camera that we didn't like what
* we got. In either case, start filling the packet
*/
if ( retries != 1 ) {
if (r <= 0) {
DBG (2,"read_data: error: read returned -1\n");
return -1;
}
DBG (2, "Attempt retry %d\n",retries);
c=0xe3;
if (write (fd, (char *)&c, 1) != 1) {
DBG (2,"read_data: error: write ack\n");
return -1;
}
if (n < sz || read (fd, &rcsum, 1) != 1) {
DBG (2,"read_data: error: buffer underrun or no checksum\n");
return -1;
}
}
for (i = 0, ccsum = 0; i < n; i++)
ccsum ^= buf[i];
for (n = 0; n < sz && (r = read (fd, (char *)&buf[n], sz - n)) > 0; n += r)
;
if (r <= 0) {
DBG (2,"read_data: error: read returned -1\n");
continue;
}
if (ccsum != rcsum) {
DBG (2,"read_data: error: bad checksum (%02x != %02x)\n",rcsum, ccsum);
return -1;
if (n < sz || read (fd, &rcsum, 1) != 1) {
DBG (2,"read_data: error: buffer underrun or no checksum\n");
continue;
}
for (i = 0, ccsum = 0; i < n; i++)
ccsum ^= buf[i];
if (ccsum != rcsum) {
DBG (2,"read_data: error: bad checksum (%02x != %02x)\n",rcsum, ccsum);
continue;
}
/* If we got this far, then the packet is OK */
break;
}
c = 0xd2;

Wyświetl plik

@ -0,0 +1,383 @@
The Independent JPEG Group's JPEG software
==========================================
README for release 6a of 7-Feb-96
=================================
This distribution contains the sixth public release of the Independent JPEG
Group's free JPEG software. You are welcome to redistribute this software and
to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
Serious users of this software (particularly those incorporating it into
larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
our electronic mailing list. Mailing list members are notified of updates
and have a chance to participate in technical discussions, etc.
This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz, Jim
Boucher, Lee Crocker, Julian Minguillon, George Phillips, Davide Rossi,
Ge' Weijers, and other members of the Independent JPEG Group.
IJG is not affiliated with the official ISO JPEG standards committee.
DOCUMENTATION ROADMAP
=====================
This file contains the following sections:
OVERVIEW General description of JPEG and the IJG software.
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
REFERENCES Where to learn more about JPEG.
ARCHIVE LOCATIONS Where to find newer versions of this software.
RELATED SOFTWARE Other stuff you should get.
FILE FORMAT WARS Software *not* to get.
TO DO Plans for future IJG releases.
Other documentation files in the distribution are:
User documentation:
install.doc How to configure and install the IJG software.
usage.doc Usage instructions for cjpeg, djpeg, jpegtran,
rdjpgcom, and wrjpgcom.
*.1 Unix-style man pages for programs (same info as usage.doc).
wizard.doc Advanced usage instructions for JPEG wizards only.
change.log Version-to-version change highlights.
Programmer and internal documentation:
libjpeg.doc How to use the JPEG library in your own programs.
example.c Sample code for calling the JPEG library.
structure.doc Overview of the JPEG library's internal structure.
filelist.doc Road map of IJG files.
coderules.doc Coding style rules --- please read if you contribute code.
Please read at least the files install.doc and usage.doc. Useful information
can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
If you want to understand how the JPEG code works, we suggest reading one or
more of the REFERENCES, then looking at the documentation files (in roughly
the order listed) before diving into the code.
OVERVIEW
========
This package contains C software to implement JPEG image compression and
decompression. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and gray-scale images. JPEG is intended for compressing
"real-world" scenes; line drawings, cartoons and other non-realistic images
are not its strong suit. JPEG is lossy, meaning that the output image is not
exactly identical to the input image. Hence you must not use JPEG if you
have to have identical output bits. However, on typical photographic images,
very good compression levels can be obtained with no visible change, and
remarkably high compression levels are possible if you can tolerate a
low-quality image. For more details, see the references, or just experiment
with various compression settings.
This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these
processes, although some uncommon parameter settings aren't implemented yet.
For legal reasons, we are not distributing code for the arithmetic-coding
variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting
the hierarchical or lossless processes defined in the standard.
We provide a set of library routines for reading and writing JPEG image files,
plus two sample applications "cjpeg" and "djpeg", which use the library to
perform conversion between JPEG and some other popular image file formats.
The library is intended to be reused in other applications.
In order to support file conversion and viewing software, we have included
considerable functionality beyond the bare JPEG coding/decoding capability;
for example, the color quantization modules are not strictly part of JPEG
decoding, but they are essential for output to colormapped file formats or
colormapped displays. These extra functions can be compiled out of the
library if not required for a particular application. We have also included
"jpegtran", a utility for lossless transcoding between different JPEG
processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
inserting and extracting textual comments in JFIF files.
The emphasis in designing this software has been on achieving portability and
flexibility, while also making it fast enough to be useful. In particular,
the software is not intended to be read as a tutorial on JPEG. (See the
REFERENCES section for introductory material.) Rather, it is intended to
be reliable, portable, industrial-strength code. We do not claim to have
achieved that goal in every aspect of the software, but we strive for it.
We welcome the use of this software as a component of commercial products.
No royalty is required, but we do ask for an acknowledgement in product
documentation, as described under LEGAL ISSUES.
LEGAL ISSUES
============
In plain English:
1. We don't promise that this software works. (But if you find any bugs,
please let us know!)
2. You can use this software for whatever you want. You don't have to pay us.
3. You may not pretend that you wrote this software. If you use it in a
program, you must acknowledge somewhere in your documentation that
you've used the IJG code.
In legalese:
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1996, Thomas G. Lane.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
ansi2knr.c is NOT covered by the above copyright and conditions, but instead
by the usual distribution terms of the Free Software Foundation; principally,
that you must include source code if you redistribute it. (See the file
ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
of any program generated from the IJG code, this does not limit you more than
the foregoing paragraphs do.
The configuration script "configure" was produced with GNU Autoconf. It
is copyright by the Free Software Foundation but is freely distributable.
It appears that the arithmetic coding option of the JPEG spec is covered by
patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
legally be used without obtaining one or more licenses. For this reason,
support for arithmetic coding has been removed from the free JPEG software.
(Since arithmetic coding provides only a marginal gain over the unpatented
Huffman mode, it is unlikely that very many implementations will support it.)
So far as we are aware, there are no patent restrictions on the remaining
code.
WARNING: Unisys has begun to enforce their patent on LZW compression against
GIF encoders and decoders. You will need a license from Unisys to use the
included rdgif.c or wrgif.c files in a commercial or shareware application.
At this time, Unisys is not enforcing their patent against freeware, so
distribution of this package remains legal. However, we intend to remove
GIF support from the IJG package as soon as a suitable replacement format
becomes reasonably popular.
We are required to state that
"The Graphics Interchange Format(c) is the Copyright property of
CompuServe Incorporated. GIF(sm) is a Service Mark property of
CompuServe Incorporated."
REFERENCES
==========
We highly recommend reading one or more of these references before trying to
understand the innards of the JPEG software.
The best short technical introduction to the JPEG compression algorithm is
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
(Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue
handy, a PostScript file containing a revised version of Wallace's article
is available at ftp.uu.net, graphics/jpeg/wallace.ps.gz. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and
IEEE, and it may not be used for commercial purposes.
A somewhat less technical, more leisurely introduction to JPEG can be found in
"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and
example C code for a multitude of compression methods including JPEG. It is
an excellent source if you are comfortable reading C code but don't know much
about data compression in general. The book's JPEG sample code is far from
industrial-strength, but when you are ready to look at a full implementation,
you've got one here...
The best full description of JPEG is the textbook "JPEG Still Image Data
Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
The book includes the complete text of the ISO JPEG standards (DIS 10918-1
and draft DIS 10918-2). This is by far the most complete exposition of JPEG
in existence, and we highly recommend it.
The JPEG standard itself is not available electronically; you must order a
paper copy through ISO or ITU. (Unless you feel a need to own a certified
official copy, we recommend buying the Pennebaker and Mitchell book instead;
it's much cheaper and includes a great deal of useful explanatory material.)
In the USA, copies of the standard may be ordered from ANSI Sales at (212)
642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI
doesn't take credit card orders, but Global does.) It's not cheap: as of
1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
shipping/handling. The standard is divided into two parts, Part 1 being the
actual specification, while Part 2 covers compliance testing methods. Part 1
is titled "Digital Compression and Coding of Continuous-tone Still Images,
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
Continuous-tone Still Images, Part 2: Compliance testing" and has document
numbers ISO/IEC IS 10918-2, ITU-T T.83.
Extensions to the original JPEG standard are defined in JPEG Part 3, a new ISO
document. Part 3 is undergoing ISO balloting and is expected to be approved
by the end of 1995; it will have document numbers ISO/IEC IS 10918-3, ITU-T
T.84. IJG currently does not support any Part 3 extensions.
The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details we follow the "JFIF" conventions, revision
1.02. A copy of the JFIF spec is available from:
Literature Department
C-Cube Microsystems, Inc.
1778 McCarthy Blvd.
Milpitas, CA 95035
phone (408) 944-6300, fax (408) 944-6314
A PostScript version of this document is available at ftp.uu.net, file
graphics/jpeg/jfif.ps.gz. It can also be obtained by e-mail from the C-Cube
mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg"
to the server to obtain the JFIF document; send the message "help" if you have
trouble.
The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed
copy from Aldus Corp. at (206) 628-6593. The JPEG incorporation scheme
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
(Compression tag 7). Copies of this Note can be obtained from sgi.com or
from ftp.uu.net:/graphics/jpeg/. It is expected that the next revision of
the TIFF spec will replace the 6.0 JPEG design with the Note's design.
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
uses our library to implement TIFF/JPEG per the Note. libtiff is available
from sgi.com:/graphics/tiff/.
ARCHIVE LOCATIONS
=================
The "official" archive site for this software is ftp.uu.net (Internet
address 192.48.96.9). The most recent released version can always be found
there in directory graphics/jpeg. This particular version will be archived
as graphics/jpeg/jpegsrc.v6a.tar.gz. If you are on the Internet, you
can retrieve files from ftp.uu.net by standard anonymous FTP. If you don't
have FTP access, UUNET's archives are also available via UUCP; contact
help@uunet.uu.net for information on retrieving files that way.
Numerous Internet sites maintain copies of the UUNET files. However, only
ftp.uu.net is guaranteed to have the latest official version.
You can also obtain this software in DOS-compatible "zip" archive format from
the SimTel archives (ftp.coast.net:/SimTel/msdos/graphics/), or on CompuServe
in the Graphics Support forum (GO CIS:GRAPHSUP), library 12 "JPEG Tools".
Again, these versions may sometimes lag behind the ftp.uu.net release.
The JPEG FAQ (Frequently Asked Questions) article is a useful source of
general information about JPEG. It is updated constantly and therefore is
not included in this distribution. The FAQ is posted every two weeks to
Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
You can always obtain the latest version from the news.answers archive at
rtfm.mit.edu. By FTP, fetch /pub/usenet/news.answers/jpeg-faq/part1 and
.../part2. If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu
with body
send usenet/news.answers/jpeg-faq/part1
send usenet/news.answers/jpeg-faq/part2
RELATED SOFTWARE
================
Numerous viewing and image manipulation programs now support JPEG. (Quite a
few of them use this library to do so.) The JPEG FAQ described above lists
some of the more popular free and shareware viewers, and tells where to
obtain them on Internet.
If you are on a Unix machine, we highly recommend Jef Poskanzer's free
PBMPLUS image software, which provides many useful operations on PPM-format
image files. In particular, it can convert PPM images to and from a wide
range of other formats. You can obtain this package by FTP from ftp.x.org
(contrib/pbmplus*.tar.Z) or ftp.ee.lbl.gov (pbmplus*.tar.Z). There is also
a newer update of this package called NETPBM, available from
wuarchive.wustl.edu under directory /graphics/graphics/packages/NetPBM/.
Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software
is; you are likely to have difficulty making it work on any non-Unix machine.
A different free JPEG implementation, written by the PVRG group at Stanford,
is available from havefun.stanford.edu in directory pub/jpeg. This program
is designed for research and experimentation rather than production use;
it is slower, harder to use, and less portable than the IJG code, but it
is easier to read and modify. Also, the PVRG code supports lossless JPEG,
which we do not.
FILE FORMAT WARS
================
Some JPEG programs produce files that are not compatible with our library.
The root of the problem is that the ISO JPEG committee failed to specify a
concrete file format. Some vendors "filled in the blanks" on their own,
creating proprietary formats that no one else could read. (For example, none
of the early commercial JPEG implementations for the Macintosh were able to
exchange compressed files.)
The file format we have adopted is called JFIF (see REFERENCES). This format
has been agreed to by a number of major commercial JPEG vendors, and it has
become the de facto standard. JFIF is a minimal or "low end" representation.
We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
Technical Note #2) for "high end" applications that need to record a lot of
additional data about an image. TIFF/JPEG is fairly new and not yet widely
supported, unfortunately.
The upcoming JPEG Part 3 standard defines a file format called SPIFF.
SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
be able to read the most common variant of SPIFF. SPIFF has some technical
advantages over JFIF, but its major claim to fame is simply that it is an
official standard rather than an informal one. At this point it is unclear
whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
standard. IJG intends to support SPIFF once the standard is frozen, but we
have not decided whether it should become our default output format or not.
(In any case, our decoder will remain capable of reading JFIF indefinitely.)
Various proprietary file formats incorporating JPEG compression also exist.
We have little or no sympathy for the existence of these formats. Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, open format standards for JPEG files. Don't
use a proprietary file format!
TO DO
=====
In future versions, we are considering supporting some of the upcoming JPEG
Part 3 extensions --- principally, variable quantization and the SPIFF file
format.
Tuning the software for better behavior at low quality/high compression
settings is also of interest. The current method for scaling the
quantization tables is known not to be very good at low Q values.
As always, speeding things up is high on our priority list.
Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1,6 @@
# List of aliased or hiddend backends. See sane-dll(5) for details.
#
# Format:
# alias SomeName SaneDeviceName
# alias "Some Name" SaneDeviceName
# hide SaneDeviceName

Wyświetl plik

@ -91,6 +91,7 @@
#include <sane/sanei_config.h>
#define DLL_CONFIG_FILE "dll.conf"
#define DLL_ALIASES_FILE "dll.aliases"
enum SANE_Ops
{
@ -170,6 +171,14 @@ struct meta_scanner
SANE_Handle handle;
};
struct alias
{
struct alias *next;
char *oldname;
char *newname;
};
static struct alias *first_alias;
static SANE_Auth_Callback auth_callback;
static struct backend *first_backend;
static const char *op_name[] =
@ -211,11 +220,10 @@ add_backend (const char *name, struct backend **bep)
return SANE_STATUS_GOOD;
}
be = malloc (sizeof (*be));
be = calloc (1, sizeof (*be));
if (!be)
return SANE_STATUS_NO_MEM;
memset (be, 0, sizeof (*be));
be->name = strdup (name);
if (!be->name)
return SANE_STATUS_NO_MEM;
@ -302,7 +310,11 @@ load (struct backend *be)
#endif /* HAVE_DLOPEN */
if (!be->handle)
{
#ifdef HAVE_DLOPEN
DBG(2, "dlopen() failed (%s)\n", dlerror());
#else
DBG(2, "dlopen() failed (%s)\n", strerror (errno));
#endif
return SANE_STATUS_INVAL;
}
@ -379,6 +391,87 @@ init (struct backend *be)
return SANE_STATUS_GOOD;
}
static void
add_alias (char *line)
{
const char *command;
enum { CMD_ALIAS, CMD_HIDE } cmd;
const char *oldname, *oldend, *newname, *newend;
size_t oldlen, newlen;
struct alias *alias;
command = sanei_config_skip_whitespace(line);
if( !*command )
return;
line = strpbrk(command, " \t");
if( !line )
return;
*line++ = '\0';
if( strcmp(command, "alias") == 0 )
cmd = CMD_ALIAS;
else
if( strcmp(command, "hide") == 0 )
cmd = CMD_HIDE;
else
return;
newlen = 0;
newname = NULL;
if( cmd == CMD_ALIAS )
{
newname = sanei_config_skip_whitespace(line);
if( !*newname )
return;
if( *newname == '\"' )
{
++newname;
newend = strchr(newname, '\"');
}
else
newend = strpbrk(newname, " \t");
if( !newend )
return;
newlen = newend - newname;
line = (char*)(newend+1);
}
oldname = sanei_config_skip_whitespace(line);
if( !*oldname )
return;
oldend = oldname + strcspn(oldname, " \t");
oldlen = oldend - oldname;
alias = malloc(sizeof(struct alias));
if( alias )
{
alias->oldname = malloc(oldlen + newlen + 2);
if( alias->oldname )
{
strncpy(alias->oldname, oldname, oldlen);
alias->oldname[oldlen] = '\0';
if( cmd == CMD_ALIAS )
{
alias->newname = alias->oldname + oldlen + 1;
strncpy(alias->newname, newname, newlen);
alias->newname[newlen] = '\0';
}
else
alias->newname = NULL;
alias->next = first_alias;
first_alias = alias;
return;
}
free(alias);
}
return;
}
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
@ -422,6 +515,24 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
}
fclose (fp);
fp = sanei_config_open (DLL_ALIASES_FILE);
if (!fp)
return SANE_STATUS_GOOD; /* don't insist on aliases file */
while (fgets (backend_name, sizeof (backend_name), fp))
{
if (backend_name[0] == '#') /* ignore line comments */
continue;
len = strlen (backend_name);
if (backend_name[len - 1] == '\n')
backend_name[--len] = '\0';
if (!len)
continue; /* ignore empty lines */
add_alias (backend_name);
}
fclose (fp);
return SANE_STATUS_GOOD;
}
@ -429,6 +540,7 @@ void
sane_exit (void)
{
struct backend *be, *next;
struct alias *alias;
DBG(1, "exiting\n");
@ -461,6 +573,13 @@ sane_exit (void)
}
}
first_backend = 0;
while( (alias = first_alias) != NULL )
{
first_alias = first_alias->next;
free(alias->oldname);
free(alias);
}
}
/* Note that a call to get_devices() implies that we'll have to load
@ -517,19 +636,47 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
{
SANE_Device *dev;
char *mem;
struct alias *alias;
/* create a new device entry with a device name that is the
sum of the backend name a colon and the backend's device
name: */
len = strlen (be->name) + 1 + strlen (be_list[i]->name);
mem = malloc (sizeof (*dev) + len + 1);
if (!mem)
return SANE_STATUS_NO_MEM;
for(alias = first_alias; alias != NULL; alias = alias->next)
{
len = strlen(be->name);
if( strlen(alias->oldname) <= len )
continue;
if( strncmp(alias->oldname, be->name, len) == 0
&& alias->oldname[len] == ':'
&& strcmp(&alias->oldname[len+1], be_list[i]->name) == 0 )
break;
}
full_name = mem + sizeof (*dev);
strcpy (full_name, be->name);
strcat (full_name, ":");
strcat (full_name, be_list[i]->name);
if( alias )
{
if( !alias->newname ) /* hidden device */
continue;
len = strlen(alias->newname);
mem = malloc(sizeof(*dev) + len + 1);
if( !mem )
return SANE_STATUS_NO_MEM;
full_name = mem + sizeof(*dev);
strcpy(full_name, alias->newname);
}
else
{
/* create a new device entry with a device name that is the
sum of the backend name a colon and the backend's device
name: */
len = strlen (be->name) + 1 + strlen (be_list[i]->name);
mem = malloc (sizeof (*dev) + len + 1);
if (!mem)
return SANE_STATUS_NO_MEM;
full_name = mem + sizeof (*dev);
strcpy (full_name, be->name);
strcat (full_name, ":");
strcat (full_name, be_list[i]->name);
}
dev = (SANE_Device *) mem;
dev->name = full_name;
@ -557,6 +704,18 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle)
SANE_Handle *handle;
struct backend *be;
SANE_Status status;
struct alias *alias;
for( alias = first_alias; alias != NULL; alias = alias->next )
{
if( !alias->newname )
continue;
if( strcmp(alias->newname, full_name) == 0 )
{
full_name = alias->oldname;
break;
}
}
dev_name = strchr (full_name, ':');
if (dev_name)
@ -607,11 +766,10 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle)
if (status != SANE_STATUS_GOOD)
return status;
s = malloc (sizeof (*s));
s = calloc (1, sizeof (*s));
if (!s)
return SANE_STATUS_NO_MEM;
memset (s, 0, sizeof (*s));
s->be = be;
s->handle = handle;
*meta_handle = s;

Wyświetl plik

@ -3,6 +3,7 @@ net
abaton
agfafocus
apple
avision
artec
canon
coolscan
@ -11,6 +12,7 @@ coolscan
dmc
epson
hp
m3096g
microtek
microtek2
mustek
@ -21,5 +23,6 @@ ricoh
s9036
sharp
snapscan
sp15c
tamarack
umax

Wyświetl plik

@ -1,2 +1,3 @@
scsi EPSON
/dev/scanner
# /dev/scanner
# usb /dev/usbscanner

Wyświetl plik

@ -1,10 +1,49 @@
:backend "epson" ; name of backend
:manpage "sane-epson"
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "epson" ; name of backend
:version "0.1.15" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
:manpage "sane-epson" ; name of manpage (if it exists)
:url "http://www.khk.net/" ; backend's web page
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:mfg "Epson" ; name a manufacturer
:url "http://www.epson.com/"
:model "GT-5000" ; name models for above-specified mfg.
:comment "parallel interface"
:model "GT-6000"
:comment "parallel interface"
:model "Actionscanner II"
:comment "parallel interface"
:model "GT-7000"
:model "Perfection 636S"
:model "Perfection 636U"
:comment "USB Interface"
:model "Perfection 1200S"
:model "Perfection 1200U"
:comment "USB Interface"
:model "Expression 636"
:model "FilmScan 200"
:comment "A better backend for the FilmScan 200 can be found at <A HREF=\"http://www.vjet.demon.co.uk/scanner/\">http://www.vjet.demon.cu.uk/scanner/</A>"
:mfg "Epson"
:model "GT-5500"
:comment "OK"
:mfg "Epson"
:model "GT-7000" ; reported to work fine by <r_valetti@popmail.iol.it>
:comment "OK"

Wyświetl plik

@ -7,8 +7,10 @@
Copyright (C) 1997 Hypercore Software Design, Ltd.
modifications
Copyright (C) 1998 Christian Bucher
Copyright (C) 1998 Kling & Hautzinger GmbH
Copyright (C) 1998-1999 Christian Bucher <bucher@vernetzt.at>
Copyright (C) 1998-1999 Kling & Hautzinger GmbH
Copyright (C) 1999 Norihiko Sawa <sawa@yb3.so-net.ne.jp>
Copyright (C) 2000 Karl Heinz Kremer <khk@khk.net>
This file is part of the SANE package.
@ -51,75 +53,155 @@
#ifndef epson_h
#define epson_h 1
typedef struct
{
char *level;
int I:1 /* request identity */
,F:1 /* request status */
,S:1 /* request condition */
,C:1 /* set color mode */
,G:1 /* start scanning */
,D:1 /* set data format */
,R:1 /* set resolution */
,H:1 /* set zoom */
,A:1 /* set scan area */
,L:1 /* set bright */
,Z:1 /* set gamma */
,B:1 /* set halftoning */
,M:1 /* set color correction */
,AT:1 /* initialize scanner */
,g:1 /* set speed */
,d:1 /* set lcount */
;
}
EpsonCmdRec, *EpsonCmd;
#define SANE_EPSON_CONFIG_USB "usb"
#define SANE_EPSON_CONFIG_PIO "pio"
#define SANE_NAME_GAMMA_CORRECTION "gamma-correction"
#define SANE_TITLE_GAMMA_CORRECTION "Gamma Correction"
#define SANE_DESC_GAMMA_CORRECTION "Selectes the gamma correction value from a list of pre-defined devices or the user defined table, which can be downloaded to the scanner"
typedef struct {
unsigned char * level;
unsigned char request_identity;
unsigned char request_status;
unsigned char request_condition;
unsigned char set_color_mode;
unsigned char start_scanning;
unsigned char set_data_format;
unsigned char set_resolution;
unsigned char set_zoom;
unsigned char set_scan_area;
unsigned char set_bright;
SANE_Range bright_range;
unsigned char set_gamma;
unsigned char set_halftoning;
unsigned char set_color_correction;
unsigned char initialize_scanner;
unsigned char set_speed; /* B4 upper */
unsigned char set_lcount;
unsigned char mirror_image; /* B5 upper */
unsigned char set_gamma_table; /* B4 upper */
unsigned char set_outline_emphasis; /* B4 upper */
unsigned char set_dither; /* B4 upper */
unsigned char set_color_correction_coefficients; /* B3 upper */
unsigned char request_extention_status; /* EXT */
unsigned char control_an_extention; /* EXT */
unsigned char eject; /* EXT */
unsigned char request_push_button_status;
unsigned char control_auto_area_segmentation;
unsigned char set_film_type; /* EXT */
unsigned char set_exposure_time; /* F5 */
unsigned char set_bay; /* F5 */
} EpsonCmdRec, * EpsonCmd;
enum
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_MODE,
OPT_HALFTONE,
OPT_DROPOUT,
OPT_BRIGHTNESS,
OPT_RESOLUTION,
OPT_GEOMETRY_GROUP,
OPT_TL_X,
OPT_TL_Y,
OPT_BR_X,
OPT_BR_Y,
NUM_OPTIONS
};
{ OPT_NUM_OPTS = 0
, OPT_MODE_GROUP
, OPT_MODE
, OPT_HALFTONE
, OPT_DROPOUT
, OPT_BRIGHTNESS
, OPT_SHARPNESS
, OPT_GAMMA_CORRECTION
, OPT_COLOR_CORRECTION
, OPT_RESOLUTION
, OPT_ADVANCED_GROUP
, OPT_MIRROR
, OPT_SPEED
, OPT_AAS
, OPT_GAMMA_VECTOR
, OPT_GAMMA_VECTOR_R
, OPT_GAMMA_VECTOR_G
, OPT_GAMMA_VECTOR_B
, OPT_CCT_GROUP
, OPT_CCT_1
, OPT_CCT_2
, OPT_CCT_3
, OPT_CCT_4
, OPT_CCT_5
, OPT_CCT_6
, OPT_CCT_7
, OPT_CCT_8
, OPT_CCT_9
, OPT_PREVIEW_GROUP
, OPT_PREVIEW
, OPT_PREVIEW_SPEED
, OPT_GEOMETRY_GROUP
, OPT_TL_X
, OPT_TL_Y
, OPT_BR_X
, OPT_BR_Y
, OPT_QUICK_FORMAT
, OPT_EQU_GROUP
, OPT_SOURCE
, OPT_AUTO_EJECT
, OPT_FILM_TYPE
, OPT_BAY
, OPT_EJECT
, NUM_OPTIONS
};
struct Epson_Device
{
SANE_Device sane;
SANE_Int level;
SANE_Range dpi_range;
SANE_Range x_range;
SANE_Range y_range;
SANE_Bool is_scsi;
SANE_Int *res_list;
SANE_Int res_list_size;
EpsonCmd cmd;
};
typedef enum { /* hardware connection to the scanner */
SANE_EPSON_NODEV, /* default, no HW specified yet */
SANE_EPSON_SCSI, /* SCSI interface */
SANE_EPSON_PIO, /* parallel interface */
SANE_EPSON_USB /* USB interface */
} Epson_Connection_Type;
struct Epson_Device {
SANE_Device sane;
SANE_Int level;
SANE_Range dpi_range;
SANE_Range * x_range; /* x range w/out extension */
SANE_Range * y_range; /* y range w/out extension */
SANE_Range fbf_x_range; /* flattbed x range */
SANE_Range fbf_y_range; /* flattbed y range */
SANE_Range adf_x_range; /* autom. document feeder x range */
SANE_Range adf_y_range; /* autom. document feeder y range */
SANE_Range tpu_x_range; /* transparency unit x range */
SANE_Range tpu_y_range; /* transparency unit y range */
Epson_Connection_Type connection;
/* hardware interface type */
SANE_Int *res_list; /* list of resolutions */
SANE_Int res_list_size; /* number of entries in this list */
SANE_Int last_res; /* last selected resolution */
SANE_Int last_res_preview; /* last selected preview resolution */
SANE_Bool extension; /* extension is installed */
SANE_Bool use_extension; /* use the installed extension */
SANE_Bool TPU; /* TPU is installed */
SANE_Bool ADF; /* ADF is installed */
EpsonCmd cmd;
};
typedef struct Epson_Device Epson_Device;
struct Epson_Scanner
{
int fd;
Epson_Device *hw;
SANE_Option_Descriptor opt[NUM_OPTIONS];
unsigned long val[NUM_OPTIONS];
SANE_Parameters params;
SANE_Bool block;
SANE_Bool eof;
SANE_Byte *buf, *end, *ptr;
SANE_Bool canceling;
};
typedef union {
SANE_Word w;
SANE_Word * wa; /* word array */
SANE_String s;
} Option_Value;
struct Epson_Scanner {
int fd;
Epson_Device * hw;
SANE_Option_Descriptor opt [ NUM_OPTIONS];
Option_Value val [ NUM_OPTIONS];
SANE_Parameters params;
SANE_Bool block;
SANE_Bool eof;
SANE_Byte * buf, * end, * ptr;
SANE_Bool canceling;
SANE_Word gamma_table [ 4] [ 256];
};
typedef struct Epson_Scanner Epson_Scanner;

Wyświetl plik

@ -42,6 +42,8 @@
HP Scanner Control Language (SCL).
*/
#define STUBS
extern int sanei_debug_hp;
#include <sane/config.h>
#include <assert.h>
@ -77,10 +79,10 @@ struct hp_data_s
static void
hp_data_resize (HpData this, size_t newsize)
{
assert(!this->frozen);
if (this->bufsiz != newsize)
{
assert(!this->frozen);
this->buf = sanei_hp_realloc(this->buf, newsize);
assert(this->buf);
this->bufsiz = newsize;
@ -402,7 +404,7 @@ hp_accessor_choice_set (HpAccessor _this, HpData data, void * valp)
continue;
strlist++;
if (strcmp(valp, choice->name) == 0)
if (strcmp((const char *)valp, choice->name) == 0)
{
*(HpChoice *)hp_data_data(data, this->data_offset) = choice;
return SANE_STATUS_GOOD;
@ -457,7 +459,7 @@ sanei_hp_accessor_choice_maxsize (HpAccessorChoice this)
SANE_Int size = 0;
for (choice = this->choices; choice; choice = choice->next)
if (strlen(choice->name) >= size)
if ((SANE_Int)strlen(choice->name) >= size)
size = strlen(choice->name) + 1;
return size;
}
@ -485,7 +487,8 @@ sanei_hp_accessor_choice_strlist (HpAccessorChoice this,
}
HpAccessor
sanei_hp_accessor_choice_new (HpData data, HpChoice choices)
sanei_hp_accessor_choice_new (HpData data, HpChoice choices,
hp_bool_t may_change)
{
static const struct hp_accessor_type_s type = {
hp_accessor_choice_get, hp_accessor_choice_set,
@ -495,6 +498,8 @@ sanei_hp_accessor_choice_new (HpData data, HpChoice choices)
size_t count = 0;
_HpAccessorChoice this;
if ( may_change ) data->frozen = 0;
for (choice = choices; choice; choice = choice->next)
count++;
this = sanei_hp_alloc(sizeof(*this) + (count+1) * sizeof(*this->strlist));
@ -793,7 +798,7 @@ sanei_hp_accessor_subvector_new (HpAccessorVector super,
if (!this)
return 0;
assert(nchan > 0 && chan >= 0 && chan < nchan);
assert(chan < nchan);
assert(this->length % nchan == 0);
this->length /= nchan;

Wyświetl plik

@ -54,7 +54,8 @@ HpAccessor sanei_hp_accessor_new (HpData data, size_t size);
HpAccessor sanei_hp_accessor_int_new (HpData data);
HpAccessor sanei_hp_accessor_bool_new (HpData data);
HpAccessor sanei_hp_accessor_fixed_new (HpData data);
HpAccessor sanei_hp_accessor_choice_new(HpData data, HpChoice choices);
HpAccessor sanei_hp_accessor_choice_new(HpData data, HpChoice choices,
hp_bool_t may_change);
HpAccessor sanei_hp_accessor_vector_new(HpData data,
unsigned length, unsigned depth);
HpAccessor sanei_hp_accessor_gamma_vector_new(HpData data,

Wyświetl plik

@ -42,6 +42,8 @@
HP Scanner Control Language (SCL).
*/
#define STUBS
extern int sanei_debug_hp;
#include <sane/config.h>
#include <stdlib.h>
@ -182,7 +184,7 @@ sanei_hp_device_support_probe (HpScsi scsi)
memset (&(info->sclsupport[0]), 0, sizeof (info->sclsupport));
for (k = 0; k < sizeof (sclprobe) / sizeof (sclprobe[0]); k++)
for (k = 0; k < (int)(sizeof (sclprobe) / sizeof (sclprobe[0])); k++)
{
inqid = SCL_INQ_ID(sclprobe[k])-HP_SCL_INQID_MIN;
sclsupport = &(info->sclsupport[inqid]);
@ -224,7 +226,9 @@ sanei_hp_device_probe (enum hp_device_compat_e *compat, HpScsi scsi)
{ SCL_HP_MODEL_8, "4P", HP_COMPAT_4P },
{ SCL_HP_MODEL_9, "5P", HP_COMPAT_5P },
{ SCL_HP_MODEL_10, "Photo Scanner", HP_COMPAT_PS },
{ SCL_HP_MODEL_14, "6200C/6250C", HP_COMPAT_6200C }
{ SCL_HP_MODEL_14, "6200C/6250C", HP_COMPAT_6200C },
{ SCL_HP_MODEL_16, "5200C",HP_COMPAT_5200C },
{ SCL_HP_MODEL_17, "6300C/6350C",HP_COMPAT_6300C }
};
int i;
char buf[8];
@ -248,7 +252,7 @@ sanei_hp_device_probe (enum hp_device_compat_e *compat, HpScsi scsi)
last_device = NULL;
}
*compat = 0;
for (i = 0; i < sizeof(probes)/sizeof(probes[0]); i++)
for (i = 0; i < (int)(sizeof(probes)/sizeof(probes[0])); i++)
{
DBG(1,"probing %s\n",probes[i].model);

Wyświetl plik

@ -57,7 +57,9 @@ enum hp_device_compat_e {
HP_COMPAT_5P = 1 << 7,
HP_COMPAT_5100C = 1 << 8, /* also 4100 C */
HP_COMPAT_PS = 1 << 9, /* Hp PhotoSmart Photo Scanner */
HP_COMPAT_6200C = 1 << 10
HP_COMPAT_6200C = 1 << 10,
HP_COMPAT_5200C = 1 << 11,
HP_COMPAT_6300C = 1 << 12
};
struct hp_device_s

Wyświetl plik

@ -42,6 +42,8 @@
HP Scanner Control Language (SCL).
*/
#define STUBS
extern int sanei_debug_hp;
#include <sane/config.h>
#ifdef HAVE_UNISTD_H
@ -91,12 +93,12 @@ hp_handle_isScanning (HpHandle this)
}
static SANE_Status
hp_handle_startReader (HpHandle this, HpScsi scsi, size_t count,
int mirror, int bytes_per_line, int bpc)
hp_handle_startReader (HpHandle this, HpScsi scsi, HpProcessData *procdata)
{
int fds[2];
sigset_t sig_set, old_set;
struct SIGACTION sa;
SANE_Status status;
assert(this->reader_pid == 0);
this->cancelled = 0;
@ -131,7 +133,10 @@ hp_handle_startReader (HpHandle this, HpScsi scsi, size_t count,
sigdelset(&sig_set, SIGTERM);
sigprocmask(SIG_SETMASK, &sig_set, 0);
_exit(sanei_hp_scsi_pipeout(scsi,fds[1],count,mirror,bytes_per_line,bpc));
/* not closing fds[1] gives an infinite loop on Digital UNIX */
status = sanei_hp_scsi_pipeout(scsi,fds[1],procdata);
close (fds[1]);
_exit(status);
}
static SANE_Status
@ -169,13 +174,17 @@ hp_handle_stopScan (HpHandle this)
}
static SANE_Status
hp_handle_uploadParameters (HpHandle this, HpScsi scsi)
hp_handle_uploadParameters (HpHandle this, HpScsi scsi, int *scan_depth,
hp_bool_t *soft_invert)
{
SANE_Parameters * p = &this->scan_params;
int data_width;
enum hp_device_compat_e compat;
assert(scsi);
*soft_invert = 0;
p->last_frame = SANE_TRUE;
/* inquire resulting size of image after setting it up */
RETURN_IF_FAIL( sanei_hp_scl_inquire(scsi, SCL_PIXELS_PER_LINE,
@ -192,15 +201,24 @@ hp_handle_uploadParameters (HpHandle this, HpScsi scsi)
case HP_SCANMODE_HALFTONE: /* Halftone */
p->format = SANE_FRAME_GRAY;
p->depth = 1;
*scan_depth = 1;
break;
case HP_SCANMODE_GRAYSCALE: /* Grayscale */
p->format = SANE_FRAME_GRAY;
p->depth = 8;
*scan_depth = 8;
break;
case HP_SCANMODE_COLOR: /* RGB */
p->format = SANE_FRAME_RGB;
p->depth = data_width/3;
DBG(1, "hp_handle_uploadParameters: data with %d\n", data_width);
p->depth = (data_width > 24) ? 16 : 8;
*scan_depth = data_width / 3;
/* HP PhotoSmart does not invert when depth > 8. Lets do it by software */
if ( (*scan_depth > 8)
&& (sanei_hp_device_probe (&compat, scsi) == SANE_STATUS_GOOD)
&& (compat & HP_COMPAT_PS) )
*soft_invert = 1;
DBG(1, "hp_handle_uploadParameters: data width %d\n", data_width);
break;
default:
assert(!"Aack");
@ -275,6 +293,8 @@ sanei_hp_handle_control(HpHandle this, SANE_Int optnum,
SANE_Status
sanei_hp_handle_getParameters (HpHandle this, SANE_Parameters *params)
{
SANE_Status status;
if (!params)
return SANE_STATUS_GOOD;
@ -284,8 +304,24 @@ sanei_hp_handle_getParameters (HpHandle this, SANE_Parameters *params)
return SANE_STATUS_GOOD;
}
return sanei_hp_optset_guessParameters(this->dev->options,
this->data, params);
status = sanei_hp_optset_guessParameters(this->dev->options,
this->data, params);
#ifdef INQUIRE_AFTER_SCAN
/* Photosmart: this gives the correct number of lines when doing
an update of the SANE parameters right after a preview */
if (!strcmp("C5100A", this->dev->sanedev.model)) {
HpScsi scsi;
SANE_Parameters * p = &this->scan_params;
if (!FAILED( sanei_hp_scsi_new(&scsi, this->dev->sanedev.name) )) {
RETURN_IF_FAIL( sanei_hp_scl_inquire(scsi, SCL_NUMBER_OF_LINES,
&p->lines,0,0));
sanei_hp_scsi_destroy(scsi);
*params = this->scan_params;
}
}
#endif
return status;
}
SANE_Status
@ -293,8 +329,8 @@ sanei_hp_handle_startScan (HpHandle this)
{
SANE_Status status;
HpScsi scsi;
hp_bool_t mirror_vertical;
hp_bool_t adf_scan;
HpScl scl;
HpProcessData procdata;
/* FIXME: setup preview mode stuff? */
@ -306,7 +342,9 @@ sanei_hp_handle_startScan (HpHandle this)
status = sanei_hp_optset_download(this->dev->options, this->data, scsi);
if (!FAILED(status))
status = hp_handle_uploadParameters(this, scsi);
status = hp_handle_uploadParameters(this, scsi,
&(procdata.bits_per_channel),
&(procdata.invert));
if (FAILED(status))
{
@ -314,14 +352,14 @@ sanei_hp_handle_startScan (HpHandle this)
return status;
}
mirror_vertical = sanei_hp_optset_mirror_vert (this->dev->options, this->data,
scsi);
DBG(1, "start: %s to mirror image vertically\n", mirror_vertical ?
procdata.mirror_vertical =
sanei_hp_optset_mirror_vert (this->dev->options, this->data, scsi);
DBG(1, "start: %s to mirror image vertically\n", procdata.mirror_vertical ?
"Request" : "No request" );
adf_scan = sanei_hp_optset_adf_scan (this->dev->options, this->data, scsi);
scl = sanei_hp_optset_scan_type (this->dev->options, this->data);
DBG(1, "start: %s to mirror image vertically\n", mirror_vertical ?
DBG(1, "start: %s to mirror image vertically\n", procdata.mirror_vertical ?
"Request" : "No request" );
this->bytes_left = ( this->scan_params.bytes_per_line
@ -330,13 +368,15 @@ sanei_hp_handle_startScan (HpHandle this)
DBG(1, "start: %d pixels per line, %d bytes, %d lines high\n",
this->scan_params.pixels_per_line, this->scan_params.bytes_per_line,
this->scan_params.lines);
procdata.bytes_per_line = (int)this->scan_params.bytes_per_line;
procdata.lines = this->scan_params.lines;
status = sanei_hp_scl_startScan(scsi, adf_scan);
status = sanei_hp_scl_startScan(scsi, scl);
if (!FAILED( status ))
status = hp_handle_startReader(this, scsi, this->bytes_left,
(int)mirror_vertical, (int)this->scan_params.bytes_per_line,
(int)this->scan_params.depth);
{
status = hp_handle_startReader(this, scsi, &procdata);
}
sanei_hp_scsi_destroy(scsi);

Wyświetl plik

@ -42,6 +42,8 @@
HP Scanner Control Language (SCL).
*/
#define STUBS
extern int sanei_debug_hp;
#include <sane/config.h>
#include <stdlib.h>
@ -59,7 +61,7 @@ struct hp_alloc_s
hp_byte_t buf[1];
};
static Alloc head[] = {{ head, head }};
static Alloc head[] = {{ head, head, {0} }};
#define DATA_OFFSET (head->buf - (hp_byte_t *)head)
#define VOID_TO_ALLOCP(p) ((Alloc *)((hp_byte_t *)(p) - DATA_OFFSET))

Plik diff jest za duży Load Diff

Wyświetl plik

@ -51,12 +51,6 @@
*
* FIXME: this should become standard
*/
#ifndef SANE_NAME_HALFTONE_TYPE
# define SANE_NAME_HALFTONE_TYPE "halftone-type"
# define SANE_TITLE_HALFTONE_TYPE "Dither Pattern"
# define SANE_DESC_HALFTONE_TYPE "Set the halftoning (dither) pattern."
#endif
#ifndef SANE_NAME_AUTO_THRESHOLD
# define SANE_NAME_AUTO_THRESHOLD "auto-threshold"
# define SANE_TITLE_AUTO_THRESHOLD "Auto Threshold"
@ -76,12 +70,6 @@
# define SANE_DESC_UNLOAD_AFTER_SCAN "Unloads the media after a scan."
#endif
#ifndef SANE_NAME_ADF_SCAN
# define SANE_NAME_ADF_SCAN "scan-from-adf"
# define SANE_TITLE_ADF_SCAN "Scan from ADF"
# define SANE_DESC_ADF_SCAN "Indicate a scan from the ADF."
#endif
#ifndef SANE_NAME_CHANGE_DOC
# define SANE_NAME_CHANGE_DOC "change-document"
# define SANE_TITLE_CHANGE_DOC "Change document"
@ -111,15 +99,8 @@
# define SANE_TITLE_PS_EXPOSURE_TIME "Exposure time"
# define SANE_DESC_PS_EXPOSURE_TIME "A longer exposure time lets the scanner\
collect more light. Suggested use is 175% for prints,\
150% for normal slides; 300% for dark slides and \"Negatives\" for\
negative film"
#endif
#ifndef SANE_NAME_DATA_WIDTH
# define SANE_NAME_DATA_WIDTH "data-width"
# define SANE_TITLE_DATA_WIDTH "Data width"
# define SANE_DESC_DATA_WIDTH "Precision of the analog to digital conversion,\
in bits"
150% for normal slides and \"Negatives\" for\
negative film. For dark (underexposed) images you can increase this value."
#endif
#ifndef SANE_NAME_MATRIX_TYPE
@ -259,9 +240,10 @@ SANE_Status sanei_hp_optset_control (HpOptSet this, HpData data,
SANE_Status sanei_hp_optset_guessParameters (HpOptSet this, HpData data,
SANE_Parameters * p);
enum hp_scanmode_e sanei_hp_optset_scanmode (HpOptSet this, HpData data);
int sanei_hp_optset_data_width (HpOptSet this, HpData data);
hp_bool_t sanei_hp_optset_isImmediate (HpOptSet this, int optnum);
hp_bool_t sanei_hp_optset_mirror_vert (HpOptSet this, HpData data, HpScsi scsi);
hp_bool_t sanei_hp_optset_adf_scan (HpOptSet this, HpData data, HpScsi scsi);
HpScl sanei_hp_optset_scan_type (HpOptSet this, HpData data);
const SANE_Option_Descriptor * sanei_hp_optset_saneoption (HpOptSet this,
HpData data, int optnum);

Wyświetl plik

@ -42,6 +42,8 @@
HP Scanner Control Language (SCL).
*/
#define STUBS
extern int sanei_debug_hp;
#include <sane/config.h>
#include <lalloca.h> /* Must be first */
@ -82,7 +84,6 @@
/*
*
*/
struct hp_scsi_s
{
int fd;
@ -95,11 +96,35 @@ struct hp_scsi_s
hp_byte_t inq_data[HP_SCSI_INQ_LEN];
};
#define HP_TMP_BUF_SIZE (1024*4)
#define HP_WR_BUF_SIZE (1024*4)
typedef struct
{
HpProcessData procdata;
int outfd;
const unsigned char *map;
unsigned char *image_buf; /* Buffer to store complete image (if req.) */
unsigned char *image_ptr;
int image_buf_size;
unsigned char *tmp_buf; /* Buffer for scan data to get even number of bytes */
int tmp_buf_size;
int tmp_buf_len;
unsigned char wr_buf[HP_WR_BUF_SIZE];
unsigned char *wr_ptr;
int wr_buf_size;
int wr_left;
} PROCDATA_HANDLE;
static SANE_Status
hp_nonscsi_write (HpScsi this, hp_byte_t *data, size_t len, HpConnect connect)
{size_t n = -1;
{int n = -1;
if (len <= 0) return SANE_STATUS_GOOD;
@ -135,7 +160,7 @@ hp_nonscsi_write (HpScsi this, hp_byte_t *data, size_t len, HpConnect connect)
static SANE_Status
hp_nonscsi_read (HpScsi this, hp_byte_t *data, size_t *len, HpConnect connect)
{size_t n = -1;
{int n = -1;
if (*len <= 0) return SANE_STATUS_GOOD;
@ -344,6 +369,7 @@ sanei_hp_scsi_new (HpScsi * newp, const char * devname)
sane_strstatus(status));
sanei_scsi_close(new->fd);
sanei_hp_free(new);
return status; /* Fix problem with non-scanner devices */
}
new->bufp = new->buf + HP_SCSI_CMD_LEN;
@ -440,8 +466,8 @@ hp_scsi_flush (HpScsi this)
this->bufp = this->buf;
DBG(10, "scsi_flush: writing %lu bytes:\n", (unsigned long) len);
DBGDUMP(10, data, len);
DBG(16, "scsi_flush: writing %lu bytes:\n", (unsigned long) len);
DBGDUMP(16, data, len);
*this->bufp++ = 0x0A;
*this->bufp++ = 0;
@ -544,8 +570,8 @@ hp_scsi_read (HpScsi this, void * dest, size_t *len)
{
RETURN_IF_FAIL( hp_nonscsi_read (this, dest, len, connect) );
}
DBG(10, "scsi_read: %lu bytes:\n", (unsigned long) *len);
DBGDUMP(10, dest, *len);
DBG(16, "scsi_read: %lu bytes:\n", (unsigned long) *len);
DBGDUMP(16, dest, *len);
return SANE_STATUS_GOOD;
}
@ -604,10 +630,348 @@ hp_get_simulation_map (const char *devname, const HpDeviceInfo *info)
return map;
}
/* Check the native byte order on the local machine */
static hp_bool_t
is_lowbyte_first_byteorder (void)
{unsigned short testvar = 1;
unsigned char *testptr = (unsigned char *)&testvar;
if (sizeof (unsigned short) == 2)
return (testptr[0] == 1);
else if (sizeof (unsigned short) == 4)
return ((testptr[0] == 1) || (testptr[2] == 1));
else
return ( (testptr[0] == 1) || (testptr[2] == 1)
|| (testptr[4] == 1) || (testptr[6] == 1));
}
/* The SANE standard defines that 2-byte data must use the full 16 bit range.
* Byte order returned by the backend must be native byte order.
* Scaling to 16 bit and byte order is achived by hp_scale_to_16bit.
* for >8 bits data, take the two data bytes and scale their content
* to the full 16 bit range, using
* scaled = unscaled << (newlen - oldlen) +
* unscaled >> (oldlen - (newlen - oldlen)),
* with newlen=16 and oldlen the original bit depth.
*/
static void
hp_scale_to_16bit(int count, register unsigned char *data, int depth,
hp_bool_t invert)
{
register unsigned int tmp;
register unsigned int mask;
register hp_bool_t lowbyte_first = is_lowbyte_first_byteorder ();
unsigned int shift1 = 16 - depth;
unsigned int shift2 = 2*depth - 16;
int k;
if (count <= 0) return;
mask = 1;
for (k = 1; k < depth; k++) mask |= (1 << k);
if (lowbyte_first)
{
while (count--) {
tmp = ((((unsigned int)data[0])<<8) | ((unsigned int)data[1])) & mask;
tmp = (tmp << shift1) + (tmp >> shift2);
if (invert) tmp = ~tmp;
*data++ = tmp & 255U;
*data++ = (tmp >> 8) & 255U;
}
}
else /* Highbyte first */
{
while (count--) {
tmp = ((((unsigned int)data[0])<<8) | ((unsigned int)data[1])) & mask;
tmp = (tmp << shift1) + (tmp >> shift2);
if (invert) tmp = ~tmp;
*data++ = (tmp >> 8) & 255U;
*data++ = tmp & 255U;
}
}
}
static PROCDATA_HANDLE *
process_data_init (HpProcessData *procdata, const unsigned char *map,
int outfd, hp_bool_t use_imgbuf)
{PROCDATA_HANDLE *ph = sanei_hp_alloc (sizeof (PROCDATA_HANDLE));
int tsz;
if (ph == NULL) return NULL;
memset (ph, 0, sizeof (*ph));
memcpy (&(ph->procdata), procdata, sizeof (*procdata));
procdata = &(ph->procdata);
tsz = (HP_TMP_BUF_SIZE <= 0) ? procdata->bytes_per_line : HP_TMP_BUF_SIZE;
ph->tmp_buf = sanei_hp_alloc (tsz);
if (ph->tmp_buf == NULL)
{
sanei_hp_free (ph);
return NULL;
}
ph->tmp_buf_size = tsz;
ph->tmp_buf_len = 0;
ph->map = map;
ph->outfd = outfd;
if ( procdata->mirror_vertical || use_imgbuf)
{
tsz = procdata->lines*procdata->bytes_per_line;
ph->image_ptr = ph->image_buf = sanei_hp_alloc (tsz);
if ( !ph->image_buf )
{
procdata->mirror_vertical = 0;
ph->image_buf_size = 0;
DBG(1, "process_scanline_init: Not enough memory to mirror image\n");
}
else
ph->image_buf_size = tsz;
}
ph->wr_ptr = ph->wr_buf;
ph->wr_buf_size = ph->wr_left = sizeof (ph->wr_buf);
return ph;
}
static SANE_Status
process_data_write (PROCDATA_HANDLE *ph, unsigned char *data, int nbytes)
{int ncopy;
if (ph == NULL) return SANE_STATUS_INVAL;
/* Fill up write buffer */
ncopy = ph->wr_left;
if (ncopy > nbytes) ncopy = nbytes;
memcpy (ph->wr_ptr, data, ncopy);
ph->wr_ptr += ncopy;
ph->wr_left -= ncopy;
data += ncopy;
nbytes -= ncopy;
if ( ph->wr_left > 0 ) /* Did not fill up the write buffer ? Finished */
return SANE_STATUS_GOOD;
DBG(12, "process_data_write: write %d bytes\n", ph->wr_buf_size);
if ( write (ph->outfd, ph->wr_buf, ph->wr_buf_size) != ph->wr_buf_size)
{
DBG(1, "process_data_write: write failed: %s\n",
signal_caught ? "signal caught" : strerror(errno));
return SANE_STATUS_IO_ERROR;
}
ph->wr_ptr = ph->wr_buf;
ph->wr_left = ph->wr_buf_size;
/* For large amount of data write it from data-buffer */
while ( nbytes > ph->wr_buf_size )
{
if ( write (ph->outfd, data, ph->wr_buf_size) != ph->wr_buf_size)
{
DBG(1, "process_data_write: write failed: %s\n",
signal_caught ? "signal caught" : strerror(errno));
return SANE_STATUS_IO_ERROR;
}
nbytes -= ph->wr_buf_size;
data += ph->wr_buf_size;
}
if ( nbytes > 0 ) /* Something left ? Save it to (empty) write buffer */
{
memcpy (ph->wr_ptr, data, nbytes);
ph->wr_ptr += nbytes;
ph->wr_left -= nbytes;
}
return SANE_STATUS_GOOD;
}
static SANE_Status
process_scanline (PROCDATA_HANDLE *ph, unsigned char *linebuf,
int bytes_per_line)
{
HpProcessData *procdata;
if (ph == NULL) return SANE_STATUS_INVAL;
procdata = &(ph->procdata);
if ( ph->map )
hp_data_map (ph->map, bytes_per_line, linebuf);
if (procdata->bits_per_channel > 8)
hp_scale_to_16bit( bytes_per_line/2, linebuf,
procdata->bits_per_channel,
procdata->invert);
if ( ph->image_buf )
{
DBG(5, "process_scanline: save in memory\n");
if ( ph->image_ptr+bytes_per_line-1 <= ph->image_buf+ph->image_buf_size-1 )
{
memcpy(ph->image_ptr, linebuf, bytes_per_line);
ph->image_ptr += bytes_per_line;
}
else
{
DBG(1, "process_scanline: would exceed image buffer\n");
}
}
else /* Save scanlines in a bigger buffer. */
{ /* Otherwise we will get performance problems */
RETURN_IF_FAIL ( process_data_write (ph, linebuf, bytes_per_line) );
}
return SANE_STATUS_GOOD;
}
static SANE_Status
process_data (PROCDATA_HANDLE *ph, unsigned char *read_ptr, int nread)
{int bytes_left;
HpProcessData *procdata;
if (nread <= 0) return SANE_STATUS_GOOD;
if (ph == NULL) return SANE_STATUS_INVAL;
procdata = &(ph->procdata);
if ( ph->tmp_buf_len > 0 ) /* Something left ? */
{
bytes_left = ph->tmp_buf_size - ph->tmp_buf_len;
if (nread < bytes_left) /* All to buffer ? */
{
memcpy (ph->tmp_buf+ph->tmp_buf_len, read_ptr, nread);
ph->tmp_buf_len += nread;
return SANE_STATUS_GOOD;
}
memcpy (ph->tmp_buf+ph->tmp_buf_len, read_ptr, bytes_left);
read_ptr += bytes_left;
nread -= bytes_left;
RETURN_IF_FAIL ( process_scanline (ph, ph->tmp_buf, ph->tmp_buf_size) );
ph->tmp_buf_len = 0;
}
while (nread > 0)
{
if (nread >= ph->tmp_buf_size)
{
RETURN_IF_FAIL ( process_scanline (ph, read_ptr, ph->tmp_buf_size) );
read_ptr += ph->tmp_buf_size;
nread -= ph->tmp_buf_size;
}
else
{
memcpy (ph->tmp_buf, read_ptr, nread);
ph->tmp_buf_len = nread;
nread = 0;
}
}
return SANE_STATUS_GOOD;
}
static SANE_Status
process_data_flush (PROCDATA_HANDLE *ph)
{SANE_Status status = SANE_STATUS_GOOD;
HpProcessData *procdata;
unsigned char *image_data;
size_t image_len;
int num_lines, bytes_per_line;
int nbytes;
if (ph == NULL) return SANE_STATUS_INVAL;
if ( ph->tmp_buf_len > 0 )
process_scanline (ph, ph->tmp_buf, ph->tmp_buf_len);
if ( ph->wr_left != ph->wr_buf_size ) /* Something in write buffer ? */
{
nbytes = ph->wr_buf_size - ph->wr_left;
if ( write (ph->outfd, ph->wr_buf, nbytes) != nbytes)
{
DBG(1, "process_data_flush: write failed: %s\n",
signal_caught ? "signal caught" : strerror(errno));
return SANE_STATUS_IO_ERROR;
}
ph->wr_ptr = ph->wr_buf;
ph->wr_left = ph->wr_buf_size;
}
procdata = &(ph->procdata);
if ( ph->image_buf )
{
bytes_per_line = procdata->bytes_per_line;
image_len = (size_t) (ph->image_ptr - ph->image_buf);
num_lines = ((int)(image_len + bytes_per_line-1)) / bytes_per_line;
DBG(3, "process_data_finish: write %d bytes from memory...\n",
(int)image_len);
if ( procdata->mirror_vertical )
{
image_data = ph->image_buf + (num_lines-1) * bytes_per_line;
while (num_lines > 0 )
{
if (write(ph->outfd, image_data, bytes_per_line) != bytes_per_line)
{
DBG(1,"process_data_finish: write from memory failed: %s\n",
signal_caught ? "signal caught" : strerror(errno));
status = SANE_STATUS_IO_ERROR;
break;
}
num_lines--;
image_data -= bytes_per_line;
}
}
else
{
image_data = ph->image_buf;
while (num_lines > 0 )
{
if (write(ph->outfd, image_data, bytes_per_line) != bytes_per_line)
{
DBG(1,"process_data_finish: write from memory failed: %s\n",
signal_caught ? "signal caught" : strerror(errno));
status = SANE_STATUS_IO_ERROR;
break;
}
num_lines--;
image_data += bytes_per_line;
}
}
}
return status;
}
static void
process_data_finish (PROCDATA_HANDLE *ph)
{
DBG(12, "process_data_finish called\n");
if (ph == NULL) return;
if (ph->image_buf != NULL) sanei_hp_free (ph->image_buf);
sanei_hp_free (ph->tmp_buf);
sanei_hp_free (ph);
}
SANE_Status
sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
int mirror, int bytes_per_line,
int bits_per_channel)
sanei_hp_scsi_pipeout (HpScsi this, int outfd, HpProcessData *procdata)
{
/* We will catch these signals, and rethrow them after cleaning up,
* anything not in this list, we will ignore. */
@ -642,6 +1006,7 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
struct SIGACTION sa;
sigset_t old_set, sig_set;
int i;
int bits_per_channel = procdata->bits_per_channel;
#define HP_PIPEBUF 32768
SANE_Status status = SANE_STATUS_GOOD;
@ -650,18 +1015,19 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
void * id;
hp_byte_t cmd[6];
hp_byte_t data[HP_PIPEBUF];
} buf[2], *req;
} buf[2], *req = NULL;
int reqs_completed = 0;
int reqs_issued = 0;
int num_lines;
size_t image_len;
char *image_buf = 0, *image_data = 0;
char *image_buf = 0;
char *read_buf = 0;
const HpDeviceInfo *info;
const char *devname = sanei_hp_scsi_devicename (this);
int enable_requests = 1;
int enable_image_buffering = 0;
const unsigned char *map = NULL;
HpConnect connect = HP_CONNECT_SCSI;
PROCDATA_HANDLE *ph = NULL;
size_t count = procdata->lines * procdata->bytes_per_line;
RETURN_IF_FAIL( hp_scsi_flush(this) );
@ -672,6 +1038,7 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
if ( info->config_is_up )
{
enable_requests = info->config.use_scsi_request;
enable_image_buffering = info->config.use_image_buffering;
connect = info->config.connect;
}
else
@ -694,7 +1061,7 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
sigfillset(&sa.sa_mask);
sigemptyset(&sig_set);
for (i = 0; i < HP_NSIGS; i++)
for (i = 0; i < (int)(HP_NSIGS); i++)
{
sigaction(kill_sig[i], &sa, &old_handler[i]);
sigaddset(&sig_set, kill_sig[i]);
@ -702,15 +1069,13 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
signal_caught = 0;
sigprocmask(SIG_UNBLOCK, &sig_set, 0);
if ( mirror )
{
image_buf = image_data = sanei_hp_alloc ( count );
if ( !image_buf )
{
mirror = 0;
DBG(1, "do_read: Not enough memory to mirror image\n");
}
}
ph = process_data_init (procdata, map, outfd, enable_image_buffering);
if ( ph == NULL )
{
DBG(1, "do_read: Error with process_data_init()\n");
goto quit;
}
DBG(1, "do_read: Start reading data from scanner\n");
@ -766,29 +1131,12 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
if (signal_caught)
goto quit;
if ( map )
hp_data_map (map, (int)req->len, (unsigned char *)req->data);
if ( mirror )
{
DBG(3, "do_read: got %lu bytes, save in memory...\n",
(unsigned long) req->len);
memcpy(image_data, req->data, req->len);
image_data += req->len;
}
else
{
DBG(3, "do_read: got %lu bytes, writing...\n",
(unsigned long) req->len);
if (write(outfd, req->data, req->len) != req->len)
{
if (signal_caught)
goto quit;
DBG(1, "do_read: write failed: %s\n", strerror(errno));
status = SANE_STATUS_IO_ERROR;
goto quit;
}
}
status = process_data (ph, (unsigned char *)req->data, (int)req->len);
if ( status != SANE_STATUS_GOOD )
{
DBG(1,"do_read: Error in process_data\n");
goto quit;
}
}
}
else /* Read directly */
@ -828,58 +1176,22 @@ sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
continue;
}
if ( map )
hp_data_map (map, (int)nread, (unsigned char *)read_buf);
if ( mirror )
status = process_data (ph, (unsigned char *)read_buf, (int)nread);
if ( status != SANE_STATUS_GOOD )
{
DBG(3, "do_read: got %lu bytes, save in memory...\n",
(unsigned long) nread);
memcpy(image_data, read_buf, nread);
image_data += nread;
}
else
{
DBG(3, "do_read: got %lu bytes, writing...\n",
(unsigned long) nread);
if (write(outfd, read_buf, nread) != nread)
{
if (signal_caught)
goto quit;
DBG(1, "do_read: write failed: %s\n", strerror(errno));
status = SANE_STATUS_IO_ERROR;
goto quit;
}
DBG(1,"do_read: Error in process_data\n");
goto quit;
}
count -= nread;
}
}
if ( mirror )
{
image_len = (size_t) (image_data - image_buf);
num_lines = ((int)(image_len+bytes_per_line-1)) / bytes_per_line;
image_data = image_buf + (num_lines-1) * bytes_per_line;
DBG(3, "do_read: write %d bytes from memory...\n", (int)image_len);
while (num_lines > 0 )
{
if (write(outfd, image_data, bytes_per_line) != bytes_per_line)
{
if (signal_caught)
goto quit;
DBG(1,"do_read: write from memory failed: %s\n", strerror(errno));
status = SANE_STATUS_IO_ERROR;
goto quit;
}
num_lines--;
image_data -= bytes_per_line;
}
}
process_data_flush (ph);
quit:
process_data_finish (ph);
if ( image_buf ) sanei_hp_free ( image_buf );
if ( read_buf ) sanei_hp_free ( read_buf );
@ -895,7 +1207,7 @@ quit:
sigfillset(&sig_set);
sigprocmask(SIG_BLOCK, &sig_set, 0);
for (i = 0; i < HP_NSIGS; i++)
for (i = 0; i < (int)(HP_NSIGS); i++)
sigaction(kill_sig[i], &old_handler[i], 0);
sigprocmask(SIG_SETMASK, &old_set, 0);
@ -981,7 +1293,7 @@ _hp_scl_inq (HpScsi scsi, HpScl scl, HpScl inq_cmnd,
*(int *)valp = val; /* Get integer value */
else
{
if (val > *lengthp)
if (val > (int)*lengthp)
{
DBG(1, "scl_inq: inquiry returned %d bytes, expected <= %lu\n",
val, (unsigned long) *lengthp);
@ -1190,14 +1502,17 @@ sanei_hp_scl_calibrate(HpScsi scsi)
}
SANE_Status
sanei_hp_scl_startScan(HpScsi scsi, hp_bool_t adf_scan)
sanei_hp_scl_startScan(HpScsi scsi, HpScl scl)
{
DBG(1, "sanei_hp_scl_startScan: Start %sscan\n", adf_scan ? "ADF " : "");
char *msg = "";
if ( adf_scan )
RETURN_IF_FAIL( hp_scsi_scl(scsi, SCL_ADF_SCAN, 0) );
else
RETURN_IF_FAIL( hp_scsi_scl(scsi, SCL_START_SCAN, 0) );
if (scl == SCL_ADF_SCAN) msg = " (ADF)";
else if (scl == SCL_XPA_SCAN) msg = " (XPA)";
else scl = SCL_START_SCAN;
DBG(1, "sanei_hp_scl_startScan: Start scan%s\n", msg);
RETURN_IF_FAIL( hp_scsi_scl(scsi, scl, 0) );
return hp_scsi_flush(scsi);
}
@ -1234,7 +1549,7 @@ hp_scl_strerror (int errnum)
"Gross Calibration Error"
};
if (errnum >= 0 && errnum < sizeof(errlist)/sizeof(errlist[0]))
if (errnum >= 0 && errnum < (int)(sizeof(errlist)/sizeof(errlist[0])))
return errlist[errnum];
else
switch(errnum) {

Wyświetl plik

@ -86,6 +86,7 @@
#define SCL_10488 HP_SCL_CONTROL(10488, 'f', 'W')
#define SCL_X_POS HP_SCL_CONTROL(10489, 'f', 'X')
#define SCL_Y_POS HP_SCL_CONTROL(10490, 'f', 'Y')
#define SCL_XPA_SCAN HP_SCL_COMMAND('u', 'D')
#define SCL_SPEED HP_SCL_CONTROL(10950, 'u', 'E')
#define SCL_FILTER HP_SCL_CONTROL(10951, 'u', 'F')
#define SCL_10952 HP_SCL_CONTROL(10952, 'u', 'G')
@ -116,6 +117,8 @@
#define SCL_HP_MODEL_9 HP_SCL_PARAMETER(16)
#define SCL_HP_MODEL_10 HP_SCL_PARAMETER(17)
#define SCL_HP_MODEL_14 HP_SCL_PARAMETER(21)
#define SCL_HP_MODEL_16 HP_SCL_PARAMETER(31)
#define SCL_HP_MODEL_17 HP_SCL_PARAMETER(32)
#define SCL_ADF_CAPABILITY HP_SCL_PARAMETER(24)
#define SCL_ADF_BIN HP_SCL_PARAMETER(25)

Wyświetl plik

@ -56,12 +56,11 @@ const char *sanei_hp_scsi_model (HpScsi this);
const char *sanei_hp_scsi_vendor (HpScsi this);
const char *sanei_hp_scsi_devicename (HpScsi this);
SANE_Status sanei_hp_scsi_pipeout (HpScsi this, int outfd, size_t count,
int mirror, int bytes_per_line,
int bits_per_channel);
SANE_Status sanei_hp_scsi_pipeout (HpScsi this, int outfd,
HpProcessData *pdescr);
SANE_Status sanei_hp_scl_calibrate (HpScsi scsi);
SANE_Status sanei_hp_scl_startScan (HpScsi scsi, hp_bool_t adf_scan);
SANE_Status sanei_hp_scl_startScan (HpScsi scsi, HpScl scl);
SANE_Status sanei_hp_scl_reset (HpScsi scsi);
SANE_Status sanei_hp_scl_clearErrors (HpScsi scsi);
SANE_Status sanei_hp_scl_errcheck (HpScsi scsi);

Wyświetl plik

@ -6,7 +6,6 @@ These are Geoffreys TODOs:
Dither pattern option not working right.
Support 10 & 12 bit modes
More use of FAILED macro , maybe SUCCESS macro ?
Convert to single .h file?
@ -49,7 +48,5 @@ New TODOs:
- rubbish on bottom of scanned image
- too few data that is received on bottom of scanned image for PhotoScanner
- scan time for slides at 2400 dpi is twice as long as under M$-Windows
- for slides and negatives it supports only scan resolutions that are
a multiple of 300. Other resolutions will give images stretched in
y-direction (scan movement). We should only have a selection menu
for the supported resolutions instead of a slider.
Support 10/12-bits for greyscale

Wyświetl plik

@ -43,10 +43,38 @@
HP Scanner Control Language (SCL).
*/
static char *hp_backend_version = "0.82";
static char *hp_backend_version = "0.86";
/* Changes:
V 0.82, 28-Feb-99, Ewald de Witt <ewald@pobox.com>:
V 0.86, 12-Feb-2000, PK:
- fix gcc warnings
- fix problems with bitdepths > 8
- allow hp_data_resize to be called with newsize==bufsiz
(Jens Heise, <heisbeee@calvados.zrz.TU-Berlin.DE>)
- add option enable-image-buffering
V 0.85, 30-Jan-2000, PK:
- correct and enhace data widths > 8 (Ewald de Wit <ewald@pobox.com>)
- enable data width for all scanners
- PhotoSmart: exposure "Off" changed to "Default"
- PhotoSmart: even if max. datawidth 24 is reported, allow 30 bits.
- change keyword -data-width to -depth and use value for bits per sample
- change keyword -halftone-type to -halftone-pattern
- change keyword -scantype to -source
- fix problem with multiple definition of sanei_debug_hp
V 0.83, 04-Jul-99, PK:
- reset scanner before downloading parameters (fixes problem
with sleep mode of scanners)
- fix problem with coredump if non-scanner HP SCSI devices
are connected (CDR)
- option scan-from-adf replaced by scantype normal/adf/xpa
- change value "Film strip" to "Film-strip" for option
--media-type
- PhotoScanner: allow only scanning at multiple of 300 dpi
for scanning slides/film strips. This also fixes a problem with the
preview which uses arbitrary resolutions.
- Marian Szebenyi: close pipe (endless loop on Digital UNIX)
V 0.82, 28-Feb-99, Ewald de Wit <ewald@pobox.com>:
- add options 'exposure time' and 'data width'
V 0.81, 11-Jan-99, PK:
@ -143,15 +171,15 @@ sanei_hp_dbgdump (const void * bufp, size_t len)
int i;
FILE * fp = stderr;
for (offset = 0; offset < len; offset += 16)
for (offset = 0; offset < (int)len; offset += 16)
{
fprintf(fp, " 0x%04X ", offset);
for (i = offset; i < offset + 16 && i < len; i++)
for (i = offset; i < offset + 16 && i < (int)len; i++)
fprintf(fp, " %02X", buf[i]);
while (i++ < offset + 16)
fputs(" ", fp);
fputs(" ", fp);
for (i = offset; i < offset + 16 && i < len; i++)
for (i = offset; i < offset + 16 && i < (int)len; i++)
fprintf(fp, "%c", isprint(buf[i]) ? buf[i] : '.');
fputs("\n", fp);
}
@ -244,6 +272,7 @@ hp_init_config (HpDeviceConfig *config)
{
config->connect = HP_CONNECT_SCSI;
config->use_scsi_request = 1;
config->use_image_buffering = 0;
}
}
@ -318,6 +347,18 @@ sanei_hp_device_info_get (const char *devname)
return 0;
}
HpDevice
sanei_hp_device_get (const char *devname)
{
HpDeviceList ptr;
for (ptr = global.device_list; ptr; ptr = ptr->next)
if (strcmp(sanei_hp_device_sanedevice(ptr->dev)->name, devname) == 0)
return ptr->dev;
return 0;
}
static void
hp_device_info_remove (void)
{
@ -539,6 +580,10 @@ hp_read_config (void)
{
config->use_scsi_request = 0;
}
else if (strcmp (arg2, "enable-image-buffering") == 0)
{
config->use_image_buffering = 1;
}
else
{
DBG(1,"hp_read_config: Invalid option %s\n", arg2);

Wyświetl plik

@ -10,8 +10,8 @@
;
:backend "hp" ; name of backend
:version "0.80" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
:version "0.86" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:manpage "sane-hp" ; name of manpage (if it exists)
:url "http://www.kirchgessner.net/" ; backend's web page
@ -21,21 +21,26 @@
:mfg "HP" ; name a manufacturer
:url "http://www.hp.com/"
:comment "Parallel port/USB scanners not supported"
:model "HP ScanJet Plus" ; name models for above-specified mfg.
:model "HP ScanJet IIc"
:model "HP ScanJet IIp"
:model "HP ScanJet IIcx"
:model "HP ScanJet 3c"
:model "HP ScanJet 4c"
:model "HP ScanJet 6100C"
:model "HP ScanJet 3p"
:model "HP ScanJet 4c"
:model "HP ScanJet 4p"
:model "HP ScanJet 4100C"
:model "HP ScanJet 5p"
:model "HP ScanJet 5100C"
:model "HP ScanJet 5200C"
:model "HP ScanJet 6100C"
:model "HP ScanJet 6200C"
:model "HP ScanJet 6250C"
:model "HP ScanJet 6300C"
:model "HP ScanJet 6350C"
:model "HP PhotoSmart PhotoScanner"
:comment "Parallel port HP ScanJet 5100C/5200C require ppSCSI driver. See http://www.torque.net/parport/ppscsi.html (under development)"
:comment "USB on HP ScanJet 4100C/5200C/6200C/6300C require USB driver. See http://www.jump.net/~dnelson/linux/usb (under development)"
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

Wyświetl plik

@ -108,6 +108,7 @@ typedef struct
{
HpConnect connect;
hp_bool_t use_scsi_request;
hp_bool_t use_image_buffering;
} HpDeviceConfig;
#define HP_SCL_INQID_MIN 10306
@ -145,6 +146,15 @@ typedef struct
HpDeviceInfo *sanei_hp_device_info_get (const char *dev_name);
typedef struct
{
int lines;
int bytes_per_line;
int bits_per_channel;
hp_bool_t mirror_vertical;
hp_bool_t invert;
} HpProcessData;
/* hp-scl.c */
#if INT_MAX > 30000
typedef int HpScl;
@ -169,6 +179,7 @@ typedef const struct hp_accessor_choice_s * HpAccessorChoice;
/* hp-device.c */
typedef struct hp_device_s * HpDevice;
hp_bool_t sanei_hp_device_simulate_get (const char *devname, HpScl scl);
HpDevice sanei_hp_device_get (const char *dev_name);
/* hp-handle.c */
typedef struct hp_handle_s * HpHandle;

27
backend/lhii.desc 100644
Wyświetl plik

@ -0,0 +1,27 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "lhii" ; name of backend
:version "(0.1)" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
; :manpage "sane-lhii" ; name of manpage (if it exists)
:url "ftp://www.cs.ubishops.ca/pub/lhii/" ; backend's web page
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:desc "Linux Drivers for Handheld Scanners" ; name a manufacturer
:url "http://www.willamowius.de/scanner.html"
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

Wyświetl plik

@ -0,0 +1,550 @@
#ifndef M3096G_SCSI_H
#define M3096G_SCSI_H
static const char RCSid_sh[] = "$Header$";
/* sane - Scanner Access Now Easy.
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
This file implements a SANE backend for Fujitsu M3096G
flatbed/ADF scanners. It was derived from the COOLSCAN driver.
Written by Randolph Bentson <bentson@holmsjoen.com> */
/* ------------------------------------------------------------------------- */
/*
* $Log$
* Revision 1.2 2000/03/05 13:55:06 pere
* Merged main branch with current DEVEL_1_9.
*
* Revision 1.1.2.3 2000/02/14 14:20:18 pere
* Make lint_catcher static to avoid link problems with duplicate symbols.
*
* Revision 1.1.2.2 2000/01/26 03:51:45 pere
* Updated backends sp15c (v1.12) and m3096g (v1.11).
*
* Revision 1.6 2000/01/05 05:27:19 bentson
* indent to barfin' GNU style
*
* Revision 1.5 1999/11/24 20:07:10 bentson
* add license verbiage
*
* Revision 1.4 1999/11/23 18:53:15 bentson
* spelling change
*
* Revision 1.3 1999/11/18 18:13:36 bentson
* basic grayscale scanning works
*
* Revision 1.2 1999/11/17 00:36:28 bentson
* basic lineart scanning works
*
* Revision 1.1 1999/11/12 05:42:08 bentson
* can move paper, but not yet scan
*
*/
/****************************************************/
static inline void
setbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
{
*pageaddr = (*pageaddr & ~(mask << shift)) | ((val & mask) << shift);
}
/* ------------------------------------------------------------------------- */
static inline void
resetbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
{
*pageaddr = (*pageaddr & ~(mask << shift)) | (((!val) & mask) << shift);
}
/* ------------------------------------------------------------------------- */
static inline int
getbitfield (unsigned char *pageaddr, int mask, int shift) \
{
return ((*pageaddr >> shift) & mask);
}
/* ------------------------------------------------------------------------- */
static inline int
getnbyte (unsigned char *pnt, int nbytes) \
{
unsigned int result = 0;
int i;
#ifdef DEBUG
assert (nbytes < 5);
#endif
for (i = 0; i < nbytes; i++)
result = (result << 8) | (pnt[i] & 0xff);
return result;
}
/* ------------------------------------------------------------------------- */
static inline void
putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) \
{
int i;
#ifdef DEBUG
assert (nbytes < 5);
#endif
for (i = nbytes - 1; i >= 0; i--)
\
{
pnt[i] = value & 0xff;
value = value >> 8;
}
}
/* ==================================================================== */
/* SCSI commands */
typedef struct
{
char *cmd;
int size;
}
scsiblk;
/* ==================================================================== */
#define RESERVE_UNIT 0x16
#define RELEASE_UNIT 0x17
#define INQUIRY 0x12
#define REQUEST_SENSE 0x03
#define SEND_DIAGNOSTIC 0x1d
#define TEST_UNIT_READY 0x00
#define SET_WINDOW 0x24
#define SET_SUBWINDOW 0xc0
#define OBJECT_POSITION 0x31
#define SEND 0x2a
#define READ 0x28
#define MODE_SELECT 0x15
#define MODE_SENSE 0x1a
#define SCAN 0x1b
/* ==================================================================== */
static unsigned char reserve_unitC[] =
{RESERVE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk reserve_unitB =
{reserve_unitC, sizeof (reserve_unitC)};
/* ==================================================================== */
static unsigned char release_unitC[] =
{RELEASE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk release_unitB =
{release_unitC, sizeof (release_unitC)};
/* ==================================================================== */
static unsigned char inquiryC[] =
{INQUIRY, 0x00, 0x00, 0x00, 0x1f, 0x00};
static scsiblk inquiryB =
{inquiryC, sizeof (inquiryC)};
#define set_IN_return_size(icb,val) icb[0x04]=val
#define set_IN_length(out,n) out[0x04]=n-5
#define get_IN_periph_qual(in) getbitfield(in, 0x07, 5)
#define IN_periph_qual_lun 0x00
#define IN_periph_qual_nolun 0x03
#define get_IN_periph_devtype(in) getbitfield(in, 0x1f, 0)
#define IN_periph_devtype_scanner 0x06
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_additional_length(in) in[0x04]
#define get_IN_vendor(in, buf) strncpy(buf, in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, in + 0x20, 0x04)
/* ==================================================================== */
static unsigned char request_senseC[] =
{REQUEST_SENSE, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk request_senseB =
{request_senseC, sizeof (request_senseC)};
#define set_RS_allocation_length(sb,val) sb[0x04] = (unsigned char)val
/* defines for request sense return block */
#define get_RS_information_valid(b) getbitfield(b + 0x00, 1, 7)
#define get_RS_error_code(b) getbitfield(b + 0x00, 0x7f, 0)
#define get_RS_filemark(b) getbitfield(b + 0x02, 1, 7)
#define get_RS_EOM(b) getbitfield(b + 0x02, 1, 6)
#define get_RS_ILI(b) getbitfield(b + 0x02, 1, 5)
#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0)
#define get_RS_information(b) getnbyte(b+0x03, 4) /* normally 0 */
#define get_RS_additional_length(b) b[0x07] /* always 10 */
#define get_RS_ASC(b) b[0x0c]
#define get_RS_ASCQ(b) b[0x0d]
#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid, always 0 */
#define rs_return_block_size 18 /* Says Nikon */
/* ==================================================================== */
static unsigned char send_diagnosticC[] =
{SEND_DIAGNOSTIC, 0x04, 0x00, 0x00, 0x00, 0x00};
static scsiblk send_diagnosticB =
{send_diagnosticC, sizeof (send_diagnosticC)};
/* ==================================================================== */
static unsigned char test_unit_readyC[] =
{TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk test_unit_readyB =
{test_unit_readyC, sizeof (test_unit_readyC)};
/* ==================================================================== */
static unsigned char set_windowC[] =
{SET_WINDOW, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,};
/* opcode, lun, _____4 X reserved____, transfer length, control byte */
static scsiblk set_windowB =
{set_windowC, sizeof (set_windowC)};
#define set_SW_xferlen(sb, len) putnbyte(sb + 0x06, len, 3)
/* ==================================================================== */
static unsigned char set_subwindowC[] =
{SET_SUBWINDOW};
static scsiblk set_subwindowB =
{set_subwindowC, sizeof (set_subwindowC)};
/* ==================================================================== */
static unsigned char object_positionC[] =
{OBJECT_POSITION, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/* ADF, _____Count_____, ________Reserved______, Ctl */
static scsiblk object_positionB =
{object_positionC, sizeof (object_positionC)};
#define set_OP_autofeed(b,val) setbitfield(b+0x01, 0x07, 0, val)
#define OP_Discharge 0x00
#define OP_Feed 0x01
/* ==================================================================== */
static unsigned char sendC[] =
{SEND, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk sendB =
{sendC, sizeof (sendC)};
#define set_S_datatype_code(sb, val) sb[0x02] = (unsigned char)val
#define S_datatype_imagedatai 0x00
#define S_EX_datatype_LUT 0x01 /* Experiment code */
#define S_EX_datatype_shading_data 0xa0 /* Experiment code */
#define S_user_reg_gamma 0xc0
#define S_device_internal_info 0x03
#define set_S_datatype_qual_upper(sb, val) sb[0x04] = (unsigned char)val
#define S_DQ_none 0x00
#define S_DQ_Rcomp 0x06
#define S_DQ_Gcomp 0x07
#define S_DQ_Bcomp 0x08
#define S_DQ_Reg1 0x01
#define S_DQ_Reg2 0x02
#define S_DQ_Reg3 0x03
#define set_S_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
/*
static unsigned char gamma_user_LUT_LS1K[512] = { 0x00 };
static scsiblk gamma_user_LUT_LS1K_LS1K = {
gamma_user_LUT_LS1K, sizeof(gamma_user_LUT_LS1K)
};
*/
/* ==================================================================== */
static unsigned char readC[] =
{READ, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/* Type, rsvd, type qual, __xfer length__, Ctl */
static scsiblk readB =
{readC, sizeof (readC)};
#define set_R_datatype_code(sb, val) sb[0x02] = val
#define R_datatype_imagedata 0x00
#define R_pixel_size 0x80
#define set_R_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
/* ==================================================================== */
static unsigned char mode_selectC[] =
{MODE_SELECT, 0x10, 0x00, 0x00, 0x00, 0x00};
static scsiblk mode_selectB =
{mode_selectC, sizeof (mode_selectC)};
/* ==================================================================== */
static unsigned char mode_senseC[] =
{MODE_SENSE, 0x18, 0x03, 0x00, 0x00, 0x00, /* PF set, page type 03 */ };
static scsiblk mode_senseB =
{mode_senseC, sizeof (mode_senseC)};
#define set_MS_DBD(b, val) setbitfield(b, 0x01, 3, (val?1:0))
#define set_MS_len(b, val) putnbyte(b+0x04, val, 1)
#define get_MS_MUD(b) getnbyte(b+(0x04+((int)*(b+0x3)))+0x4,2)
/* ==================================================================== */
static unsigned char scanC[] =
{SCAN, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk scanB =
{scanC, sizeof (scanC)};
#define set_SC_xfer_length(sb, val) sb[0x04] = (unsigned char)val
/* ==================================================================== */
/* We use the same structure for both SET WINDOW and GET WINDOW. */
static unsigned char window_parameter_data_blockC[] =
{
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, /* reserved */
0x00, 0x00, /* Window Descriptor Length */
};
static scsiblk window_parameter_data_blockB =
{window_parameter_data_blockC, sizeof (window_parameter_data_blockC)};
#define set_WPDB_wdblen(sb, len) putnbyte(sb + 0x06, len, 2)
#define STD_WDB_LEN 0x28 /* wdb_len if nothing is set by inquiry */
#define used_WDB_size 0x40
#define max_WDB_size 0xff
/* ==================================================================== */
static unsigned char window_descriptor_blockC[] =
{
0x00, /* 0x00 *//* Window Identifier */
#define set_WD_wid(sb, val) sb[0] = val
#define WD_wid_all 0x00 /* Only one supported */
0x00, /* 0x01 *//* reserved, AUTO */
#define set_WD_auto(sb, val) setbitfield(sb + 0x01, 1, 0, val)
#define get_WD_auto(sb) getbitfield(sb + 0x01, 1, 0)
0x00, 0x00, /* 0x02 *//* X resolution in dpi, 0 => 400 */
#define set_WD_Xres(sb, val) putnbyte(sb + 0x02, val, 2)
#define get_WD_Xres(sb) getnbyte(sb + 0x02, 2)
0x00, 0x00, /* 0x04 *//* Y resolution in dpi, 0 => 400 */
#define set_WD_Yres(sb, val) putnbyte(sb + 0x04, val, 2)
#define get_WD_Yres(sb) getnbyte(sb + 0x04, 2)
0x00, 0x00,
0x00, 0x00, /* 0x06 *//* Upper Left X in inch/1200 */
#define set_WD_ULX(sb, val) putnbyte(sb + 0x06, val, 4)
#define get_WD_ULX(sb) getnbyte(sb + 0x06, 4)
0x00, 0x00,
0x00, 0x00, /* 0x0a *//* Upper Left Y in inch/1200 */
#define set_WD_ULY(sb, val) putnbyte(sb + 0x0a, val, 4)
#define get_WD_ULY(sb) getnbyte(sb + 0x0a, 4)
0x00, 0x00,
0x00, 0x00, /* 0x0e *//* Width */
#define set_WD_width(sb, val) putnbyte(sb + 0x0e, val, 4)
#define get_WD_width(sb) getnbyte(sb + 0x0e, 4)
#define WD_width 10200
0x00, 0x00,
0x00, 0x00, /* 0x12 *//* Length */
#define set_WD_length(sb, val) putnbyte(sb + 0x12, val, 4)
#define get_WD_length(sb) getnbyte(sb + 0x12, 4)
#define WD_length 13200
0x00, /* 0x16 *//* Brightness */
#define set_WD_brightness(sb, val) sb[0x16] = val
#define get_WD_brightness(sb) sb[0x16]
#define WD_brightness 0x80
0x00, /* 0x17 *//* Threshold */
#define set_WD_threshold(sb, val) sb[0x17] = val
#define get_WD_threshold(sb) sb[0x17]
#define WD_threshold 0x80
0x00, /* 0x18 *//* Contrast */
#define set_WD_contrast(sb, val) sb[0x18] = val
#define get_WD_contrast(sb) sb[0x18]
0x05, /* 0x19 *//* Image composition */
#define set_WD_composition(sb, val) sb[0x19] = val
#define get_WD_composition(sb) sb[0x19]
#define WD_comp_LA 0
#define WD_comp_HT 1
#define WD_comp_GS 2
0x08, /* 0x1a *//* Bits/Pixel */
#define set_WD_bitsperpixel(sb, val) sb[0x1a] = val
#define get_WD_bitsperpixel(sb) sb[0x1a]
0x00, 0x00, /* 0x1b *//* Halftone pattern */
#define set_WD_halftone(sb, val) putnbyte(sb + 0x1b, val, 2)
#define get_WD_halftone(sb) getnbyte(sb + 0x1b, 2)
0x00,
/* 0x1d *//*************** STUFF ***************/
#define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val)
#define get_WD_rif(sb) getbitfield(sb + 0x1d, 1, 7)
0x00, 0x00, /* 0x1e *//* bit ordering */
#define set_WD_bitorder(sb, val) putnbyte(sb + 0x1e, val, 2)
#define get_WD_bitorder(sb) getnbyte(sb + 0x1e, 2)
0x00, /* 0x20 *//* compression type */
#define set_WD_compress_type(sb, val) sb[0x20] = val
#define get_WD_compress_type(sb) sb[0x20]
0x00, /* 0x21 *//* compression argument */
#define set_WD_compress_arg(sb, val) sb[0x21] = val
#define get_WD_compress_arg(sb) sb[0x21]
0x00, 0x00,
0x00, 0x00,
0x00, 0x00, /* 0x22 *//* reserved */
0x00, /* 0x28 *//* vendor id code */
#define set_WD_vendor_id_code(sb, val) sb[0x28] = val
#define get_WD_vendor_id_code(sb) sb[0x28]
0x00, /* 0x29 *//* reserved */
0x00, /* 0x2a *//* Outline */
#define set_WD_outline(sb, val) sb[0x2a] = val
#define get_WD_outline(sb) sb[0x2a]
0x00, /* 0x2b *//* Emphasis */
#define set_WD_emphasis(sb, val) sb[0x2b] = val
#define get_WD_emphasis(sb) sb[0x2b]
0x00, /* 0x2c *//* Automatic separation */
#define set_WD_auto_sep(sb, val) sb[0x2c] = val
#define get_WD_auto_sep(sb) sb[0x2c]
0x00, /* 0x2d *//* Mirroring */
#define set_WD_mirroring(sb, val) sb[0x2d] = val
#define get_WD_mirroring(sb) sb[0x2d]
0x00, /* 0x2e *//* Variance rate for dynamic threshold */
#define set_WD_var_rate_dyn_thresh(sb, val) sb[0x2e] = val
#define get_WD_var_rate_dyn_thresh(sb) sb[0x2e]
0x00, /* 0x2f *//* reserved */
0x00, /* 0x30 *//* reserved */
0x00, /* 0x31 *//* reserved */
0x00, /* 0x32 *//* white level follower */
#define set_WD_white_level_follow(sb, val) sb[0x32] = val
#define get_WD_white_level_follow(sb) sb[0x32]
0x00, 0x00, /* 0x33 *//* subwindow list */
#define set_WD_subwindow_list(sb, val) putnbyte(sb + 0x33, val, 2)
#define get_WD_subwindow_list(sb) getnbyte(sb + 0x33, 2)
0x00, /* 0x35 *//* paper size */
#define set_WD_paper_size(sb, val) sb[0x35] = val
#define get_WD_paper_size(sb) sb[0x35]
0x00, 0x00,
0x00, 0x00, /* 0x36 *//* paper width X */
#define set_WD_paper_width_X(sb, val) putnbyte(sb + 0x36, val, 4)
#define get_WD_paper_width_X(sb) getnbyte(sb + 0x36, 4)
0x00, 0x00,
0x00, 0x00, /* 0x3a *//* paper length Y */
#define set_WD_paper_length_Y(sb, val) putnbyte(sb+0x3a, val, 4)
#define get_WD_paper_length_Y(sb) getnbyte(sb+0x3a, 4)
0x00, /* 0x3e *//* reserved */
0x00, /* 0x3f *//* reserved */
/* 0x40 (last) */
};
static scsiblk window_descriptor_blockB =
{window_descriptor_blockC, sizeof (window_descriptor_blockC)};
/* ==================================================================== */
/*#define set_WDB_length(length) (window_descriptor_block.size = (length)) */
#define WPDB_OFF(b) (b + set_window.size)
#define WDB_OFF(b, n) (b + set_window.size + \
window_parameter_data_block.size + \
( window_descriptor_block.size * (n - 1) ) )
#define set_WPDB_wdbnum(sb,n) set_WPDB_wdblen(sb,window_descriptor_block.size*n)
/* ==================================================================== */
/* Length of internal info structure */
#define DI_length 256
/* Functions for picking out data from the internal info structure */
#define get_DI_ADbits(b) getnbyte(b + 0x00, 1)
#define get_DI_Outputbits(b) getnbyte(b + 0x01, 1)
#define get_DI_MaxResolution(b) getnbyte(b + 0x02, 2)
#define get_DI_Xmax(b) getnbyte(b + 0x04, 2)
#define get_DI_Ymax(b) getnbyte(b + 0x06, 2)
#define get_DI_Xmaxpixel(b) getnbyte(b + 0x08, 2)
#define get_DI_Ymaxpixel(b) getnbyte(b + 0x0a, 2)
#define get_DI_currentY(b) getnbyte(b + 0x10, 2)
#define get_DI_currentFocus(b) getnbyte(b + 0x12, 2)
#define get_DI_currentscanpitch(b) getnbyte(b + 0x14, 1)
#define get_DI_autofeeder(b) getnbyte(b + 0x1e, 1)
#define get_DI_analoggamma(b) getnbyte(b + 0x1f, 1)
#define get_DI_deviceerror0(b) getnbyte(b + 0x40, 1)
#define get_DI_deviceerror1(b) getnbyte(b + 0x41, 1)
#define get_DI_deviceerror2(b) getnbyte(b + 0x42, 1)
#define get_DI_deviceerror3(b) getnbyte(b + 0x43, 1)
#define get_DI_deviceerror4(b) getnbyte(b + 0x44, 1)
#define get_DI_deviceerror5(b) getnbyte(b + 0x45, 1)
#define get_DI_deviceerror6(b) getnbyte(b + 0x46, 1)
#define get_DI_deviceerror7(b) getnbyte(b + 0x47, 1)
#define get_DI_WBETR_R(b) getnbyte(b + 0x80, 2) /* White balance exposure time variable R */
#define get_DI_WBETR_G(b) getnbyte(b + 0x82, 2)
#define get_DI_WBETR_B(b) getnbyte(b + 0x84, 2)
#define get_DI_PRETV_R(b) getnbyte(b + 0x88, 2) /* Prescan result exposure tim4e variable R */
#define get_DI_PRETV_G(b) getnbyte(b + 0x8a, 2)
#define get_DI_PRETV_B(b) getnbyte(b + 0x8c, 2)
#define get_DI_CETV_R(b) getnbyte(b + 0x90, 2) /* Current exposure time variable R */
#define get_DI_CETV_G(b) getnbyte(b + 0x92, 2)
#define get_DI_CETV_B(b) getnbyte(b + 0x94, 2)
#define get_DI_IETU_R(b) getnbyte(b + 0x98, 1) /* Internal exposure time unit R */
#define get_DI_IETU_G(b) getnbyte(b + 0x99, 1)
#define get_DI_IETU_B(b) getnbyte(b + 0x9a, 1)
#define get_DI_limitcondition(b) getnbyte(b + 0xa0, 1)
#define get_DI_offsetdata_R(b) getnbyte(b + 0xa1, 1)
#define get_DI_offsetdata_G(b) getnbyte(b + 0xa2, 1)
#define get_DI_offsetdata_B(b) getnbyte(b + 0xa3, 1)
#define get_DI_poweron_errors(b,to) memcpy(to, (b + 0xa8), 8)
/* ==================================================================== */
static scsiblk *lint_catcher[] =
{&reserve_unitB,
&release_unitB,
&inquiryB,
&request_senseB,
&send_diagnosticB,
&test_unit_readyB,
&set_windowB,
&set_subwindowB,
&object_positionB,
&sendB,
&readB,
&mode_selectB,
&mode_senseB,
&scanB,
&window_parameter_data_blockB,
&window_descriptor_blockB};
#endif /* M3096G_SCSI_H */

1973
backend/m3096g.c 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1 @@
scsi FUJITSU

Wyświetl plik

@ -0,0 +1,25 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "m3096g" ; name of backend
:version "1.11" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:manpage "sane-fujitsu" ; name of manpage (if it exists)
:url "http://www.aa.net/~bentson/sane.html" ; backend's web page
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:mfg "Fujitsu" ; name a manufacturer
:url "http://www.fujitsu.com/scanners.html"
:model "M3096G" ; name models for above-specified mfg.

318
backend/m3096g.h 100644
Wyświetl plik

@ -0,0 +1,318 @@
#ifndef M3096G_H
#define M3096G_H
static const char RCSid_h[] = "$Header$";
/* sane - Scanner Access Now Easy.
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
This file implements a SANE backend for Fujitsu M3096G
flatbed/ADF scanners. It was derived from the COOLSCAN driver.
Written by Randolph Bentson <bentson@holmsjoen.com> */
/* ------------------------------------------------------------------------- */
/*
* $Log$
* Revision 1.2 2000/03/05 13:55:07 pere
* Merged main branch with current DEVEL_1_9.
*
* Revision 1.1.2.2 2000/01/26 03:51:47 pere
* Updated backends sp15c (v1.12) and m3096g (v1.11).
*
* Revision 1.8 2000/01/25 16:25:34 bentson
* clean-up compiler warnings
*
* Revision 1.7 2000/01/05 05:26:00 bentson
* indent to barfin' GNU style
*
* Revision 1.6 1999/11/24 20:06:58 bentson
* add license verbiage
*
* Revision 1.5 1999/11/23 18:47:43 bentson
* add some constraint checking
*
* Revision 1.4 1999/11/19 17:30:07 bentson
* enhance control of device; remove unused cruft
*
* Revision 1.3 1999/11/18 18:13:36 bentson
* basic grayscale scanning works
*
* Revision 1.2 1999/11/17 00:36:22 bentson
* basic lineart scanning works
*
* Revision 1.1 1999/11/12 05:41:45 bentson
* can move paper, but not yet scan
*
*/
static int num_devices;
static struct m3096g *first_dev;
enum m3096g_Option
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_SOURCE,
OPT_MODE,
OPT_TYPE,
OPT_X_RES,
OPT_Y_RES,
OPT_PRESCAN,
OPT_PREVIEW_RES,
OPT_GEOMETRY_GROUP,
OPT_TL_X, /* in mm/2^16 */
OPT_TL_Y, /* in mm/2^16 */
OPT_BR_X, /* in mm/2^16 */
OPT_BR_Y, /* in mm/2^16 */
OPT_ENHANCEMENT_GROUP,
OPT_AVERAGING,
OPT_BRIGHTNESS,
OPT_THRESHOLD,
OPT_ADVANCED_GROUP,
OPT_PREVIEW,
/* must come last: */
NUM_OPTIONS
};
struct m3096g
{
struct m3096g *next;
SANE_Option_Descriptor opt[NUM_OPTIONS];
SANE_Device sane;
char vendor[9];
char product[17];
char version[5];
char *devicename; /* name of the scanner device */
int sfd; /* output file descriptor, scanner device */
int pipe;
int scanning; /* "in progress" flag */
int autofeeder; /* detected */
int use_adf; /* requested */
int reader_pid; /* child is running */
int prescan; /* ??? */
/***** terms for "set window" command *****/
int x_res; /* resolution in */
int y_res; /* pixels/inch */
int tl_x; /* top left position, */
int tl_y; /* in inch/1200 units */
int br_x; /* bottom right position, */
int br_y; /* in inch/1200 units */
int brightness;
int threshold;
int contrast;
int composition;
int bitsperpixel;
int halftone;
int rif;
int bitorder;
int compress_type;
int compress_arg;
int vendor_id_code;
int outline;
int emphasis;
int auto_sep;
int mirroring;
int var_rate_dyn_thresh;
int white_level_follow;
int subwindow_list;
int paper_size;
int paper_width_X;
int paper_length_Y;
/***** end of "set window" terms *****/
/* buffer used for scsi-transfer */
unsigned char *buffer;
unsigned int row_bufsize;
};
/* ------------------------------------------------------------------------- */
#define MM_PER_INCH 25.4
#define length_quant SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))
#define mmToIlu(mm) ((mm) / length_quant)
#define iluToMm(ilu) ((ilu) * length_quant)
#define M3096G_CONFIG_FILE "m3096g.conf"
/* ------------------------------------------------------------------------- */
static void
m3096g_do_inquiry (struct m3096g *s);
/* ------------------------------------------------------------------------- */
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize);
SANE_Status
sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only);
SANE_Status
sane_open (SANE_String_Const name, SANE_Handle * handle);
SANE_Status
sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking);
SANE_Status
sane_get_select_fd (SANE_Handle h, SANE_Int * fdp);
const SANE_Option_Descriptor *
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option);
SANE_Status
sane_control_option (SANE_Handle handle, SANE_Int option,
SANE_Action action, void *val, SANE_Int * info);
SANE_Status
sane_start (SANE_Handle handle);
SANE_Status
sane_get_parameters (SANE_Handle handle, SANE_Parameters * params);
SANE_Status
sane_read (SANE_Handle handle, SANE_Byte * buf,
SANE_Int max_len, SANE_Int * len);
void
sane_cancel (SANE_Handle h);
void
sane_close (SANE_Handle h);
void
sane_exit (void);
/* ------------------------------------------------------------------------- */
static SANE_Status
attach_scanner (const char *devicename, struct m3096g **devp);
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg);
static int
request_sense_parse (u_char * sensed_data);
static int
m3096g_identify_scanner (struct m3096g *s);
static void
m3096g_do_inquiry (struct m3096g *s);
static int
do_scsi_cmd (int fd, char *cmd, int cmd_len, char *out, size_t out_len);
static void
hexdump (int level, char *comment, unsigned char *p, int l);
static SANE_Status
init_options (struct m3096g *scanner);
static int
m3096g_check_values (struct m3096g *s);
static int
m3096g_grab_scanner (struct m3096g *s);
static int
m3096g_free_scanner (struct m3096g *s);
static int
wait_scanner (struct m3096g *s);
static int
m3096g_object_position (struct m3096g *s);
static SANE_Status
do_cancel (struct m3096g *scanner);
static void
swap_res (struct m3096g *s);
static int
m3096g_object_discharge (struct m3096g *s);
static int
m3096g_set_window_param (struct m3096g *s, int prescan);
static size_t
max_string_size (const SANE_String_Const strings[]);
static int
m3096g_start_scan (struct m3096g *s);
static int
reader_process (struct m3096g *scanner, int pipe_fd);
static SANE_Status
do_eof (struct m3096g *scanner);
static int
pixels_per_line (struct m3096g *s);
static int
lines_per_scan (struct m3096g *s);
static int
bytes_per_line (struct m3096g *s);
static void
m3096g_trim_rowbufsize (struct m3096g *s);
static int
m3096g_read_data_block (struct m3096g *s, unsigned int length);
static SANE_Status
attach_one (const char *name);
static int
m3096g_valid_number (int value, const int *acceptable);
#endif /* M3096G_H */

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,4 +1,7 @@
#Uncomment following line to disable "clever precalibration" routines...
# Uncomment following line to disable "real calibration" routines...
#norealcal
# Uncomment following line to disable "clever precalibration" routines...
#noprecal
# Using "norealcal" will revert backend to pre-0.11.0 calibration code.
scsi * * Scanner
/dev/scanner

Wyświetl plik

@ -1,5 +1,5 @@
:backend "microtek"
:version "0.10"
:version "0.12.0"
:status :beta
:manpage "sane-microtek"
:url "http://www.mir.com/mtek/"
@ -14,6 +14,10 @@
:comment "3-pass"
:model "Scanmaker 35t+"
:comment "slide-scanner"
:model "Scanmaker 45t"
:comment "slide-scanner"
:model "Scanmaker 35"
:comment "slide-scanner"
:model "Scanmaker III"
:model "Scanmaker IISP"
:model "Scanmaker IIHR"
@ -26,12 +30,15 @@
:comment "untested (color?)"
:model "Scanmaker 600G(S)"
:comment "gray only (see manpage)"
:model "Color PageWiz"
:comment "sheet-fed (preliminary)"
:mfg "Agfa"
:url "http://www.agfa.com/"
:model "Arcus II"
:comment "Arcus *II*, not Arcus!"
:model "StudioScan"
:model "StudioScan II"
:comment "not quite functional yet"
:model "StudioScan IIsi"
:comment "not quite functional yet"
:model "DuoScan"
:comment "preliminary"

Wyświetl plik

@ -3,7 +3,7 @@
microtek.h
This file (C) 1997 Matthew Marjanovic
This file (C) 1999 Matthew Marjanovic
This file is part of the SANE package.
@ -74,9 +74,9 @@ enum Mtek_Option
OPT_EXP_RES,
OPT_NEGATIVE, /* -n */
OPT_SPEED, /* -v */
/* OPT_FORCE_3PASS,*/
OPT_SOURCE, /* -t */
OPT_PREVIEW,
OPT_CALIB_ONCE,
OPT_GEOMETRY_GROUP, /* -f .... */
OPT_TL_X, /* top-left x */
@ -185,7 +185,7 @@ typedef struct Microtek_Info {
#define MI_ENH_CAP_MIDTONE 0x02 /* can adjust midtone */
SANE_Byte enhance_cap;
SANE_Int max_lookup_size; /* max. size of gamma LUT */
SANE_Int max_gamma_val; /* max. value of a gamma LUT element */
SANE_Int max_gamma_bit_depth; /* max. bits of a gamma LUT element */
SANE_Int gamma_size; /* size (bytes) of each LUT element */
SANE_Byte fast_color_preview; /* allows fast color preview? */
SANE_Byte xfer_format_select; /* allows select of transfer format? */
@ -291,14 +291,22 @@ typedef struct Microtek_Scanner {
SANE_Bool midtone_support;
SANE_Int paper_length; /* whatever unit */
SANE_Bool do_clever_precal;
SANE_Bool do_clever_precal; /* calibrate scanner once, via fake scan */
SANE_Bool do_real_calib; /* calibrate via magic commands */
SANE_Bool calib_once; /* ...only calibrate magically once */
SANE_Bool allow_calibrate;
SANE_Bool onepass;
SANE_Bool prescan, allowbacktrack;
SANE_Bool reversecolors;
SANE_Bool fastprescan;
SANE_Int bits_per_color;
SANE_Bool gamma_entries;
SANE_Int gamma_entries;
SANE_Int gamma_entry_size;
SANE_Int gamma_bit_depth;
/* SANE_Int gamma_max_entry;*/
SANE_Range gamma_entry_range;
/* ...set by sane_get_parameters (i.e. parameters specified by options) */
SANE_Parameters params; /* format, lastframe, lines, depth, ppl, bpl */
@ -337,7 +345,6 @@ typedef struct Microtek_Scanner {
SANE_Int pixel_bpl; /* bytes per line, pixels */
SANE_Int header_bpl; /* bytes per line, headers */
SANE_Int ppl; /* pixels per line */
/* SANE_Int lines; lines, left to scan */
SANE_Int planes; /* color planes */
SANE_Bool doexpansion;

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,25 @@
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "musteka4s2" ; name of backend
:version "(0.3)" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:manpage "sane-musteka4s2" ; name of manpage (if it exists)
:url "http://www.i2k.com/~jeffd/a4s2/" ; backend's web page
:devicetype :scanner
:mfg "Mustek" ; name a manufacturer
:url "http://www.mustek.com/"
:model "MFS-600IIIP" ; name models for above-specified mfg.
:comment "Mustek 600 III EP Plus"
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

15
backend/nec.desc 100644
Wyświetl plik

@ -0,0 +1,15 @@
:backend "nec" ; name of backend
:version "(0.10)" ; version of backend
:status :new ; :alpha, :beta, :stable, :new
; Currently no home page. Email author to get it.
:url "mailto:fukuda@avm.nhe.nec.co.jp" ; backend's homepage
:devicetype :scanner
:mfg "NEC" ; name a manufacturer
:url "http://www.nec.co.jp/"
:model "PC-IN500/4C" ; name models for above-specified mfg.
:comment "PC-IN500/4C was sold only in JAPAN"
:model "PC-IN600,700,800 series"; name models for above-specified mfg.
:comment "PC-IN600,700,800 series is not supprted"

Wyświetl plik

@ -1,2 +1,12 @@
:backend "pint" ; name of backend
; :version "0.?" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
; :url "" ; backend's homepage
:manpage "sane-pint"
:devicetype :api
; name models for above-specified mfg.
:desc "Scanners with the machine-independent PINT interface"
; :comment ""

Wyświetl plik

@ -10,7 +10,7 @@
;
:backend "plustek" ; name of backend
:version "0.11" ; version of backend
:version "(0.27)" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
;;:manpage "sane-umax" ; name of manpage (if it exists)
:url "http://www.efn.org/~rick/plustek/" ; backend's web page

Wyświetl plik

@ -1,2 +1,14 @@
:backend "qcam" ; name of backend
; :version "0.?" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
; :url "" ; backend's homepage
:manpage "sane-qcam"
:devicetype :vidcam
:mfg "Connectix" ; name a manufacturer
:url "http://www.connectix.com/"
:model "Color QuickCam" ; name models for above-specified mfg.
:comment "Require root privileges."
:model "Greyscale QuickCam" ; name models for above-specified mfg.
:comment "Require root privileges. Partly working."

Wyświetl plik

@ -75,6 +75,7 @@
static int num_devices = 0;
static Ricoh_Device *first_dev = NULL;
static Ricoh_Scanner *first_handle = NULL;
static int is50 = 0;
#include "ricoh-scsi.c"
@ -141,12 +142,14 @@ attach (const char *devnam, Ricoh_Device ** devp)
if (ibuf.devtype != 6
|| strncmp (ibuf.vendor, "RICOH", 5) != 0
|| strncmp (ibuf.product, "IS60", 4) != 0)
|| (strncmp (ibuf.product, "IS50", 4) != 0
&& strncmp (ibuf.product, "IS60", 4) != 0))
{
DBG (1, "attach: device doesn't look like the Ricoh scanner I know\n");
sanei_scsi_close (fd);
return (SANE_STATUS_INVAL);
}
is50 = (strncmp (ibuf.product, "IS50", 4) == 0);
DBG (3, "attach: sending TEST_UNIT_READY\n");
status = test_unit_ready (fd);
@ -241,7 +244,10 @@ attach (const char *devnam, Ricoh_Device ** devp)
if (wbuf.image_comp == RICOH_GRAYSCALE || wbuf.image_comp == RICOH_DITHERED_MONOCHROME)
{
dev->info.brightness_default = 256 - wbuf.brightness;
dev->info.contrast_default = 256 - wbuf.contrast;
if (is50)
dev->info.contrast_default = wbuf.contrast;
else
dev->info.contrast_default = 256 - wbuf.contrast;
}
else /* wbuf.image_comp == RICOH_BINARY_MONOCHROME */
{
@ -348,6 +354,10 @@ init_options (Ricoh_Scanner * s)
s->opt[OPT_X_RESOLUTION].constraint_type = SANE_CONSTRAINT_RANGE;
s->opt[OPT_X_RESOLUTION].constraint.range = &is60_res_range;
s->val[OPT_X_RESOLUTION].w = s->hw->info.xres_default;
if (is50)
s->opt[OPT_X_RESOLUTION].constraint.range = &is50_res_range;
else
s->opt[OPT_X_RESOLUTION].constraint.range = &is60_res_range;
/* y resolution */
s->opt[OPT_Y_RESOLUTION].name = "Y" SANE_NAME_SCAN_RESOLUTION;
@ -356,8 +366,11 @@ init_options (Ricoh_Scanner * s)
s->opt[OPT_Y_RESOLUTION].type = SANE_TYPE_INT;
s->opt[OPT_Y_RESOLUTION].unit = SANE_UNIT_DPI;
s->opt[OPT_Y_RESOLUTION].constraint_type = SANE_CONSTRAINT_RANGE;
s->opt[OPT_Y_RESOLUTION].constraint.range = &is60_res_range;
s->val[OPT_Y_RESOLUTION].w = s->hw->info.yres_default;
if (is50)
s->opt[OPT_Y_RESOLUTION].constraint.range = &is50_res_range;
else
s->opt[OPT_Y_RESOLUTION].constraint.range = &is60_res_range;
/* "Geometry" group: */
s->opt[OPT_GEOMETRY_GROUP].title = "Geometry";
@ -833,7 +846,10 @@ sane_start (SANE_Handle handle)
if (wbuf.image_comp == RICOH_DITHERED_MONOCHROME)
wbuf.mrif_filtering_gamma_id = (SANE_Byte) 0x10;
wbuf.brightness = 256 - (SANE_Byte) s->brightness;
wbuf.contrast = 256 - (SANE_Byte) s->contrast;
if (is50)
wbuf.contrast = (SANE_Byte) s->contrast;
else
wbuf.contrast = 256 - (SANE_Byte) s->contrast;
}
else /* wbuf.image_comp == RICOH_BINARY_MONOCHROME */
{

27
backend/ricoh.desc 100644
Wyświetl plik

@ -0,0 +1,27 @@
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "ricoh" ; name of backend
:version "?" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;
; Sorry, no manpage yet. Anybody want to write one?
;:manpage "sane-ricoh" ; name of manpage (if it exists)
:devicetype :scanner
:mfg "Ricoh" ; name a manufacturer
:url "http://www.ricoh.com/"
:model "Ricoh IS50" ; name models for above-specified mfg.
:comment "?"
:model "Ricoh IS60" ; name models for above-specified mfg.
:comment "?"

Wyświetl plik

@ -79,6 +79,12 @@ static const SANE_Range u8_range =
255, /* maximum */
0 /* quantization */
};
static const SANE_Range is50_res_range =
{
75, /* minimum */
400, /* maximum */
0 /* quantization */
};
static const SANE_Range is60_res_range =
{

Wyświetl plik

@ -1 +1,12 @@
:backend "s9036" ; name of backend
; :version "0.XXX" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
; :url "" ; backend's homepage
; :manpage "sane-XXX"
:devicetype :vidcam
:mfg "Siemens" ; name a manufacturer
:url "http://www.siemens.com/"
:model "9036 Flatbed scanner" ; name models for above-specified mfg.
; :comment ""

Wyświetl plik

@ -1,7 +1,7 @@
;Sagitta backend .desc file by Andre Herms.
:backend "sagitta" ; name of backend
:version "0.3" ; version of backend
:version "(0.4)" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;:manpage none ; name of manpage (if it exists)
:url "http://www.cs.uni-magdeburg.de/~aherms/sane-sagitta.html" ; backend's web page

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1 +1,32 @@
# The options are only meaningful if the backend was
# compiled with USE_FORK defined
#
# option buffersize: size of one buffer allocated as shared
# memory for data transfer between the reader process
# and the parent process
# option buffers: number of these buffers
# The minimum is 2
# option readqueue: number of queued read requests. This is
# with the current SANE version (1.01) only useful for
# Linux, since queued read requests are not supported
# for other operating systems.
#
# For Linux, a value of 2 is recommended, at least if a
# JX-250 is used. Bigger values are only a waste of memory.
#
# For other operationg systems, set this value to zero
#
# global options:
option buffers 4
option buffersize 131072
option readqueue 2
# look for all devices with vendor ID "SHARP" and type "Scanner"
scsi SHARP * Scanner
# no options specific to these devices listed -> use global options
/dev/scanner
# options specific to /dev/scanner
option buffers 6
option buffersize 262144
option readqueue 2
# example for another (Linux) device name:
#/dev/sg1

Wyświetl plik

@ -1,6 +1,6 @@
:backend "sharp" ; name of backend
:version "0.15" ; version of backend
:status :new ; :alpha, :beta, :stable, :new
:version "0.30" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:url "http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html"
; backend's homepage
@ -9,8 +9,8 @@
:mfg "SHARP" ; name a manufacturer
:url "http://sharp-world.com/"
:model "JX-610" ; name models for above-specified mfg.
:comment "Preview/Color Lineart/Lineart/Threshold does not work!(JX-610)"
:comment ""
:model "JX-250" ; name models for above-specified mfg.
:comment "Color Lineart does not give useful output"
:comment ""
:model "JX-330" ; name models for above-specified mfg.
:comment "backend is not yet tested with a JX 330!"

Wyświetl plik

@ -45,22 +45,53 @@
#include <sys/types.h>
/* default values for configurable options.
Though these options are only meaningful if USE_FORK is defined,
they are
DEFAULT_BUFFERS: number of buffers allocated as shared memory
for the data transfer from reader_process to
read_data. The minimum value is 2
DEFAULT_BUFSIZE: default size of one buffer. Must be greater
than zero.
DEFAULT_QUEUED_READS: number of read requests queued by
sanei_scsi_req_enter. Since queued read requests
are currently only supported for Linux and
DomainOS, this value should automatically be set
dependent on the target OS...
For Linux, 2 is the optimum; for DomainOS, I
don't have any recommendation; other OS
should use the value zero.
The value for DEFAULT_BUFSIZE is probably too Linux-oriented...
*/
#define DEFAULT_BUFFERS 12
#define DEFAULT_BUFSIZE 128 * 1024
#define DEFAULT_QUEUED_READS 2
typedef enum
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
XOPT_MODE,
OPT_MODE,
OPT_HALFTONE,
OPT_PAPER,
OPT_SCANSOURCE,
OPT_GAMMA,
#ifdef USE_CUSTOM_GAMMA
OPT_CUSTOM_GAMMA,
#endif
OPT_SPEED,
OPT_RESOLUTION_GROUP,
OPT_RESOLUTION,
#ifdef USE_RESOLUTION_LIST
OPT_RESOLUTION_LIST,
#endif
OPT_X_RESOLUTION,
#ifdef USE_SEPARATE_Y_RESOLUTION
OPT_Y_RESOLUTION,
#endif
OPT_GEOMETRY_GROUP,
OPT_TL_X, /* top-left x */
@ -70,10 +101,16 @@ typedef enum
OPT_ENHANCEMENT_GROUP,
OPT_EDGE_EMPHASIS,
XOPT_THRESHOLD,
OPT_THRESHOLD,
#ifdef USE_COLOR_THRESHOLD
OPT_THRESHOLD_R,
OPT_THRESHOLD_G,
OPT_THRESHOLD_B,
#endif
OPT_LIGHTCOLOR,
#ifdef USE_CUSTOM_GAMMA
OPT_CUSTOM_GAMMA,
OPT_PREVIEW,
#ifdef USE_CUSTOM_GAMMA
OPT_GAMMA_VECTOR,
OPT_GAMMA_VECTOR_R,
OPT_GAMMA_VECTOR_G,
@ -92,12 +129,55 @@ typedef union
}
Option_Value;
#ifdef USE_FORK
/* status defines for a buffer:
buffer not used / read request queued / buffer contains data
*/
#define SHM_EMPTY 0
#define SHM_BUSY 1
#define SHM_FULL 2
typedef struct SHARP_shmem_ctl
{
int shm_status; /* can be SHM_EMPTY, SHM_BUSY, SHM_FULL */
size_t used; /* number of bytes successfully read from scanner */
size_t nreq; /* number of bytes requested from scanner */
size_t start; /* index of the begin of used area of the buffer */
void *qid;
SANE_Byte *buffer;
}
SHARP_shmem_ctl;
typedef struct SHARP_rdr_ctl
{
int cancel; /* 1 = flag for the reader process to cancel */
int running; /* 1 indicates that the reader process is alive */
SANE_Status status; /* return status of the reader process */
SHARP_shmem_ctl *buf_ctl;
}
SHARP_rdr_ctl;
#endif /* USE_FORK */
typedef enum
{
/* JX250, JX330, JX610 are used as array indices, so the corresponding
numbers should start at 0
*/
unknown = -1,
JX250,
JX330,
JX610
}
SHARP_Model;
typedef struct SHARP_Info
{
SANE_Range xres_range;
SANE_Range yres_range;
SANE_Range x_range;
SANE_Range y_range;
SANE_Range tl_x_ranges[3]; /* normal / FSU / ADF */
SANE_Range br_x_ranges[3]; /* normal / FSU / ADF */
SANE_Range tl_y_ranges[3]; /* normal / FSU / ADF */
SANE_Range br_y_ranges[3]; /* normal / FSU / ADF */
SANE_Range threshold_range;
SANE_Int xres_default;
@ -106,17 +186,46 @@ typedef struct SHARP_Info
SANE_Int y_default;
SANE_Int bmu;
SANE_Int mud;
SANE_Int adf_fsu_installed;
SANE_String_Const scansources[5];
size_t buffers;
size_t bufsize;
int wanted_bufsize;
size_t queued_reads;
}
SHARP_Info;
typedef struct SHARP_Sense_Data
{
SHARP_Model model;
/* flag, if conditions like "paper jam" or "cover open"
are considered as an error. Should be 0 for attach, else
a frontend might refuse to start, if the scanner returns
these errors.
*/
int complain_on_adf_error;
/* Linux returns only 16 bytes of sense data... */
u_char sb[16];
}
SHARP_Sense_Data;
typedef struct SHARP_Device
{
struct SHARP_Device *next;
SANE_Device sane;
SHARP_Info info;
/* xxx now part of sense data SHARP_Model model; */
SHARP_Sense_Data sensedat;
}
SHARP_Device;
typedef struct SHARP_New_Device
{
struct SHARP_Device *dev;
struct SHARP_New_Device *next;
}
SHARP_New_Device;
typedef struct SHARP_Scanner
{
struct SHARP_Scanner *next;
@ -126,14 +235,10 @@ typedef struct SHARP_Scanner
Option_Value val[NUM_OPTIONS];
SANE_Parameters params;
SANE_Byte *buffer;
size_t buf_used;
size_t buf_pos;
SANE_Byte *outbuffer;
size_t outbuf_start;
size_t outbuf_used;
size_t outbuf_size;
size_t outbuf_remain_read;
int get_params_called;
SANE_Byte *buffer; /* for color data re-ordering, required for JX 250 */
SANE_Int buf_used;
SANE_Int buf_pos;
SANE_Int modes;
SANE_Int xres;
SANE_Int yres;
@ -150,6 +255,8 @@ typedef struct SHARP_Scanner
SANE_Int gamma;
SANE_Int edge;
SANE_Int lightcolor;
SANE_Int adf_fsu_mode; /* mode selected by user */
SANE_Int adf_scan; /* flag, if the actual scan is an ADF scan */
size_t bytes_to_read;
size_t max_lines_to_read;
@ -160,6 +267,12 @@ typedef struct SHARP_Scanner
#ifdef USE_CUSTOM_GAMMA
SANE_Int gamma_table[4][256];
#endif
#ifdef USE_FORK
pid_t reader_pid;
SHARP_rdr_ctl *rdr_ctl;
int shmid;
size_t read_buff; /* index of the buffer actually used by read_data */
#endif /* USE_FORK */
}
SHARP_Scanner;
@ -213,10 +326,16 @@ typedef struct WDB
}
WDB;
/* "extension" off the window descriptor block for the JX 250 */
typedef struct WDBX250
/* "extension" of the window descriptor block for the JX 330 */
typedef struct WDBX330
{
SANE_Byte moire_reduction[2];
}
WDBX330;
/* "extension" of the window descriptor block for the JX 250 */
typedef struct XWDBX250
{
SANE_Byte threshold_red;
SANE_Byte threshold_green;
SANE_Byte threshold_blue;
@ -232,6 +351,7 @@ typedef struct window_param
{
WPDH wpdh;
WDB wdb;
WDBX330 wdbx330;
WDBX250 wdbx250;
}
window_param;
@ -245,7 +365,7 @@ typedef struct mode_sense_param
SANE_Byte resereved[5];
SANE_Byte blocklength[3];
SANE_Byte page_code;
SANE_Byte constant6;
SANE_Byte page_length; /* 6 */
SANE_Byte bmu;
SANE_Byte res2;
SANE_Byte mud[2];
@ -254,6 +374,36 @@ typedef struct mode_sense_param
}
mode_sense_param;
typedef struct mode_sense_subdevice
{
/* This definition reflects the JX250. The JX330 would need a slightly
different definition, but the bytes used right now (for ADF and FSU)
are identical.
*/
SANE_Byte mode_data_length;
SANE_Byte mode_param_header2;
SANE_Byte mode_param_header3;
SANE_Byte mode_desciptor_length;
SANE_Byte res1[5];
SANE_Byte blocklength[3];
SANE_Byte page_code;
SANE_Byte page_length; /* 0x1a */
SANE_Byte a_mode_type;
SANE_Byte f_mode_type;
SANE_Byte res2;
SANE_Byte max_x[4];
SANE_Byte max_y[4];
SANE_Byte res3[2];
SANE_Byte x_basic_resolution[2];
SANE_Byte y_basic_resolution[2];
SANE_Byte x_max_resolution[2];
SANE_Byte y_max_resolution[2];
SANE_Byte x_min_resolution[2];
SANE_Byte y_min_resolution[2];
SANE_Byte res4;
}
mode_sense_subdevice;
typedef struct mode_select_param
{
SANE_Byte mode_param_header1;
@ -261,7 +411,7 @@ typedef struct mode_select_param
SANE_Byte mode_param_header3;
SANE_Byte mode_param_header4;
SANE_Byte page_code;
SANE_Byte constant6;
SANE_Byte page_length; /* 6 */
SANE_Byte res1;
SANE_Byte res2;
SANE_Byte mud[2];
@ -270,6 +420,20 @@ typedef struct mode_select_param
}
mode_select_param;
typedef struct mode_select_subdevice
{
SANE_Byte mode_param_header1;
SANE_Byte mode_param_header2;
SANE_Byte mode_param_header3;
SANE_Byte mode_param_header4;
SANE_Byte page_code;
SANE_Byte page_length; /* 0x1A */
SANE_Byte a_mode;
SANE_Byte f_mode;
SANE_Byte res[24];
}
mode_select_subdevice;
/* SCSI commands */
#define TEST_UNIT_READY 0x00
#define REQUEST_SENSE 0x03
@ -284,12 +448,12 @@ mode_select_param;
#define GET_WINDOW 0x25
#define READ 0x28
#define SEND 0x2a
#define OBJECT_POSITION 0x31
#define SENSE_LEN 18
#define INQUIRY_LEN 36
#define MODEPARAM_LEN 12
#define MODE_SUBDEV_LEN 32
#define WINDOW_LEN 76
#define DEFAULT_BUFSIZE 128
#endif /* not sharp_h */

Wyświetl plik

@ -1,6 +1,10 @@
/* $Id$
SnapScan backend data sources (implementation) */
#ifndef __FUNCTION__
#define __FUNCTION__ "(undef)"
#endif
#ifdef TEMPORARY
SANE_Status status = SANE_STATUS_GOOD;
FDSource *ps = (FDSource*)pself;
@ -158,7 +162,7 @@ SANE_Status SCSISource_init (SCSISource *pself, SnapScan_Scanner *pss)
if(gettimeofday(&(pself->time), NULL) != 0)
{
DBG (DL_MAJOR_ERROR, "%s: error in gettimeofday(): %s\n",
__FUNCTION__, sys_errlist[errno]);
__FUNCTION__, strerror(errno));
pself->time.tv_sec = SCSISOURCE_BAD_TIME;
pself->time.tv_usec = SCSISOURCE_BAD_TIME;
}
@ -216,7 +220,7 @@ FDSource_get (Source *pself, SANE_Byte *pbuf, SANE_Int *plen)
/* it's an IO error */
{
DBG (DL_MAJOR_ERROR, "%s: read failed: %s\n",
__FUNCTION__, sys_errlist[errno]);
__FUNCTION__, strerror(errno));
status = SANE_STATUS_IO_ERROR;
}
}

Plik diff jest za duży Load Diff

Wyświetl plik

@ -11,10 +11,10 @@
;
:backend "SnapScan" ; name of backend
:version "0.5" ; version of backend
:version "0.7" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;:manpage "sane-template" ; name of manpage (if it exists)
:url "http://www.cs.ualberta.ca/~charter/snapscan.html" ; backend's web page
:url "http://www.cs.ualberta.ca/~charter/SnapScan/snapscan.html" ; backend's web page
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
@ -23,17 +23,24 @@
:mfg "AGFA" ; name a manufacturer
:url "http://www.agfa.com/"
:model "SnapScan 300" ; name models for above-specified mfg.
:comment "Only 8 bits/sample at present"
:comment "Only 8 bits/sample at present."
:model "SnapScan 310"
:comment "Ditto"
:model "SnapScan 600"
:comment "Ditto"
:model "SnapScan 1236s"
:comment "Ditto"
:comment "Ditto. Have no specific programming info yet."
:mfg "Vuego"
:model "310S"
:model "310s"
:comment "Close SnapScan 310 compatible."
:mfg "Acer"
:model "310s"
:comment "Same thing as the Vuego 310s."
:model "Prisa 620s"
:comment "Seems to be a close SnapScan 310/600 compatible."
:mfg "Guillemot International"
:model "Maxi Scan A4 Deluxe (SCSI)"
:comment "May be a repackaged Vuego 310s or SnapScan 310s."
;:devicetype :api ; specify a different type
;:desc "Interface to FrObYz API" ; describe a non-hardware device

Wyświetl plik

@ -1,8 +1,8 @@
/* sane - Scanner Access Now Easy.
Copyright (C) 1997, 1998 Franck Schnefra, Michel Roelofs,
Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller
and Kevin Charter
Copyright (C) 1997, 1998, 1999 Franck Schnefra, Michel Roelofs,
Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller,
Petter Reinholdtsen, Gary Plewa, and Kevin Charter
This file is part of the SANE package.
@ -65,7 +65,8 @@ typedef enum
SNAPSCAN310, /* the SnapScan 310 */
SNAPSCAN600, /* the SnapScan 600 */
SNAPSCAN1236S, /* the SnapScan 1236s */
VUEGO310S /* Vuego-Version of SnapScan 310 WG changed */
VUEGO310S, /* Vuego-Version of SnapScan 310 WG changed */
PRISA620S /* Prisa-Version of SnapScan 600 GP added */
} SnapScan_Model;
struct SnapScan_Model_desc
@ -78,6 +79,7 @@ static struct SnapScan_Model_desc scanners[] =
{
/* SCSI model name -> enum value */
{ "FlatbedScanner_4", VUEGO310S },
{ "FlatbedScanner_9", PRISA620S },
{ "SNAPSCAN 1236", SNAPSCAN1236S },
{ "SNAPSCAN 310", SNAPSCAN310 },
{ "SNAPSCAN 600", SNAPSCAN600 },
@ -89,7 +91,7 @@ static char *vendors[] =
{
/* SCSI Vendor name */
"AGFA",
"COLOR",
"COLOR"
};
#define known_vendors (sizeof(vendors)/sizeof(vendors[0]))
@ -155,7 +157,11 @@ typedef struct snapscan_device
#define MAX_SCSI_CMD_LEN 256 /* not that large */
#define SCANNER_BUF_SZ 31744
typedef struct snapscan_scanner
typedef struct snapscan_scanner SnapScan_Scanner;
#include <snapscan-sources.h>
struct snapscan_scanner
{
SANE_String devname; /* the scsi device name */
SnapScan_Device *pdev; /* the device */
@ -174,7 +180,7 @@ typedef struct snapscan_scanner
size_t buf_sz; /* effective buffer size */
size_t expected_read_bytes; /* expected amount of data in a single read */
size_t read_bytes; /* amount of actual data read */
size_t expected_data_len; /* total amount of expected data in scan */
size_t bytes_remaining; /* remaining bytes expected from scanner */
size_t actual_res; /* actual resolution */
size_t lines; /* number of scan lines */
size_t bytes_per_line; /* bytes per scan line */
@ -186,9 +192,26 @@ typedef struct snapscan_scanner
char *as_str; /* additional sense string */
u_char asi1; /* first additional sense info byte */
u_char asi2; /* second additional sense info byte */
#ifdef OBSOLETE
struct
{ /* RGB ring buffer for 310/600 model */
SANE_Byte *data; /* buffer data */
SANE_Int line_in; /* virtual position */
SANE_Int pixel_pos;
SANE_Int line_out; /* read lines */
SANE_Byte g_offset; /* green offset */
SANE_Byte b_offset; /* blue offset */
SANE_Byte r_offset; /* red offset */
} rgb_buf;
#else
SANE_Byte g_offset; /* green chroma offset */
SANE_Byte b_offset; /* blue chroma offset */
SANE_Byte r_offset; /* red chroma offset */
#endif
Source *psrc; /* data source */
SANE_Option_Descriptor
options[NUM_OPTS]; /* the option descriptors */
SANE_Option_Descriptor
options[NUM_OPTS]; /* the option descriptors */
/* the options themselves... */
SANE_Int res; /* resolution */
SANE_Bool preview; /* preview mode toggle */
@ -213,28 +236,45 @@ typedef struct snapscan_scanner
SANE_Int threshold; /* threshold for line art */
SANE_Int rgb_lpr; /* lines per scsi read (RGB) */
SANE_Int gs_lpr; /* lines per scsi read (greyscale) */
struct
{ /* RGB ring buffer for 310/600 model */
SANE_Byte *data; /* buffer data */
SANE_Int line_in; /* virtual position */
SANE_Int pixel_pos;
SANE_Int line_out; /* read lines */
SANE_Byte g_offset; /* green offset */
SANE_Byte b_offset; /* blue offset */
SANE_Byte r_offset; /* red offset */
} rgb_buf;
}
SnapScan_Scanner;
};
#endif
/* $Log$
* Revision 1.1.1.1 1999/08/09 18:05:53 pere
* Wiped old repository. Imported v1.0.1.
/*
* $Log$
* Revision 1.2 2000/03/05 13:55:21 pere
* Merged main branch with current DEVEL_1_9.
*
* Revision 1.25 1998/12/16 18:40:53 charter
* Revision 1.1.1.1.2.1 1999/09/15 18:20:02 charter
* Early version 1.0 snapscan.h
*
* Revision 2.2 1999/09/09 18:25:02 charter
* Checkpoint. Removed references to snapscan-310.c stuff using
* "#ifdef OBSOLETE".
*
* Revision 2.1 1999/09/08 03:05:05 charter
* Start of branch 2; same as 1.30.
*
* Revision 1.30 1999/09/07 20:54:07 charter
* Changed expected_data_len to bytes_remaining.
*
* Revision 1.29 1999/09/02 05:29:46 charter
* Fixed the spelling of Petter's name (again).
*
* Revision 1.28 1999/09/02 05:28:50 charter
* Added Gary Plewa's name to the list of contributors.
*
* Revision 1.27 1999/09/02 04:48:25 charter
* Added models and strings for the Acer PRISA 620s (thanks to Gary Plewa).
*
* Revision 1.26 1999/09/02 02:01:46 charter
* Checking in rev 1.26 (for backend version 0.7) again.
* This is part of the recovery from the great disk crash of Sept 1, 1999.
*
* Revision 1.26 1999/07/09 20:54:34 charter
* Modifications for SnapScan 1236s (Petter Reinholdsten).
*
* Revision 1.25 1998/12/16 18:40:53 charter
* Commented the INOPERATIVE define to get rid of spurious brightness
* and contrast controls accidentally reintroduced previously.
*

Wyświetl plik

@ -0,0 +1,554 @@
#ifndef SP15C_SCSI_H
#define SP15C_SCSI_H
static const char RCSid_sh[] = "$Header$";
/* sane - Scanner Access Now Easy.
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
This file implements a SANE backend for Fujitsu ScanParner 15c
flatbed/ADF scanners. It was derived from the COOLSCAN driver.
Written by Randolph Bentson <bentson@holmsjoen.com> */
/* ------------------------------------------------------------------------- */
/*
* $Log$
* Revision 1.2 2000/03/05 13:55:21 pere
* Merged main branch with current DEVEL_1_9.
*
* Revision 1.1.2.3 2000/02/14 14:20:19 pere
* Make lint_catcher static to avoid link problems with duplicate symbols.
*
* Revision 1.1.2.2 2000/01/26 03:51:48 pere
* Updated backends sp15c (v1.12) and m3096g (v1.11).
*
* Revision 1.7 2000/01/05 05:27:34 bentson
* indent to barfin' GNU style
*
* Revision 1.6 1999/12/03 20:56:44 bentson
* add MEDIA CHECK command
*
* Revision 1.5 1999/11/24 15:57:50 bentson
* add license
*
* Revision 1.4 1999/11/23 19:04:08 bentson
* clean up and enhance inquiry command
*
* Revision 1.3 1999/11/23 06:42:19 bentson
* add 4-bit grayscale support; fix color count field placement
*
* Revision 1.2 1999/11/22 18:15:43 bentson
* more work on color support
*
* Revision 1.1 1999/11/19 15:09:08 bentson
* cribbed from m3096g
*
*/
/****************************************************/
static inline void
setbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
{
*pageaddr = (*pageaddr & ~(mask << shift)) | ((val & mask) << shift);
}
/* ------------------------------------------------------------------------- */
static inline void
resetbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
{
*pageaddr = (*pageaddr & ~(mask << shift)) | (((!val) & mask) << shift);
}
/* ------------------------------------------------------------------------- */
static inline int
getbitfield (unsigned char *pageaddr, int mask, int shift) \
{
return ((*pageaddr >> shift) & mask);
}
/* ------------------------------------------------------------------------- */
static inline int
getnbyte (unsigned char *pnt, int nbytes) \
{
unsigned int result = 0;
int i;
#ifdef DEBUG
assert (nbytes < 5);
#endif
for (i = 0; i < nbytes; i++)
result = (result << 8) | (pnt[i] & 0xff);
return result;
}
/* ------------------------------------------------------------------------- */
static inline void
putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) \
{
int i;
#ifdef DEBUG
assert (nbytes < 5);
#endif
for (i = nbytes - 1; i >= 0; i--)
\
{
pnt[i] = value & 0xff;
value = value >> 8;
}
}
/* ==================================================================== */
/* SCSI commands */
typedef struct
{
char *cmd;
int size;
}
scsiblk;
/* ==================================================================== */
#define RESERVE_UNIT 0x16
#define RELEASE_UNIT 0x17
#define INQUIRY 0x12
#define REQUEST_SENSE 0x03
#define SEND_DIAGNOSTIC 0x1d
#define TEST_UNIT_READY 0x00
#define SET_WINDOW 0x24
#define SET_SUBWINDOW 0xc0
#define OBJECT_POSITION 0x31
#define MEDIA_CHECK 0x08
#define SEND 0x2a
#define READ 0x28
#define MODE_SELECT 0x15
#define MODE_SENSE 0x1a
#define SCAN 0x1b
/* ==================================================================== */
static unsigned char reserve_unitC[] =
{RESERVE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk reserve_unitB =
{reserve_unitC, sizeof (reserve_unitC)};
/* ==================================================================== */
static unsigned char release_unitC[] =
{RELEASE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk release_unitB =
{release_unitC, sizeof (release_unitC)};
/* ==================================================================== */
static unsigned char inquiryC[] =
{INQUIRY, 0x00, 0x00, 0x00, 0x1f, 0x00};
static scsiblk inquiryB =
{inquiryC, sizeof (inquiryC)};
#define set_IN_return_size(icb,val) icb[0x04]=val
#define set_IN_length(out,n) out[0x04]=n-5
#define get_IN_periph_qual(in) getbitfield(in, 0x07, 5)
#define IN_periph_qual_lun 0x00
#define IN_periph_qual_nolun 0x03
#define get_IN_periph_devtype(in) getbitfield(in, 0x1f, 0)
#define IN_periph_devtype_scanner 0x06
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x0f, 0)
#define IN_recognized 0x02
#define get_IN_additional_length(in) in[0x04]
#define get_IN_vendor(in, buf) strncpy(buf, in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, in + 0x20, 0x04)
#define get_IN_color_mode(in) getbitfield(in + 0x24, 0xf, 0)
#define get_IN_color_seq(in) getbitfield(in + 0x24, 0x7, 4)
#define get_IN_adf(in) getbitfield(in + 0x24, 0x1, 7)
/* ==================================================================== */
static unsigned char request_senseC[] =
{REQUEST_SENSE, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk request_senseB =
{request_senseC, sizeof (request_senseC)};
#define set_RS_allocation_length(sb,val) sb[0x04] = (unsigned char)val
/* defines for request sense return block */
#define get_RS_information_valid(b) getbitfield(b + 0x00, 1, 7)
#define get_RS_error_code(b) getbitfield(b + 0x00, 0x7f, 0)
#define get_RS_filemark(b) getbitfield(b + 0x02, 1, 7)
#define get_RS_EOM(b) getbitfield(b + 0x02, 1, 6)
#define get_RS_ILI(b) getbitfield(b + 0x02, 1, 5)
#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0)
#define get_RS_information(b) getnbyte(b+0x03, 4) /* normally 0 */
#define get_RS_additional_length(b) b[0x07] /* always 10 */
#define get_RS_ASC(b) b[0x0c]
#define get_RS_ASCQ(b) b[0x0d]
#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid, always 0 */
#define rs_return_block_size 18 /* Says Nikon */
/* ==================================================================== */
static unsigned char send_diagnosticC[] =
{SEND_DIAGNOSTIC, 0x04, 0x00, 0x00, 0x00, 0x00};
static scsiblk send_diagnosticB =
{send_diagnosticC, sizeof (send_diagnosticC)};
/* ==================================================================== */
static unsigned char test_unit_readyC[] =
{TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk test_unit_readyB =
{test_unit_readyC, sizeof (test_unit_readyC)};
/* ==================================================================== */
static unsigned char set_windowC[] =
{SET_WINDOW, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,};
/* opcode, lun, _____4 X reserved____, _transfer length, ctl */
static scsiblk set_windowB =
{set_windowC, sizeof (set_windowC)};
#define set_SW_xferlen(sb, len) putnbyte(sb + 0x06, len, 3)
#define get_SW_xferlen(sb) getnbyte(sb + 0x06, 3)
/* ==================================================================== */
static unsigned char set_subwindowC[] =
{SET_SUBWINDOW};
static scsiblk set_subwindowB =
{set_subwindowC, sizeof (set_subwindowC)};
/* ==================================================================== */
static unsigned char object_positionC[] =
{OBJECT_POSITION, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/* ADF, _____Count_____, ________Reserved______, Ctl */
static scsiblk object_positionB =
{object_positionC, sizeof (object_positionC)};
#define set_OP_autofeed(b,val) setbitfield(b+0x01, 0x07, 0, val)
#define OP_Discharge 0x00
#define OP_Feed 0x01
/* ==================================================================== */
static unsigned char media_checkC[] =
{MEDIA_CHECK, 0x00, 0x00, 0x00, 0x00, 0x00};
/* ADF, _Reserved_, Len, Ctl */
static scsiblk media_checkB =
{media_checkC, sizeof (media_checkC)};
#define set_MC_return_size(sb,val) sb[0x04]=val
#define get_MC_adf_status(sb) sb[0x00]
#define MC_ADF_OK 0x01
/* ==================================================================== */
static unsigned char media_parameter_data_blockC[] =
{
0x00
};
static scsiblk media_parameter_data_blockB =
{media_parameter_data_blockC, sizeof (media_parameter_data_blockC)};
/* ==================================================================== */
static unsigned char sendC[] =
{SEND, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk sendB =
{sendC, sizeof (sendC)};
#define set_S_datatype_code(sb, val) sb[0x02] = (unsigned char)val
#define S_datatype_imagedatai 0x00
#define S_EX_datatype_LUT 0x01 /* Experiment code */
#define S_EX_datatype_shading_data 0xa0 /* Experiment code */
#define S_user_reg_gamma 0xc0
#define S_device_internal_info 0x03
#define set_S_datatype_qual_upper(sb, val) sb[0x04] = (unsigned char)val
#define S_DQ_none 0x00
#define S_DQ_Rcomp 0x06
#define S_DQ_Gcomp 0x07
#define S_DQ_Bcomp 0x08
#define S_DQ_Reg1 0x01
#define S_DQ_Reg2 0x02
#define S_DQ_Reg3 0x03
#define set_S_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
/*
static unsigned char gamma_user_LUT_LS1K[512] = { 0x00 };
static scsiblk gamma_user_LUT_LS1K_LS1K = {
gamma_user_LUT_LS1K, sizeof(gamma_user_LUT_LS1K)
};
*/
/* ==================================================================== */
static unsigned char readC[] =
{READ, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/* Type, rsvd, type qual, __xfer length__, Ctl */
static scsiblk readB =
{readC, sizeof (readC)};
#define set_R_datatype_code(sb, val) sb[0x02] = val
#define R_datatype_imagedata 0x00
#define R_pixel_size 0x80
#define set_R_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
/* ==================================================================== */
static unsigned char mode_selectC[] =
{MODE_SELECT, 0x10, 0x00, 0x00, 0x00, 0x00};
static scsiblk mode_selectB =
{mode_selectC, sizeof (mode_selectC)};
/* ==================================================================== */
static unsigned char mode_senseC[] =
{MODE_SENSE, 0x18, 0x03, 0x00, 0x00, 0x00, /* PF set, page type 03 */ };
static scsiblk mode_senseB =
{mode_senseC, sizeof (mode_senseC)};
#define set_MS_DBD(b, val) setbitfield(b, 0x01, 3, (val?1:0))
#define set_MS_len(b, val) putnbyte(b+0x04, val, 1)
#define get_MS_MUD(b) getnbyte(b+(0x04+((int)*(b+0x3)))+0x4,2)
/* ==================================================================== */
static unsigned char scanC[] =
{SCAN, 0x00, 0x00, 0x00, 0x00, 0x00};
static scsiblk scanB =
{scanC, sizeof (scanC)};
#define set_SC_xfer_length(sb, val) sb[0x04] = (unsigned char)val
/* ==================================================================== */
/* We use the same structure for both SET WINDOW and GET WINDOW. */
static unsigned char window_parameter_data_blockC[] =
{
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, /* reserved */
0x00, 0x00, /* Window Descriptor Length */
};
static scsiblk window_parameter_data_blockB =
{window_parameter_data_blockC, sizeof (window_parameter_data_blockC)};
#define set_WDPB_wdblen(sb, len) putnbyte(sb + 0x06, len, 2)
#define get_WDPB_wdblen(sb) getnbyte(sb + 0x06, 2)
#define WDB_size_empty 0x28 /* wdb_len if nothing is set by inquiry */
#define WDB_size_BW 0x40
#define WDB_size_Color 0x33
#define WDB_size_max 0xff
/* ==================================================================== */
static unsigned char window_descriptor_blockC[] =
{
0x00, /* 0x00 *//* Window Identifier */
#define set_WD_wid(sb, val) sb[0] = val
#define WD_wid_all 0x00 /* Only one supported */
0x00, /* 0x01 *//* reserved, AUTO */
#define set_WD_auto(sb, val) setbitfield(sb + 0x01, 1, 0, val)
#define get_WD_auto(sb) getbitfield(sb + 0x01, 1, 0)
0x00, 0x00, /* 0x02 *//* X resolution in dpi, 0 => 400 */
#define set_WD_Xres(sb, val) putnbyte(sb + 0x02, val, 2)
#define get_WD_Xres(sb) getnbyte(sb + 0x02, 2)
0x00, 0x00, /* 0x04 *//* Y resolution in dpi, 0 => 400 */
#define set_WD_Yres(sb, val) putnbyte(sb + 0x04, val, 2)
#define get_WD_Yres(sb) getnbyte(sb + 0x04, 2)
0x00, 0x00,
0x00, 0x00, /* 0x06 *//* Upper Left X in inch/1200 */
#define set_WD_ULX(sb, val) putnbyte(sb + 0x06, val, 4)
#define get_WD_ULX(sb) getnbyte(sb + 0x06, 4)
0x00, 0x00,
0x00, 0x00, /* 0x0a *//* Upper Left Y in inch/1200 */
#define set_WD_ULY(sb, val) putnbyte(sb + 0x0a, val, 4)
#define get_WD_ULY(sb) getnbyte(sb + 0x0a, 4)
0x00, 0x00,
0x00, 0x00, /* 0x0e *//* Width */
#define set_WD_width(sb, val) putnbyte(sb + 0x0e, val, 4)
#define get_WD_width(sb) getnbyte(sb + 0x0e, 4)
#define WD_width 10200
0x00, 0x00,
0x00, 0x00, /* 0x12 *//* Length */
#define set_WD_length(sb, val) putnbyte(sb + 0x12, val, 4)
#define get_WD_length(sb) getnbyte(sb + 0x12, 4)
#define WD_length 13200
0x00, /* 0x16 *//* Brightness */
#define set_WD_brightness(sb, val) sb[0x16] = val
#define get_WD_brightness(sb) sb[0x16]
#define WD_brightness 0x80
0x00, /* 0x17 *//* Threshold */
#define set_WD_threshold(sb, val) sb[0x17] = val
#define get_WD_threshold(sb) sb[0x17]
#define WD_threshold 0x80
0x00, /* 0x18 *//* Contrast */
#define set_WD_contrast(sb, val) sb[0x18] = val
#define get_WD_contrast(sb) sb[0x18]
0x05, /* 0x19 *//* Image composition */
#define set_WD_composition(sb, val) sb[0x19] = val
#define get_WD_composition(sb) sb[0x19]
/* lineart, halftone, greyscale, binary color, dither color, multi-color */
#define WD_comp_LA 0
#define WD_comp_HT 1
#define WD_comp_GS 2
#define WD_comp_BC 3
#define WD_comp_DC 4
#define WD_comp_MC 5
#define WD_comp_G4 10
#define WD_comp_G8 11
0x08, /* 0x1a *//* Bits/Pixel */
#define set_WD_bitsperpixel(sb, val) sb[0x1a] = val
#define get_WD_bitsperpixel(sb) sb[0x1a]
0x00, 0x00, /* 0x1b *//* Halftone pattern */
#define set_WD_halftone(sb, val) putnbyte(sb + 0x1b, val, 2)
#define get_WD_halftone(sb) getnbyte(sb + 0x1b, 2)
0x00,
/* 0x1d *//*************** STUFF ***************/
#define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val)
#define get_WD_rif(sb) getbitfield(sb + 0x1d, 1, 7)
#define set_WD_pad(sb, val) setbitfield(sb + 0x1d, 7, 0, val)
#define get_WD_pad(sb) getbitfield(sb + 0x1d, 7, 0)
0x00, 0x00, /* 0x1e *//* bit ordering */
#define set_WD_bitorder(sb, val) putnbyte(sb + 0x1e, val, 2)
#define get_WD_bitorder(sb) getnbyte(sb + 0x1e, 2)
0x00, /* 0x20 *//* compression type */
#define set_WD_compress_type(sb, val) sb[0x20] = val
#define get_WD_compress_type(sb) sb[0x20]
0x00, /* 0x21 *//* compression argument */
#define set_WD_compress_arg(sb, val) sb[0x21] = val
#define get_WD_compress_arg(sb) sb[0x21]
0x00, 0x00,
0x00, 0x00,
0x00, 0x00, /* 0x22 *//* reserved */
0x00, /* 0x28 *//* vendor id code */
#define set_WD_vendor_id_code(sb, val) sb[0x28] = val
#define get_WD_vendor_id_code(sb) sb[0x28]
#define WD_bw 0x00
#define WD_color 0xFF
0x00, /* 0x29 C *//* parm length */
#define set_WD_parm_length(sb, val) sb[0x29] = val
#define get_WD_parm_length(sb) sb[0x29]
0x00, /* 0x2a C *//* ADF, source, Color */
#define set_WD_adf(sb, val) setbitfield(sb + 0x2a, 1, 7, val)
#define get_WD_adf(sb) getbitfield(sb + 0x2a, 1, 7)
#define set_WD_source(sb, val) setbitfield(sb + 0x2a, 1, 6, val)
#define get_WD_source(sb) getbitfield(sb + 0x2a, 1, 6)
#define set_WD_color(sb, val) setbitfield(sb + 0x2a, 7, 3, val)
#define get_WD_color(sb) getbitfield(sb + 0x2a, 7, 3)
#define WD_color_green 0
#define WD_color_red 1
#define WD_color_greenx 2
#define WD_color_blue 3
#define WD_color_rgb 4
0x00, /* 0x2b C *//* highlight color */
#define set_WD_highlight_color(sb, val) sb[0x2b] = val
#define get_WD_highlight_color(sb) sb[0x2b]
0x00, /* 0x2c C *//* shadow value */
#define set_WD_shadow_value(sb, val) sb[0x2c] = val
#define get_WD_shadow_value(sb) sb[0x2c]
0x00, 0x00, /* 0x2d C *//* line width */
#define set_WD_line_width(sb, val) putnbyte(sb + 0x2d, val, 2)
#define get_WD_line_width(sb) getnbyte(sb + 0x2d, 2)
0x00, 0x00, /* 0x2f C *//* line count */
#define set_WD_line_count(sb, val) putnbyte(sb + 0x2f, val, 2)
#define get_WD_line_count(sb) getnbyte(sb + 0x2f, 2)
0x00, /* 0x31 *//* reserved */
0x00, /* 0x32 *//* reserved */
0x00, /* 0x33 *//* reserved */
0x00, /* 0x34 *//* reserved */
0x00, /* 0x35 *//* paper size */
#define set_WD_paper_size(sb, val) sb[0x35] = val
#define get_WD_paper_size(sb) sb[0x35]
0x00, 0x00,
0x00, 0x00, /* 0x36 BW *//* paper width X */
#define set_WD_paper_width_X(sb, val) putnbyte(sb + 0x36, val, 4)
#define get_WD_paper_width_X(sb) getnbyte(sb + 0x36, 4)
0x00, 0x00,
0x00, 0x00, /* 0x3a BW *//* paper length Y */
#define set_WD_paper_length_Y(sb, val) putnbyte(sb+0x3a, val, 4)
#define get_WD_paper_length_Y(sb) getnbyte(sb + 0x3a, 4)
0x00, /* 0x3e *//* reserved */
0x00, /* 0x3f *//* reserved */
/* 0x40 (last) */
};
static scsiblk window_descriptor_blockB =
{window_descriptor_blockC, sizeof (window_descriptor_blockC)};
/* ==================================================================== */
#if 0
#define set_WDB_length(wdb,len) (wdb.size = (len))
#define WDB_OFF(b) (b + set_window.size)
#define WDB_OFF(b, n) (b + set_window.size + \
window_parameter_data_block.size + \
( window_descriptor_block.size * (n - 1) ) )
#define set_WDPB_wdbnum(sb,n) set_WPDB_wdblen(sb,window_descriptor_block.size*n)
#endif
/* ==================================================================== */
static scsiblk *lint_catcher[] =
{&reserve_unitB,
&release_unitB,
&inquiryB,
&request_senseB,
&send_diagnosticB,
&test_unit_readyB,
&set_windowB,
&set_subwindowB,
&object_positionB,
&media_checkB,
&media_parameter_data_blockB,
&sendB,
&readB,
&mode_selectB,
&mode_senseB,
&scanB,
&window_parameter_data_blockB,
&window_descriptor_blockB};
#endif /* SP15C_SCSI_H */

2121
backend/sp15c.c 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1 @@
scsi FCPA

25
backend/sp15c.desc 100644
Wyświetl plik

@ -0,0 +1,25 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "sp15c" ; name of backend
:version "1.12" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new
:manpage "sane-fujitsu" ; name of manpage (if it exists)
:url "http://www.aa.net/~bentson/sane.html" ; backend's web page
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:mfg "Fujitsu Computer Products of America" ; name a manufacturer
:url "http://www.fujitsu.com/scanners.html"
:model "SP15C" ; name models for above-specified mfg.

317
backend/sp15c.h 100644
Wyświetl plik

@ -0,0 +1,317 @@
#ifndef SP15C_H
#define SP15C_H
static const char RCSid_h[] = "$Header$";
/* sane - Scanner Access Now Easy.
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
This file implements a SANE backend for Fujitsu ScanParner 15c
flatbed/ADF scanners. It was derived from the COOLSCAN driver.
Written by Randolph Bentson <bentson@holmsjoen.com> */
/* ------------------------------------------------------------------------- */
/*
* $Log$
* Revision 1.2 2000/03/05 13:55:23 pere
* Merged main branch with current DEVEL_1_9.
*
* Revision 1.1.2.2 2000/01/26 03:51:50 pere
* Updated backends sp15c (v1.12) and m3096g (v1.11).
*
* Revision 1.7 2000/01/05 05:22:26 bentson
* indent to barfable GNU style
*
* Revision 1.6 1999/12/03 20:57:13 bentson
* add MEDIA CHECK command
*
* Revision 1.5 1999/11/24 15:55:56 bentson
* remove some debug stuff; rename function
*
* Revision 1.4 1999/11/23 18:54:26 bentson
* tidy up function types for constraint checking
*
* Revision 1.3 1999/11/23 06:41:54 bentson
* add debug flag to interface
*
* Revision 1.2 1999/11/22 18:15:20 bentson
* more work on color support
*
* Revision 1.1 1999/11/19 15:09:08 bentson
* cribbed from m3096g
*
*/
static int num_devices;
static struct sp15c *first_dev;
enum sp15c_Option
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_SOURCE,
OPT_MODE,
OPT_TYPE,
OPT_X_RES,
OPT_Y_RES,
OPT_PRESCAN,
OPT_PREVIEW_RES,
OPT_GEOMETRY_GROUP,
OPT_TL_X, /* in mm/2^16 */
OPT_TL_Y, /* in mm/2^16 */
OPT_BR_X, /* in mm/2^16 */
OPT_BR_Y, /* in mm/2^16 */
OPT_ENHANCEMENT_GROUP,
OPT_AVERAGING,
OPT_BRIGHTNESS,
OPT_THRESHOLD,
OPT_ADVANCED_GROUP,
OPT_PREVIEW,
/* must come last: */
NUM_OPTIONS
};
struct sp15c
{
struct sp15c *next;
SANE_Option_Descriptor opt[NUM_OPTIONS];
SANE_Device sane;
char vendor[9];
char product[17];
char version[5];
char *devicename; /* name of the scanner device */
int sfd; /* output file descriptor, scanner device */
int pipe;
int scanning; /* "in progress" flag */
int autofeeder; /* detected */
int use_adf; /* requested */
int reader_pid; /* child is running */
int prescan; /* ??? */
/***** terms for "set window" command *****/
int x_res; /* resolution in */
int y_res; /* pixels/inch */
int tl_x; /* top left position, */
int tl_y; /* in inch/1200 units */
int br_x; /* bottom right position, */
int br_y; /* in inch/1200 units */
int brightness;
int threshold;
int contrast;
int composition;
int bitsperpixel; /* at the scanner interface */
int halftone;
int rif;
int bitorder;
int compress_type;
int compress_arg;
int vendor_id_code;
int outline;
int emphasis;
int auto_sep;
int mirroring;
int var_rate_dyn_thresh;
int white_level_follow;
int subwindow_list;
int paper_size;
int paper_width_X;
int paper_length_Y;
/***** end of "set window" terms *****/
/* buffer used for scsi-transfer */
unsigned char *buffer;
unsigned int row_bufsize;
};
/* ------------------------------------------------------------------------- */
#define MM_PER_INCH 25.4
#define length_quant SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))
#define mmToIlu(mm) ((mm) / length_quant)
#define iluToMm(ilu) ((ilu) * length_quant)
#define SP15C_CONFIG_FILE "sp15c.conf"
/* ------------------------------------------------------------------------- */
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize);
SANE_Status
sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only);
SANE_Status
sane_open (SANE_String_Const name, SANE_Handle * handle);
SANE_Status
sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking);
SANE_Status
sane_get_select_fd (SANE_Handle h, SANE_Int * fdp);
const SANE_Option_Descriptor *
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option);
SANE_Status
sane_control_option (SANE_Handle handle, SANE_Int option,
SANE_Action action, void *val, SANE_Int * info);
SANE_Status
sane_start (SANE_Handle handle);
SANE_Status
sane_get_parameters (SANE_Handle handle, SANE_Parameters * params);
SANE_Status
sane_read (SANE_Handle handle, SANE_Byte * buf,
SANE_Int max_len, SANE_Int * len);
void
sane_cancel (SANE_Handle h);
void
sane_close (SANE_Handle h);
void
sane_exit (void);
/* ------------------------------------------------------------------------- */
static SANE_Status
attach_scanner (const char *devicename, struct sp15c **devp);
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg);
static int
request_sense_parse (u_char * sensed_data);
static SANE_Status
sp15c_identify_scanner (struct sp15c *s);
static SANE_Status
sp15c_do_inquiry (struct sp15c *s);
static SANE_Status
do_scsi_cmd (int fd, char *cmd, int cmd_len, char *out, size_t out_len);
static void
hexdump (int level, char *comment, unsigned char *p, int l);
static SANE_Status
init_options (struct sp15c *scanner);
static int
sp15c_check_values (struct sp15c *s);
static int
sp15c_grab_scanner (struct sp15c *s);
static int
sp15c_free_scanner (struct sp15c *s);
static int
wait_scanner (struct sp15c *s);
static int
sp15c_object_position (struct sp15c *s);
static SANE_Status
do_cancel (struct sp15c *scanner);
static void
swap_res (struct sp15c *s);
static int
sp15c_object_discharge (struct sp15c *s);
static int
sp15c_set_window_param (struct sp15c *s, int prescan);
static size_t
max_string_size (const SANE_String_Const strings[]);
static int
sp15c_start_scan (struct sp15c *s);
static int
reader_process (struct sp15c *scanner, int pipe_fd);
static SANE_Status
do_eof (struct sp15c *scanner);
static int
pixels_per_line (struct sp15c *s);
static int
lines_per_scan (struct sp15c *s);
static int
bytes_per_line (struct sp15c *s);
static void
sp15c_trim_rowbufsize (struct sp15c *s);
static int
sp15c_read_data_block (struct sp15c *s, unsigned int length);
static SANE_Status
attach_one (const char *name);
static void
adjust_width (struct sp15c *s, SANE_Int * info);
static SANE_Status
apply_constraints (struct sp15c *s, SANE_Int opt,
SANE_Int * target, SANE_Word * info);
static int
sp15c_media_check (struct sp15c *s);
#endif /* SP15C_H */

Wyświetl plik

@ -1,6 +1,7 @@
; ST400 backend .desc by Ingo Wilken
:backend "st400" ; name of backend
:version "(1.4)" ; version number
:status :alpha ; :alpha, :beta, :stable, :new
:manpage "sane-st400" ; name of manpage (if it exists)
:url "http://www.informatik.uni-oldenburg.de/~ingo/sane/" ; backend's web page

Wyświetl plik

@ -19,9 +19,9 @@
:mfg "Tamarack" ; name a manufacturer
:url "http://www.tamarack.net/"
:model "Artiscan 6000C" ; name models for above-specified mfg.
:comment "3 pass, 300 DPI; please report succes to R.E.Wolff@BitWizard.nl"
:comment "3 pass, 300 DPI"
:model "Artiscan 8000C" ; name models for above-specified mfg.
:comment "3 pass, 400 DPI; please report succes to R.E.Wolff@BitWizard.nl"
:comment "3 pass, 400 DPI"
:model "Artiscan 12000C" ; name models for above-specified mfg.
:comment "3 pass, 600 DPI"

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-scanner.h: scanner-definiton header-file for UMAX scanner driver.
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@ -92,33 +92,36 @@ static inquiry_blk *inquiry_table[] =
static char *scanner_str[] =
{
"UMAX " ,"Vista-S6 ",
"UMAX " ,"Vista-S6E ",
"UMAX " ,"UMAX S-6E ",
"UMAX " ,"UMAX S-6EG ",
"UMAX " ,"Vista-S8 ",
"UMAX " ,"Vista-T630 ",
"UMAX " ,"UMAX S-12 ",
"UMAX " ,"UMAX S-12G ",
"UMAX " ,"SuperVista S-12 ",
"UMAX " ,"PSD ",
"UMAX " ,"PL-II ",
"UMAX " ,"Astra 600S ",
"UMAX " ,"Astra 610S ",
"UMAX " ,"Astra 1200S ",
"UMAX " ,"Astra 1220S ",
/* "UMAX " ,"Mirage D-16L ", */
/* "UMAX " ,"Mirage II ", */
"UMAX " ,"Mirage IIse ",
/* "UMAX " ,"PL-II ", */
/* "UMAX " ,"Power Look 2000 ", */
/* "UMAX " ,"Power Look III ", */
/* "UMAX " ,"Power Look 3000 ", */
"UMAX " ,"Gemini D-16 ",
"LinoHell","Office ",
"LinoHell","Office2 ",
"LinoHell","SAPHIR2 ",
"Nikon " ,"AX-210 ",
"UMAX ", "Vista-T630 ",
"UMAX ", "Vista-S6 ",
"UMAX ", "Vista-S6E ",
"UMAX ", "UMAX S-6E ",
"UMAX ", "UMAX S-6EG ",
"UMAX ", "Vista-S8 ",
"UMAX ", "UMAX S-12 ",
"UMAX ", "UMAX S-12G ",
"UMAX ", "SuperVista S-12 ",
"UMAX ", "PSD ",
"UMAX ", "PL-II ",
"UMAX ", "Astra 600S ",
"UMAX ", "Astra 610S ",
"UMAX ", "Astra 1200S ",
"UMAX ", "Astra 1220S ",
"UMAX ", "Astra 2200 ",
"UMAX ", "Astra 2400S ",
"UMAX ", "Mirage D-16L ",
/* "UMAX ", "Mirage II ", */
"UMAX ", "Mirage IIse ",
/* "UMAX ", "PL-II ", */
/* "UMAX ", "Power Look 2000 ", */
/* "UMAX ", "Power Look III ", */
/* "UMAX ", "Power Look 3000 ", */
"UMAX ", "Gemini D-16 ",
"LinoHell", "Office ",
"LinoHell", "Office2 ",
"LinoHell", "SAPHIR2 ",
"Nikon ", "AX-210 ",
"KYE ", "ColorPage-HR5 ",
"END_OF_LIST"
};

Wyświetl plik

@ -3,7 +3,7 @@
/* umax-scsidef.h: scsi-definiton header file for UMAX scanner driver.
Copyright (C) 1996-1997 Michael K. Johnson
Copyright (C) 1997-1999 Oliver Rauch
Copyright (C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@ -48,6 +48,8 @@
#ifndef UMAX_SCSIDEF_H
#define UMAX_SCSIDEF_H
#include "umax.h"
/* --------------------------------------------------------------------------------------------------------- */
@ -150,6 +152,7 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define get_inquiry_0x01_bit6(in) getbitfield(in + 0x01, 0x01, 6)
#define get_inquiry_0x01_bit5(in) getbitfield(in + 0x01, 0x01, 5)
#define get_inquiry_CBHS(in) getbitfield(in + 0x01, 0x03, 3)
#define set_inquiry_CBHS(in, val) setbitfield(in + 0x01, 0x03, 3, val)
# define IN_CBHS_50 0x00
# define IN_CBHS_255 0x01
# define IN_CBHS_auto 0x02
@ -189,6 +192,7 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define get_inquiry_product(in, buf) strncpy(buf, in + 0x10, 0x010)
#define get_inquiry_version(in, buf) strncpy(buf, in + 0x20, 0x04)
#define set_inquiry_fw_quality(in, val) setbitfield(in + 0x24, 1, 0, val)
#define get_inquiry_fw_quality(in) getbitfield(in + 0x24, 1, 0)
#define get_inquiry_fw_fast_preview(in) getbitfield(in + 0x24, 1, 1)
#define get_inquiry_fw_shadow_comp(in) getbitfield(in + 0x24, 1, 2)
@ -223,11 +227,19 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define get_inquiry_sc_lineart(in) getbitfield(in + 0x60, 1, 2)
#define get_inquiry_sc_halftone(in) getbitfield(in + 0x60, 1, 3)
#define get_inquiry_sc_gray(in) getbitfield(in + 0x60, 1, 4)
#define get_inquiry_sc_gray(in) getbitfield(in + 0x60, 1, 4)
#define get_inquiry_sc_color(in) getbitfield(in + 0x60, 1, 5)
#define get_inquiry_sc_uta(in) getbitfield(in + 0x60, 1, 6)
#define get_inquiry_sc_adf(in) getbitfield(in + 0x60, 1, 7)
#define set_inquiry_sc_three_pass_color(in,val) setbitfield(in + 0x60, 1, 0, val)
#define set_inquiry_sc_one_pass_color(in,val) setbitfield(in + 0x60, 1, 1, val)
#define set_inquiry_sc_lineart(in,val) setbitfield(in + 0x60, 1, 2, val)
#define set_inquiry_sc_halftone(in,val) setbitfield(in + 0x60, 1, 3, val)
#define set_inquiry_sc_gray(in,val) setbitfield(in + 0x60, 1, 4, val)
#define set_inquiry_sc_color(in,val) setbitfield(in + 0x60, 1, 5, val)
#define set_inquiry_sc_uta(in,val) setbitfield(in + 0x60, 1, 6, val)
#define set_inquiry_sc_adf(in,val) setbitfield(in + 0x60, 1, 7, val)
#define get_inquiry_sc_double_res(in) getbitfield(in + 0x61, 1, 0)
#define get_inquiry_sc_high_byte_first(in) getbitfield(in + 0x61, 1, 1)
#define get_inquiry_sc_bi_image_reverse(in) getbitfield(in + 0x61, 1, 2)
@ -318,13 +330,13 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
# define IN_color_sequence_BRG 0x04
# define IN_color_sequence_BGR 0x05
# define IN_color_sequence_all 0x07
#define get_inquiry_color_order(in) getbitfield(in+0x6d,0x1f,0)
#define set_inquiry_color_order(in,val) setbitfield(in+0x6d,0x1f,0,val)
#define get_inquiry_color_order_pixel(in) getbitfield(in+0x6d, 1, 0)
#define get_inquiry_color_order_line_no_ccd(in) getbitfield(in+0x6d, 1, 1)
#define get_inquiry_color_order_plane(in) getbitfield(in+0x6d, 1, 2)
#define get_inquiry_color_order_line_w_ccd(in) getbitfield(in+0x6d, 1, 3)
#define get_inquiry_color_order_reserved(in) getbitfield(in+0x6d, 1, 4)
#define get_inquiry_color_order(in) getbitfield(in + 0x6d, 0x1f, 0)
#define set_inquiry_color_order(in,val) setbitfield(in + 0x6d, 0x1f, 0, val)
#define get_inquiry_color_order_pixel(in) getbitfield(in + 0x6d, 1, 0)
#define get_inquiry_color_order_line_no_ccd(in) getbitfield(in + 0x6d, 1, 1)
#define get_inquiry_color_order_plane(in) getbitfield(in + 0x6d, 1, 2)
#define get_inquiry_color_order_line_w_ccd(in) getbitfield(in + 0x6d, 1, 3)
#define get_inquiry_color_order_reserved(in) getbitfield(in + 0x6d, 1, 4)
# define IN_color_ordering_pixel 0x01
# define IN_color_ordering_line_no_ccd 0x02
# define IN_color_ordering_plane 0x04
@ -344,9 +356,10 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define get_inquiry_uta_max_scan_length(in) getnbyte(in + 0x80, 2)
#define get_inquiry_0x82(in) in[0x82]
#define get_inquiry_0x83(in) in[0x83]
#define get_inquiry_0x84(in) in[0x84]
#define get_inquiry_0x85(in) in[0x85]
#define get_inquiry_dor_max_opt_res(in) in[0x83]
#define get_inquiry_dor_max_x_res(in) in[0x84]
#define get_inquiry_dor_max_y_res(in) in[0x85]
#define get_inquiry_dor_x_original_point(in) getnbyte(in + 0x86, 2)
#define get_inquiry_dor_y_original_point(in) getnbyte(in + 0x88, 2)
@ -380,6 +393,12 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define set_inquiry_adf_line_arrangement_mode(out,val) out[0x9c]=val
#define set_inquiry_CCD_line_distance(out,val) out[0x9d]=val
#define get_inquiry_0x9e(in) in[0x9e]
#define get_inquiry_dor_optical_resolution_residue(in) in[0xa0]
#define get_inquiry_dor_x_resolution_residue(in) in[0xa1]
#define get_inquiry_dor_y_resolution_residue(in) in[0xa2]
/* --------------------------------------------------------------------------------------------------------- */
@ -895,7 +914,7 @@ static scsiblk request_sense = { request_senseC, sizeof(request_senseC) };
/* --------------------------------------------------------------------------------------------------------- */
static char *cbhs_str[] = { "78-178","0-255", "0-255 autoexposure", "reserved" };
static char *cbhs_str[] = { "0-50","0-255", "0-255 autoexposure", "reserved" };
static char *scanmode_str[] = { "flatbed (FB)", "automatic document feeder (ADF)" };

Wyświetl plik

@ -3,7 +3,7 @@
/* umax-uc1200s.h: inquiry for UMAX scanner uc1200s
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as

Wyświetl plik

@ -3,7 +3,7 @@
/* umax-uc1200se.h: inquiry for UMAX scanner uc1200se
(C) 1998 Oliver Rauch
(C) 1998-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@ -74,21 +74,21 @@ static unsigned char UC1200SE_INQUIRY[] =
00, 00, 00, 00, 00, 00, 00, 00,
/* 60 -62 scanner capability*/
0x2e,
0x3e,
0x0c,
0x07,
0x03,
/* 63 reserved */
0x00,
/* 64 gamma */
0xa3,
0x83,
/* 65 reserved */
0x00,
/* 66 GIB */
0x05,
0x04,
/* 67 reserved */
0x00,
@ -97,13 +97,13 @@ static unsigned char UC1200SE_INQUIRY[] =
0x01,
/* 69 - 6a halftone */
0x0c, 0x2f,
0x00, 0x2f,
/* 6b - 6c reserved */
0x00, 0x00,
/* 6d color sequence */
0xe8, /* 0xe9 or 0xe1 ? */
0xe1, /* 0xe8, 0xe9 or 0xe1 ? */
/* 6e - 71 video memory */
0x00, 0x20, 0x00, 0x00,
@ -166,7 +166,7 @@ static unsigned char UC1200SE_INQUIRY[] =
0x00,
/* 92-93 window descriptor block length */
0x00, 0x30,
0x00, 0x31,
/* 94 optical resolution residue (1dpi) */
0x00,

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-uc1260.h: inquiry for UMAX scanner uc1260
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-uc630.h: inquiry for UMAX scanner uc630
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-uc840.h: inquiry for UMAX scanner uc840
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-ug630.h: inquiry for UMAX scanner ug630
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as

Wyświetl plik

@ -2,7 +2,7 @@
/* umax-ug80.h: inquiry for UMAX scanner ug80
(C) 1998 Oliver Rauch
(C) 1998-2000 Oliver Rauch
Thanks to Andreas Hofmeister <hofmeist@informatik.uni-freiburg.de>
for his help!

Wyświetl plik

@ -6,10 +6,7 @@ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
KNOWN BUGS:
* some UC630 and UC840 don't work in greyscale and rgb-mode
* pixel count in x-direction is sometimes wrong if xres > 600dpi (Vista S12)
* pixel count in x-direction is sometimes wrong (res>600dpi)
* line count is sometimes wrong for Astra 6X0S in colormode while
driver does color ordering
* first scan with Astra 2400S gives wrong colors

Wyświetl plik

@ -474,8 +474,6 @@ sane-1.00-build-0 -> build-1
* removed options speed and smear, I got the info from umax that
these values should never be changed!
-----------------
* removed ten_bit_mode and twelve_bit_mode options, added option bit_depth
and added support for 9, 14 and 16 bpp
@ -494,8 +492,8 @@ build-1 -> build-2
* added inverted calibration modes for Astra 6X0S scanners.
build-2 -> build-3
------------------
build-2 -> build-3 (sane-1.0.1)
-------------------------------
* inversion of calibration is automatically set for Astra 6X0S and Vista S6E
@ -503,3 +501,212 @@ build-2 -> build-3
* made umax_do request_sense static
build-3 -> build-4
------------------
* Added option name and parameter in debug output in option set value
* Added option name in debug output in option get value
* Changed calculation of pixels/line and lines, may be the problem
with shaered images at resolutions>600 dpi is solved now
later Remark: This error does still occur, but not so often!
build-4 -> build-5
------------------
* Changed calculation in umax_order_line, color images should
have the correct length now for Astra 6X0S and Vista S6E
* Added DOR resolutions and area
build-5 -> build-6
------------------
* Bits for ADF and UTA in driver internal inquiry block (old UMAX scanners)
are set dynamically now.
* Added Genius ColorPage-HR5 (vendor KYE) (=Astra 1200S) as supported scanner
* Added Astra 2400S as experimentally supported scanner
* Added pauses for Astra 2400S
* Removed reposition_scanner at start of scan, Astra 2400S does not work with it!
* changed debug output in correct_inquiry
* for UMAX S12 the driver does not wait any more until scanner is repositioned
this is experimental, it may work with other scanners too!
build-6 -> build-7
------------------
* changed some int -> unsigned int (resolution and scanwidth etc)
* calculate_pixel is called with right values in UTA mode now.
* if DOR resolution is not defined and DOR is available
the DOR resolution is set to double standard resolution
* removed wait_scanner after set_window-command
* added Mirage D16-L as supported scanner
* Astra 2400S works stable now
build-7 -> build-8
------------------
* for Mirage D-16L the driver does not wait any more until scanner is repositioned
this is experimental, it may work with other scanners too!
* Mirage D-16L does not give back informations for calibration by driver,
added new modus that "guesses" the values for Mirage D-16L.
* Added read_shading_data to 16 bit calibration routine and made a routine for
averaging with low byte first and one for high byte first
* Byte order (HBT) is set always (also in lineart and halftone)
because it is used in driver calibration
* Added relevant_*_res the is set to normal or double resolution values
* Added test if scsi buffer is large enough for one shading line
* selection for Calibration mode, Shading type and Speed/Smear
are only compiled in if define is set in umax.h
build-8 -> build-9
------------------
* slow speed options is preset for Vista T-630
* speed/smear can be set now (forgotten #ifdef)
* selection of exposure times now is only available if it is enabeld
* gamma table is disabled in lineart and halftone modes
* if image is transmitted completly sane_read (close_pipe)
returns with SANE_STATUS_GOOD in adf mode and in any other case
with SANE_STATUS_EOF
build-9 -> build-10
-------------------
* removed change about sane_read returns SANE_STATUS_GOOD in ADF mode
* transformed all gif files into jpeg format because of all the
trouble about the gif licence. Will never use gif again!
* added correction for inquiry-ADF-bit for Astra 2400S
* added second test method to detect ADF error in sane_start:
inquiry block is read and cover open, jammed and no paper is tested
build-10 -> build-11
--------------------
* test for adf errors (sane_start) is now only done if adf is selected
build-11 -> build-12
--------------------
* moved adf error tests from sane_start to umax_start_scan
* sane_control_option: printing option name is set to "(none)" if pointer is NULL
* added error message after each call of sanei_scsi_cmd
* changed manipulation of ADF bit for Astra 2400S in umax_correct_inquiry
from dev->adf to set_inquiry_sc_adf()
build-12 -> build-13
--------------------
* changed inquiry data of UC1200SE
* added set_inquiry_CBHS(50) in correct_inquiry for UC1200SE
* correct_inquiry is called for scanners with short inquiry now
* dev->inquiry_max_calib_lines is preset to 66,
problem with Vist S6E V1.6 should be solved this way.
* inquiry block parameters > 0x93 are only used if block is long enough
build-13 -> build-14
--------------------
* changed inquiry_cbhs_[min,max] -> inquiry_[contrast, brightness, threshold,
highlight, shadow]_[min,max] and set correct values for CBHS_255 and CBHS_50
* changed cbhs_str[CBHS_50] from "78-178" to "0-50"
* changed umax-uc1200se.h inquiry byte 0x64 bit 5 to 0 (gamma download format != 2)
and wdb len from 0x30 to 0x31
* disabled halftone pattern download, and halftone dimension selection - not ready
preselected is a 8x8 built in halftone pattern
* removed set_inquiry_CBHS(50) from correct_inquiry for UC1200SE
* added "Astra 2200 " as supported scanner
* added cast from (void *) to (unsigned char*) in umax_send_gamma_data
build-14 -> build-15
--------------------
* add "(unsigned)" to option number test in sane_control_option
* for Astra 1200 the driver does not wait any more until scanner is repositioned
this is experimental, it may work with other scanners too!
build-15 -> build-16
--------------------
* OPT_SOURCE: removed change of width/height and "*info |= SANE_INFO_RELOAD_PARAMS;"
from get_value to set_value and added "*info |= SANE_INFO_RELOAD_OPTIONS;"
build-16 -> build-17
--------------------
* changed calibration mode from SHADING_TYPE_AVERAGE_INVERT to SHADING_TYPE_AVERAGE
for UMAX S-6E, UMAX S-6EG and Vista-S6E
* changed several int -> unsigned int
* added support for sanei_scsi_open_extended and variable scsi buffer size
build-17 -> build-18
--------------------
* some cosmetic changes of the form
if (..) {...}
=>
if (..)
{
...
}
* removed unnecessary SHADING_TYPE-handling routines for UMAX S-6E, UMAX S-6EG and Vista-S6E
* scsi buffer is only reallocated when size has changed

Wyświetl plik

@ -13,20 +13,18 @@ A: The optimization set by "-O2" makes problems, try which one of the following
-------------------------------------------------------------------------------
Q: Will there be a support for the UMAX-parallel-port-scanners?
A: UMAX published their SCSI-protocol for scanners, but the
parallel-port-protocol is not published until now. Without
such informations I will not work on a driver!
Martin Mevald <martinmv@penguin.cz> is working on a driver!
-------------------------------------------------------------------------------
Q: Will there be a support for the UMAX-USB-scanners?
A: I don't know if there is a published protocoll for the UMAX-USB-scanners.
As far as I know there are no generic-USB-drivers on unix-systems in the
moment. For linux it is worked on a driver.
A: UMAX published their SCSI-protocol for scanners. However they
have not so far published parallel port and USB protocols. Without
the protocol documentation I will not work on a driver.
Martin Mevald <martinmv@penguin.cz> has worked on a parallel-port-driver
but stopped the development.
The Astra 2200W does work when connected via SCSI.
It could work with SCSI-via-USB-driver and connected via USB, but that
is not tested.
-------------------------------------------------------------------------------
@ -50,9 +48,17 @@ A: The cards that come with the umax scanners are very simple cards.
the UDS-IS11 is a DTC3181E-card based on the NCR5380-chip.
On linux you may have the chance to get it work with the recent
g_NCR5380-driver. The card does not have IRQ/DMA.
Try the following option for kernel/module:
dtc3181e=0x280,254
(Thanks to Colin Brough for that tip)
Try the following option for kernel: dtc_3181e=0x280,255
or use the following command:
insmod g_NCR5380 ncr_irq=255 ncr_addr=0x280 dtc_3181e=1
- ncr_irq=255 : no IRQ, no DMA
- ncr_irq=254 : autoprobe IRQ
- ncr_addr : can be: 0x220 0x240 0x280 0x2A0 0x2C0 0x300 0x320 0x340
(Thanks to Colin Brough and Hans Schaefer for that tip)
-------------------------------------------------------------------------------
@ -60,7 +66,35 @@ Q: I use linux with a NCR/Symbios logic SCSI-Controller, sane does not work
right.
A: There are two differen drivers in the linux Kernel/modules.
Use the BSD-driver!
Use the BSD-driver (ncr53c8xx)!
-------------------------------------------------------------------------------
Q: Does SANE and the umax backend work on LinuxPPC / big endian machine ?
A: There are people using the sane-umax on a LinuxPPC (big endian) machine.
Other people write that they can not scan on a LinuxPPC. It looks like this
is a problem with the driver of the scsi card.
The "MESH" SCSI card is reported to work. The NCR53C94 SCSI card
seems not to work.
-------------------------------------------------------------------------------
Q: I am using an AM53C974 based scsi card with a umax scanner, the system
freezes when I start a scan, what can I do?
A: Try the recent driver for the scsi card, take a look at:
http://www.garloff.de/kurt/linux/dc390/index.html
-------------------------------------------------------------------------------
Q: Sane hangs or crashes when I start a frontend for sane, what can I do?
A: Sometimes the backends that are not used make problems.
Edit /usr/(local)/etc/sane.d/dll.conf
and comment out everything but the backend you need.
-------------------------------------------------------------------------------

Wyświetl plik

@ -1,22 +1,15 @@
TODO UMAX BACKEND FOR SANE
==========================
* DOR-Mode
* change set_window if (dev->do_color_ordering != 0) {..}
one of the settings makes an error for Astra 6X0S scanners
* make UTA test work with UTA-lamp on!
* UTA x- and y-original point is not used!
* include push-button function to SANE_START (?)
* test exposure-times
* if possible - add white calibration on picture
* add support for parallel-port-scanners
* turn off gamma correction in lineart mode
* add builtin halftone pattern selection
* add halftone pattern doenload, dimension selection

Plik diff jest za duży Load Diff

Wyświetl plik

@ -2,7 +2,7 @@
/* umax.h - headerfile for SANE-backend for umax scanners
(C) 1997-1998 Oliver Rauch
(C) 1997-2000 Oliver Rauch
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@ -51,6 +51,19 @@
#include "sys/types.h"
/* --------------------------------------------------------------------------------------------------------- */
/* COMPILER OPTIONS: */
#define UMAX_HIDE_UNUSED
/* #define SANE_UMAX_DEBUG_S12 */
/* #define PREVIEW_FIX_ON */
/* #define UMAX_SHADING_TYPE_SELECTABLE */
/* #define UMAX_SPEED_SELECTABLE */
/* #define UMAX_CALIBRATION_MODE_SELECTABLE */
/* --------------------------------------------------------------------------------------------------------- */
@ -135,13 +148,19 @@ enum Umax_Option
OPT_SELECT_EXPOSURE_TIME,
OPT_SELECT_LAMP_DENSITY,
#if 0
#ifdef UMAX_SPEED_SELECTABLE
OPT_SLOW,
OPT_SMEAR,
#endif
#ifdef UMAX_CALIBRATION_MODE_SELECTABLE
OPT_CALIB_MODE,
#endif
#ifdef UMAX_SHADING_TYPE_SELECTABLE
OPT_SHADING_TYPE,
#endif
OPT_PREVIEW, /* preview, sets preview-bit and bind x/y-resolution */
/* must come last: */
@ -213,15 +232,20 @@ typedef struct Umax_Device
/* data defined by inquiry */
int inquiry_len; /* length of inquiry return block */
int inquiry_wdb_len; /* length of window descriptor block */
int inquiry_optical_res; /* optical resolution form read_inquiry */
int inquiry_optical_res; /* optical resolution */
int inquiry_x_res; /* maximum x-resolution */
int inquiry_y_res; /* maximum y-resolution */
int inquiry_dor_optical_res; /* optical resolution for dor mode */
int inquiry_dor_x_res; /* maximum x-resolution for dor mode */
int inquiry_dor_y_res; /* maximum y-resolution for dor mode */
double inquiry_fb_width; /* flatbed width in inches */
double inquiry_fb_length; /* flatbed length in inches */
double inquiry_uta_width; /* transparency width in inches */
double inquiry_uta_length; /* transparency length in inches */
double inquiry_dor_width; /* double resolution width in inches */
double inquiry_dor_length; /* double resolution length in inches */
double inquiry_dor_x_off; /* double resolution x offset in inches */
double inquiry_dor_y_off; /* double resolution y offset in inches */
int inquiry_exposure_adj; /* 1 if exposure adjust is supported */
int inquiry_exposure_time_step_unit; /* exposure time unit in micro sec */
@ -247,6 +271,16 @@ typedef struct Umax_Device
int inquiry_cbhs; /* 50, 255, 255+autoexp. */
int inquiry_cbhs_min; /* minimum value for cbhs */
int inquiry_cbhs_max; /* maximum value for cbhs */
int inquiry_contrast_min; /* minimum value for c */
int inquiry_contrast_max; /* maximum value for c */
int inquiry_brightness_min; /* minimum value for b */
int inquiry_brightness_max; /* maximum value for b */
int inquiry_threshold_min; /* minimum value for t */
int inquiry_threshold_max; /* maximum value for t */
int inquiry_highlight_min; /* minimum value for h */
int inquiry_highlight_max; /* maximum value for h */
int inquiry_shadow_min; /* minimum value for s */
int inquiry_shadow_max; /* maximum value for s */
int inquiry_quality_ctrl; /* 1 = supported */
int inquiry_preview; /* 1 = supported */
@ -281,6 +315,10 @@ typedef struct Umax_Device
int inquiry_fb_uta_color_arrangement; /* line arrangement for fb & uta */
int inquiry_adf_color_arrangement; /* line arrangement for adf */
int relevant_optical_res; /* optical resolution */
int relevant_max_x_res; /* maximum x-resolution */
int relevant_max_y_res; /* maximum y-resolution */
/* selected data */
int use_exposure_time_min; /* exposure tine minimum */
@ -291,23 +329,23 @@ typedef struct Umax_Device
int wdb_len; /* use this length of WDB */
double maxwidth; /* use this width of scan-area */
double maxlength; /* use this length of scan-area */
int width_in_pixels; /* thats the wanted width in pixels */
int length_in_pixels; /* thats the wanted length in pixels */
int scanwidth; /* thats the width in pixels at x_coordinate_base dpi */
int scanlength; /* thats the length in pixels at y_coordinate_base dpi */
int bytes_per_color; /* bytes per each color */
unsigned int width_in_pixels; /* thats the wanted width in pixels */
unsigned int length_in_pixels; /* thats the wanted length in pixels */
unsigned int scanwidth; /* thats the width in pixels at x_coordinate_base dpi */
unsigned int scanlength; /* thats the length in pixels at y_coordinate_base dpi */
unsigned int bytes_per_color; /* bytes per each color */
int x_resolution; /* scan-resolution for x in dpi */
int y_resolution; /* scan-resolution for y in dpi */
unsigned int x_resolution; /* scan-resolution for x in dpi */
unsigned int y_resolution; /* scan-resolution for y in dpi */
double scale_x; /* x-scaling of optical resolution */
double scale_y; /* y-scaling of optical resolution */
int upper_left_x; /* thats the left edge in points at 1200pt/inch */
int upper_left_y; /* thats the top edge in points at 1200pt/inch */
int x_coordinate_base; /* x base in pixels/inch, normaly 1200 */
int y_coordinate_base; /* y base in pixels/inch, normaly 1200 */
unsigned int x_coordinate_base; /* x base in pixels/inch, normaly 1200 */
unsigned int y_coordinate_base; /* y base in pixels/inch, normaly 1200 */
int bits_per_pixel; /* number of bits per pixel */
unsigned int bits_per_pixel; /* number of bits per pixel */
int bits_per_pixel_code; /* 1 = 24bpp, 4 = 30 bpp, 8 = 36 bpp */
int gamma_input_bits_code; /* 1 = 24bpp, 4 = 30 bpp, 8 = 36 bpp */
int set_auto; /* 0 or 1, don't know what it is */
@ -371,6 +409,13 @@ typedef struct Umax_Device
int button_pressed; /* scan-button on scanner is pressed => 1 */
int calibration_area; /* define calibration area if no area is given */
int pause_for_color_calibration; /* pause between start_scan and do_calibration in ms */
int pause_for_gray_calibration; /* pause between start_scan and do_calibration in ms */
int pause_after_calibration; /* pause between do_calibration and read data in ms */
int pause_after_reposition; /* pause for repositioning in ms */
int pause_for_moving; /* pause for moving scanhead over full scanarea in ms */
int RGB_PREVIEW_FIX;
} Umax_Device;

27
backend/v4l.desc 100644
Wyświetl plik

@ -0,0 +1,27 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "v4l" ; name of backend
:version "(0.1)" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;:manpage "sane-v4l" ; name of manpage (if it exists)
:url "http://www.franken.de/users/solid/" ; backend's web page
:devicetype :api ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:devicetype :api ; specify a different type
:desc "Interface to Video For Linux API" ; describe a non-hardware device
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

27
backend/v4l2.desc 100644
Wyświetl plik

@ -0,0 +1,27 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "v4l2" ; name of backend
:version "(19991125)" ; version of backend
:status :alpha ; :alpha, :beta, :stable, :new
;:manpage "sane-v4l2" ; name of manpage (if it exists)
:url "http://video.inodes.org/sane-v4l2/" ; backend's web page
:devicetype :api ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:devicetype :api ; specify a different type
:desc "Interface to Video For Linux 2 API" ; describe a non-hardware device
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

89
config.guess vendored
Wyświetl plik

@ -1,6 +1,7 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -114,7 +115,13 @@ EOF
esac
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@ -158,7 +165,7 @@ EOF
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@ -414,7 +421,7 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 )
9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h>
#include <unistd.h>
@ -488,7 +495,7 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE*:*:*)
*9??*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@ -507,6 +514,9 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@ -546,7 +556,7 @@ EOF
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
@ -559,12 +569,12 @@ EOF
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
@ -589,6 +599,15 @@ EOF
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
@ -622,7 +641,36 @@ EOF
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
elf32ppc)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
@ -755,6 +803,14 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:5:7*)
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@ -764,18 +820,15 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
@ -862,7 +915,7 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else

290
config.sub vendored
Wyświetl plik

@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@ -98,11 +98,21 @@ case $os in
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=vxworks
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
@ -121,6 +131,13 @@ case $os in
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-7.1.* | sysv4.2uw*)
os=-unixware
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@ -152,14 +169,20 @@ case $basic_machine in
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips64 | mipsel | mips64el \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@ -175,26 +198,41 @@ case $basic_machine in
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67] \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* \
| f301-* | armv*-*)
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
@ -224,6 +262,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
@ -300,6 +342,10 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
@ -318,6 +364,14 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
@ -333,13 +387,30 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@ -348,13 +419,13 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
os=-mpeix
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
os=-mpeix
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
@ -377,6 +448,22 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@ -405,6 +492,10 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
*mint | *MiNT)
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
@ -419,10 +510,22 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
msdos)
basic_machine=i386-unknown
os=-msdos
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-corel
os=-linux
@ -439,6 +542,10 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
@ -464,9 +571,25 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
np1)
basic_machine=np1-gould
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@ -484,19 +607,19 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | nexen)
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | k6 | 6x86)
pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | k6-* | 6x86-*)
pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@ -520,12 +643,20 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent)
basic_machine=i386-sequent
;;
@ -533,6 +664,10 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
@ -540,6 +675,13 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
@ -584,6 +726,10 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=t3e-cray
os=-unicos
;;
tx39)
basic_machine=mipstx39-unknown
;;
@ -601,6 +747,10 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
@ -624,6 +774,14 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xmp)
basic_machine=xmp-cray
os=-unicos
@ -631,9 +789,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
*mint | *MiNT)
basic_machine=m68k-atari
os=-mint
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
@ -642,6 +800,15 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
@ -664,7 +831,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sparc)
sparc | sparcv9)
basic_machine=sparc-sun
;;
cydra)
@ -676,6 +843,16 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@ -729,14 +906,21 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
| -openstep* | -mpeix* | -oskit*)
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@ -761,6 +945,9 @@ case $os in
-acis*)
os=-aos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
@ -792,6 +979,12 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
@ -847,6 +1040,15 @@ case $basic_machine in
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@ -859,6 +1061,15 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
@ -922,6 +1133,15 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
@ -946,10 +1166,10 @@ case $basic_machine in
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
-beos*)
vendor=be
;;
-mpeix*)
-hpux*)
vendor=hp
;;
-mpeix*)
@ -982,6 +1202,12 @@ case $basic_machine in
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
vendor=atari
;;

Wyświetl plik

@ -2,4 +2,6 @@
#
# Notes: Set CPP to your path to cpp.exe.
#
LN_S=cp configure --sysconfdir=. --program-suffix=.exe --disable-dynamic --without-x
LN_S=cp \
LIBS=-lsyslog \
configure --sysconfdir=. --program-suffix=.exe --disable-dynamic --without-x

Wyświetl plik

@ -33,13 +33,13 @@ SECT1 = saned.1 scanimage.1 xscanimage.1
SECT5 = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-dll.5 sane-dc25.5 \
sane-dmc.5 sane-epson.5 sane-hp.5 sane-microtek.5 sane-microtek2.5 \
sane-mustek.5 sane-net.5 sane-pint.5 sane-pnm.5 sane-umax.5 \
sane-qcam.5 sane-scsi.5
sane-qcam.5 sane-scsi.5 sane-artec.5 sane-fujitsu.5 sane-sharp.5
MANPAGES = $(SECT1) $(SECT5)
LATEX = TEXINPUTS=$(srcdir):$$TEXINPUTS latex
DLH = TEXINPUTS=$(srcdir):$$TEXINPUTS dlh
MAN2HTML= nroff -man |\
man2html -compress -title $${page} -cgiurl '$$title.$$section.html'|\
sed 's,<BODY>,<BODY BGCOLOR=\#FFFFFF TEXT=\#000000><H1 ALIGN=CENTER><IMG SRC="../sane.gif" HEIGHT=117 WIDTH=346></H1>,'
sed 's,<BODY>,<BODY BGCOLOR=\#FFFFFF TEXT=\#000000><H1 ALIGN=CENTER><IMG SRC="../sane.png" HEIGHT=117 WIDTH=346></H1>,'
all: $(MANPAGES)

89
doc/canon.README 100644
Wyświetl plik

@ -0,0 +1,89 @@
This is a SANE backend with support for the following SCSI scanners:
Canon CanoScan 300
Canon CanoScan 600
Canon CanoScan 2700F
No parallel port scanners are supported and there are no plans to support
them in the future.
** IMPORTANT: this is alpha code. Don't expect this to work correctly. Many
functions are missing, others contain errors. In some cases, your computer
might even hang. It cannot be excluded (although I consider it extremely
unprobable) that your scanner will be damaged. **
That said, TESTERS ARE WELCOME. Send your bug reports and comments to
Manuel Panea <mpd@rzg.mpg.de>.
--------------------------------------------------------------------------
To install this SANE backend:
1) Get the SANE sources (from http://www.mostang.com/sane)
and install them. You will find the original canon backend. Do the complete
installation for the canon backend as explained in the docs which you get
with the sources and test that it works.
2) Assuming you installed the SANE sources under /usr/local/src/sane, copy
this backend's files to the /usr/local/src/sane/backend directory,
overwriting the existing "canon*" files.
3) Go to /usr/local/src/sane and type "make".
4) Test the backend by typing "frontend/xscanimage canon:/dev/scanner"
---------------------------------------------------------------------------
Here are some assorted tips and information about the use of the
backend. They refer to the 2700F model, but they may also apply to the
300/600 models:
* There is a bug in file 'frontend/preview.c', that is, a bug in the
'xscanimage' frontend. I include a modified version. Only one line need
be changed. The bug makes preview images look like diagonal stripes in
certain cases. This has been reported and should be fixed in a future
version of 'xscanimage'.
* There seems to be another bug in file '/usr/src/linux/drivers/scsi/sg.c'
(many thanks to Jonathan Adams for pointing this out, I really got stucked
for a long time until I knew about this). This bug makes some SCSI commands
not work. Apparently not everyone gets the problem because depending on
your SCSI configuration maybe you don't need 'sg.c'. If your computer hangs
misteriously, edit the file and change the 'sg_write' procedure (near
to where 'size=COMMAND_SIZE(opcode);' appears. Add the two lines:
if ((opcode == 0xd5) || (opcode == 0xd4)) size = 6;
else
before the line:
if (opcode >= 0xc0 && device->header.twelve_byte) size = 12;
Then recompile the kernel (or the 'sg' module, if you use modules).
* When scanning either slides or negatives, I found that I must set the
gamma value to something about 2.2 to 2.4 (I set the same value for all
three red, green, blue). Also, for slides, using "Auto Exposure" helps
a lot.
* The "Auto Exposure" function for slides makes the scanner do a first
pass on the film to determine the Highlight and Shadow point
values. The "Auto Focus" function triggers yet another pass to
determine the focus value. After that, the real scanning pass takes
place. The "Auto Exposure" function is not available for negatives yet.
* Even after "Auto Focus", the image I get is often a bit too
blurred. I found that using the GIMP to do a
"Filter->Enhance->Sharpen" at about 40 to 60 improves the image
quite a bit. In fact, I find it so good that I might implement a
sharpen filter into the backend in the future.
* The "native" scanner resolutions of the 2700F are the integer
sub-multiples of 2720 dpi, i.e. 1360, 680, 340 and 170. You can scan
at any other resolution, but you will notice that the image has
noticeably more jaggies that when using one of the "native"
resolutions.

Some files were not shown because too many files have changed in this diff Show More