diff -Nru sane-backends-1.0.20/acinclude.m4 sane-backends-1.0.21/acinclude.m4 --- sane-backends-1.0.20/acinclude.m4 2009-04-30 23:34:55.000000000 +1000 +++ sane-backends-1.0.21/acinclude.m4 2010-04-14 10:52:59.000000000 +1000 @@ -41,10 +41,10 @@ -Wstrict-prototypes \ -pedantic" - # OS/2 and others don't include some headers with -ansi enabled + # Some platforms are overly strict with -ansi enabled. Exclude those. ANSI_FLAG=-ansi case "${host_os}" in - solaris* | hpux* | os2* | darwin* ) + solaris* | hpux* | os2* | darwin* | cygwin* | mingw*) ANSI_FLAG= ;; esac @@ -220,24 +220,30 @@ [ case "${host_os}" in - darwin*) # currently only enabled on MacOS X + darwin* | mingw*) # currently only enabled on MacOS X on MINGW use_pthread=yes ;; *) use_pthread=no esac + have_pthread=no # # now that we have the systems preferences, we check # the user - AC_ARG_ENABLE( [fork-process], - AC_HELP_STRING([--enable-fork-process], - [use fork instead of pthread (default=no for MacOS X, yes for everything else)]), + + AC_ARG_ENABLE([pthread], + AC_HELP_STRING([--enable-pthread], + [use pthread instead of fork (default=yes for MacOS X/MINGW, no for everything else)]), [ - if test $enableval != yes ; then + if test $enableval = yes ; then use_pthread=yes + else + use_pthread=no fi ]) + + if test $use_pthread = yes ; then AC_CHECK_HEADERS(pthread.h, [ AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread") @@ -246,17 +252,21 @@ LIBS="$LIBS $PTHREAD_LIBS" AC_CHECK_FUNCS([pthread_create pthread_kill pthread_join pthread_detach pthread_cancel pthread_testcancel], ,[ have_pthread=no; use_pthread=no ]) - LIBS="$save_LIBS" + LIBS="$save_LIBS" ],) - AC_SUBST(PTHREAD_LIBS) + fi if test $use_pthread = yes ; then AC_DEFINE_UNQUOTED(USE_PTHREAD, "$use_pthread", [Define if pthreads should be used instead of forked processes.]) + else + dnl Reset library in case it was found but we are not going to use it. + PTHREAD_LIBS="" fi if test "$have_pthread" = "yes" ; then CPPFLAGS="${CPPFLAGS} -D_REENTRANT" fi + AC_SUBST(PTHREAD_LIBS) AC_MSG_CHECKING([whether to enable pthread support]) AC_MSG_RESULT([$have_pthread]) AC_MSG_CHECKING([whether to use pthread instead of fork]) @@ -383,19 +393,29 @@ AC_DEFUN([SANE_LINKER_RPATH], [dnl AC_REQUIRE([AC_SUBST])dnl This line resulted in an empty AC_SUBST() !! - AC_CACHE_CHECK([linker parameter to set runtime link path], my_cv_LINKER_RPATH, - [my_cv_LINKER_RPATH= - case "$host_os" in - linux* | freebsd* | netbsd* | openbsd* | irix*) - # I believe this only works with GNU ld [pere 2001-04-16] - my_cv_LINKER_RPATH="-Wl,-rpath," - ;; - solaris*) - my_cv_LINKER_RPATH="-R " - ;; - esac - ]) - LINKER_RPATH="$my_cv_LINKER_RPATH" + AC_MSG_CHECKING([whether runtime link path should be used]) + AC_ARG_ENABLE([rpath], + [AS_HELP_STRING([--enable-rpath], + [use runtime library search path @<:@default=yes@:>@])]) + + LINKER_RPATH= + AS_IF([test "x$enable_rpath" != xno], + AC_MSG_RESULT([yes]) + [AC_CACHE_CHECK([linker parameter to set runtime link path], my_cv_LINKER_RPATH, + [my_cv_LINKER_RPATH= + case "$host_os" in + linux* | freebsd* | netbsd* | openbsd* | irix*) + # I believe this only works with GNU ld [pere 2001-04-16] + my_cv_LINKER_RPATH="-Wl,-rpath," + ;; + solaris*) + my_cv_LINKER_RPATH="-R " + ;; + esac + ]) + LINKER_RPATH="$my_cv_LINKER_RPATH"], + [AC_MSG_RESULT([no]) + LINKER_RPATH=]) AC_SUBST(LINKER_RPATH)dnl ]) @@ -408,7 +428,7 @@ dnl The old style would add an #undef of the type check on platforms dnl that defined that type... That is not portable to platform that dnl define it as a #define. -AC_CHECK_TYPES([u_char, u_int, u_long],,,) +AC_CHECK_TYPES([u_char, u_short, u_int, u_long],,,) ]) # @@ -570,7 +590,7 @@ mustek_pp) if test "${sane_cv_use_libieee1284}" != "yes" && test "${enable_parport_directio}" != "yes"; then - echo "*** $be backend requires libieee1284 and paraport-directio libraries - DISABLE_MSG" + echo "*** $be backend requires libieee1284 and paraport-directio libraries - $DISABLE_MSG" backend_supported="no" fi ;; @@ -643,9 +663,16 @@ [ AH_BOTTOM([ +#if defined(__MINGW32__) +#define _BSDTYPES_DEFINED +#endif + #ifndef HAVE_U_CHAR #define u_char unsigned char #endif +#ifndef HAVE_U_SHORT +#define u_short unsigned short +#endif #ifndef HAVE_U_INT #define u_int unsigned int #endif @@ -724,7 +751,6 @@ /* Prototype for vsyslog */ #ifndef HAVE_VSYSLOG -#define vsyslog sanei_vsyslog #include void vsyslog(int priority, const char *format, va_list args); #endif diff -Nru sane-backends-1.0.20/aclocal.m4 sane-backends-1.0.21/aclocal.m4 --- sane-backends-1.0.20/aclocal.m4 2009-05-04 02:39:00.000000000 +1000 +++ sane-backends-1.0.21/aclocal.m4 2010-04-05 23:18:03.000000000 +1000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.63],, +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. @@ -175,7 +175,7 @@ fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -187,10 +187,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' +[am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -204,12 +204,12 @@ # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -266,14 +266,14 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -286,6 +286,7 @@ AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -299,14 +300,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -363,6 +364,16 @@ if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -380,7 +391,17 @@ done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested @@ -390,19 +411,23 @@ break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -459,57 +484,68 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -529,13 +565,13 @@ # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 13 +# serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -552,7 +588,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl +[AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -603,8 +639,8 @@ AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -612,24 +648,37 @@ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header @@ -652,7 +701,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -663,7 +712,14 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -690,27 +746,38 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl + AC_SUBST([MAINT])dnl ] ) @@ -718,13 +785,13 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -733,7 +800,7 @@ [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -743,24 +810,24 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) @@ -768,14 +835,14 @@ rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_PROG_CC_C_O # -------------- @@ -787,8 +854,9 @@ # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC -ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. @@ -804,14 +872,14 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -828,7 +896,14 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " @@ -866,13 +941,13 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -889,7 +964,7 @@ # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -899,14 +974,14 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_SANITY_CHECK # --------------- @@ -915,16 +990,29 @@ # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ @@ -977,18 +1065,25 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff -Nru sane-backends-1.0.20/AUTHORS sane-backends-1.0.21/AUTHORS --- sane-backends-1.0.20/AUTHORS 2009-01-19 05:45:37.000000000 +1100 +++ sane-backends-1.0.21/AUTHORS 2010-04-05 23:18:03.000000000 +1000 @@ -68,6 +68,7 @@ nec: Kazuya Fukuda (*) net: Andreas Beck, David Mosberger, Julien Blache (*) niash: Ullrich Sigwanz (*), Bertrik Sikken + p5: Stéphane Voltz (*) pie: Simon Munton (*) pint: Gordon Matzigkeit pixma: Wittawat Yamwong (*) diff -Nru sane-backends-1.0.20/backend/abaton.c sane-backends-1.0.21/backend/abaton.c --- sane-backends-1.0.20/backend/abaton.c 2009-02-27 03:11:16.000000000 +1100 +++ sane-backends-1.0.21/backend/abaton.c 2010-04-05 23:18:03.000000000 +1000 @@ -45,7 +45,7 @@ This file implements a SANE backend for Abaton flatbed scanners. */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -61,27 +61,26 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" #define BACKEND_NAME abaton -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define ABATON_CONFIG_FILE "abaton.conf" #include "abaton.h" -#define MM_PER_INCH 25.4 static int num_devices; static Abaton_Device *first_dev; @@ -343,11 +342,11 @@ invert = s->val[OPT_NEGATIVE].w; - if (!strcmp (s->val[OPT_MODE].s, "Lineart")) + if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) { STORE8 (window + 17, 0); } - else if (!strcmp (s->val[OPT_MODE].s, "Halftone")) + else if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_HALFTONE)) { STORE8 (window + 17, 1); } @@ -514,7 +513,7 @@ DBG (FLOW_CONTROL, "Entering calc_parameters\n"); - if (!strcmp (val, "Lineart") || !strcmp (val, "Halftone")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) || !strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) { s->params.depth = 1; s->bpp = 1; @@ -584,14 +583,14 @@ { Abaton_Scanner *s = handle; - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) { DISABLE (OPT_BRIGHTNESS); DISABLE (OPT_CONTRAST); ENABLE (OPT_THRESHOLD); DISABLE (OPT_HALFTONE_PATTERN); } - else if (!strcmp (val, "Halftone")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) { ENABLE (OPT_BRIGHTNESS); ENABLE (OPT_CONTRAST); @@ -661,12 +660,12 @@ s->opt[OPT_MODE_GROUP].cap = 0; s->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - mode_list[0]="Lineart"; + mode_list[0]=SANE_VALUE_SCAN_MODE_LINEART; switch (s->hw->ScannerModel) { case ABATON_300GS: - mode_list[1]="Halftone"; + mode_list[1]=SANE_VALUE_SCAN_MODE_HALFTONE; mode_list[2]="Gray16"; mode_list[3]="Gray256"; mode_list[4]=NULL; diff -Nru sane-backends-1.0.20/backend/agfafocus.c sane-backends-1.0.21/backend/agfafocus.c --- sane-backends-1.0.20/backend/agfafocus.c 2008-11-27 08:21:22.000000000 +1100 +++ sane-backends-1.0.21/backend/agfafocus.c 2010-04-05 23:18:03.000000000 +1000 @@ -21,7 +21,7 @@ This file implements a SANE backend for AGFA Focus flatbed scanners. */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -31,15 +31,15 @@ #include #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/sanei_config.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_thread.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_thread.h" #define BACKEND_NAME agfafocus -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "agfafocus.h" @@ -47,7 +47,6 @@ # define PATH_MAX 1024 #endif -#define MM_PER_INCH 25.4 #undef Byte #define Byte SANE_Byte diff -Nru sane-backends-1.0.20/backend/apple.c sane-backends-1.0.21/backend/apple.c --- sane-backends-1.0.20/backend/apple.c 2009-02-27 03:11:16.000000000 +1100 +++ sane-backends-1.0.21/backend/apple.c 2010-04-05 23:18:03.000000000 +1000 @@ -43,7 +43,7 @@ This file implements a SANE backend for Apple flatbed scanners. */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -59,12 +59,12 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" /* SCSI commands that the Apple scanners understand: */ @@ -124,18 +124,17 @@ #define READ24(p) *(p)*65536 + *(p+1)*256 + *(p+2) -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define APPLE_CONFIG_FILE "apple.conf" #include "apple.h" -#define MM_PER_INCH 25.4 static int num_devices; static Apple_Device *first_dev; @@ -680,16 +679,16 @@ /* The Mode */ - if (!strcmp (s->val[OPT_MODE].s, "Lineart")) + if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) STORE8 (WP + 25, 0) - else if (!strcmp (s->val[OPT_MODE].s, "Halftone")) + else if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_HALFTONE)) STORE8 (WP + 25, 1) - else if (!strcmp (s->val[OPT_MODE].s, "Gray") || + else if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY) || !strcmp (s->val[OPT_MODE].s, "Gray16")) STORE8 (WP + 25, 2) else if (!strcmp (s->val[OPT_MODE].s, "BiColor")) STORE8 (WP + 25, 3) - else if (!strcmp (s->val[OPT_MODE].s, "Color")) + else if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR)) STORE8 (WP + 25, 5) else { @@ -881,14 +880,14 @@ DBG (FLOW_CONTROL, "Entering calc_parameters\n"); - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) { s->params.last_frame = SANE_TRUE; s->params.format = SANE_FRAME_GRAY; s->params.depth = 1; s->bpp = 1; } - else if (!strcmp (val, "Halftone")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) { s->params.last_frame = SANE_TRUE; s->params.format = SANE_FRAME_GRAY; @@ -902,7 +901,7 @@ s->params.depth = 8; s->bpp = 4; } - else if (!strcmp (val, "Gray")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_GRAY)) { s->params.last_frame = SANE_TRUE; s->params.format = SANE_FRAME_GRAY; @@ -916,7 +915,7 @@ s->params.depth = 24; s->bpp = 3; } - else if (!strcmp (val, "Color")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_COLOR)) { s->params.last_frame = SANE_FALSE; s->params.format = SANE_FRAME_RED; @@ -1066,7 +1065,7 @@ if (s->hw->ScannerModel == COLORONESCANNER) { - if ( !strcmp(s->val[OPT_MODE].s,"Gray") || + if ( !strcmp(s->val[OPT_MODE].s,SANE_VALUE_SCAN_MODE_GRAY) || !strcmp(s->val[OPT_MODE].s,"Gray16") ) { ENABLE (OPT_CUSTOM_GAMMA); @@ -1103,7 +1102,7 @@ goto discustom; } } - else if (!strcmp(s->val[OPT_MODE].s,"Color")) + else if (!strcmp(s->val[OPT_MODE].s,SANE_VALUE_SCAN_MODE_COLOR)) { ENABLE (OPT_CUSTOM_GAMMA); if (s->val[OPT_CUSTOM_GAMMA].w) @@ -1147,7 +1146,7 @@ DISABLE(OPT_COLOR_SENSOR); - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) { if (s->hw->ScannerModel == APPLESCANNER) ENABLE (OPT_AUTOBACKGROUND); @@ -1157,12 +1156,12 @@ UseThreshold=SANE_TRUE; } - else if (!strcmp (val, "Halftone")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) { DISABLE (OPT_AUTOBACKGROUND); ENABLE (OPT_HALFTONE_PATTERN); } - else if (!strcmp (val, "Gray16") || !strcmp (val, "Gray")) + else if (!strcmp (val, "Gray16") || !strcmp (val, SANE_VALUE_SCAN_MODE_GRAY)) { DISABLE (OPT_AUTOBACKGROUND); DISABLE (OPT_HALFTONE_PATTERN); @@ -1176,7 +1175,7 @@ DISABLE (OPT_HALFTONE_PATTERN); UseThreshold=SANE_TRUE; } - else if (!strcmp (val, "Color")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_COLOR)) { DISABLE (OPT_AUTOBACKGROUND); DISABLE (OPT_HALFTONE_PATTERN); @@ -1330,27 +1329,27 @@ switch (s->hw->ScannerModel) { case APPLESCANNER: - mode_list[0]="Lineart"; - mode_list[1]="Halftone"; + mode_list[0]=SANE_VALUE_SCAN_MODE_LINEART; + mode_list[1]=SANE_VALUE_SCAN_MODE_HALFTONE; mode_list[2]="Gray16"; mode_list[3]=NULL; break; case ONESCANNER: - mode_list[0]="Lineart"; - mode_list[1]="Halftone"; + mode_list[0]=SANE_VALUE_SCAN_MODE_LINEART; + mode_list[1]=SANE_VALUE_SCAN_MODE_HALFTONE; mode_list[2]="Gray16"; - mode_list[3]="Gray"; + mode_list[3]=SANE_VALUE_SCAN_MODE_GRAY; mode_list[4]=NULL; halftone_pattern_list[3]="spiral8x8"; halftone_pattern_list[4]="bayer8x8"; halftone_pattern_list[5]=NULL; break; case COLORONESCANNER: - mode_list[0]="Lineart"; + mode_list[0]=SANE_VALUE_SCAN_MODE_LINEART; mode_list[1]="Gray16"; - mode_list[2]="Gray"; + mode_list[2]=SANE_VALUE_SCAN_MODE_GRAY; mode_list[3]="BiColor"; - mode_list[4]="Color"; + mode_list[4]=SANE_VALUE_SCAN_MODE_COLOR; mode_list[5]=NULL; break; default: @@ -1494,7 +1493,7 @@ s->opt[OPT_AUTOBACKGROUND].title = "Use Auto Background Adjustment"; s->opt[OPT_AUTOBACKGROUND].desc = "Enables/Disables the Auto Background Adjustment feature"; - if (strcmp (s->val[OPT_MODE].s, "Lineart") + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) || (s->hw->ScannerModel != APPLESCANNER)) DISABLE (OPT_AUTOBACKGROUND); s->opt[OPT_AUTOBACKGROUND].type = SANE_TYPE_BOOL; @@ -1683,7 +1682,7 @@ /* Color Functions: Advanced */ - s->opt[OPT_COLOR_GROUP].title = "Color"; + s->opt[OPT_COLOR_GROUP].title = SANE_VALUE_SCAN_MODE_COLOR; s->opt[OPT_COLOR_GROUP].desc = ""; s->opt[OPT_COLOR_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_COLOR_GROUP].cap = SANE_CAP_ADVANCED; diff -Nru sane-backends-1.0.20/backend/artec.c sane-backends-1.0.21/backend/artec.c --- sane-backends-1.0.20/backend/artec.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/artec.c 2010-04-05 23:18:03.000000000 +1000 @@ -68,13 +68,13 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include "sane/sane.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_backend.h" -#include "sane/sanei_config.h" +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" #include @@ -85,7 +85,6 @@ #define ARTEC_SUB 16 #define ARTEC_LAST_MOD "05/26/2001 17:28 EST" -#define MM_PER_INCH 25.4 #ifndef PATH_MAX #define PATH_MAX 1024 @@ -101,7 +100,10 @@ static const SANE_String_Const mode_list[] = { - "Lineart", "Halftone", "Gray", "Color", + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_HALFTONE, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, 0 }; @@ -1356,22 +1358,22 @@ * byte 33 is mode * byte 37 bit 7 is "negative" setting */ - if (strcmp (s->mode, "Lineart") == 0) + if (strcmp (s->mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) { data[33] = ARTEC_COMP_LINEART; data[37] = (s->val[OPT_NEGATIVE].w == SANE_TRUE) ? 0x0 : 0x80; } - else if (strcmp (s->mode, "Halftone") == 0) + else if (strcmp (s->mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) { data[33] = ARTEC_COMP_HALFTONE; data[37] = (s->val[OPT_NEGATIVE].w == SANE_TRUE) ? 0x0 : 0x80; } - else if (strcmp (s->mode, "Gray") == 0) + else if (strcmp (s->mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) { data[33] = ARTEC_COMP_GRAY; data[37] = (s->val[OPT_NEGATIVE].w == SANE_TRUE) ? 0x80 : 0x0; } - else if (strcmp (s->mode, "Color") == 0) + else if (strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) { data[33] = ARTEC_COMP_COLOR; data[37] = (s->val[OPT_NEGATIVE].w == SANE_TRUE) ? 0x80 : 0x0; @@ -2990,7 +2992,7 @@ s->opt[OPT_FILTER_TYPE].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_NEGATIVE].cap &= ~SANE_CAP_INACTIVE; - if (strcmp (val, "Lineart") == 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0) { /* Lineart mode */ s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; /* OFF */ @@ -2999,13 +3001,13 @@ if (s->hw->flags & ARTEC_FLAG_ENHANCE_LINE_EDGE) s->opt[OPT_EDGE_ENH].cap &= ~SANE_CAP_INACTIVE; } - else if (strcmp (val, "Halftone") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) { /* Halftone mode */ if (s->hw->flags & ARTEC_FLAG_HALFTONE_PATTERN) s->opt[OPT_HALFTONE_PATTERN].cap &= ~SANE_CAP_INACTIVE; } - else if (strcmp (val, "Gray") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_GRAY) == 0) { /* Grayscale mode */ if (!(s->hw->flags & ARTEC_FLAG_MBPP_NEGATIVE)) @@ -3013,7 +3015,7 @@ s->opt[OPT_NEGATIVE].cap |= SANE_CAP_INACTIVE; } } - else if (strcmp (val, "Color") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_COLOR) == 0) { /* Color mode */ s->opt[OPT_FILTER_TYPE].cap |= SANE_CAP_INACTIVE; @@ -3085,13 +3087,13 @@ { const char *mode = s->val[OPT_MODE].s; - if ((strcmp (mode, "Lineart") == 0) || - (strcmp (mode, "Halftone") == 0) || - (strcmp (mode, "Gray") == 0)) + if ((strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) || + (strcmp (mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) || + (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0)) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; } - else if (strcmp (mode, "Color") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; @@ -3202,15 +3204,15 @@ if ((s->val[OPT_PREVIEW].w == SANE_TRUE) && (s->val[OPT_GRAY_PREVIEW].w == SANE_TRUE)) { - s->mode = "Gray"; + s->mode = SANE_VALUE_SCAN_MODE_GRAY; } else { s->mode = s->val[OPT_MODE].s; } - if ((strcmp (s->mode, "Lineart") == 0) || - (strcmp (s->mode, "Halftone") == 0)) + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) || + (strcmp (s->mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0)) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = (s->params.pixels_per_line + 7) / 8; @@ -3224,7 +3226,7 @@ /* full, so this should not affect scans in a negative way */ s->params.pixels_per_line = s->params.bytes_per_line * 8; } - else if (strcmp (s->mode, "Gray") == 0) + else if (strcmp (s->mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; @@ -3321,11 +3323,11 @@ return status; /* DAL: For 3 pass colour set the current pass parameters */ - if ((strcmp (s->mode, "Color") == 0) && s->threepasscolor) + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) && s->threepasscolor) set_pass_parameters (s); /* DAL: For single pass scans and the first pass of a 3 pass scan */ - if ((strcmp (s->mode, "Color") != 0) || + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) != 0) || (!s->threepasscolor) || ((s->threepasscolor) && (s->this_pass == 1))) @@ -3366,7 +3368,7 @@ s->x_resolution, s->y_resolution, (u_long) s->bytes_to_read); /* DAL: For single pass scans and the first pass of a 3 pass scan */ - if ((strcmp (s->mode, "Color") != 0) || !s->threepasscolor || + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) != 0) || !s->threepasscolor || (s->threepasscolor && s->this_pass == 1)) { @@ -3419,7 +3421,7 @@ /* now we can start the actual scan */ /* DAL: For single pass scans and the first pass of a 3 pass scan */ - if ((strcmp (s->mode, "Color") != 0) || + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) != 0) || (!s->threepasscolor) || (s->this_pass == 1)) { @@ -3481,7 +3483,7 @@ if (s->bytes_to_read == 0) { - if ((strcmp (s->mode, "Color") != 0) || !s->threepasscolor || + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) != 0) || !s->threepasscolor || (s->threepasscolor && s->this_pass == 3)) { do_cancel (s); @@ -3574,7 +3576,7 @@ write (debug_fd, temp_buf, nread); } - if ((strcmp (s->mode, "Color") == 0) && + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) && (s->hw->flags & ARTEC_FLAG_RGB_LINE_OFFSET)) { for (line = 0; line < lread; line++) @@ -3615,12 +3617,12 @@ else { if ((s->hw->flags & ARTEC_FLAG_IMAGE_REV_LR) || - ((strcmp (s->mode, "Color") == 0) && + ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) && (s->hw->flags & ARTEC_FLAG_RGB_CHAR_SHIFT))) { for (line = 0; line < lread; line++) { - if ((strcmp (s->mode, "Color") == 0) && + if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) && (s->hw->flags & ARTEC_FLAG_RGB_CHAR_SHIFT)) { artec_line_rgb_to_byte_rgb (temp_buf + @@ -3637,7 +3639,7 @@ /* do software calibration if necessary */ if ((s->val[OPT_SOFTWARE_CAL].w) && - (strcmp (s->mode, "Color") == 0)) + (strcmp (s->mode, SANE_VALUE_SCAN_MODE_COLOR) == 0)) { artec_software_rgb_calibrate (s, temp_buf, lread); } diff -Nru sane-backends-1.0.20/backend/artec_eplus48u.c sane-backends-1.0.21/backend/artec_eplus48u.c --- sane-backends-1.0.20/backend/artec_eplus48u.c 2008-11-27 08:21:22.000000000 +1100 +++ sane-backends-1.0.21/backend/artec_eplus48u.c 2010-04-05 23:18:03.000000000 +1000 @@ -93,8 +93,8 @@ #include "../include/sane/saneopts.h" #define BACKEND_NAME artec_eplus48u -#include "sane/sanei_backend.h" -#include "sane/sanei_config.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" #include "artec_eplus48u.h" @@ -151,9 +151,9 @@ static SANE_Word recv_small_res_index = 0x3f00; /**< Receive small result - wIndex */ static SANE_String_Const mode_list[] = { - SANE_I18N ("Lineart"), - SANE_I18N ("Grayscale"), - SANE_I18N ("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, NULL }; diff -Nru sane-backends-1.0.20/backend/artec_eplus48u.h sane-backends-1.0.21/backend/artec_eplus48u.h --- sane-backends-1.0.20/backend/artec_eplus48u.h 2008-05-15 22:50:20.000000000 +1000 +++ sane-backends-1.0.21/backend/artec_eplus48u.h 2010-04-05 23:18:03.000000000 +1000 @@ -36,7 +36,6 @@ #define HIBYTE(w) ((SANE_Byte)(((SANE_Word)(w) >> 8) & 0xFF)) #define LOBYTE(w) ((SANE_Byte)(w)) -#define MM_PER_INCH 25.4 #define CHECK_DEV_NOT_NULL(dev, func_name) \ do { \ diff -Nru sane-backends-1.0.20/backend/as6e.c sane-backends-1.0.21/backend/as6e.c --- sane-backends-1.0.20/backend/as6e.c 2008-11-27 08:21:22.000000000 +1100 +++ sane-backends-1.0.21/backend/as6e.c 2010-04-05 23:18:03.000000000 +1000 @@ -76,7 +76,9 @@ /* static SANE_Status attach_one (const char *dev); */ static const SANE_String_Const mode_list[] = { - "Lineart", "Gray", "Color", + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, 0 }; @@ -314,11 +316,11 @@ return (SANE_STATUS_IO_ERROR); DBG (1, "sending start_scan signal\n"); scan_params[0] = s->as6e_params.resolution; - if (strcmp (s->value[OPT_MODE].s, "Color") == 0) + if (strcmp (s->value[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) scan_params[1] = 0; - else if (strcmp (s->value[OPT_MODE].s, "Gray") == 0) + else if (strcmp (s->value[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY) == 0) scan_params[1] = 1; - else if (strcmp (s->value[OPT_MODE].s, "Lineart") == 0) + else if (strcmp (s->value[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) scan_params[1] = 2; else return (SANE_STATUS_JAMMED); /*this should never happen */ @@ -376,15 +378,15 @@ (s->as6e_params.stopline - s->as6e_params.startline) * s->as6e_params.resolution / 300; mode = s->value[OPT_MODE].s; -/* if ((strcmp (s->mode, "Lineart") == 0) || - (strcmp (s->mode, "Halftone") == 0)) +/* if ((strcmp (s->mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) || + (strcmp (s->mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0)) { s->sane_params.format = SANE_FRAME_GRAY; s->sane_params.bytes_per_line = (s->sane_params.pixels_per_line + 7) / 8; s->sane_params.depth = 1; } */ -/*else*/ if ((strcmp (mode, "Gray") == 0) - || (strcmp (mode, "Lineart") == 0)) +/*else*/ if ((strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) + || (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0)) { s->sane_params.format = SANE_FRAME_GRAY; s->sane_params.bytes_per_line = s->sane_params.pixels_per_line; diff -Nru sane-backends-1.0.20/backend/as6e.h sane-backends-1.0.21/backend/as6e.h --- sane-backends-1.0.20/backend/as6e.h 2003-09-13 02:10:33.000000000 +1000 +++ sane-backends-1.0.21/backend/as6e.h 2010-04-05 23:18:03.000000000 +1000 @@ -48,7 +48,7 @@ #include #include -#include +#include "../include/sane/sane.h" typedef enum @@ -118,7 +118,6 @@ #define READPIPE 0 #define WRITEPIPE 1 -#define MM_PER_INCH 25.4 #define SCAN_BUF_SIZE 32768 diff -Nru sane-backends-1.0.20/backend/avision.c sane-backends-1.0.21/backend/avision.c --- sane-backends-1.0.20/backend/avision.c 2009-03-31 08:08:30.000000000 +1100 +++ sane-backends-1.0.21/backend/avision.c 2010-04-05 23:18:03.000000000 +1000 @@ -136,14 +136,14 @@ #define BACKEND_NAME avision #define BACKEND_BUILD 290 /* avision backend BUILD version */ -#include -#include -#include -#include -#include -#include -#include -#include +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_thread.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_backend.h" #include @@ -164,443 +164,443 @@ { "AVISION", "AV100CS", 0, 0, "Avision", "AV100CS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV100IIICS", 0, 0, "Avision", "AV100IIICS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV100S", 0, 0, "Avision", "AV100S", - 0}, + 0,0}, /* status="untested" */ { NULL, NULL, 0x0638, 0x0A27, "Avision", "AV120", - AV_INT_STATUS}, + AV_INT_STATUS,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A3C, "Avision", "AV121", - AV_INT_BUTTON | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA}, + AV_INT_BUTTON | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA,0}, /* comment="sheetfed scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A33, "Avision", "AV122", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, /* comment="sheetfed duplex scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A93, "Avision", "AV122 C2", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, /* comment="sheetfed duplex scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A24, "Avision", "AV210", - AV_INT_BUTTON | AV_ACCEL_TABLE}, + AV_INT_BUTTON | AV_ACCEL_TABLE,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A25, "Avision", "AV210", - AV_INT_BUTTON | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN}, + AV_INT_BUTTON | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A3A, "Avision", "AV210C2", - AV_INT_BUTTON | AV_GRAY_MODES}, + AV_INT_BUTTON | AV_GRAY_MODES,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2F, "Avision", "AV210C2-G", - AV_INT_BUTTON | AV_GRAY_MODES}, + AV_INT_BUTTON | AV_GRAY_MODES,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A3A, "Avision", "AV210C2", - AV_INT_BUTTON | AV_GRAY_MODES}, + AV_INT_BUTTON | AV_GRAY_MODES,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A23, "Avision", "AV220", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2A, "Avision", "AV220C2", - AV_INT_BUTTON | AV_CANCEL_BUTTON}, + AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2B, "Avision", "AV220D2", - AV_INT_BUTTON | AV_CANCEL_BUTTON}, + AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2C, "Avision", "AV220+", - AV_INT_BUTTON | AV_CANCEL_BUTTON}, + AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2D, "Avision", "AV220C2-G", - AV_INT_BUTTON | AV_CANCEL_BUTTON}, + AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2E, "Avision", "AV220C2-B", - AV_INT_BUTTON | AV_CANCEL_BUTTON}, + AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A94, "Avision", "AV220-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { "AVISION", "AV240SC", 0, 0, "Avision", "AV240SC", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV260CS", 0, 0, "Avision", "AV260CS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV360CS", 0, 0, "Avision", "AV360CS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV363CS", 0, 0, "Avision", "AV363CS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV420CS", 0, 0, "Avision", "AV420CS", - 0}, + 0,0}, /* status="untested" */ { "AVISION", "AV6120", 0, 0, "Avision", "AV6120", - 0}, + 0,0}, /* status="untested" */ { NULL, "AV610", 0x0638, 0x0a18, "Avision", "AV610", - AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_STATUS | AV_INT_BUTTON}, + AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_STATUS | AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x0638, 0x0a18, "Avision", "AV600U Plus", - AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_STATUS | AV_INT_BUTTON}, + AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_STATUS | AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x0638, 0x0a5e, "Avision", "AV610C2", - AV_NO_BACKGROUND | AV_INT_BUTTON}, /* cancel button -> sense abort! */ + AV_NO_BACKGROUND | AV_INT_BUTTON,0}, /* cancel button -> sense abort! */ /* status="good" */ { NULL, NULL, 0x0638, 0x0a41, "Avision", "AM3000 Series", - 0}, + 0,0}, /* comment="MFD" */ /* status="basic" */ { NULL, NULL, 0x0638, 0x0a16, "Avision", "DS610CU Scancopier", - AV_INT_STATUS}, + AV_INT_STATUS,0}, /* comment="1 pass, 600 dpi, A4" */ /* status="good" */ { "AVISION", "AV620CS", 0, 0, "Avision", "AV620CS", - 0}, + 0,0}, /* comment="1 pass, 600 dpi" */ /* status="complete" */ { "AVISION", "AV620CS Plus", 0, 0, "Avision", "AV620CS Plus", - 0}, + 0,0}, /* comment="1 pass, 1200 dpi" */ /* status="complete" */ { "AVISION", "AV630CS", 0, 0, "Avision", "AV630CS", - 0}, + 0,0}, /* comment="1 pass, 1200 dpi - regularly tested" */ /* status="complete" */ { "AVISION", "AV630CSL", 0, 0, "Avision", "AV630CSL", - 0}, + 0,0}, /* comment="1 pass, 1200 dpi" */ /* status="untested" */ { "AVISION", "AV6240", 0, 0, "Avision", "AV6240", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A13, "Avision", "AV600U", - AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_SOFT_SCALE | AV_INT_STATUS | AV_NO_BUTTON}, + AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_SOFT_SCALE | AV_INT_STATUS | AV_NO_BUTTON,0}, /* comment="1 pass, 600 dpi" */ /* status="good" */ { "AVISION", "AV660S", 0, 0, "Avision", "AV660S", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV680S", 0, 0, "Avision", "AV680S", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV690U", 0, 0, "Avision", "AV690U", - 0}, + 0,0}, /* comment="1 pass, 2400 dpi" */ /* status="untested" */ { "AVISION", "AV800S", 0, 0, "Avision", "AV800S", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV810C", 0, 0, "Avision", "AV810C", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV820", 0, 0, "Avision", "AV820", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV820C", 0, 0, "Avision", "AV820C", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV820C Plus", 0, 0, "Avision", "AV820C Plus", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV830C", 0, 0, "Avision", "AV830C", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV830C Plus", 0, 0, "Avision", "AV830C Plus", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV880", 0, 0, "Avision", "AV880", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV880C", 0, 0, "Avision", "AV880C", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV3200C", 0, 0, "Avision", "AV3200C", - AV_NON_INTERLACED_DUPLEX_300 | AV_FASTER_WITH_FILTER}, + AV_NON_INTERLACED_DUPLEX_300 | AV_FASTER_WITH_FILTER,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3200SU", 0x0638, 0x0A4E, "Avision", "AV3200SU", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3730SU", 0x0638, 0x0A4F, "Avision", "AV3730SU", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3750SU", 0x0638, 0x0A65, "Avision", "AV3750SU", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3800C", 0, 0, "Avision", "AV3800C", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3850SU", 0x0638, 0x0a66, "Avision", "AV3850SU", - 0}, + 0,0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "FB6000E", 0, 0, "Avision", "FB6000E", - AV_NON_INTERLACED_DUPLEX_300}, + AV_NON_INTERLACED_DUPLEX_300,0}, /* comment="1 pass, 1200 dpi, A3 - duplex! - zero edge!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0a82, "Avision", "FB6080E", - AV_NON_INTERLACED_DUPLEX_300}, + AV_NON_INTERLACED_DUPLEX_300,0}, /* comment="1 pass, 1200 dpi, A3 - duplex! - zero edge!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0xa84, "Avision", "FB2080E", - 0}, + 0,0}, /* comment="1 pass, 600 dpi, zero-edge" ASIC 7 */ /* status="basic" */ { "AVISION", "AV8000S", 0, 0, "Avision", "AV8000S", - AV_DOES_NOT_KEEP_WINDOW}, + AV_DOES_NOT_KEEP_WINDOW,0}, /* comment="1 pass, 1200 dpi, A3 - regularly tested" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0a4d, "Avision", "AV8050U", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { "AVISION", "AV8300", 0x0638, 0x0A40, "Avision", "AV8300", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { "AVISION", "AV8350", 0x0638, 0x0A68, "Avision", "AV8350", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A61, "Avision", "IT8300", - AV_NON_INTERLACED_DUPLEX_300 | AV_ACCEL_TABLE}, + AV_NON_INTERLACED_DUPLEX_300 | AV_ACCEL_TABLE,0}, /* comment="1 pass, 1200 dpi, A3 - duplex!, LCD screen, paper sensors" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0AA1, "Avision", "@V2500", - 0}, + 0,0}, /* comment="" */ /* status="untested" */ { NULL, NULL, 0x0638, 0x0A45, "Avision", "@V5100", - 0}, + 0,0}, /* comment="" */ /* status="good" */ { "AVISION", "AVA3", 0, 0, "Avision", "AVA3", - AV_FORCE_A3}, + AV_FORCE_A3,0}, /* comment="1 pass, 600 dpi, A3" */ /* status="basic" */ @@ -609,21 +609,21 @@ { "HP", "ScanJet 5300C", 0x03f0, 0x0701, "Hewlett-Packard", "ScanJet 5300C", - AV_INT_STATUS}, + AV_INT_STATUS,0}, /* comment="1 pass, 2400 dpi - regularly tested - some FW revisions have x-axis image scaling problems over 1200 dpi" */ /* status="complete" */ { "HP", "ScanJet 5370C", 0x03f0, 0x0701, "Hewlett-Packard", "ScanJet 5370C", - AV_MULTI_CALIB_CMD | AV_INT_STATUS}, + AV_MULTI_CALIB_CMD | AV_INT_STATUS,0}, /* comment="1 pass, 2400 dpi - some FW revisions have x-axis image scaling problems over 1200 dpi" */ /* status="good" */ { "hp", "scanjet 7400c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7400c", - AV_LIGHT_CHECK_BOGUS | AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, + AV_LIGHT_CHECK_BOGUS | AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface" */ /* status="good" */ @@ -631,14 +631,14 @@ { "hp", "scanjet 7450c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7450c", - AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, + AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface - regularly tested" */ /* status="good" */ { "hp", "scanjet 7490c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7490c", - AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, + AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, /* comment="1 pass, 1200 dpi - dual USB/SCSI interface" */ /* status="good" */ @@ -646,7 +646,7 @@ { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8200", - 0}, + 0,0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -654,7 +654,7 @@ { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8250", - 0}, + 0,0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ #endif @@ -662,7 +662,7 @@ { "HP", "C9930A", 0x03f0, 0x3905, "Hewlett-Packard", "ScanJet 8270", - 0}, + 0,0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -670,7 +670,7 @@ { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8290", - 0}, + 0,0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0 and SCSI - only SCSI tested so far" */ /* status="good" */ @@ -678,86 +678,86 @@ { "HP", "C9930A", 0x03f0, 0x3805, "Hewlett-Packard", "ScanJet 8390", - 0}, + 0,0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ { "Minolta", "#2882", 0, 0, "Minolta", "Dimage Scan Dual I", - AV_FORCE_FILM | AV_NO_START_SCAN}, /* not AV_FILMSCANNER (no frame control) */ + AV_FORCE_FILM | AV_NO_START_SCAN,0}, /* not AV_FILMSCANNER (no frame control) */ /* status="basic" */ { "Minolta", "#2887", 0, 0, "Minolta", "Scan Multi Pro", - AV_FORCE_FILM | AV_NO_START_SCAN}, /* AV_FILMSCANNER (rame control)? */ + AV_FORCE_FILM | AV_NO_START_SCAN,0}, /* AV_FILMSCANNER (rame control)? */ /* status="untested" */ { "MINOLTA", "FS-V1", 0x0638, 0x026a, "Minolta", "Dimage Scan Dual II", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_12_BIT_MODE}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_12_BIT_MODE,0}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "MINOLTA", "Elite II", 0x0686, 0x4004, "Minolta", "Elite II", - AV_FILMSCANNER | AV_ONE_CALIB_CMD}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD,0}, /* comment="1 pass, film-scanner" */ /* status="untested" */ { "MINOLTA", "FS-V3", 0x0686, 0x400d, "Minolta", "Dimage Scan Dual III", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_ACCEL_TABLE }, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_ACCEL_TABLE ,0}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "MINOLTA", "FS-V4", 0x0686, 0x400e, "Minolta", "Dimage Scan Elite 5400", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | /*AV_ACCEL_TABLE |*/ AV_NO_START_SCAN}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | /*AV_ACCEL_TABLE |*/ AV_NO_START_SCAN,0}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "QMS", "SC-110", 0x0638, 0x0a15, "Minolta-QMS", "SC-110", - 0}, + 0,0}, /* comment="" */ /* status="untested" */ { "QMS", "SC-215", 0x0638, 0x0a16, "Minolta-QMS", "SC-215", - 0}, + 0,0}, /* comment="" */ /* status="good" */ { "MITSBISH", "MCA-ADFC", 0, 0, "Mitsubishi", "MCA-ADFC", - 0}, + 0,0}, /* status="untested" */ { "MITSBISH", "MCA-S1200C", 0, 0, "Mitsubishi", "S1200C", - 0}, + 0,0}, /* status="untested" */ { "MITSBISH", "MCA-S600C", 0, 0, "Mitsubishi", "S600C", - 0}, + 0,0}, /* status="untested" */ { "MITSBISH", "SS600", 0, 0, "Mitsubishi", "SS600", - 0}, + 0,0}, /* status="good" */ /* The next are all untested ... */ @@ -765,355 +765,355 @@ { "FCPA", "ScanPartner", 0, 0, "Fujitsu", "ScanPartner", - AV_FUJITSU}, + AV_FUJITSU,0}, /* status="untested" */ { "FCPA", "ScanPartner 10", 0, 0, "Fujitsu", "ScanPartner 10", - AV_FUJITSU}, + AV_FUJITSU,0}, /* status="untested" */ { "FCPA", "ScanPartner 10C", 0, 0, "Fujitsu", "ScanPartner 10C", - AV_FUJITSU}, + AV_FUJITSU,0}, /* status="untested" */ { "FCPA", "ScanPartner 15C", 0, 0, "Fujitsu", "ScanPartner 15C", - AV_FUJITSU}, + AV_FUJITSU,0}, /* status="untested" */ { "FCPA", "ScanPartner 300C", 0, 0, "Fujitsu", "ScanPartner 300C", - 0}, + 0,0}, /* status="untested" */ { "FCPA", "ScanPartner 600C", 0, 0, "Fujitsu", "ScanPartner 600C", - 0}, + 0,0}, /* status="untested" */ { "FCPA", "ScanPartner 620C", 0, 0, "Fujitsu", "ScanPartner 620C", - 0}, + AV_LIGHT_CHECK_BOGUS,0}, /* status="good" */ { "FCPA", "ScanPartner Jr", 0, 0, "Fujitsu", "ScanPartner Jr", - 0}, + 0,0}, /* status="untested" */ { "FCPA", "ScanStation", 0, 0, "Fujitsu", "ScanStation", - 0}, + 0,0}, /* status="untested" */ { NULL, NULL, 0x04c5, 0x1029, "Fujitsu", "fi-4010CU", - 0}, + 0,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6001, "Kodak", "i30", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6002, "Kodak", "i40", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="basic" */ { NULL, NULL, 0x040a, 0x6003, "Kodak", "i50", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6003, "Kodak", "i55", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6004, "Kodak", "i60", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6004, "Kodak", "i65", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6005, "Kodak", "i80", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { "iVina", "1200U", 0x0638, 0x0268, "iVina", "1200U", - 0}, + 0,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0424, "Visioneer", "Strobe XP 450", - AV_INT_BUTTON | AV_ACCEL_TABLE}, + AV_INT_BUTTON | AV_ACCEL_TABLE,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0491, "Visioneer", "Strobe XP 450-G", - AV_INT_BUTTON | AV_ACCEL_TABLE}, + AV_INT_BUTTON | AV_ACCEL_TABLE,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0479, "Visioneer", "Strobe XP 470", - AV_INT_BUTTON | AV_ACCEL_TABLE}, + AV_INT_BUTTON | AV_ACCEL_TABLE,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x048F, "Visioneer", "Strobe XP 470-G", - AV_INT_BUTTON | AV_ACCEL_TABLE}, + AV_INT_BUTTON | AV_ACCEL_TABLE,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0420, "Visioneer", "9320", - 0}, + 0,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0421, "Visioneer", "9450", - 0}, + AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_NO_BUTTON, AV_NO_TUNE_SCAN_LENGTH}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x047A, "Visioneer", "9450-G", - 0}, + 0,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0422, "Visioneer", "9550", - 0}, + 0,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0390, "Visioneer", "9650", - 0}, + 0,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x047B, "Visioneer", "9650-G", - 0}, + 0,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0423, "Visioneer", "9750", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0493, "Visioneer", "9750-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0497, "Visioneer", "Patriot 430", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x048F, "Visioneer", "Patriot 470", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0498, "Visioneer", "Patriot 680", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0499, "Visioneer", "Patriot 780", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x049C, "Xerox", "DocuMate150", - AV_INT_BUTTON | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_BACKGROUND_QUIRK}, + AV_INT_BUTTON | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_BACKGROUND_QUIRK,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0477, "Xerox", "DocuMate152", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x049D, "Xerox", "DocuMate162", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0448, "Xerox", "DocuMate250", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0490, "Xerox", "DocuMate250-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0449, "Xerox", "DocuMate252", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x048C, "Xerox", "DocuMate252-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x044c, "Xerox", "DocuMate262", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x048D, "Xerox", "DocuMate262-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0475, "Xerox", "DocuMate272", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x048E, "Xerox", "DocuMate272-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0446, "Xerox", "DocuMate510", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0495, "Xerox", "DocuMate512", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x047c, "Xerox", "DocuMate510-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0447, "Xerox", "DocuMate520", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0492, "Xerox", "DocuMate520-G", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0498, "Xerox", "DocuMate632", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0478, "Xerox", "DocuMate752", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x049A, "Xerox", "DocuMate752", - AV_INT_BUTTON}, + AV_INT_BUTTON,0}, /* status="untested" */ { NULL, NULL, 0x0638, 0x0a16, "OKI", "S700 Scancopier", - 0}, + 0,0}, /* comment="1 pass, 600 dpi, A4" */ /* status="good" */ { "B+H", "2000F", 0, 0, "Bell+Howell", "2000F", - 0}, + 0,0}, /* comment="1 pass, ??? dpi, A4" */ /* status="basic" */ { NULL, NULL, 0x0482, 0x0335, "Kyocera", "FS-1016MFP", - 0}, + 0,0}, /* comment="1 pass, ??? dpi, A4" */ /* status="untested" */ @@ -1155,7 +1155,7 @@ { NULL, NULL, 0, 0, NULL, NULL, - 0} + 0,0} }; #if 0 @@ -1182,7 +1182,6 @@ #define AVISION_INQUIRY_SIZE_V2 0x88 #define AVISION_INQUIRY_SIZE_MAX AVISION_INQUIRY_SIZE_V2 -#define MM_PER_INCH 25.4 #define AVISION_BASE_RES 300 @@ -4071,6 +4070,9 @@ } dev->inquiry_tune_scan_length = BIT(result[94],2); + if (Avision_Device_List [model_num].feature_type2 & AV_NO_TUNE_SCAN_LENGTH) + dev->inquiry_tune_scan_length = 0; + dev->inquiry_background_raster = BIT(result[95],2); if (dev->hw->feature_type & AV_NO_BACKGROUND) @@ -4309,12 +4311,12 @@ if (!dev->inquiry_no_gray_modes) { if (dev->inquiry_bits_per_channel > 0) { - add_color_mode (dev, AV_THRESHOLDED, "Lineart"); + add_color_mode (dev, AV_THRESHOLDED, SANE_VALUE_SCAN_MODE_LINEART); add_color_mode (dev, AV_DITHERED, "Dithered"); } if (dev->inquiry_bits_per_channel >= 8) - add_color_mode (dev, AV_GRAYSCALE, "Gray"); + add_color_mode (dev, AV_GRAYSCALE, SANE_VALUE_SCAN_MODE_GRAY); if (dev->inquiry_bits_per_channel == 12) add_color_mode (dev, AV_GRAYSCALE12, "12bit Gray"); @@ -4324,7 +4326,7 @@ } if (dev->inquiry_channels_per_pixel > 1) { - add_color_mode (dev, AV_TRUECOLOR, "Color"); + add_color_mode (dev, AV_TRUECOLOR, SANE_VALUE_SCAN_MODE_COLOR); if (dev->inquiry_bits_per_channel == 12) add_color_mode (dev, AV_TRUECOLOR12, "12bit Color"); diff -Nru sane-backends-1.0.20/backend/avision.h sane-backends-1.0.21/backend/avision.h --- sane-backends-1.0.20/backend/avision.h 2008-05-26 19:57:27.000000000 +1000 +++ sane-backends-1.0.21/backend/avision.h 2010-04-05 23:18:03.000000000 +1000 @@ -196,6 +196,12 @@ /* maybe more ...*/ } feature_type; + /*second enum cause 32 bit int above is full*/ + enum { + /* force no calibration */ + AV_NO_TUNE_SCAN_LENGTH = (1<<0) + } feature_type2; + } Avision_HWEntry; typedef enum { diff -Nru sane-backends-1.0.20/backend/bh.c sane-backends-1.0.21/backend/bh.c --- sane-backends-1.0.20/backend/bh.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/bh.c 2010-04-05 23:18:03.000000000 +1000 @@ -42,7 +42,7 @@ If you do not wish that, delete this exception notice. */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include #include @@ -52,13 +52,13 @@ #include #include #include -#include "sane/sane.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_config.h" +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_config.h" #define BACKEND_NAME bh -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #define BUILD 4 #include "bh.h" diff -Nru sane-backends-1.0.20/backend/bh.h sane-backends-1.0.21/backend/bh.h --- sane-backends-1.0.20/backend/bh.h 2003-09-13 02:10:33.000000000 +1000 +++ sane-backends-1.0.21/backend/bh.h 2010-04-05 23:18:03.000000000 +1000 @@ -206,7 +206,6 @@ } BH_Option; /* macros for accessing the value for an option within a scanning context */ -#define MM_PER_INCH 25.4 #define _OPT_VAL_WORD(s, o) ((s)->val[(o)].w) #define _OPT_VAL_WORD_THOUSANDTHS(s, o) \ (SANE_UNFIX(_OPT_VAL_WORD((s), (o))) * 1000.0 / MM_PER_INCH) diff -Nru sane-backends-1.0.20/backend/canon.c sane-backends-1.0.21/backend/canon.c --- sane-backends-1.0.20/backend/canon.c 2009-02-24 09:01:04.000000000 +1100 +++ sane-backends-1.0.21/backend/canon.c 2010-04-05 23:18:03.000000000 +1000 @@ -106,19 +106,19 @@ #include /* for FB1200S */ #include /* for FB1200S */ -#include -#include -#include +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" #define BACKEND_NAME canon -#include +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX #define PATH_MAX 1024 #endif -#include +#include "../include/sane/sanei_config.h" #define CANON_CONFIG_FILE "canon.conf" #include @@ -127,7 +127,6 @@ #define SANE_I18N(text) text #endif -#define MM_PER_INCH 25.4 static SANE_Byte primaryHigh[256], primaryLow[256], secondaryHigh[256], secondaryLow[256]; /* modification for FB1200S */ @@ -137,24 +136,33 @@ static CANON_Scanner *first_handle = NULL; static const SANE_String_Const mode_list[] = { - SANE_I18N(SANE_I18N("Lineart")), SANE_I18N("Halftone"), SANE_I18N("Gray"), - SANE_I18N("Color"), 0 + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_HALFTONE, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, + 0 }; /* modification for FS2710 */ static const SANE_String_Const mode_list_fs2710[] = { - SANE_I18N("Color"), SANE_I18N("Raw"), 0 + SANE_VALUE_SCAN_MODE_COLOR, + SANE_I18N("Raw"), 0 }; /* modification for FB620S */ static const SANE_String_Const mode_list_fb620[] = { - SANE_I18N("Lineart"), SANE_I18N("Gray"), SANE_I18N("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, SANE_I18N("Fine color"), 0 }; /* modification for FB1200S */ static const SANE_String_Const mode_list_fb1200[] = { - SANE_I18N("Lineart"), SANE_I18N("Gray"), SANE_I18N("Color"), 0 + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, + 0 }; static const SANE_String_Const tpu_dc_mode_list[] = { @@ -253,6 +261,8 @@ dev->tpu.Transparency = tbuf[4 + 4 + 5] * 256 + tbuf[5 + 4 + 5]; dev->tpu.PosNeg = tbuf[6 + 4 + 5] & 0x01; dev->tpu.FilmType = tbuf[7 + 4 + 5]; + if(dev->tpu.FilmType > 3) + dev->tpu.FilmType = 0; DBG (11, "TPU Status: %d\n", dev->tpu.Status); DBG (11, "TPU ControlMode: %d\n", dev->tpu.ControlMode); @@ -563,7 +573,7 @@ strcmp (filmtype_list[1], s->val[OPT_NEGATIVE].s) : s->val[OPT_HNEGATIVE].w; - if (!strcmp (s->val[OPT_MODE].s, SANE_I18N("Gray"))) + if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) { /* If scanning in gray mode, use the first curve for the scanner's monochrome gamma component */ diff -Nru sane-backends-1.0.20/backend/canon_dr.c sane-backends-1.0.21/backend/canon_dr.c --- sane-backends-1.0.20/backend/canon_dr.c 2009-04-21 05:31:20.000000000 +1000 +++ sane-backends-1.0.21/backend/canon_dr.c 2010-04-05 23:18:03.000000000 +1000 @@ -3,11 +3,13 @@ This file is part of the SANE package, and implements a SANE backend for various Canon DR-series scanners. - Copyright (C) 2008-2009 m. allan noah + Copyright (C) 2008-2010 m. allan noah Corcaribe Tecnología C.A. www.cc.com.ve provided significant funding EvriChart, Inc. www.evrichart.com provided funding and loaned equipment Canon, USA. www.usa.canon.com loaned equipment + HPrint hprint.com.br provided funding and testing for DR-2510 support + Stone-IT www.stone-it.com provided funding for DR-2010 and DR-2050 support -------------------------------------------------------------------------- @@ -56,8 +58,10 @@ Section 2 - sane_init, _get_devices, _open & friends Section 3 - sane_*_option functions Section 4 - sane_start, _get_param, _read & friends - Section 5 - sane_close functions - Section 6 - misc functions + Section 5 - calibration functions + Section 6 - sane_close functions + Section 7 - misc functions + Section 8 - image processing functions Changes: v1 2008-10-29, MAN @@ -182,6 +186,75 @@ v26 2009-04-14, MAN (SANE 1.0.20) - return cmd status for reads on sensors - allow rs to adjust read length for all bad status responses + v27 2009-05-08, MAN + - bug fix in read_panel() + - initialize vars in do_usb_cmd() + - set buffermode off by default + - clear page counter during init and sane_start() + - eject previous page during init and sane_start() + - improved SSM_BUFF macros + - moved set_window() to after ssm-*() + - add coarse calibration (AFE offset/gain & per-channel exposure) + - add fine calibration (per-cell offset/gain) + - free image and fine cal buffers in sane_close() + - compare page counter of small scanners only in non-buffered mode + - add back-side gray mirroring code for DR-2580C + v28 2009-05-20, MAN + - use average instead of min/max for fine offset and gain + - rewrite supported resolution list as x and y arrays + - merge x and y resolution options into single option + - move scan params into two new structs, s->u and s->s + - sane_get_parameters() just returns values from s->u + - dont call wait_scanner() in object_position() + - dont call ssm_*() from option handler + - refactor sane_start() + - read_from_buffer() can workaround missing res, modes and cropping + - set most DR-2xxx machines to use the read_from_buffer workarounds + - set default threshold to 90 + - add option for button #3 of some machines + - don't eject paper during init + - add DR-2010 quirks + - switch counter to HARD_SELECT, not SOFT + v29 2009-06-01, MAN + - split coarse and fine cal to run independently + - add side option + - reset scan params to user request if calibration fails + - better handling of sane_cancel + - better handling of errors during sane_start and sane_read + v30 2009-06-17, MAN + - add fine cal support for machines with internal buffer (2050/2080) + - support fixed-width machines that require even bytes per scanline + - pad end of scan with gray if scanner stops prematurely + - better handling of errors during calibration + - cleanup canceling debug messages + - remove old cancel() prototype + - small sleep before clearing usb halt condition + v31 2009-06-29, MAN + - reduce default buffer size to 2 megs + v32 2009-07-21, MAN + - crop/resample image data before buffering, not after + - shink image buffers to size of output image, not input + - correct some debug message + - better handling of EOF + - add intermediate param struct to existing user and scan versions + v33 2009-07-23, MAN + - add software brightness/contrast for dumb scanners + - add blocking mode to allow full-page manipulation options to run + - add swdespeck option and support code + - add swdeskew and swcrop options (disabled) + v34 2009-07-28, MAN + - add simplified Hough transform based deskewing code + - add extremity detecting cropping code + - use per-model background color to fill corners after deskew + - request and chop extra scanlines instead of rounding down + - remove padding dumb scanners add to top of front side + - sane_get_params uses intermediate struct instead of user struct + - if scanner stops, clone the last line until the end of buffer + - reset some intermediate params between duplex sides + v35 2010-02-09, MAN + - cleanup #includes and copyright + - add SANE_I18N to static strings + - don't fail if scsi buffer is too small SANE FLOW DIAGRAM @@ -213,36 +286,24 @@ * @@ Section 1 - Init */ -#include "sane/config.h" +#include "../include/sane/config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#ifdef HAVE_LIBC_H -# include /* NeXTStep/OpenStep */ -#endif - -#include "sane/sanei_backend.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" -#include "sane/sanei_config.h" +#include /*memcpy...*/ +#include /*isspace*/ +#include /*tan*/ +#include /*usleep*/ + +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" #include "canon_dr-cmd.h" #include "canon_dr.h" #define DEBUG 1 -#define BUILD 26 +#define BUILD 35 /* values for SANE_DEBUG_CANON_DR env var: - errors 5 @@ -255,42 +316,29 @@ */ /* ------------------------------------------------------------------------- */ -static const char string_Flatbed[] = "Flatbed"; -static const char string_ADFFront[] = "ADF Front"; -static const char string_ADFBack[] = "ADF Back"; -static const char string_ADFDuplex[] = "ADF Duplex"; - -static const char string_Lineart[] = "Lineart"; -static const char string_Halftone[] = "Halftone"; -static const char string_Grayscale[] = "Gray"; -static const char string_Color[] = "Color"; - -static const char string_Default[] = "Default"; -static const char string_On[] = "On"; -static const char string_Off[] = "Off"; - -static const char string_Dither[] = "Dither"; -static const char string_Diffusion[] = "Diffusion"; - -static const char string_Red[] = "Red"; -static const char string_Green[] = "Green"; -static const char string_Blue[] = "Blue"; -static const char string_En_Red[] = "Enhance Red"; -static const char string_En_Green[] = "Enhance Green"; -static const char string_En_Blue[] = "Enhance Blue"; - -static const char string_White[] = "White"; -static const char string_Black[] = "Black"; - -static const char string_None[] = "None"; -static const char string_JPEG[] = "JPEG"; +#define STRING_FLATBED SANE_I18N("Flatbed") +#define STRING_ADFFRONT SANE_I18N("ADF Front") +#define STRING_ADFBACK SANE_I18N("ADF Back") +#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex") + +#define STRING_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define STRING_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE +#define STRING_GRAYSCALE SANE_VALUE_SCAN_MODE_GRAY +#define STRING_COLOR SANE_VALUE_SCAN_MODE_COLOR + +#define STRING_RED SANE_I18N("Red") +#define STRING_GREEN SANE_I18N("Green") +#define STRING_BLUE SANE_I18N("Blue") +#define STRING_EN_RED SANE_I18N("Enhance Red") +#define STRING_EN_GREEN SANE_I18N("Enhance Green") +#define STRING_EN_BLUE SANE_I18N("Enhance Blue") -static const char string_Front[] = "Front"; -static const char string_Back[] = "Back"; +#define STRING_NONE SANE_I18N("None") +#define STRING_JPEG SANE_I18N("JPEG") /* Also set via config file. */ static int global_buffer_size; -static int global_buffer_size_default = 4 * 1024 * 1024; +static int global_buffer_size_default = 2 * 1024 * 1024; static int global_padded_read; static int global_padded_read_default = 0; static char global_vendor_name[9]; @@ -770,7 +818,6 @@ if(!ret && buffer_size != s->buffer_size){ DBG (5, "connect_fd: cannot get requested buffer size (%d/%d)\n", buffer_size, s->buffer_size); - ret = SANE_STATUS_NO_MEM; } } @@ -939,67 +986,83 @@ DBG (15, " min y res: %d dpi\n", s->min_y_res); /* some scanners list B&W resolutions. */ - s->std_res_60 = get_IN_std_res_60 (in); - DBG (15, " 60 dpi: %d\n", s->std_res_60); - - s->std_res_75 = get_IN_std_res_75 (in); - DBG (15, " 75 dpi: %d\n", s->std_res_75); - - s->std_res_100 = get_IN_std_res_100 (in); - DBG (15, " 100 dpi: %d\n", s->std_res_100); - - s->std_res_120 = get_IN_std_res_120 (in); - DBG (15, " 120 dpi: %d\n", s->std_res_120); - - s->std_res_150 = get_IN_std_res_150 (in); - DBG (15, " 150 dpi: %d\n", s->std_res_150); - - s->std_res_160 = get_IN_std_res_160 (in); - DBG (15, " 160 dpi: %d\n", s->std_res_160); - - s->std_res_180 = get_IN_std_res_180 (in); - DBG (15, " 180 dpi: %d\n", s->std_res_180); - - s->std_res_200 = get_IN_std_res_200 (in); - DBG (15, " 200 dpi: %d\n", s->std_res_200); - - s->std_res_240 = get_IN_std_res_240 (in); - DBG (15, " 240 dpi: %d\n", s->std_res_240); - - s->std_res_300 = get_IN_std_res_300 (in); - DBG (15, " 300 dpi: %d\n", s->std_res_300); - - s->std_res_320 = get_IN_std_res_320 (in); - DBG (15, " 320 dpi: %d\n", s->std_res_320); - - s->std_res_400 = get_IN_std_res_400 (in); - DBG (15, " 400 dpi: %d\n", s->std_res_400); - - s->std_res_480 = get_IN_std_res_480 (in); - DBG (15, " 480 dpi: %d\n", s->std_res_480); - - s->std_res_600 = get_IN_std_res_600 (in); - DBG (15, " 600 dpi: %d\n", s->std_res_600); - - s->std_res_800 = get_IN_std_res_800 (in); - DBG (15, " 800 dpi: %d\n", s->std_res_800); - - s->std_res_1200 = get_IN_std_res_1200 (in); - DBG (15, " 1200 dpi: %d\n", s->std_res_1200); + s->std_res_x[DPI_60] = get_IN_std_res_60 (in); + s->std_res_y[DPI_60] = s->std_res_x[DPI_60]; + DBG (15, " 60 dpi: %d\n", s->std_res_x[DPI_60]); + + s->std_res_x[DPI_75] = get_IN_std_res_75 (in); + s->std_res_y[DPI_75] = s->std_res_x[DPI_75]; + DBG (15, " 75 dpi: %d\n", s->std_res_x[DPI_75]); + + s->std_res_x[DPI_100] = get_IN_std_res_100 (in); + s->std_res_y[DPI_100] = s->std_res_x[DPI_100]; + DBG (15, " 100 dpi: %d\n", s->std_res_x[DPI_100]); + + s->std_res_x[DPI_120] = get_IN_std_res_120 (in); + s->std_res_y[DPI_120] = s->std_res_x[DPI_120]; + DBG (15, " 120 dpi: %d\n", s->std_res_x[DPI_120]); + + s->std_res_x[DPI_150] = get_IN_std_res_150 (in); + s->std_res_y[DPI_150] = s->std_res_x[DPI_150]; + DBG (15, " 150 dpi: %d\n", s->std_res_x[DPI_150]); + + s->std_res_x[DPI_160] = get_IN_std_res_160 (in); + s->std_res_y[DPI_160] = s->std_res_x[DPI_160]; + DBG (15, " 160 dpi: %d\n", s->std_res_x[DPI_160]); + + s->std_res_x[DPI_180] = get_IN_std_res_180 (in); + s->std_res_y[DPI_180] = s->std_res_x[DPI_180]; + DBG (15, " 180 dpi: %d\n", s->std_res_x[DPI_180]); + + s->std_res_x[DPI_200] = get_IN_std_res_200 (in); + s->std_res_y[DPI_200] = s->std_res_x[DPI_200]; + DBG (15, " 200 dpi: %d\n", s->std_res_x[DPI_200]); + + s->std_res_x[DPI_240] = get_IN_std_res_240 (in); + s->std_res_y[DPI_240] = s->std_res_x[DPI_240]; + DBG (15, " 240 dpi: %d\n", s->std_res_x[DPI_240]); + + s->std_res_x[DPI_300] = get_IN_std_res_300 (in); + s->std_res_y[DPI_300] = s->std_res_x[DPI_300]; + DBG (15, " 300 dpi: %d\n", s->std_res_x[DPI_300]); + + s->std_res_x[DPI_320] = get_IN_std_res_320 (in); + s->std_res_y[DPI_320] = s->std_res_x[DPI_320]; + DBG (15, " 320 dpi: %d\n", s->std_res_x[DPI_320]); + + s->std_res_x[DPI_400] = get_IN_std_res_400 (in); + s->std_res_y[DPI_400] = s->std_res_x[DPI_400]; + DBG (15, " 400 dpi: %d\n", s->std_res_x[DPI_400]); + + s->std_res_x[DPI_480] = get_IN_std_res_480 (in); + s->std_res_y[DPI_480] = s->std_res_x[DPI_480]; + DBG (15, " 480 dpi: %d\n", s->std_res_x[DPI_480]); + + s->std_res_x[DPI_600] = get_IN_std_res_600 (in); + s->std_res_y[DPI_600] = s->std_res_x[DPI_600]; + DBG (15, " 600 dpi: %d\n", s->std_res_x[DPI_600]); + + s->std_res_x[DPI_800] = get_IN_std_res_800 (in); + s->std_res_y[DPI_800] = s->std_res_x[DPI_800]; + DBG (15, " 800 dpi: %d\n", s->std_res_x[DPI_800]); + + s->std_res_x[DPI_1200] = get_IN_std_res_1200 (in); + s->std_res_y[DPI_1200] = s->std_res_x[DPI_1200]; + DBG (15, " 1200 dpi: %d\n", s->std_res_x[DPI_1200]); /* maximum window width and length are reported in basic units.*/ - s->max_x_basic = get_IN_window_width(in); - DBG(15, " max width: %2.2f inches\n",(float)s->max_x_basic/s->basic_x_res); + s->max_x = get_IN_window_width(in) * 1200 / s->basic_x_res; + DBG(15, " max width: %d (%2.2f in)\n",s->max_x,(float)s->max_x/1200); - s->max_y_basic = get_IN_window_length(in); - DBG(15, " max length: %2.2f inches\n",(float)s->max_y_basic/s->basic_y_res); + s->max_y = get_IN_window_length(in) * 1200 / s->basic_y_res; + DBG(15, " max length: %d (%2.2f in)\n",s->max_y,(float)s->max_y/1200); DBG (15, " AWD: %d\n", get_IN_awd(in)); DBG (15, " CE Emphasis: %d\n", get_IN_ce_emphasis(in)); DBG (15, " C Emphasis: %d\n", get_IN_c_emphasis(in)); DBG (15, " High quality: %d\n", get_IN_high_quality(in)); - /* known modes */ + /* known modes FIXME more here? */ s->can_grayscale = get_IN_multilevel (in); DBG (15, " grayscale: %d\n", s->can_grayscale); @@ -1051,11 +1114,10 @@ s->contrast_steps = 255; s->threshold_steps = 255; - /* convert to 1200dpi units */ - s->max_x = s->max_x_basic * 1200 / s->basic_x_res; - s->max_y = s->max_y_basic * 1200 / s->basic_y_res; + s->bg_color = 0xee; /* assume these are same as adf, override below */ + s->valid_x = s->max_x; s->max_x_fb = s->max_x; s->max_y_fb = s->max_y; @@ -1078,26 +1140,41 @@ s->rgb_format = 1; s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_RRGGBB; s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_rRgGbB; + s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_gG; s->duplex_interlace = DUPLEX_INTERLACE_FBFB; + s->need_ccal = 1; + s->need_fcal = 1; + + /*lies*/ + s->can_halftone=0; + s->can_monochrome=0; } - else if (strstr (s->model_name,"DR-2510")){ + else if (strstr (s->model_name,"DR-2510") + || strstr (s->model_name,"DR-2010") + ){ s->rgb_format = 1; s->always_op = 0; s->unknown_byte2 = 0x80; s->fixed_width = 1; + s->valid_x = 8.5 * 1200; s->gray_interlace[SIDE_FRONT] = GRAY_INTERLACE_2510; s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_2510; s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_2510; s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_2510; s->duplex_interlace = DUPLEX_INTERLACE_2510; - - /*only in Y direction, so we trash them*/ - s->std_res_100=0; - s->std_res_150=0; - s->std_res_200=0; - s->std_res_240=0; - s->std_res_400=0; + s->duplex_offset = 400; + s->need_ccal = 1; + s->need_fcal = 1; + s->sw_lut = 1; + /*s->invert_tly = 1;*/ + + /*only in Y direction, so we trash them in X*/ + s->std_res_x[DPI_100]=0; + s->std_res_x[DPI_150]=0; + s->std_res_x[DPI_200]=0; + s->std_res_x[DPI_240]=0; + s->std_res_x[DPI_400]=0; /*lies*/ s->can_halftone=0; @@ -1105,14 +1182,22 @@ } else if (strstr (s->model_name,"DR-2050") - || strstr (s->model_name,"DR-2080") - ){ + || strstr (s->model_name,"DR-2080")){ s->can_write_panel = 0; s->has_df = 0; s->fixed_width = 1; + s->even_Bpl = 1; s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_RRGGBB; s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_RRGGBB; s->duplex_interlace = DUPLEX_INTERLACE_FBFB; + s->need_fcal_buffer = 1; + s->bg_color = 0x08; + s->duplex_offset = 840; + s->sw_lut = 1; + + /*lies*/ + s->can_halftone=0; + s->can_monochrome=0; } DBG (10, "init_model: finish\n"); @@ -1132,6 +1217,7 @@ ret = read_panel(s,OPT_COUNTER); s->panel_enable_led = 1; + s->panel_counter = 0; ret = send_panel(s); DBG (10, "init_panel: finish\n"); @@ -1151,50 +1237,44 @@ /* source */ if(s->has_flatbed) - s->source = SOURCE_FLATBED; + s->u.source = SOURCE_FLATBED; else if(s->has_adf) - s->source = SOURCE_ADF_FRONT; + s->u.source = SOURCE_ADF_FRONT; /* scan mode */ if(s->can_monochrome) - s->mode = MODE_LINEART; + s->u.mode=MODE_LINEART; else if(s->can_halftone) - s->mode=MODE_HALFTONE; + s->u.mode=MODE_HALFTONE; else if(s->can_grayscale) - s->mode=MODE_GRAYSCALE; + s->u.mode=MODE_GRAYSCALE; else if(s->can_color) - s->mode=MODE_COLOR; - - /*x res*/ - s->resolution_x = s->basic_x_res; + s->u.mode=MODE_COLOR; - /*y res*/ - s->resolution_y = s->basic_y_res; - if(s->resolution_y > s->resolution_x){ - s->resolution_y = s->resolution_x; - } + /*x and y res*/ + s->u.dpi_x = s->basic_x_res; + s->u.dpi_y = s->basic_x_res; /* page width US-Letter */ - s->page_width = 8.5 * 1200; - if(s->page_width > s->max_x || s->fixed_width){ - s->page_width = s->max_x; + s->u.page_x = 8.5 * 1200; + if(s->u.page_x > s->valid_x){ + s->u.page_x = s->valid_x; } /* page height US-Letter */ - s->page_height = 11 * 1200; - if(s->page_height > s->max_y){ - s->page_height = s->max_y; + s->u.page_y = 11 * 1200; + if(s->u.page_y > s->max_y){ + s->u.page_y = s->max_y; } /* bottom-right x */ - s->br_x = s->page_width; + s->u.br_x = s->u.page_x; /* bottom-right y */ - s->br_y = s->page_height; + s->u.br_y = s->u.page_y; - s->threshold = 0x80; + s->threshold = 90; s->compress_arg = 50; - s->buffermode = 1; DBG (10, "init_user: finish\n"); @@ -1341,16 +1421,16 @@ if(option==OPT_SOURCE){ i=0; if(s->has_flatbed){ - s->source_list[i++]=string_Flatbed; + s->source_list[i++]=STRING_FLATBED; } if(s->has_adf){ - s->source_list[i++]=string_ADFFront; + s->source_list[i++]=STRING_ADFFRONT; if(s->has_back){ - s->source_list[i++]=string_ADFBack; + s->source_list[i++]=STRING_ADFBACK; } if(s->has_duplex){ - s->source_list[i++]=string_ADFDuplex; + s->source_list[i++]=STRING_ADFDUPLEX; } } s->source_list[i]=NULL; @@ -1368,17 +1448,17 @@ /* scan mode */ if(option==OPT_MODE){ i=0; - if(s->can_monochrome){ - s->mode_list[i++]=string_Lineart; + if(s->can_monochrome || s->can_grayscale || s->can_color){ + s->mode_list[i++]=STRING_LINEART; } if(s->can_halftone){ - s->mode_list[i++]=string_Halftone; + s->mode_list[i++]=STRING_HALFTONE; } - if(s->can_grayscale){ - s->mode_list[i++]=string_Grayscale; + if(s->can_grayscale || s->can_color){ + s->mode_list[i++]=STRING_GRAYSCALE; } if(s->can_color){ - s->mode_list[i++]=string_Color; + s->mode_list[i++]=STRING_COLOR; } s->mode_list[i]=NULL; @@ -1392,151 +1472,80 @@ opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; } - /* x resolution */ + /* resolution */ /* some scanners only support fixed res * build a list of possible choices */ - if(option==OPT_X_RES){ + /* we actually only look at the y resolution choices, + * and interpolate the image data as required for limited x resolutions */ + if(option==OPT_RES){ i=0; - if(s->std_res_60 && s->max_x_res >= 60 && s->min_x_res <= 60){ - s->x_res_list[++i] = 60; + if(s->std_res_y[DPI_60] && s->max_y_res >= 60 && s->min_y_res <= 60){ + s->res_list[++i] = 60; } - if(s->std_res_75 && s->max_x_res >= 75 && s->min_x_res <= 75){ - s->x_res_list[++i] = 75; + if(s->std_res_y[DPI_75] && s->max_y_res >= 75 && s->min_y_res <= 75){ + s->res_list[++i] = 75; } - if(s->std_res_100 && s->max_x_res >= 100 && s->min_x_res <= 100){ - s->x_res_list[++i] = 100; + if(s->std_res_y[DPI_100] && s->max_y_res >= 100 && s->min_y_res <= 100){ + s->res_list[++i] = 100; } - if(s->std_res_120 && s->max_x_res >= 120 && s->min_x_res <= 120){ - s->x_res_list[++i] = 120; + if(s->std_res_y[DPI_120] && s->max_y_res >= 120 && s->min_y_res <= 120){ + s->res_list[++i] = 120; } - if(s->std_res_150 && s->max_x_res >= 150 && s->min_x_res <= 150){ - s->x_res_list[++i] = 150; + if(s->std_res_y[DPI_150] && s->max_y_res >= 150 && s->min_y_res <= 150){ + s->res_list[++i] = 150; } - if(s->std_res_160 && s->max_x_res >= 160 && s->min_x_res <= 160){ - s->x_res_list[++i] = 160; + if(s->std_res_y[DPI_160] && s->max_y_res >= 160 && s->min_y_res <= 160){ + s->res_list[++i] = 160; } - if(s->std_res_180 && s->max_x_res >= 180 && s->min_x_res <= 180){ - s->x_res_list[++i] = 180; + if(s->std_res_y[DPI_180] && s->max_y_res >= 180 && s->min_y_res <= 180){ + s->res_list[++i] = 180; } - if(s->std_res_200 && s->max_x_res >= 200 && s->min_x_res <= 200){ - s->x_res_list[++i] = 200; + if(s->std_res_y[DPI_200] && s->max_y_res >= 200 && s->min_y_res <= 200){ + s->res_list[++i] = 200; } - if(s->std_res_240 && s->max_x_res >= 240 && s->min_x_res <= 240){ - s->x_res_list[++i] = 240; + if(s->std_res_y[DPI_240] && s->max_y_res >= 240 && s->min_y_res <= 240){ + s->res_list[++i] = 240; } - if(s->std_res_300 && s->max_x_res >= 300 && s->min_x_res <= 300){ - s->x_res_list[++i] = 300; + if(s->std_res_y[DPI_300] && s->max_y_res >= 300 && s->min_y_res <= 300){ + s->res_list[++i] = 300; } - if(s->std_res_320 && s->max_x_res >= 320 && s->min_x_res <= 320){ - s->x_res_list[++i] = 320; + if(s->std_res_y[DPI_320] && s->max_y_res >= 320 && s->min_y_res <= 320){ + s->res_list[++i] = 320; } - if(s->std_res_400 && s->max_x_res >= 400 && s->min_x_res <= 400){ - s->x_res_list[++i] = 400; + if(s->std_res_y[DPI_400] && s->max_y_res >= 400 && s->min_y_res <= 400){ + s->res_list[++i] = 400; } - if(s->std_res_480 && s->max_x_res >= 480 && s->min_x_res <= 480){ - s->x_res_list[++i] = 480; + if(s->std_res_y[DPI_480] && s->max_y_res >= 480 && s->min_y_res <= 480){ + s->res_list[++i] = 480; } - if(s->std_res_600 && s->max_x_res >= 600 && s->min_x_res <= 600){ - s->x_res_list[++i] = 600; + if(s->std_res_y[DPI_600] && s->max_y_res >= 600 && s->min_y_res <= 600){ + s->res_list[++i] = 600; } - if(s->std_res_800 && s->max_x_res >= 800 && s->min_x_res <= 800){ - s->x_res_list[++i] = 800; + if(s->std_res_y[DPI_800] && s->max_y_res >= 800 && s->min_y_res <= 800){ + s->res_list[++i] = 800; } - if(s->std_res_1200 && s->max_x_res >= 1200 && s->min_x_res <= 1200){ - s->x_res_list[++i] = 1200; + if(s->std_res_y[DPI_1200] && s->max_y_res >= 1200 && s->min_y_res <= 1200){ + s->res_list[++i] = 1200; } - s->x_res_list[0] = i; + s->res_list[0] = i; opt->name = SANE_NAME_SCAN_RESOLUTION; - opt->title = SANE_TITLE_SCAN_X_RESOLUTION; - opt->desc = SANE_DESC_SCAN_X_RESOLUTION; - opt->type = SANE_TYPE_INT; - opt->unit = SANE_UNIT_DPI; - opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - - if(s->step_x_res){ - s->x_res_range.min = s->min_x_res; - s->x_res_range.max = s->max_x_res; - s->x_res_range.quant = s->step_x_res; - opt->constraint_type = SANE_CONSTRAINT_RANGE; - opt->constraint.range = &s->x_res_range; - } - else{ - opt->constraint_type = SANE_CONSTRAINT_WORD_LIST; - opt->constraint.word_list = s->x_res_list; - } - } - - /* y resolution */ - if(option==OPT_Y_RES){ - i=0; - if(s->std_res_60 && s->max_y_res >= 60 && s->min_y_res <= 60){ - s->y_res_list[++i] = 60; - } - if(s->std_res_75 && s->max_y_res >= 75 && s->min_y_res <= 75){ - s->y_res_list[++i] = 75; - } - if(s->std_res_100 && s->max_y_res >= 100 && s->min_y_res <= 100){ - s->y_res_list[++i] = 100; - } - if(s->std_res_120 && s->max_y_res >= 120 && s->min_y_res <= 120){ - s->y_res_list[++i] = 120; - } - if(s->std_res_150 && s->max_y_res >= 150 && s->min_y_res <= 150){ - s->y_res_list[++i] = 150; - } - if(s->std_res_160 && s->max_y_res >= 160 && s->min_y_res <= 160){ - s->y_res_list[++i] = 160; - } - if(s->std_res_180 && s->max_y_res >= 180 && s->min_y_res <= 180){ - s->y_res_list[++i] = 180; - } - if(s->std_res_200 && s->max_y_res >= 200 && s->min_y_res <= 200){ - s->y_res_list[++i] = 200; - } - if(s->std_res_240 && s->max_y_res >= 240 && s->min_y_res <= 240){ - s->y_res_list[++i] = 240; - } - if(s->std_res_300 && s->max_y_res >= 300 && s->min_y_res <= 300){ - s->y_res_list[++i] = 300; - } - if(s->std_res_320 && s->max_y_res >= 320 && s->min_y_res <= 320){ - s->y_res_list[++i] = 320; - } - if(s->std_res_400 && s->max_y_res >= 400 && s->min_y_res <= 400){ - s->y_res_list[++i] = 400; - } - if(s->std_res_480 && s->max_y_res >= 480 && s->min_y_res <= 480){ - s->y_res_list[++i] = 480; - } - if(s->std_res_600 && s->max_y_res >= 600 && s->min_y_res <= 600){ - s->y_res_list[++i] = 600; - } - if(s->std_res_800 && s->max_y_res >= 800 && s->min_y_res <= 800){ - s->y_res_list[++i] = 800; - } - if(s->std_res_1200 && s->max_y_res >= 1200 && s->min_y_res <= 1200){ - s->y_res_list[++i] = 1200; - } - s->y_res_list[0] = i; - - opt->name = SANE_NAME_SCAN_Y_RESOLUTION; - opt->title = SANE_TITLE_SCAN_Y_RESOLUTION; - opt->desc = SANE_DESC_SCAN_Y_RESOLUTION; + opt->title = SANE_TITLE_SCAN_RESOLUTION; + opt->desc = SANE_DESC_SCAN_RESOLUTION; opt->type = SANE_TYPE_INT; opt->unit = SANE_UNIT_DPI; opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; if(s->step_y_res){ - s->y_res_range.min = s->min_y_res; - s->y_res_range.max = s->max_y_res; - s->y_res_range.quant = s->step_y_res; + s->res_range.min = s->min_y_res; + s->res_range.max = s->max_y_res; + s->res_range.quant = s->step_y_res; opt->constraint_type = SANE_CONSTRAINT_RANGE; - opt->constraint.range = &s->y_res_range; + opt->constraint.range = &s->res_range; } else{ opt->constraint_type = SANE_CONSTRAINT_WORD_LIST; - opt->constraint.word_list = s->y_res_list; + opt->constraint.word_list = s->res_list; } } @@ -1626,7 +1635,7 @@ /* values stored in 1200 dpi units */ /* must be converted to MM for sane */ s->paper_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); - s->paper_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->max_x); + s->paper_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->valid_x); s->paper_x_range.quant = MM_PER_UNIT_FIX; opt->name = SANE_NAME_PAGE_WIDTH; @@ -1639,7 +1648,7 @@ if(s->has_adf){ opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - if(s->source == SOURCE_FLATBED){ + if(s->u.source == SOURCE_FLATBED){ opt->cap |= SANE_CAP_INACTIVE; } } @@ -1666,7 +1675,7 @@ if(s->has_adf){ opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - if(s->source == SOURCE_FLATBED){ + if(s->u.source == SOURCE_FLATBED){ opt->cap |= SANE_CAP_INACTIVE; } } @@ -1745,7 +1754,7 @@ if (s->threshold_steps){ opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - if(s->mode != MODE_LINEART){ + if(s->u.mode != MODE_LINEART){ opt->cap |= SANE_CAP_INACTIVE; } } @@ -1778,10 +1787,10 @@ /*image compression*/ if(option==OPT_COMPRESS){ i=0; - s->compress_list[i++]=string_None; + s->compress_list[i++]=STRING_NONE; if(s->has_comp_JPEG){ - s->compress_list[i++]=string_JPEG; + s->compress_list[i++]=STRING_JPEG; } s->compress_list[i]=NULL; @@ -1796,7 +1805,7 @@ if (i > 1){ opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - if (s->mode != MODE_COLOR && s->mode != MODE_GRAYSCALE){ + if (s->u.mode != MODE_COLOR && s->u.mode != MODE_GRAYSCALE){ opt->cap |= SANE_CAP_INACTIVE; } } @@ -1873,6 +1882,51 @@ opt->cap = SANE_CAP_INACTIVE; } + /*deskew by software*/ + if(option==OPT_SWDESKEW){ + opt->name = "swdeskew"; + opt->title = "Software deskew"; + opt->desc = "Request driver to rotate skewed pages digitally"; + opt->type = SANE_TYPE_BOOL; + if (1) + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + else + opt->cap = SANE_CAP_INACTIVE; + } + + /*software despeckle radius*/ + if(option==OPT_SWDESPECK){ + + opt->name = "swdespeck"; + opt->title = "Software despeckle diameter"; + opt->desc = "Maximum diameter of lone dots to remove from scan"; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->swdespeck_range; + s->swdespeck_range.quant=1; + + if(1){ + s->swdespeck_range.min=0; + s->swdespeck_range.max=9; + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + else + opt->cap = SANE_CAP_INACTIVE; + } + + /*crop by software*/ + if(option==OPT_SWCROP){ + opt->name = "swcrop"; + opt->title = "Software crop"; + opt->desc = "Request driver to remove border from pages digitally"; + opt->type = SANE_TYPE_BOOL; + if (1) + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + else + opt->cap = SANE_CAP_INACTIVE; + } + /*staple detection*/ if(option==OPT_STAPLEDETECT){ opt->name = "stapledetect"; @@ -1887,13 +1941,13 @@ /*dropout color front*/ if(option==OPT_DROPOUT_COLOR_F){ - s->do_color_list[0] = string_None; - s->do_color_list[1] = string_Red; - s->do_color_list[2] = string_Green; - s->do_color_list[3] = string_Blue; - s->do_color_list[4] = string_En_Red; - s->do_color_list[5] = string_En_Green; - s->do_color_list[6] = string_En_Blue; + s->do_color_list[0] = STRING_NONE; + s->do_color_list[1] = STRING_RED; + s->do_color_list[2] = STRING_GREEN; + s->do_color_list[3] = STRING_BLUE; + s->do_color_list[4] = STRING_EN_RED; + s->do_color_list[5] = STRING_EN_GREEN; + s->do_color_list[6] = STRING_EN_BLUE; s->do_color_list[7] = NULL; opt->name = "dropout-front"; @@ -1906,7 +1960,7 @@ if (1){ opt->cap = SANE_CAP_SOFT_SELECT|SANE_CAP_SOFT_DETECT|SANE_CAP_ADVANCED; - if(s->mode == MODE_COLOR) + if(s->u.mode == MODE_COLOR) opt->cap |= SANE_CAP_INACTIVE; } else @@ -1915,13 +1969,13 @@ /*dropout color back*/ if(option==OPT_DROPOUT_COLOR_B){ - s->do_color_list[0] = string_None; - s->do_color_list[1] = string_Red; - s->do_color_list[2] = string_Green; - s->do_color_list[3] = string_Blue; - s->do_color_list[4] = string_En_Red; - s->do_color_list[5] = string_En_Green; - s->do_color_list[6] = string_En_Blue; + s->do_color_list[0] = STRING_NONE; + s->do_color_list[1] = STRING_RED; + s->do_color_list[2] = STRING_GREEN; + s->do_color_list[3] = STRING_BLUE; + s->do_color_list[4] = STRING_EN_RED; + s->do_color_list[5] = STRING_EN_GREEN; + s->do_color_list[6] = STRING_EN_BLUE; s->do_color_list[7] = NULL; opt->name = "dropout-back"; @@ -1934,7 +1988,7 @@ if (1){ opt->cap = SANE_CAP_SOFT_SELECT|SANE_CAP_SOFT_DETECT|SANE_CAP_ADVANCED; - if(s->mode == MODE_COLOR) + if(s->u.mode == MODE_COLOR) opt->cap |= SANE_CAP_INACTIVE; } else @@ -1953,6 +2007,17 @@ opt->cap = SANE_CAP_INACTIVE; } + if(option==OPT_SIDE){ + opt->name = "side"; + opt->title = "Duplex side"; + opt->desc = "Tells which side (0=front, 1=back) of a duplex scan the next call to sane_read will return."; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + opt->size = sizeof(SANE_Word); + opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + /* "Sensor" group ------------------------------------------------------ */ if(option==OPT_SENSOR_GROUP){ opt->name = SANE_NAME_SENSORS; @@ -1964,8 +2029,8 @@ if(option==OPT_START){ opt->name = "start"; - opt->title = "Start button"; - opt->desc = "Big green button"; + opt->title = "Start/1 button"; + opt->desc = "Big green or small 1 button"; opt->type = SANE_TYPE_BOOL; opt->unit = SANE_UNIT_NONE; opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; @@ -1973,8 +2038,17 @@ if(option==OPT_STOP){ opt->name = "stop"; - opt->title = "Stop button"; - opt->desc = "Little orange button"; + opt->title = "Stop/2 button"; + opt->desc = "Small orange or small 2 button"; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + } + + if(option==OPT_BUTT3){ + opt->name = "button-3"; + opt->title = "3 button"; + opt->desc = "Small 3 button"; opt->type = SANE_TYPE_BOOL; opt->unit = SANE_UNIT_NONE; opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; @@ -2020,7 +2094,7 @@ s->counter_range.quant=1; if (s->has_counter) - opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; else opt->cap = SANE_CAP_INACTIVE; } @@ -2089,65 +2163,61 @@ return SANE_STATUS_GOOD; case OPT_SOURCE: - if(s->source == SOURCE_FLATBED){ - strcpy (val, string_Flatbed); + if(s->u.source == SOURCE_FLATBED){ + strcpy (val, STRING_FLATBED); } - else if(s->source == SOURCE_ADF_FRONT){ - strcpy (val, string_ADFFront); + else if(s->u.source == SOURCE_ADF_FRONT){ + strcpy (val, STRING_ADFFRONT); } - else if(s->source == SOURCE_ADF_BACK){ - strcpy (val, string_ADFBack); + else if(s->u.source == SOURCE_ADF_BACK){ + strcpy (val, STRING_ADFBACK); } - else if(s->source == SOURCE_ADF_DUPLEX){ - strcpy (val, string_ADFDuplex); + else if(s->u.source == SOURCE_ADF_DUPLEX){ + strcpy (val, STRING_ADFDUPLEX); } return SANE_STATUS_GOOD; case OPT_MODE: - if(s->mode == MODE_LINEART){ - strcpy (val, string_Lineart); + if(s->u.mode == MODE_LINEART){ + strcpy (val, STRING_LINEART); } - else if(s->mode == MODE_HALFTONE){ - strcpy (val, string_Halftone); + else if(s->u.mode == MODE_HALFTONE){ + strcpy (val, STRING_HALFTONE); } - else if(s->mode == MODE_GRAYSCALE){ - strcpy (val, string_Grayscale); + else if(s->u.mode == MODE_GRAYSCALE){ + strcpy (val, STRING_GRAYSCALE); } - else if(s->mode == MODE_COLOR){ - strcpy (val, string_Color); + else if(s->u.mode == MODE_COLOR){ + strcpy (val, STRING_COLOR); } return SANE_STATUS_GOOD; - case OPT_X_RES: - *val_p = s->resolution_x; - return SANE_STATUS_GOOD; - - case OPT_Y_RES: - *val_p = s->resolution_y; + case OPT_RES: + *val_p = s->u.dpi_x; return SANE_STATUS_GOOD; case OPT_TL_X: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->tl_x); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.tl_x); return SANE_STATUS_GOOD; case OPT_TL_Y: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->tl_y); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.tl_y); return SANE_STATUS_GOOD; case OPT_BR_X: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->br_x); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.br_x); return SANE_STATUS_GOOD; case OPT_BR_Y: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->br_y); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.br_y); return SANE_STATUS_GOOD; case OPT_PAGE_WIDTH: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->page_width); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.page_x); return SANE_STATUS_GOOD; case OPT_PAGE_HEIGHT: - *val_p = SCANNER_UNIT_TO_FIXED_MM(s->page_height); + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u.page_y); return SANE_STATUS_GOOD; case OPT_BRIGHTNESS: @@ -2169,10 +2239,10 @@ /* Advanced Group */ case OPT_COMPRESS: if(s->compress == COMP_JPEG){ - strcpy (val, string_JPEG); + strcpy (val, STRING_JPEG); } else{ - strcpy (val, string_None); + strcpy (val, STRING_NONE); } return SANE_STATUS_GOOD; @@ -2192,6 +2262,18 @@ *val_p = s->rollerdeskew; return SANE_STATUS_GOOD; + case OPT_SWDESKEW: + *val_p = s->swdeskew; + return SANE_STATUS_GOOD; + + case OPT_SWDESPECK: + *val_p = s->swdespeck; + return SANE_STATUS_GOOD; + + case OPT_SWCROP: + *val_p = s->swcrop; + return SANE_STATUS_GOOD; + case OPT_STAPLEDETECT: *val_p = s->stapledetect; return SANE_STATUS_GOOD; @@ -2199,25 +2281,25 @@ case OPT_DROPOUT_COLOR_F: switch (s->dropout_color_f) { case COLOR_NONE: - strcpy (val, string_None); + strcpy (val, STRING_NONE); break; case COLOR_RED: - strcpy (val, string_Red); + strcpy (val, STRING_RED); break; case COLOR_GREEN: - strcpy (val, string_Green); + strcpy (val, STRING_GREEN); break; case COLOR_BLUE: - strcpy (val, string_Blue); + strcpy (val, STRING_BLUE); break; case COLOR_EN_RED: - strcpy (val, string_En_Red); + strcpy (val, STRING_EN_RED); break; case COLOR_EN_GREEN: - strcpy (val, string_En_Green); + strcpy (val, STRING_EN_GREEN); break; case COLOR_EN_BLUE: - strcpy (val, string_En_Blue); + strcpy (val, STRING_EN_BLUE); break; } return SANE_STATUS_GOOD; @@ -2225,25 +2307,25 @@ case OPT_DROPOUT_COLOR_B: switch (s->dropout_color_b) { case COLOR_NONE: - strcpy (val, string_None); + strcpy (val, STRING_NONE); break; case COLOR_RED: - strcpy (val, string_Red); + strcpy (val, STRING_RED); break; case COLOR_GREEN: - strcpy (val, string_Green); + strcpy (val, STRING_GREEN); break; case COLOR_BLUE: - strcpy (val, string_Blue); + strcpy (val, STRING_BLUE); break; case COLOR_EN_RED: - strcpy (val, string_En_Red); + strcpy (val, STRING_EN_RED); break; case COLOR_EN_GREEN: - strcpy (val, string_En_Green); + strcpy (val, STRING_EN_GREEN); break; case COLOR_EN_BLUE: - strcpy (val, string_En_Blue); + strcpy (val, STRING_EN_BLUE); break; } return SANE_STATUS_GOOD; @@ -2252,6 +2334,10 @@ *val_p = s->buffermode; return SANE_STATUS_GOOD; + case OPT_SIDE: + *val_p = s->side; + return SANE_STATUS_GOOD; + /* Sensor Group */ case OPT_START: ret = read_panel(s,OPT_START); @@ -2263,6 +2349,11 @@ *val_p = s->panel_stop; return ret; + case OPT_BUTT3: + ret = read_panel(s,OPT_BUTT3); + *val_p = s->panel_butt3; + return ret; + case OPT_NEWFILE: ret = read_panel(s,OPT_NEWFILE); *val_p = s->panel_new_file; @@ -2322,127 +2413,112 @@ /* Mode Group */ case OPT_SOURCE: - if (!strcmp (val, string_ADFFront)) { + if (!strcmp (val, STRING_ADFFRONT)) { tmp = SOURCE_ADF_FRONT; } - else if (!strcmp (val, string_ADFBack)) { + else if (!strcmp (val, STRING_ADFBACK)) { tmp = SOURCE_ADF_BACK; } - else if (!strcmp (val, string_ADFDuplex)) { + else if (!strcmp (val, STRING_ADFDUPLEX)) { tmp = SOURCE_ADF_DUPLEX; } else{ tmp = SOURCE_FLATBED; } - if (s->source == tmp) + if (s->u.source == tmp) return SANE_STATUS_GOOD; - s->source = tmp; + s->u.source = tmp; + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; - return ssm_buffer(s); + return SANE_STATUS_GOOD; case OPT_MODE: - if (!strcmp (val, string_Lineart)) { + if (!strcmp (val, STRING_LINEART)) { tmp = MODE_LINEART; } - else if (!strcmp (val, string_Halftone)) { + else if (!strcmp (val, STRING_HALFTONE)) { tmp = MODE_HALFTONE; } - else if (!strcmp (val, string_Grayscale)) { + else if (!strcmp (val, STRING_GRAYSCALE)) { tmp = MODE_GRAYSCALE; } else{ tmp = MODE_COLOR; } - if (tmp == s->mode) + if (tmp == s->u.mode) return SANE_STATUS_GOOD; - s->mode = tmp; - *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; - return SANE_STATUS_GOOD; - - case OPT_X_RES: - - if (s->resolution_x == val_c) - return SANE_STATUS_GOOD; - - /* currently the same? move y too */ - if (s->resolution_x == s->resolution_y){ - s->resolution_y = val_c; - /*sanei_constrain_value (s->opt + OPT_Y_RES, (void *) &val_c, 0) == SANE_STATUS_GOOD*/ - } - - s->resolution_x = val_c; + s->u.mode = tmp; *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; - case OPT_Y_RES: + case OPT_RES: - if (s->resolution_y == val_c) + if (s->u.dpi_x == val_c && s->u.dpi_y == val_c) return SANE_STATUS_GOOD; - s->resolution_y = val_c; + s->u.dpi_x = val_c; + s->u.dpi_y = val_c; *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; /* Geometry Group */ case OPT_TL_X: - if (s->tl_x == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.tl_x == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - if(!s->fixed_width) - s->tl_x = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.tl_x = FIXED_MM_TO_SCANNER_UNIT(val_c); *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; case OPT_TL_Y: - if (s->tl_y == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.tl_y == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - s->tl_y = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.tl_y = FIXED_MM_TO_SCANNER_UNIT(val_c); *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; case OPT_BR_X: - if (s->br_x == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.br_x == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - if(!s->fixed_width) - s->br_x = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.br_x = FIXED_MM_TO_SCANNER_UNIT(val_c); *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; case OPT_BR_Y: - if (s->br_y == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.br_y == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - s->br_y = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.br_y = FIXED_MM_TO_SCANNER_UNIT(val_c); *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; case OPT_PAGE_WIDTH: - if (s->page_width == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.page_x == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - if(!s->fixed_width) - s->page_width = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.page_x = FIXED_MM_TO_SCANNER_UNIT(val_c); *info |= SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; case OPT_PAGE_HEIGHT: - if (s->page_height == FIXED_MM_TO_SCANNER_UNIT(val_c)) + if (s->u.page_y == FIXED_MM_TO_SCANNER_UNIT(val_c)) return SANE_STATUS_GOOD; - s->page_height = FIXED_MM_TO_SCANNER_UNIT(val_c); + s->u.page_y = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; @@ -2465,7 +2541,7 @@ /* Advanced Group */ case OPT_COMPRESS: - if (!strcmp (val, string_JPEG)) { + if (!strcmp (val, STRING_JPEG)) { s->compress = COMP_JPEG; } else{ @@ -2479,62 +2555,70 @@ case OPT_DF_LENGTH: s->df_length = val_c; - return ssm_df(s); + return SANE_STATUS_GOOD; case OPT_DF_THICKNESS: s->df_thickness = val_c; - return ssm_df(s); + return SANE_STATUS_GOOD; case OPT_ROLLERDESKEW: s->rollerdeskew = val_c; - return ssm_df(s); + return SANE_STATUS_GOOD; + + case OPT_SWDESKEW: + s->swdeskew = val_c; + return SANE_STATUS_GOOD; + + case OPT_SWDESPECK: + s->swdespeck = val_c; + return SANE_STATUS_GOOD; + + case OPT_SWCROP: + s->swcrop = val_c; + return SANE_STATUS_GOOD; case OPT_STAPLEDETECT: s->stapledetect = val_c; - return ssm_df(s); + return SANE_STATUS_GOOD; case OPT_DROPOUT_COLOR_F: - if (!strcmp(val, string_None)) + if (!strcmp(val, STRING_NONE)) s->dropout_color_f = COLOR_NONE; - else if (!strcmp(val, string_Red)) + else if (!strcmp(val, STRING_RED)) s->dropout_color_f = COLOR_RED; - else if (!strcmp(val, string_Green)) + else if (!strcmp(val, STRING_GREEN)) s->dropout_color_f = COLOR_GREEN; - else if (!strcmp(val, string_Blue)) + else if (!strcmp(val, STRING_BLUE)) s->dropout_color_f = COLOR_BLUE; - else if (!strcmp(val, string_En_Red)) + else if (!strcmp(val, STRING_EN_RED)) s->dropout_color_f = COLOR_EN_RED; - else if (!strcmp(val, string_En_Green)) + else if (!strcmp(val, STRING_EN_GREEN)) s->dropout_color_f = COLOR_EN_GREEN; - else if (!strcmp(val, string_En_Blue)) + else if (!strcmp(val, STRING_EN_BLUE)) s->dropout_color_f = COLOR_EN_BLUE; - return ssm_do(s); + return SANE_STATUS_GOOD; case OPT_DROPOUT_COLOR_B: - if (!strcmp(val, string_None)) + if (!strcmp(val, STRING_NONE)) s->dropout_color_b = COLOR_NONE; - else if (!strcmp(val, string_Red)) + else if (!strcmp(val, STRING_RED)) s->dropout_color_b = COLOR_RED; - else if (!strcmp(val, string_Green)) + else if (!strcmp(val, STRING_GREEN)) s->dropout_color_b = COLOR_GREEN; - else if (!strcmp(val, string_Blue)) + else if (!strcmp(val, STRING_BLUE)) s->dropout_color_b = COLOR_BLUE; - else if (!strcmp(val, string_En_Red)) + else if (!strcmp(val, STRING_EN_RED)) s->dropout_color_b = COLOR_EN_RED; - else if (!strcmp(val, string_En_Green)) + else if (!strcmp(val, STRING_EN_GREEN)) s->dropout_color_b = COLOR_EN_GREEN; - else if (!strcmp(val, string_En_Blue)) + else if (!strcmp(val, STRING_EN_BLUE)) s->dropout_color_b = COLOR_EN_BLUE; - return ssm_do(s); + return SANE_STATUS_GOOD; case OPT_BUFFERMODE: s->buffermode = val_c; - return ssm_buffer(s); + return SANE_STATUS_GOOD; - /* Sensor Group */ - case OPT_COUNTER: - s->panel_counter = val_c; - return send_panel(s); } } /* else */ @@ -2563,11 +2647,17 @@ set_SSM_page_code(out, SM_pc_buffer); set_SSM_page_len(out, SSM_PAGE_len); - if(s->source == SOURCE_ADF_DUPLEX){ - set_SSM_BUFF_duplex(out, 0x02); + if(s->s.source == SOURCE_ADF_DUPLEX){ + set_SSM_BUFF_duplex(out, 1); } if(s->buffermode){ - set_SSM_BUFF_async(out, 0x40); + set_SSM_BUFF_async(out, 1); + } + if(0){ + set_SSM_BUFF_ald(out, 1); + } + if(0){ + set_SSM_BUFF_unk(out,1); } ret = do_cmd ( @@ -2745,7 +2835,7 @@ DBG (10, "read_panel: start\n"); /* only run this if frontend has read previous value */ - if (!s->hw_read[option-OPT_START]) { + if (s->hw_read[option-OPT_START]) { DBG (15, "read_panel: running\n"); @@ -2767,6 +2857,7 @@ s->panel_start = get_R_PANEL_start(in); s->panel_stop = get_R_PANEL_stop(in); + s->panel_butt3 = get_R_PANEL_butt3(in); s->panel_new_file = get_R_PANEL_new_file(in); s->panel_count_only = get_R_PANEL_count_only(in); s->panel_bypass_mode = get_R_PANEL_bypass_mode(in); @@ -2778,7 +2869,7 @@ s->hw_read[option-OPT_START] = 1; - DBG (10, "read_panel: finish\n"); + DBG (10, "read_panel: finish %d\n",s->panel_counter); return ret; } @@ -2854,89 +2945,222 @@ struct scanner *s = (struct scanner *) handle; DBG (10, "sane_get_parameters: start\n"); - - /* started? get param data from struct */ - if(s->started){ - DBG (15, "sane_get_parameters: started, copying to caller\n"); - params->format = s->params.format; - params->last_frame = s->params.last_frame; - params->lines = s->params.lines; - params->depth = s->params.depth; - params->pixels_per_line = s->params.pixels_per_line; - params->bytes_per_line = s->params.bytes_per_line; + + if(!s->started){ + ret = update_params(s,0); + if(ret){ + DBG (5, "sane_get_parameters: up error, returning %d\n", ret); + return ret; + } } - /* not started? get param data from user settings */ - else { - DBG (15, "sane_get_parameters: not started, updating\n"); + /* this backend only sends single frame images */ + params->last_frame = 1; + + params->format = s->i.format; + params->lines = s->i.height; + params->depth = s->i.bpp; + if(params->depth == 24) params->depth = 8; + params->pixels_per_line = s->i.width; + params->bytes_per_line = s->i.Bpl; - /* this backend only sends single frame images */ - params->last_frame = 1; + DBG(15,"sane_get_parameters: x: max=%d, page=%d, gpw=%d, res=%d\n", + s->valid_x, s->i.page_x, get_page_width(s), s->i.dpi_x); + + DBG(15,"sane_get_parameters: y: max=%d, page=%d, gph=%d, res=%d\n", + s->max_y, s->i.page_y, get_page_height(s), s->i.dpi_y); + + DBG(15,"sane_get_parameters: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", + s->i.tl_x, s->i.br_x, s->i.tl_y, s->i.br_y); + + DBG (15, "sane_get_parameters: params: ppl=%d, Bpl=%d, lines=%d\n", + params->pixels_per_line, params->bytes_per_line, params->lines); - params->pixels_per_line = (s->br_x - s->tl_x) * s->resolution_x / 1200; + DBG (15, "sane_get_parameters: params: format=%d, depth=%d, last=%d\n", + params->format, params->depth, params->last_frame); + + DBG (10, "sane_get_parameters: finish\n"); - params->lines = s->resolution_y * (s->br_y - s->tl_y) / 1200; + return ret; +} - /* round lines down to even number */ - params->lines -= params->lines % 2; - - if (s->mode == MODE_COLOR) { - params->format = SANE_FRAME_RGB; - params->depth = 8; +SANE_Status +update_params(struct scanner *s, int calib) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + DBG (10, "update_params: start\n"); + + s->u.width = (s->u.br_x - s->u.tl_x) * s->u.dpi_x / 1200; + s->u.height = (s->u.br_y - s->u.tl_y) * s->u.dpi_y / 1200; -#ifdef SANE_FRAME_JPEG - /* jpeg requires 8x8 squares */ - if(s->compress == COMP_JPEG){ - params->format = SANE_FRAME_JPEG; - params->pixels_per_line -= params->pixels_per_line % 8; - params->lines -= params->lines % 8; - } -#endif + if (s->u.mode == MODE_COLOR) { + s->u.format = SANE_FRAME_RGB; + s->u.bpp = 24; + } + else if (s->u.mode == MODE_GRAYSCALE) { + s->u.format = SANE_FRAME_GRAY; + s->u.bpp = 8; + } + else { + s->u.format = SANE_FRAME_GRAY; + s->u.bpp = 1; - params->bytes_per_line = params->pixels_per_line * 3; - } - else if (s->mode == MODE_GRAYSCALE) { - params->format = SANE_FRAME_GRAY; - params->depth = 8; + /* round down to byte boundary */ + s->u.width -= s->u.width % 8; + } #ifdef SANE_FRAME_JPEG - /* jpeg requires 8x8 squares */ - if(s->compress == COMP_JPEG){ - params->format = SANE_FRAME_JPEG; - params->pixels_per_line -= params->pixels_per_line % 8; - params->lines -= params->lines % 8; - } + /* jpeg requires 8x8 squares */ + if(s->compress == COMP_JPEG && s->u.mode >= MODE_GRAYSCALE){ + s->u.format = SANE_FRAME_JPEG; + s->u.width -= s->u.width % 8; + s->u.height -= s->u.height % 8; + } #endif - params->bytes_per_line = params->pixels_per_line; - } - else { - params->format = SANE_FRAME_GRAY; - params->depth = 1; - - /* round down to byte boundary */ - params->pixels_per_line -= params->pixels_per_line % 8; - params->bytes_per_line = params->pixels_per_line / 8; - } + s->u.Bpl = s->u.width * s->u.bpp / 8; + s->u.valid_Bpl = s->u.Bpl; + s->u.valid_width = s->u.width; + + DBG (15, "update_params: user params: w:%d h:%d m:%d f:%d b:%d\n", + s->u.width, s->u.height, s->u.mode, s->u.format, s->u.bpp); + DBG (15, "update_params: user params: B:%d vB:%d vw:%d\n", + s->u.Bpl, s->u.valid_Bpl, s->u.valid_width); + DBG (15, "update_params: user params: x b:%d t:%d d:%d y b:%d t:%d d:%d\n", + s->u.br_x, s->u.tl_x, s->u.dpi_x, s->u.br_y, s->u.tl_y, s->u.dpi_y); + + /* some scanners are limited in their valid scan params + * make a second version of the params struct, but + * override the user's values with what the scanner can actually do */ + + memcpy(&s->s,&s->u,sizeof(struct img_params)); + + /*********** missing modes (move up to valid one) **************/ + if(s->s.mode == MODE_LINEART && !s->can_monochrome){ + s->s.mode = MODE_GRAYSCALE; + s->s.format = SANE_FRAME_GRAY; + s->s.bpp = 8; + } + if(s->s.mode == MODE_GRAYSCALE && !s->can_grayscale){ + s->s.mode = MODE_COLOR; + s->s.format = SANE_FRAME_RGB; + s->s.bpp = 24; + } + if(s->s.mode == MODE_COLOR && !s->can_color){ + DBG (5, "update_params: no valid mode\n"); + return SANE_STATUS_INVAL; } - DBG(15,"sane_get_parameters: x: max=%d, page=%d, gpw=%d, res=%d\n", - s->max_x, s->page_width, get_page_width(s), s->resolution_x); + /********** missing resolutions (move up to valid one) *********/ + if(!s->step_x_res){ + int i; + for(i=0;imax_y, s->page_height, get_page_height(s), s->resolution_y); + /* this res is smaller or invalid, skip it */ + if(s->s.dpi_x > dpi_list[i] || !s->std_res_x[i]) + continue; - DBG(15,"sane_get_parameters: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", - s->tl_x, s->br_x, s->tl_y, s->br_y); + /* same & valid res, done */ + if(s->s.dpi_x == dpi_list[i]) + break; - DBG (15, "sane_get_parameters: params: ppl=%d, Bpl=%d, lines=%d\n", - params->pixels_per_line, params->bytes_per_line, params->lines); + /* different & valid res, switch */ + s->s.dpi_x = dpi_list[i]; + break; + } - DBG (15, "sane_get_parameters: params: format=%d, depth=%d, last=%d\n", - params->format, params->depth, params->last_frame); + if(i > DPI_1200){ + DBG (5, "update_params: no dpi\n"); + return SANE_STATUS_INVAL; + } + } - DBG (10, "sane_get_parameters: finish\n"); + /*********** weird scan area (increase to valid one) *********/ + if(s->fixed_width){ + s->s.tl_x = 0; + s->s.br_x = s->max_x; + s->s.page_x = s->max_x; + } + + /*recalculate new params*/ + s->s.width = (s->s.br_x - s->s.tl_x) * s->s.dpi_x / 1200; + + /* round down to byte boundary */ + if(s->s.mode < MODE_GRAYSCALE){ + s->s.width -= s->s.width % 8; + } + + s->s.valid_width = s->s.width; + s->s.valid_Bpl = s->s.valid_width * s->s.bpp / 8; + + /* some machines (DR-2050) require even bytes per scanline */ + /* increase width and Bpl, but not valid_width and valid_Bpl */ + if(s->even_Bpl && (s->s.width % 2)){ + s->s.width++; + } + + s->s.Bpl = s->s.width * s->s.bpp / 8; + + /* figure out how many valid bytes per line (2510 is padded) */ + if(s->color_interlace[SIDE_FRONT] == COLOR_INTERLACE_2510){ + s->s.valid_Bpl = s->s.Bpl*11/12; + s->s.valid_width = s->s.width*11/12; + } + + /* some scanners need longer scans because front/back is offset */ + if(s->u.source == SOURCE_ADF_DUPLEX && s->duplex_offset) + s->s.height = (s->u.br_y-s->u.tl_y+s->duplex_offset) * s->u.dpi_y / 1200; + + /* round lines up to even number */ + s->s.height += s->s.height % 2; + + DBG (15, "update_params: scan params: w:%d h:%d m:%d f:%d b:%d\n", + s->s.width, s->s.height, s->s.mode, s->s.format, s->s.bpp); + DBG (15, "update_params: scan params: B:%d vB:%d vw:%d\n", + s->s.Bpl, s->s.valid_Bpl, s->s.valid_width); + DBG (15, "update_params: scan params: x b:%d t:%d d:%d y b:%d t:%d d:%d\n", + s->s.br_x, s->s.tl_x, s->s.dpi_x, s->s.br_y, s->s.tl_y, s->s.dpi_y); + + /* make a third (intermediate) version of the params struct, + * currently identical to the user's params. this is what + * we actually will send back to the user (though buffer_xxx + * functions might change these values after this runs) */ + + /* calibration code needs the data just as it comes from the scanner */ + if(calib) + memcpy(&s->i,&s->s,sizeof(struct img_params)); + /* normal scans need the data cleaned for presentation to the user */ + else{ + memcpy(&s->i,&s->u,sizeof(struct img_params)); + /*dumb scanners pad the top of front page in duplex*/ + if(s->i.source == SOURCE_ADF_DUPLEX) + s->i.skip_lines[0] = s->duplex_offset * s->i.dpi_y / 1200; + } + + DBG (15, "update_params: i params: w:%d h:%d m:%d f:%d b:%d\n", + s->i.width, s->i.height, s->i.mode, s->i.format, s->i.bpp); + DBG (15, "update_params: i params: B:%d vB:%d vw:%d\n", + s->i.Bpl, s->i.valid_Bpl, s->i.valid_width); + DBG (15, "update_params: i params: x b:%d t:%d d:%d y b:%d t:%d d:%d\n", + s->i.br_x, s->i.tl_x, s->i.dpi_x, s->i.br_y, s->i.tl_y, s->i.dpi_y); + + DBG (10, "update_params: finish\n"); + return ret; +} + +/* reset image size parameters after buffer_xxx functions changed them */ +SANE_Status +update_i_params(struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + DBG (10, "update_i_params: start\n"); + + s->i.width = s->u.width; + s->i.Bpl = s->u.Bpl; + + DBG (10, "update_i_params: finish\n"); return ret; } @@ -2955,251 +3179,374 @@ SANE_Status ret = SANE_STATUS_GOOD; DBG (10, "sane_start: start\n"); - DBG (15, "started=%d, side=%d, source=%d\n", s->started, s->side, s->source); + DBG (15, "started=%d, side=%d, source=%d\n", + s->started, s->side, s->u.source); /* undo any prior sane_cancel calls */ s->cancelled=0; + /* protect this block from sane_cancel */ + s->reading=1; + /* not finished with current side, error */ - if (s->started && s->bytes_tx[s->side] != s->bytes_tot[s->side]) { - DBG(5,"sane_start: previous transfer not finished?"); - return SANE_STATUS_INVAL; + if (s->started && !s->u.eof[s->side]) { + DBG(5,"sane_start: previous transfer not finished?"); + return SANE_STATUS_INVAL; } /* batch start? inititalize struct and scanner */ if(!s->started){ - /* load side marker */ - if(s->source == SOURCE_ADF_BACK){ - s->side = SIDE_BACK; - } - else{ - s->side = SIDE_FRONT; - } + /* load side marker */ + if(s->u.source == SOURCE_ADF_BACK){ + s->side = SIDE_BACK; + } + else{ + s->side = SIDE_FRONT; + } - /* load our own private copy of scan params */ - ret = sane_get_parameters ((SANE_Handle) s, &s->params); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot get params\n"); - return ret; - } + /* eject paper leftover*/ + if(object_position (s, SANE_FALSE)){ + DBG (5, "sane_start: ERROR: cannot eject page\n"); + } - /* switch source - if(s->source == SOURCE_FLATBED){ - ret = scanner_control(s, SC_function_fb); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot control fb\n"); - return ret; - } - } - else{ - ret = scanner_control(s, SC_function_adf); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot control adf\n"); - return ret; - } - } - * */ + /* wait for scanner to finish eject */ + ret = wait_scanner (s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot wait scanner\n"); + goto errors; + } - /* eject paper leftover*/ - if(object_position (s, SANE_FALSE)){ - DBG (5, "sane_start: ERROR: cannot eject page\n"); - } + /* load the brightness/contrast lut with linear slope for calibration */ + ret = load_lut (s->lut, 8, 8, 0, 255, 0, 0); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot load lut\n"); + goto errors; + } - /* set window command */ - ret = set_window(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot set window\n"); - return ret; - } - - /* buffer command */ - ret = ssm_buffer(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot ssm buffer\n"); - return ret; - } + /* AFE cal */ + if((ret = calibrate_AFE(s))){ + DBG (5, "sane_start: ERROR: cannot cal afe\n"); + goto errors; + } - ret = ssm_do(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot ssm do\n"); - return ret; - } + /* fine cal */ + if((ret = calibrate_fine(s))){ + DBG (5, "sane_start: ERROR: cannot cal fine\n"); + goto errors; + } - ret = ssm_df(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot ssm df\n"); - return ret; - } - } - /* if already running, duplex needs to switch sides */ - else if(s->source == SOURCE_ADF_DUPLEX){ - s->side = !s->side; + if((ret = calibrate_fine_buffer(s))){ + DBG (5, "sane_start: ERROR: cannot cal fine from buffer\n"); + goto errors; + } + + /* reset the page counter after calibration */ + s->panel_counter = 0; + s->prev_page = 0; + if(send_panel(s)){ + DBG (5, "sane_start: ERROR: cannot send panel\n"); + } + + /* load our own private copy of scan params */ + ret = update_params(s,0); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot update_params\n"); + goto errors; + } + + /* set window command */ + ret = set_window(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot set window\n"); + goto errors; + } + + /* buffer/duplex/ald command */ + ret = ssm_buffer(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot ssm buffer\n"); + goto errors; + } + + /* dropout color command */ + ret = ssm_do(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot ssm do\n"); + goto errors; + } + + /* double feed detection command */ + ret = ssm_df(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot ssm df\n"); + goto errors; + } + + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot clean_params\n"); + goto errors; + } + + /* make large buffers to hold the images */ + ret = image_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot load buffers\n"); + goto errors; + } + + /* load the brightness/contrast lut with user choices */ + ret = load_lut (s->lut, 8, 8, 0, 255, s->contrast, s->brightness); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot load lut\n"); + goto errors; + } + + /* grab next page */ + ret = object_position (s, SANE_TRUE); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot load page\n"); + goto errors; + } + + /* wait for scanner to finish load */ + ret = wait_scanner (s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot wait scanner\n"); + goto errors; + } + + /* start scanning */ + ret = start_scan (s,0); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot start_scan\n"); + goto errors; + } + + s->started = 1; } - /* set clean defaults with new sheet of paper */ - /* dont reset the transfer vars on backside of duplex page */ - /* otherwise buffered back page will be lost */ - /* ingest paper with adf (no-op for fb) */ - /* dont call object pos or scan on back side of duplex scan */ - if(s->side == SIDE_FRONT || s->source == SOURCE_ADF_BACK){ - - s->eof_rx[0]=0; - s->eof_rx[1]=0; - s->bytes_rx[0]=0; - s->bytes_rx[1]=0; - s->lines_rx[0]=0; - s->lines_rx[1]=0; - - s->bytes_tx[0]=0; - s->bytes_tx[1]=0; - - /* store the number of front bytes */ - if ( s->source != SOURCE_ADF_BACK ){ - s->bytes_tot[SIDE_FRONT] = s->params.bytes_per_line * s->params.lines; - } - else{ - s->bytes_tot[SIDE_FRONT] = 0; - } + /* stuff done for subsequent images */ + else{ - /* store the number of back bytes */ - if ( s->source == SOURCE_ADF_DUPLEX || s->source == SOURCE_ADF_BACK ){ - s->bytes_tot[SIDE_BACK] = s->params.bytes_per_line * s->params.lines; - } - else{ - s->bytes_tot[SIDE_BACK] = 0; - } + /* duplex needs to switch sides */ + if(s->s.source == SOURCE_ADF_DUPLEX){ + s->side = !s->side; + } - /* first page of batch */ - if(!s->started){ + /* reset the intermediate params */ + ret = update_i_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot update_i_params\n"); + goto errors; + } - /* make large buffers to hold the images */ - ret = setup_buffers(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot load buffers\n"); - return ret; - } + /* set clean defaults with new sheet of paper */ + /* dont reset the transfer vars on backside of duplex page */ + /* otherwise buffered back page will be lost */ + /* ingest paper with adf (no-op for fb) */ + /* dont call object pos or scan on back side of duplex scan */ + if(s->side == SIDE_FRONT || s->s.source == SOURCE_ADF_BACK){ - /* grab page count before first page */ - ret = read_panel (s, OPT_COUNTER); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot load page\n"); - return ret; - } - s->prev_page = s->panel_counter; + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot clean_params\n"); + goto errors; + } - /* grab page */ + /* big scanners and small ones in non-buff mode: OP to detect paper */ + if(s->always_op || !s->buffermode){ ret = object_position (s, SANE_TRUE); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot load page\n"); - return ret; - } - - /* start scanning */ - ret = start_scan (s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot start_scan\n"); - return ret; + goto errors; } - /* set started flag */ - s->started=1; - } - - /* stuff done between subsequent pages */ - else { - - /* big scanners use OP to detect paper */ - if(s->always_op){ - ret = object_position (s, SANE_TRUE); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot load page\n"); - return ret; - } - } - /* user wants unbuffered scans */ /* send scan command */ if(!s->buffermode){ - ret = start_scan (s); + ret = start_scan (s,0); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot start_scan\n"); - return ret; + goto errors; } } + } - /* small scanners check for more pages by reading counter */ - if(!s->always_op){ - ret = read_panel (s, OPT_COUNTER); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot load page\n"); - return ret; - } - if(s->prev_page == s->panel_counter){ - DBG (5, "sane_start: same counter (%d) no paper?\n",s->prev_page); - - /* eject paper leftover*/ - if(object_position (s, SANE_FALSE)){ - DBG (5, "sane_start: ERROR: cannot eject page\n"); - } - - return SANE_STATUS_NO_DOCS; - } - DBG (5, "sane_start: diff counter (%d/%d)\n", - s->prev_page,s->panel_counter); + /* small, buffering scanners check for more pages by reading counter */ + else{ + ret = read_panel (s, OPT_COUNTER); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot load page\n"); + goto errors; + } + if(s->prev_page == s->panel_counter){ + DBG (5, "sane_start: same counter (%d) no paper?\n",s->prev_page); + ret = SANE_STATUS_NO_DOCS; + goto errors; } + DBG (5, "sane_start: diff counter (%d/%d)\n", + s->prev_page,s->panel_counter); } - + } } /* reset jpeg params on each page */ s->jpeg_stage=JPEG_STAGE_NONE; s->jpeg_ff_offset=0; - DBG (15, "started=%d, side=%d, source=%d\n", s->started, s->side, s->source); + DBG (15, "started=%d, side=%d, source=%d\n", + s->started, s->side, s->u.source); + + /* certain options require the entire image to + * be collected from the scanner before we can + * tell the user the size of the image. the sane + * API has no way to inform the frontend of this, + * so we block and buffer. yuck */ + if( (s->swdeskew || s->swdespeck || s->swcrop) +#ifdef SANE_FRAME_JPEG + && s->s.format != SANE_FRAME_JPEG +#endif + ){ + + /* get image */ + while(!s->s.eof[s->side] && !ret){ + SANE_Int len = 0; + ret = sane_read((SANE_Handle)s, NULL, 0, &len); + } + + /* check for errors */ + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot buffer image\n"); + goto errors; + } + + DBG (5, "sane_start: OK: done buffering\n"); + + /* finished buffering, adjust image as required */ + if(s->swdeskew){ + buffer_deskew(s,s->side); + } + if(s->swcrop){ + buffer_crop(s,s->side); + } + if(s->swdespeck){ + buffer_despeck(s,s->side); + } + + } + + ret = check_for_cancel(s); + s->reading = 0; DBG (10, "sane_start: finish %d\n", ret); + return ret; + + errors: + DBG (10, "sane_start: error %d\n", ret); + s->started = 0; + s->cancelled = 0; + s->reading = 0; + return ret; +} + +/* + * cleans params for new scan + */ +static SANE_Status +clean_params (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + DBG (10, "clean_params: start\n"); + + s->u.eof[0]=0; + s->u.eof[1]=0; + s->u.bytes_sent[0]=0; + s->u.bytes_sent[1]=0; + s->u.bytes_tot[0]=0; + s->u.bytes_tot[1]=0; + + s->i.eof[0]=0; + s->i.eof[1]=0; + s->i.bytes_sent[0]=0; + s->i.bytes_sent[1]=0; + s->i.bytes_tot[0]=0; + s->i.bytes_tot[1]=0; + + s->s.eof[0]=0; + s->s.eof[1]=0; + s->s.bytes_sent[0]=0; + s->s.bytes_sent[1]=0; + s->s.bytes_tot[0]=0; + s->s.bytes_tot[1]=0; + + /* store the number of front bytes */ + if ( s->u.source != SOURCE_ADF_BACK ) + s->u.bytes_tot[SIDE_FRONT] = s->u.Bpl * s->u.height; + + if ( s->i.source != SOURCE_ADF_BACK ) + s->i.bytes_tot[SIDE_FRONT] = s->i.Bpl * s->i.height; + + if ( s->s.source != SOURCE_ADF_BACK ) + s->s.bytes_tot[SIDE_FRONT] = s->s.Bpl * s->s.height; + + /* store the number of back bytes */ + if ( s->u.source == SOURCE_ADF_DUPLEX || s->u.source == SOURCE_ADF_BACK ) + s->u.bytes_tot[SIDE_BACK] = s->u.Bpl * s->u.height; + + if ( s->i.source == SOURCE_ADF_DUPLEX || s->i.source == SOURCE_ADF_BACK ) + s->i.bytes_tot[SIDE_BACK] = s->i.Bpl * s->i.height; + + if ( s->s.source == SOURCE_ADF_DUPLEX || s->s.source == SOURCE_ADF_BACK ) + s->s.bytes_tot[SIDE_BACK] = s->s.Bpl * s->s.height; + + DBG (10, "clean_params: finish\n"); return ret; } /* - * callocs a buffer to hold the scan data + * frees/callocs buffers to hold the scan data */ static SANE_Status -setup_buffers (struct scanner *s) +image_buffers (struct scanner *s, int setup) { SANE_Status ret = SANE_STATUS_GOOD; int side; - DBG (10, "setup_buffers: start\n"); + DBG (10, "image_buffers: start\n"); for(side=0;side<2;side++){ - /* free old mem */ + /* free current buffer */ if (s->buffers[side]) { - DBG (15, "setup_buffers: free buffer %d.\n",side); + DBG (15, "image_buffers: free buffer %d.\n",side); free(s->buffers[side]); s->buffers[side] = NULL; } - if(s->bytes_tot[side]){ - s->buffers[side] = calloc (1,s->bytes_tot[side]); + /* build new buffer if asked */ + if(s->i.bytes_tot[side] && setup){ + s->buffers[side] = calloc (1,s->i.bytes_tot[side]); if (!s->buffers[side]) { - DBG (5, "setup_buffers: Error, no buffer %d.\n",side); + DBG (5, "image_buffers: Error, no buffer %d.\n",side); return SANE_STATUS_NO_MEM; } } } - DBG (10, "setup_buffers: finish\n"); + DBG (10, "image_buffers: finish\n"); return ret; } /* * This routine issues a SCSI SET WINDOW command to the scanner, using the - * values currently in the scanner data structure. + * values currently in the s->s param structure. */ static SANE_Status set_window (struct scanner *s) @@ -3229,27 +3576,35 @@ set_WPDB_wdblen(header, SW_desc_len); /* init the window block */ - if (s->source == SOURCE_ADF_BACK) { + if (s->s.source == SOURCE_ADF_BACK) { set_WD_wid (desc1, WD_wid_back); } else{ set_WD_wid (desc1, WD_wid_front); } - set_WD_Xres (desc1, s->resolution_x); - set_WD_Yres (desc1, s->resolution_y); + set_WD_Xres (desc1, s->s.dpi_x); + set_WD_Yres (desc1, s->s.dpi_y); + + /* some machines need max width */ + if(s->fixed_width){ + set_WD_ULX (desc1, 0); + set_WD_width (desc1, s->max_x); + } - /* we have to center the window ourselves */ - set_WD_ULX (desc1, (s->max_x - s->page_width) / 2 + s->tl_x); + /* or we have to center the window ourselves */ + else{ + set_WD_ULX (desc1, (s->max_x - s->s.page_x) / 2 + s->s.tl_x); + set_WD_width (desc1, s->s.width * 1200/s->s.dpi_x); + } /* some models require that the tly value be inverted? */ if(s->invert_tly) - set_WD_ULY (desc1, ~s->tl_y); + set_WD_ULY (desc1, ~s->s.tl_y); else - set_WD_ULY (desc1, s->tl_y); + set_WD_ULY (desc1, s->s.tl_y); - set_WD_width (desc1, s->params.pixels_per_line * 1200/s->resolution_x); - set_WD_length (desc1, s->params.lines * 1200/s->resolution_y); + set_WD_length (desc1, s->s.height * 1200/s->s.dpi_y); /*convert our common -127 to +127 range into HW's range *FIXME: this code assumes hardware range of 0-255 */ @@ -3261,11 +3616,14 @@ *FIXME: this code assumes hardware range of 0-255 */ set_WD_contrast (desc1, s->contrast+128); - set_WD_composition (desc1, s->mode); + set_WD_composition (desc1, s->s.mode); - set_WD_bitsperpixel (desc1, s->params.depth); + if(s->s.bpp == 24) + set_WD_bitsperpixel (desc1, 8); + else + set_WD_bitsperpixel (desc1, s->s.bpp); - if(s->mode == MODE_HALFTONE){ + if(s->s.mode == MODE_HALFTONE){ /*set_WD_ht_type(desc1, s->ht_type); set_WD_ht_pattern(desc1, s->ht_pattern);*/ } @@ -3282,9 +3640,9 @@ #ifdef SANE_FRAME_JPEG /* some scanners support jpeg image compression, for color/gs only */ - if(s->params.format == SANE_FRAME_JPEG){ - set_WD_compress_type(desc1, COMP_JPEG); - set_WD_compress_arg(desc1, s->compress_arg); + if(s->s.format == SANE_FRAME_JPEG){ + set_WD_compress_type(desc1, COMP_JPEG); + set_WD_compress_arg(desc1, s->compress_arg); } #endif @@ -3300,7 +3658,7 @@ NULL, NULL ); - if (!ret && s->source == SOURCE_ADF_DUPLEX) { + if (!ret && s->s.source == SOURCE_ADF_DUPLEX) { set_WD_wid (desc1, WD_wid_back); ret = do_cmd ( s, 1, 0, @@ -3328,7 +3686,7 @@ DBG (10, "object_position: start\n"); - if (s->source == SOURCE_FLATBED) { + if (s->u.source == SOURCE_FLATBED) { DBG (10, "object_position: flatbed no-op\n"); return SANE_STATUS_GOOD; } @@ -3354,8 +3712,6 @@ if (ret != SANE_STATUS_GOOD) return ret; - wait_scanner (s); - DBG (10, "object_position: finish\n"); return ret; @@ -3368,7 +3724,7 @@ * to start scanning.) */ static SANE_Status -start_scan (struct scanner *s) +start_scan (struct scanner *s, int type) { SANE_Status ret = SANE_STATUS_GOOD; @@ -3380,9 +3736,15 @@ DBG (10, "start_scan: start\n"); - if (s->source != SOURCE_ADF_DUPLEX) { + /* calibration scans use 0xff or 0xfe */ + if(type){ + out[0] = type; + out[1] = type; + } + + if (s->s.source != SOURCE_ADF_DUPLEX) { outLen--; - if(s->source == SOURCE_ADF_BACK) { + if(s->s.source == SOURCE_ADF_BACK) { out[0] = WD_wid_back; } } @@ -3403,39 +3765,6 @@ return ret; } -/* sends cancel command to scanner, clears s->started. don't call - * this function asyncronously, wait for scan to complete */ -static SANE_Status -cancel(struct scanner *s) -{ - SANE_Status ret = SANE_STATUS_GOOD; - - unsigned char cmd[CANCEL_len]; - size_t cmdLen = CANCEL_len; - - DBG (10, "cancel: start\n"); - - memset(cmd,0,cmdLen); - set_SCSI_opcode(cmd, CANCEL_code); - - ret = do_cmd ( - s, 1, 0, - cmd, cmdLen, - NULL, 0, - NULL, NULL - ); - - if(!object_position(s,SANE_FALSE)){ - DBG (5, "cancel: ignoring bad eject\n"); - } - - s->started = 0; - - DBG (10, "cancel: finish\n"); - - return SANE_STATUS_CANCELLED; -} - /* * Called by SANE to read data. * @@ -3467,56 +3796,72 @@ } /* sane_start required between sides */ - if(s->bytes_tx[s->side] == s->bytes_tot[s->side]){ + if(s->u.bytes_sent[s->side] == s->i.bytes_tot[s->side]){ + s->u.eof[s->side] = 1; DBG (15, "sane_read: returning eof\n"); return SANE_STATUS_EOF; } + s->reading = 1; + /* double width pnm interlacing */ - if(s->source == SOURCE_ADF_DUPLEX - && s->params.format <= SANE_FRAME_RGB + if(s->s.source == SOURCE_ADF_DUPLEX + && s->s.format <= SANE_FRAME_RGB && s->duplex_interlace != DUPLEX_INTERLACE_NONE ){ /* buffer both sides */ - if(!s->eof_rx[SIDE_FRONT] || !s->eof_rx[SIDE_BACK]){ - ret = read_from_scanner_duplex(s); + if(!s->s.eof[SIDE_FRONT] || !s->s.eof[SIDE_BACK]){ + ret = read_from_scanner_duplex(s, 0); if(ret){ DBG(5,"sane_read: front returning %d\n",ret); - return ret; + goto errors; + } + /*read last block, update counter*/ + if(s->s.eof[SIDE_FRONT] && s->s.eof[SIDE_BACK]){ + s->prev_page++; + DBG(15,"sane_read: duplex counter %d\n",s->prev_page); } } } /* simplex or non-alternating duplex */ else{ - if(!s->eof_rx[s->side]){ - ret = read_from_scanner(s, s->side); + if(!s->s.eof[s->side]){ + ret = read_from_scanner(s, s->side, 0); if(ret){ DBG(5,"sane_read: side %d returning %d\n",s->side,ret); - return ret; + goto errors; + } + /*read last block, update counter*/ + if(s->s.eof[s->side]){ + s->prev_page++; + DBG(15,"sane_read: side %d counter %d\n",s->side,s->prev_page); } } } /* copy a block from buffer to frontend */ ret = read_from_buffer(s,buf,max_len,len,s->side); - - /* we've read everything, and user cancelled */ - /* tell scanner to stop */ - if(s->eof_rx[s->side] && - (s->cancelled || (!read_panel(s,OPT_STOP) && s->panel_stop)) - ){ - DBG(5,"sane_read: user cancelled\n"); - return cancel(s); - } + if(ret) + goto errors; + + ret = check_for_cancel(s); + s->reading = 0; DBG (10, "sane_read: finish %d\n", ret); return ret; + + errors: + DBG (10, "sane_read: error %d\n", ret); + s->reading = 0; + s->cancelled = 0; + s->started = 0; + return ret; } static SANE_Status -read_from_scanner(struct scanner *s, int side) +read_from_scanner(struct scanner *s, int side, int exact) { SANE_Status ret=SANE_STATUS_GOOD; @@ -3526,21 +3871,28 @@ unsigned char * in; size_t inLen = 0; - int bytes = s->buffer_size; - size_t remain = s->bytes_tot[side] - s->bytes_rx[side]; + size_t bytes = s->buffer_size; + size_t remain = s->s.bytes_tot[side] - s->s.bytes_sent[side]; DBG (10, "read_from_scanner: start\n"); /* all requests must end on line boundary */ - bytes -= (bytes % s->params.bytes_per_line); + bytes -= (bytes % s->s.Bpl); /* some larger scanners require even bytes per block */ if(bytes % 2){ - bytes -= s->params.bytes_per_line; + bytes -= s->s.Bpl; + } + + /* usually (image) we want to read too much data, and get RS */ + /* sometimes (calib) we want to do an exact read */ + if(exact && bytes > remain){ + bytes = remain; } - DBG(15, "read_from_scanner: si:%d to:%d rx:%d re:%d bu:%d pa:%d\n", side, - s->bytes_tot[side], s->bytes_rx[side], remain, s->buffer_size, bytes); + DBG(15, "read_from_scanner: si:%d to:%d rx:%d re:%d bu:%d pa:%d ex:%d\n", + side, s->s.bytes_tot[side], s->s.bytes_sent[side], + remain, s->buffer_size, bytes, exact); inLen = bytes; in = malloc(inLen); @@ -3563,10 +3915,10 @@ ); if (ret == SANE_STATUS_GOOD) { - DBG(15, "read_from_scanner: got GOOD, returning GOOD\n"); + DBG(15, "read_from_scanner: got GOOD, returning GOOD %d\n",inLen); } else if (ret == SANE_STATUS_EOF) { - DBG(15, "read_from_scanner: got EOF, finishing\n"); + DBG(15, "read_from_scanner: got EOF, finishing %d\n",inLen); } else if (ret == SANE_STATUS_DEVICE_BUSY) { DBG(5, "read_from_scanner: got BUSY, returning GOOD\n"); @@ -3580,7 +3932,7 @@ #ifdef SANE_FRAME_JPEG /* this is jpeg data, we need to fix the missing image size */ - if(s->params.format == SANE_FRAME_JPEG){ + if(s->s.format == SANE_FRAME_JPEG){ /* look for the SOF header near the beginning */ if(s->jpeg_stage == JPEG_STAGE_NONE || s->jpeg_ff_offset < 0x0d){ @@ -3607,21 +3959,21 @@ /* lines in start of frame, overwrite it */ if(s->jpeg_ff_offset == 5){ - in[i] = (s->params.lines >> 8) & 0xff; + in[i] = (s->s.height >> 8) & 0xff; continue; } if(s->jpeg_ff_offset == 6){ - in[i] = s->params.lines & 0xff; + in[i] = s->s.height & 0xff; continue; } /* width in start of frame, overwrite it */ if(s->jpeg_ff_offset == 7){ - in[i] = (s->params.pixels_per_line >> 8) & 0xff; + in[i] = (s->s.width >> 8) & 0xff; continue; } if(s->jpeg_ff_offset == 8){ - in[i] = s->params.pixels_per_line & 0xff; + in[i] = s->s.width & 0xff; continue; } } @@ -3642,13 +3994,60 @@ free(in); + /* we've read all data, but not eof. clear and pretend */ + if(exact && inLen == remain){ + DBG (10, "read_from_scanner: exact read, clearing\n"); + ret = object_position (s,SANE_FALSE); + if(ret){ + return ret; + } + ret = SANE_STATUS_EOF; + } + if(ret == SANE_STATUS_EOF){ - s->bytes_tot[side] = s->bytes_rx[side]; - s->eof_rx[side] = 1; - s->prev_page++; + + switch (s->s.format){ + +#ifdef SANE_FRAME_JPEG + /* this is jpeg data, we need to change the total size */ + case SANE_FRAME_JPEG: + s->s.bytes_tot[side] = s->s.bytes_sent[side]; + s->i.bytes_tot[side] = s->i.bytes_sent[side]; + s->u.bytes_tot[side] = s->i.bytes_sent[side]; + break; +#endif + + /* this is non-jpeg data, fill remainder, change rx'd size */ + default: + + DBG (15, "read_from_scanner: eof: %d %d\n", s->i.bytes_tot[side], s->i.bytes_sent[side]); + + /* clone the last line repeatedly until the end */ + while(s->i.bytes_tot[side] > s->i.bytes_sent[side]){ + memcpy( + s->buffers[side]+s->i.bytes_sent[side]-s->i.Bpl, + s->buffers[side]+s->i.bytes_sent[side], + s->i.Bpl + ); + s->i.bytes_sent[side] += s->i.Bpl; + } + + DBG (15, "read_from_scanner: eof2: %d %d\n", s->i.bytes_tot[side], s->i.bytes_sent[side]); + + /* pretend we got all the data from scanner */ + s->s.bytes_sent[side] = s->s.bytes_tot[side]; + break; + } + + s->i.eof[side] = 1; + s->s.eof[side] = 1; ret = SANE_STATUS_GOOD; } + DBG(15, "read_from_scanner: sto:%d srx:%d sef:%d uto:%d urx:%d uef:%d\n", + s->s.bytes_tot[side], s->s.bytes_sent[side], s->s.eof[side], + s->u.bytes_tot[side], s->u.bytes_sent[side], s->u.eof[side]); + DBG (10, "read_from_scanner: finish\n"); return ret; @@ -3657,7 +4056,7 @@ /* cheaper scanners interlace duplex scans on a byte basis * this code requests double width lines from scanner */ static SANE_Status -read_from_scanner_duplex(struct scanner *s) +read_from_scanner_duplex(struct scanner *s,int exact) { SANE_Status ret=SANE_STATUS_GOOD; @@ -3667,17 +4066,23 @@ unsigned char * in; size_t inLen = 0; - int bytes = s->buffer_size; - size_t remain = s->bytes_tot[SIDE_FRONT] + s->bytes_tot[SIDE_BACK] - - s->bytes_rx[SIDE_FRONT] - s->bytes_rx[SIDE_BACK]; + size_t bytes = s->buffer_size; + size_t remain = s->s.bytes_tot[SIDE_FRONT] + s->s.bytes_tot[SIDE_BACK] + - s->s.bytes_sent[SIDE_FRONT] - s->s.bytes_sent[SIDE_BACK]; DBG (10, "read_from_scanner_duplex: start\n"); /* all requests must end on WIDE line boundary */ - bytes -= (bytes % (s->params.bytes_per_line*2)); + bytes -= (bytes % (s->s.Bpl*2)); + + /* usually (image) we want to read too much data, and get RS */ + /* sometimes (calib) we want to do an exact read */ + if(exact && bytes > remain){ + bytes = remain; + } - DBG(15, "read_from_scanner_duplex: re:%d bu:%d pa:%d\n", - remain, s->buffer_size, bytes); + DBG(15, "read_from_scanner_duplex: re:%d bu:%d pa:%d ex:%d\n", + remain, s->buffer_size, bytes, exact); inLen = bytes; in = malloc(inLen); @@ -3701,10 +4106,10 @@ ); if (ret == SANE_STATUS_GOOD) { - DBG(15, "read_from_scanner_duplex: got GOOD, returning GOOD\n"); + DBG(15, "read_from_scanner_duplex: got GOOD, returning GOOD %d\n",inLen); } else if (ret == SANE_STATUS_EOF) { - DBG(15, "read_from_scanner_duplex: got EOF, finishing\n"); + DBG(15, "read_from_scanner_duplex: got EOF, finishing %d\n",inLen); } else if (ret == SANE_STATUS_DEVICE_BUSY) { DBG(5, "read_from_scanner_duplex: got BUSY, returning GOOD\n"); @@ -3729,12 +4134,75 @@ free(in); + /* we've read all data, but not eof. clear and pretend */ + if(exact && inLen == remain){ + DBG (10, "read_from_scanner_duplex: exact read, clearing\n"); + ret = object_position (s,SANE_FALSE); + if(ret){ + return ret; + } + ret = SANE_STATUS_EOF; + } + if(ret == SANE_STATUS_EOF){ - s->bytes_tot[SIDE_FRONT] = s->bytes_rx[SIDE_FRONT]; - s->bytes_tot[SIDE_BACK] = s->bytes_rx[SIDE_BACK]; - s->eof_rx[SIDE_FRONT] = 1; - s->eof_rx[SIDE_BACK] = 1; - s->prev_page++; + + switch (s->s.format){ + +#ifdef SANE_FRAME_JPEG + /* this is jpeg data, we need to change the total size */ + case SANE_FRAME_JPEG: + s->s.bytes_tot[SIDE_FRONT] = s->s.bytes_sent[SIDE_FRONT]; + s->s.bytes_tot[SIDE_BACK] = s->s.bytes_sent[SIDE_BACK]; + s->i.bytes_tot[SIDE_FRONT] = s->i.bytes_sent[SIDE_FRONT]; + s->i.bytes_tot[SIDE_BACK] = s->i.bytes_sent[SIDE_BACK]; + s->u.bytes_tot[SIDE_FRONT] = s->i.bytes_sent[SIDE_FRONT]; + s->u.bytes_tot[SIDE_BACK] = s->i.bytes_sent[SIDE_BACK]; + break; +#endif + + /* this is non-jpeg data, fill remainder, change rx'd size */ + default: + + DBG (15, "read_from_scanner_duplex: eof: %d %d %d %d\n", + s->i.bytes_tot[SIDE_FRONT], s->i.bytes_sent[SIDE_FRONT], + s->i.bytes_tot[SIDE_BACK], s->i.bytes_sent[SIDE_BACK] + ); + + /* clone the last line repeatedly until the end */ + while(s->i.bytes_tot[SIDE_FRONT] > s->i.bytes_sent[SIDE_FRONT]){ + memcpy( + s->buffers[SIDE_FRONT]+s->i.bytes_sent[SIDE_FRONT]-s->i.Bpl, + s->buffers[SIDE_FRONT]+s->i.bytes_sent[SIDE_FRONT], + s->i.Bpl + ); + s->i.bytes_sent[SIDE_FRONT] += s->i.Bpl; + } + + /* clone the last line repeatedly until the end */ + while(s->i.bytes_tot[SIDE_BACK] > s->i.bytes_sent[SIDE_BACK]){ + memcpy( + s->buffers[SIDE_BACK]+s->i.bytes_sent[SIDE_BACK]-s->i.Bpl, + s->buffers[SIDE_BACK]+s->i.bytes_sent[SIDE_BACK], + s->i.Bpl + ); + s->i.bytes_sent[SIDE_BACK] += s->i.Bpl; + } + + DBG (15, "read_from_scanner_duplex: eof2: %d %d %d %d\n", + s->i.bytes_tot[SIDE_FRONT], s->i.bytes_sent[SIDE_FRONT], + s->i.bytes_tot[SIDE_BACK], s->i.bytes_sent[SIDE_BACK] + ); + + /* pretend we got all the data from scanner */ + s->s.bytes_sent[SIDE_FRONT] = s->s.bytes_tot[SIDE_FRONT]; + s->s.bytes_sent[SIDE_BACK] = s->s.bytes_tot[SIDE_BACK]; + break; + } + + s->i.eof[SIDE_FRONT] = 1; + s->i.eof[SIDE_BACK] = 1; + s->s.eof[SIDE_FRONT] = 1; + s->s.eof[SIDE_BACK] = 1; ret = SANE_STATUS_GOOD; } @@ -3751,142 +4219,197 @@ { SANE_Status ret=SANE_STATUS_GOOD; int i, j; - int bwidth = s->params.bytes_per_line; - int pwidth = s->params.pixels_per_line; + int bwidth = s->s.Bpl; + int pwidth = s->s.width; int t = bwidth/3; int f = bwidth/4; int tw = bwidth/12; - /* invert image if scanner needs it for this mode */ - /* jpeg data does not use inverting */ - if(s->params.format <= SANE_FRAME_RGB && s->reverse_by_mode[s->mode]){ - for(i=0; is.format > SANE_FRAME_RGB){ + DBG (15, "copy_simplex: jpeg bulk copy\n"); + memcpy(s->buffers[side]+s->i.bytes_sent[side], buf, len); + s->i.bytes_sent[side] += len; + s->s.bytes_sent[side] += len; + return ret; } + + DBG (15, "copy_simplex: per-line copy\n"); + + line = malloc(bwidth); + if(!line) return SANE_STATUS_NO_MEM; - if(s->params.format == SANE_FRAME_GRAY){ + /* ingest each line */ + for(i=0; igray_interlace[side]) { + int lineNum = s->s.bytes_sent[side] / bwidth; - case GRAY_INTERLACE_2510: - DBG (10, "copy_simplex: gray, 2510\n"); - - for(i=0; is.bytes_sent[side] += bwidth; + + /*have some padding from scanner to drop*/ + if ( lineNum < s->i.skip_lines[side] + || lineNum - s->i.skip_lines[side] >= s->i.height + ){ + continue; + } + + line_next = 0; + + if(s->s.format == SANE_FRAME_GRAY){ + + switch (s->gray_interlace[side]) { + + /* one line has the following format: ggg...GGG + * where the 'capital' letters are the beginning of the line */ + case GRAY_INTERLACE_gG: + DBG (17, "copy_simplex: gray, gG\n"); + for (j=bwidth-1; j>=0; j--){ + line[line_next++] = buf[i+j]; + } + break; + + case GRAY_INTERLACE_2510: + DBG (17, "copy_simplex: gray, 2510\n"); + /* first read head (third byte of every three) */ for(j=bwidth-1;j>=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; + line[line_next++] = buf[i+j]; } /* second read head (first byte of every three) */ for(j=bwidth*3/4-3;j>=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; + line[line_next++] = buf[i+j]; } /* third read head (second byte of every three) */ for(j=bwidth-2;j>=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; + line[line_next++] = buf[i+j]; } /* padding */ for(j=0;jbuffers[side][s->bytes_rx[side]++] = 0; + line[line_next++] = 0; } - } - break; - - default: - DBG (10, "copy_simplex: gray, default\n"); - memcpy(s->buffers[side]+s->bytes_rx[side],buf,len); - s->bytes_rx[side] += len; - break; + break; + } } - } - - else if (s->params.format == SANE_FRAME_RGB){ - - switch (s->color_interlace[side]) { - /* scanner returns color data as bgrbgr... */ - case COLOR_INTERLACE_BGR: - DBG (10, "copy_simplex: color, BGR\n"); - for(i=0; is.format == SANE_FRAME_RGB){ + + switch (s->color_interlace[side]) { + + /* scanner returns color data as bgrbgr... */ + case COLOR_INTERLACE_BGR: + DBG (17, "copy_simplex: color, BGR\n"); for (j=0; jbuffers[side][s->bytes_rx[side]++] = buf[i+j*3+2]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+j*3+1]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+j*3]; + line[line_next++] = buf[i+j*3+2]; + line[line_next++] = buf[i+j*3+1]; + line[line_next++] = buf[i+j*3]; } - } - break; - - /* one line has the following format: rrr...rrrggg...gggbbb...bbb */ - case COLOR_INTERLACE_RRGGBB: - DBG (10, "copy_simplex: color, RRGGBB\n"); - for(i=0; ibuffers[side][s->bytes_rx[side]++] = buf[i+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+pwidth+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+2*pwidth+j]; + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+pwidth+j]; + line[line_next++] = buf[i+2*pwidth+j]; } - } - break; - - /* one line has the following format: rrr...RRRggg...GGGbbb...BBB - * where the 'capital' letters are the beginning of the line */ - case COLOR_INTERLACE_rRgGbB: - DBG (10, "copy_simplex: color, rRgGbB\n"); - for(i=0; i=0; j--){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+pwidth+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+2*pwidth+j]; + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+pwidth+j]; + line[line_next++] = buf[i+2*pwidth+j]; } - } - break; - - case COLOR_INTERLACE_2510: - DBG (10, "copy_simplex: color, 2510\n"); - - for(i=0; i=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+t+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+2*t+j]; + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; } /* second read head (first byte of every three) */ for(j=f-3;j>=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+t+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+2*t+j]; + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; } /* third read head (second byte of every three) */ for(j=t-2;j>=0;j-=3){ - s->buffers[side][s->bytes_rx[side]++] = buf[i+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+t+j]; - s->buffers[side][s->bytes_rx[side]++] = buf[i+2*t+j]; + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; } /* padding */ for(j=0;jbuffers[side][s->bytes_rx[side]++] = 0; + line[line_next++] = 0; } - } - break; + break; + } + } - default: - DBG (10, "copy_simplex: color, default\n"); - memcpy(s->buffers[side]+s->bytes_rx[side],buf,len); - s->bytes_rx[side] += len; - break; + /* nothing sent above? just copy one line of the block */ + /* used by uninterlaced gray/color */ + if(!line_next){ + DBG (17, "copy_simplex: default\n"); + memcpy(line+line_next,buf+i,bwidth); + line_next = bwidth; + } + + /* invert image if scanner needs it for this mode */ + if(s->reverse_by_mode[s->s.mode]){ + for(j=0; jf_offset[side]){ + DBG (17, "copy_simplex: apply offset\n"); + for(j=0; js.valid_Bpl; j++){ + int curr = line[j] - s->f_offset[side][j]; + if(curr < 0) curr = 0; + line[j] = curr; + } } - } - /* only used by jpeg data? */ - else{ - DBG (10, "copy_simplex: default\n"); - memcpy(s->buffers[side]+s->bytes_rx[side],buf,len); - s->bytes_rx[side] += len; + if(s->f_gain[side]){ + DBG (17, "copy_simplex: apply gain\n"); + for(j=0; js.valid_Bpl; j++){ + int curr = line[j] * 240/s->f_gain[side][j]; + if(curr > 255) curr = 255; + line[j] = curr; + } + } + + /* apply brightness and contrast if hardware cannot do it */ + if(s->sw_lut && (s->s.mode == MODE_COLOR || s->s.mode == MODE_GRAYSCALE)){ + DBG (17, "copy_simplex: apply brightness/contrast\n"); + for(j=0; js.valid_Bpl; j++){ + line[j] = s->lut[line[j]]; + } + } + + /*copy the line into the buffer*/ + ret = copy_line(s,line,side); + if(ret){ + break; + } } + free(line); + DBG (10, "copy_simplex: finished\n"); return ret; @@ -3899,7 +4422,7 @@ { SANE_Status ret=SANE_STATUS_GOOD; int i,j; - int bwidth = s->params.bytes_per_line; + int bwidth = s->s.Bpl; int dbwidth = 2*bwidth; unsigned char * front; unsigned char * back; @@ -3978,1026 +4501,3296 @@ return ret; } + +/* downsample a single line from scanner's size to user's size */ +/* and copy into final buffer */ +static SANE_Status +copy_line(struct scanner *s, unsigned char * buff, int side) +{ + SANE_Status ret=SANE_STATUS_GOOD; + int spwidth = s->s.width; + int sbwidth = s->s.Bpl; + int ibwidth = s->i.Bpl; + unsigned char * line; + int offset = 0; + int i, j; + + DBG (20, "copy_line: start\n"); + + /* the 'standard' case: non-stupid scan */ + if(s->s.width == s->i.width + && s->s.dpi_x == s->i.dpi_x + && s->s.mode == s->i.mode + ){ + + memcpy(s->buffers[side]+s->i.bytes_sent[side], buff, sbwidth); + s->i.bytes_sent[side] += sbwidth; + + DBG (20, "copy_line: finished smart\n"); + return ret; + } + + /* the 'corner' case: stupid scan */ + + /*setup 24 bit color single line buffer*/ + line = malloc(spwidth*3); + if(!line) return SANE_STATUS_NO_MEM; + + /*load single line color buffer*/ + switch (s->s.mode) { + + case MODE_COLOR: + memcpy(line, buff, sbwidth); + break; + + case MODE_GRAYSCALE: + for(i=0;i> 7) & 1) ?0:255; + line[i*24+3] = line[i*24+4] = line[i*24+5] = ((curr >> 6) & 1) ?0:255; + line[i*24+6] = line[i*24+7] = line[i*24+8] = ((curr >> 5) & 1) ?0:255; + line[i*24+9] = line[i*24+10] = line[i*24+11] = ((curr >> 4) & 1) ?0:255; + line[i*24+12] = line[i*24+13] = line[i*24+14] =((curr >> 3) & 1) ?0:255; + line[i*24+15] = line[i*24+16] = line[i*24+17] =((curr >> 2) & 1) ?0:255; + line[i*24+18] = line[i*24+19] = line[i*24+20] =((curr >> 1) & 1) ?0:255; + line[i*24+21] = line[i*24+22] = line[i*24+23] =((curr >> 0) & 1) ?0:255; + } + break; + } + + /* scan is higher res than user wanted, scale it */ + /*FIXME: interpolate instead */ + if(s->i.dpi_x != s->s.dpi_x){ + for(i=0;is.dpi_x/s->i.dpi_x * 3; + + if(source+2 >= spwidth*3) + break; + + line[i*3] = line[source]; + line[i*3+1] = line[source+1]; + line[i*3+2] = line[source+2]; + } + } + + /* scan is wider than user wanted, skip some pixels on left side */ + if(s->i.width != s->s.width){ + offset = ((s->valid_x-s->i.page_x) / 2 + s->i.tl_x) * s->i.dpi_x/1200*3; + } + + /* change mode, store line in buffer */ + switch (s->i.mode) { + + case MODE_COLOR: + memcpy(s->buffers[side]+s->i.bytes_sent[side], line+offset, ibwidth); + s->i.bytes_sent[side] += ibwidth; + break; + case MODE_GRAYSCALE: + for(i=0;ibuffers[side][s->i.bytes_sent[side]++] + = ((int)line[source] + line[source+1] + line[source+2])/3; + } + break; + + default: + /*loop over output bytes*/ + for(i=0;ithreshold*3; + + /*loop over output bits*/ + for(j=0;j<8;j++){ + int source = (offset+i)*24 + j*3; + if( (line[source] + line[source+1] + line[source+2]) < thresh ){ + curr |= 1 << (7-j); + } + } + + s->buffers[side][s->i.bytes_sent[side]++] = curr; + } + break; + } + + free(line); + + DBG (20, "copy_line: finish stupid\n"); + + return ret; +} + static SANE_Status read_from_buffer(struct scanner *s, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len, int side) { SANE_Status ret=SANE_STATUS_GOOD; int bytes = max_len; - int remain = s->bytes_rx[side] - s->bytes_tx[side]; + int remain = s->i.bytes_sent[side] - s->u.bytes_sent[side]; DBG (10, "read_from_buffer: start\n"); /* figure out the max amount to transfer */ - if(bytes > remain){ + if(bytes > remain) bytes = remain; - } - + *len = bytes; - - DBG(15, "read_from_buffer: si:%d to:%d tx:%d re:%d bu:%d pa:%d\n", side, - s->bytes_tot[side], s->bytes_tx[side], remain, max_len, bytes); - + /*FIXME this needs to timeout eventually */ if(!bytes){ DBG(5,"read_from_buffer: nothing to do\n"); return SANE_STATUS_GOOD; } + + DBG(15, "read_from_buffer: si:%d to:%d tx:%d bu:%d pa:%d\n", side, + s->i.bytes_tot[side], s->u.bytes_sent[side], max_len, bytes); /* copy to caller */ - memcpy(buf,s->buffers[side]+s->bytes_tx[side],bytes); - s->bytes_tx[side] += bytes; + memcpy(buf,s->buffers[side]+s->u.bytes_sent[side],bytes); + s->u.bytes_sent[side] += bytes; - DBG (10, "read_from_buffer: finish\n"); + DBG (10, "read_from_buffer: finished\n"); return ret; } - -/* - * @@ Section 4 - SANE cleanup functions - */ /* - * Cancels a scan. - * - * It has been said on the mailing list that sane_cancel is a bit of a - * misnomer because it is routinely called to signal the end of a - * batch - quoting David Mosberger-Tang: - * - * > In other words, the idea is to have sane_start() be called, and - * > collect as many images as the frontend wants (which could in turn - * > consist of multiple frames each as indicated by frame-type) and - * > when the frontend is done, it should call sane_cancel(). - * > Sometimes it's better to think of sane_cancel() as "sane_stop()" - * > but that name would have had some misleading connotations as - * > well, that's why we stuck with "cancel". - * - * The current consensus regarding duplex and ADF scans seems to be - * the following call sequence: sane_start; sane_read (repeat until - * EOF); sane_start; sane_read... and then call sane_cancel if the - * batch is at an end. I.e. do not call sane_cancel during the run but - * as soon as you get a SANE_STATUS_NO_DOCS. - * - * From the SANE spec: - * This function is used to immediately or as quickly as possible - * cancel the currently pending operation of the device represented by - * handle h. This function can be called at any time (as long as - * handle h is a valid handle) but usually affects long-running - * operations only (such as image is acquisition). It is safe to call - * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not - * imply that the currently pending operation has been cancelled. It - * only guarantees that cancellation has been initiated. Cancellation - * completes only when the cancelled call returns (typically with a - * status value of SANE_STATUS_CANCELLED). Since the SANE API does - * not require any other operations to be re-entrant, this implies - * that a frontend must not call any other operation until the - * cancelled operation has returned. + * @@ Section 5 - calibration functions */ -void -sane_cancel (SANE_Handle handle) -{ - struct scanner * s = (struct scanner *) handle; - - DBG (10, "sane_cancel: start\n"); - s->cancelled = 1; - DBG (10, "sane_cancel: finish\n"); -} -/* - * Ends use of the scanner. - * - * From the SANE spec: - * This function terminates the association between the device handle - * passed in argument h and the device it represents. If the device is - * presently active, a call to sane_cancel() is performed first. After - * this function returns, handle h must not be used anymore. - */ -void -sane_close (SANE_Handle handle) +#if 0 +static SANE_Status +foo_AFE(struct scanner *s) { - struct scanner * s = (struct scanner *) handle; + SANE_Status ret = SANE_STATUS_GOOD; - DBG (10, "sane_close: start\n"); - /*clears any held scans*/ - disconnect_fd(s); - DBG (10, "sane_close: finish\n"); -} + unsigned char cmd[] = { + 0x3b, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 + }; + size_t cmdLen = 12; -static SANE_Status -disconnect_fd (struct scanner *s) -{ - DBG (10, "disconnect_fd: start\n"); + unsigned char in[4]; + size_t inLen = 4; - if(s->fd > -1){ - if (s->connection == CONNECTION_USB) { - DBG (15, "disconnecting usb device\n"); - sanei_usb_close (s->fd); - } - else if (s->connection == CONNECTION_SCSI) { - DBG (15, "disconnecting scsi device\n"); - sanei_scsi_close (s->fd); - } - s->fd = -1; - } + DBG (10, "foo_AFE: start\n"); - DBG (10, "disconnect_fd: finish\n"); + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + in, &inLen + ); + if (ret != SANE_STATUS_GOOD) + return ret; - return SANE_STATUS_GOOD; + DBG (10, "foo_AFE: finish\n"); + + return ret; } +#endif /* - * Terminates the backend. - * - * From the SANE spec: - * This function must be called to terminate use of a backend. The - * function will first close all device handles that still might be - * open (it is recommended to close device handles explicitly through - * a call to sane_close(), but backends are required to release all - * resources upon a call to this function). After this function - * returns, no function other than sane_init() may be called - * (regardless of the status value returned by sane_exit(). Neglecting - * to call this function may result in some resources not being - * released properly. + * makes several scans, adjusts coarse calibration */ -void -sane_exit (void) +static SANE_Status +calibrate_AFE (struct scanner *s) { - struct scanner *dev, *next; + SANE_Status ret = SANE_STATUS_GOOD; + int i, j, k; + int min, max; + int lines = 8; + + /*buffer these for later*/ + int old_tl_y = s->u.tl_y; + int old_br_y = s->u.br_y; + int old_mode = s->u.mode; + int old_source = s->u.source; - DBG (10, "sane_exit: start\n"); + DBG (10, "calibrate_AFE: start\n"); - for (dev = scanner_devList; dev; dev = next) { - disconnect_fd(dev); - next = dev->next; - free (dev); + if(!s->need_ccal){ + DBG (10, "calibrate_AFE: not required\n"); + return ret; } - if (sane_devArray) - free (sane_devArray); + /* always cal with a short scan in duplex color */ + s->u.tl_y = 0; + s->u.br_y = lines * 1200 / s->u.dpi_y; + s->u.mode = MODE_COLOR; + s->u.source = SOURCE_ADF_DUPLEX; - scanner_devList = NULL; - sane_devArray = NULL; + /* load our own private copy of scan params */ + ret = update_params(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot update_params\n"); + goto cleanup; + } - DBG (10, "sane_exit: finish\n"); -} + if(s->c_res == s->s.dpi_x && s->c_mode == s->s.mode){ + DBG (10, "calibrate_AFE: already done\n"); + goto cleanup; + } + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot clean_params\n"); + goto cleanup; + } -/* - * @@ Section 5 - misc helper functions - */ -static void -default_globals(void) -{ - global_buffer_size = global_buffer_size_default; - global_padded_read = global_padded_read_default; - global_vendor_name[0] = 0; - global_model_name[0] = 0; - global_version_name[0] = 0; -} + /* make buffers to hold the images */ + ret = image_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot load buffers\n"); + goto cleanup; + } -/* - * Called by the SANE SCSI core and our usb code on device errors - * parses the request sense return data buffer, - * decides the best SANE_Status for the problem, produces debug msgs, - * and copies the sense buffer into the scanner struct - */ -static SANE_Status -sense_handler (int fd, unsigned char * sensed_data, void *arg) -{ - struct scanner *s = arg; - unsigned int sense = get_RS_sense_key (sensed_data); - unsigned int asc = get_RS_ASC (sensed_data); - unsigned int ascq = get_RS_ASCQ (sensed_data); - unsigned int eom = get_RS_EOM (sensed_data); - unsigned int ili = get_RS_ILI (sensed_data); - unsigned int info = get_RS_information (sensed_data); + /*blast the existing fine cal data so reading code wont apply it*/ + ret = offset_buffers(s,0); + ret = gain_buffers(s,0); - DBG (5, "sense_handler: start\n"); + /* need to tell it we want duplex */ + ret = ssm_buffer(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot ssm buffer\n"); + goto cleanup; + } - /* kill compiler warning */ - fd = fd; + /* set window command */ + ret = set_window(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot set window\n"); + goto cleanup; + } + + /* first pass (black offset), lamp off, no offset/gain/exposure */ + DBG (15, "calibrate_AFE: offset\n"); - /* copy the rs return data into the scanner struct - so that the caller can use it if he wants - memcpy(&s->rs_buffer,sensed_data,RS_return_size); - */ + /* blast all the existing coarse cal data */ + for(i=0;i<2;i++){ + s->c_gain[i] = 1; + s->c_offset[i] = 1; + for(j=0;j<3;j++){ + s->c_exposure[i][j] = 0; + } + } - DBG (5, "Sense=%#02x, ASC=%#02x, ASCQ=%#02x, EOM=%d, ILI=%d, info=%#08x\n", sense, asc, ascq, eom, ili, info); + ret = write_AFE(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot write afe\n"); + goto cleanup; + } - switch (sense) { - case 0: - if (ili == 1) { - s->rs_info = info; - DBG (5, "No sense: EOM remainder:%d\n",info); - return SANE_STATUS_EOF; - } - DBG (5, "No sense: unknown asc/ascq\n"); - return SANE_STATUS_GOOD; + ret = calibration_scan(s,0xff); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot make offset cal scan\n"); + goto cleanup; + } - case 1: - if (asc == 0x37 && ascq == 0x00) { - DBG (5, "Recovered error: parameter rounded\n"); - return SANE_STATUS_GOOD; - } - DBG (5, "Recovered error: unknown asc/ascq\n"); - return SANE_STATUS_GOOD; + for(i=0;i<2;i++){ + min = 255; + for(j=0; js.valid_Bpl; j++){ + if(s->buffers[i][j] < min) + min = s->buffers[i][j]; + } + s->c_offset[i] = min*3-2; + DBG (15, "calibrate_AFE: offset %d %d %02x\n", i, min, s->c_offset[i]); + } - case 2: - if (asc == 0x04 && ascq == 0x01) { - DBG (5, "Not ready: previous command unfinished\n"); - return SANE_STATUS_DEVICE_BUSY; - } - DBG (5, "Not ready: unknown asc/ascq\n"); - return SANE_STATUS_DEVICE_BUSY; + /*handle second pass (per channel exposure), lamp on, overexposed*/ + DBG (15, "calibrate_AFE: exposure\n"); + for(i=0;i<2;i++){ + for(j=0; j<3; j++){ + s->c_exposure[i][j] = 0x320; + } + } - case 3: - if (asc == 0x36 && ascq == 0x00) { - DBG (5, "Medium error: no cartridge\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x3a && ascq == 0x00) { - DBG (5, "Medium error: hopper empty\n"); - return SANE_STATUS_NO_DOCS; - } - if (asc == 0x80 && ascq == 0x00) { - DBG (5, "Medium error: paper jam\n"); - return SANE_STATUS_JAMMED; - } - if (asc == 0x80 && ascq == 0x01) { - DBG (5, "Medium error: cover open\n"); - return SANE_STATUS_COVER_OPEN; + ret = write_AFE(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot write afe\n"); + goto cleanup; + } + + ret = calibration_scan(s,0xfe); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot make exposure cal scan\n"); + goto cleanup; + } + + for(i=0;i<2;i++){ /*sides*/ + for(j=0;j<3;j++){ /*channels*/ + max = 0; + for(k=j; ks.valid_Bpl; k+=3){ /*bytes*/ + if(s->buffers[i][k] > max) + max = s->buffers[i][k]; } - if (asc == 0x81 && ascq == 0x01) { - DBG (5, "Medium error: double feed\n"); - return SANE_STATUS_JAMMED; + + /*generally we reduce the exposure (smaller number) */ + if(old_mode == MODE_COLOR) + s->c_exposure[i][j] = s->c_exposure[i][j] * 102/max; + else + s->c_exposure[i][j] = s->c_exposure[i][j] * 64/max; + + DBG (15, "calibrate_AFE: exp %d %d %d %02x\n", i, j, max, + s->c_exposure[i][j]); + } + } + + /*handle third pass (gain), lamp on with current offset/exposure */ + DBG (15, "calibrate_AFE: gain\n"); + + ret = write_AFE(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot write afe\n"); + goto cleanup; + } + + ret = calibration_scan(s,0xfe); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot make gain cal scan\n"); + goto cleanup; + } + + for(i=0;i<2;i++){ + max = 0; + for(j=0; js.valid_Bpl; j++){ + if(s->buffers[i][j] > max) + max = s->buffers[i][j]; + } + + if(old_mode == MODE_COLOR) + s->c_gain[i] = (250-max)*4/5; + else + s->c_gain[i] = (125-max)*4/5; + + if(s->c_gain[i] < 1) + s->c_gain[i] = 1; + + DBG (15, "calibrate_AFE: gain %d %d %02x\n", i, max, s->c_gain[i]); + } + + /*handle fourth pass (offset again), lamp off*/ +#if 0 + DBG (15, "calibrate_AFE: offset2\n"); + + ret = write_AFE(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot write afe\n"); + goto cleanup; + } + + ret = calibration_scan(s,0xff); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot make offset2 cal scan\n"); + goto cleanup; + } + + for(i=0;i<2;i++){ + min = 255; + for(j=0; js.valid_Bpl; j++){ + if(s->buffers[i][j] < min) + min = s->buffers[i][j]; + } + /*s->c_offset[i] += min*3-2;*/ + DBG (15, "calibrate_AFE: offset2 %d %d %02x\n", i, min, s->c_offset[i]); + } +#endif + + /*send final afe params to scanner*/ + ret = write_AFE(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_AFE: ERROR: cannot write afe\n"); + goto cleanup; + } + + /* log current cal type */ + s->c_res = s->s.dpi_x; + s->c_mode = s->s.mode; + + cleanup: + + /* recover user settings */ + s->u.tl_y = old_tl_y; + s->u.br_y = old_br_y; + s->u.mode = old_mode; + s->u.source = old_source; + + DBG (10, "calibrate_AFE: finish %d\n",ret); + + return ret; +} + + +/* alternative version- extracts data from scanner memory */ +static SANE_Status +calibrate_fine_buffer (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i, j, k; + + unsigned char cmd[READ_len]; + size_t cmdLen = READ_len; + + unsigned char * in = NULL; + size_t inLen = 0, reqLen = 0; + + /*buffer these for later*/ + int old_tl_y = s->u.tl_y; + int old_br_y = s->u.br_y; + int old_source = s->u.source; + + DBG (10, "calibrate_fine_buffer: start\n"); + + if(!s->need_fcal_buffer){ + DBG (10, "calibrate_fine_buffer: not required\n"); + return ret; + } + + /* pretend we are doing a 1 line scan in duplex */ + s->u.tl_y = 0; + s->u.br_y = 1200 / s->u.dpi_y; + s->u.source = SOURCE_ADF_DUPLEX; + + /* load our own private copy of scan params */ + ret = update_params(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine_buffer: ERROR: cannot update_params\n"); + goto cleanup; + } + + if(s->f_res == s->s.dpi_x && s->f_mode == s->s.mode){ + DBG (10, "calibrate_fine_buffer: already done\n"); + goto cleanup; + } + + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine_buffer: ERROR: cannot clean_params\n"); + goto cleanup; + } + + /*calibration buffers in scanner are single color channel, but duplex*/ + reqLen = s->s.width*2; + + in = malloc(reqLen); + if (!in) { + DBG (5, "calibrate_fine_buffer: ERROR: cannot malloc in\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + /*fine offset*/ + ret = offset_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine_buffer: ERROR: cannot load offset buffers\n"); + goto cleanup; + } + + DBG (5, "calibrate_fine_buffer: %d %x\n", s->s.dpi_x/10, s->s.dpi_x/10); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, READ_code); + set_R_datatype_code (cmd, SR_datatype_fineoffset); + set_R_xfer_lid (cmd, s->s.dpi_x/10); + set_R_xfer_length (cmd, reqLen); + + inLen = reqLen; + + hexdump(15, "cmd:", cmd, cmdLen); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + in, &inLen + ); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + + for(i=0;i<2;i++){ + + /*color mode, expand offset across all three channels? */ + if(s->s.format == SANE_FRAME_RGB){ + for(j=0; js.valid_width; j++){ + + /*red*/ + s->f_offset[i][j*3] = in[j*2+i]; + if(s->f_offset[i][j*3] < 1) + s->f_offset[i][j*3] = 1; + + /*green and blue, same as red*/ + s->f_offset[i][j*3+1] = s->f_offset[i][j*3+2] = s->f_offset[i][j*3]; } - if (asc == 0x81 && ascq == 0x02) { - DBG (5, "Medium error: skew detected\n"); - return SANE_STATUS_JAMMED; + } + + /*gray mode, copy*/ + else{ + for(j=0; js.valid_width; j++){ + + s->f_offset[i][j] = in[j*2+i]; + if(s->f_offset[i][j] < 1) + s->f_offset[i][j] = 1; } - if (asc == 0x81 && ascq == 0x04) { - DBG (5, "Medium error: staple detected\n"); - return SANE_STATUS_JAMMED; + } + + hexdump(15, "off:", s->f_offset[i], s->s.valid_Bpl); + } + + /*fine gain*/ + ret = gain_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine_buffer: ERROR: cannot load gain buffers\n"); + goto cleanup; + } + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, READ_code); + set_R_datatype_code (cmd, SR_datatype_finegain); + set_R_xfer_lid (cmd, s->s.dpi_x/10); + set_R_xfer_length (cmd, reqLen); + + /*color gain split into three buffers, grab them and merge*/ + if(s->s.format == SANE_FRAME_RGB){ + + int codes[] = {R_FINE_uid_red,R_FINE_uid_green,R_FINE_uid_blue}; + + for(k=0;k<3;k++){ + + set_R_xfer_uid (cmd, codes[k]); + inLen = reqLen; + + hexdump(15, "cmd:", cmd, cmdLen); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + in, &inLen + ); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + + for(i=0;i<2;i++){ + for(j=0; js.valid_width; j++){ + + s->f_gain[i][j*3+k] = in[j*2+i]*3/4; + + if(s->f_gain[i][j*3+k] < 1) + s->f_gain[i][j*3+k] = 1; + } } - DBG (5, "Medium error: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + } + } - case 4: - if (asc == 0x60 && ascq == 0x00) { - DBG (5, "Hardware error: lamp error\n"); - return SANE_STATUS_IO_ERROR; + /*gray gain, copy*/ + else{ + + set_R_xfer_uid (cmd, R_FINE_uid_gray); + inLen = reqLen; + + hexdump(15, "cmd:", cmd, cmdLen); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + in, &inLen + ); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + + for(i=0;i<2;i++){ + for(j=0; js.valid_width; j++){ + + s->f_gain[i][j] = in[j*2+i]*3/4; + + if(s->f_gain[i][j] < 1) + s->f_gain[i][j] = 1; } - if (asc == 0x80 && ascq == 0x01) { - DBG (5, "Hardware error: CPU check error\n"); - return SANE_STATUS_IO_ERROR; + } + } + + for(i=0;i<2;i++){ + hexdump(15, "gain:", s->f_gain[i], s->s.valid_Bpl); + } + + /* log current cal type */ + s->f_res = s->s.dpi_x; + s->f_mode = s->s.mode; + + cleanup: + + if(in){ + free(in); + } + + /* recover user settings */ + s->u.tl_y = old_tl_y; + s->u.br_y = old_br_y; + s->u.source = old_source; + + DBG (10, "calibrate_fine_buffer: finish %d\n",ret); + + return ret; +} + +/* + * makes several scans, adjusts fine calibration + */ +static SANE_Status +calibrate_fine (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i, j, k; + int min, max; + int lines = 8; + + /*buffer these for later*/ + int old_tl_y = s->u.tl_y; + int old_br_y = s->u.br_y; + int old_source = s->u.source; + + DBG (10, "calibrate_fine: start\n"); + + if(!s->need_fcal){ + DBG (10, "calibrate_fine: not required\n"); + return ret; + } + + /* always cal with a short scan in duplex */ + s->u.tl_y = 0; + s->u.br_y = lines * 1200 / s->u.dpi_y; + s->u.source = SOURCE_ADF_DUPLEX; + + /* load our own private copy of scan params */ + ret = update_params(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot update_params\n"); + goto cleanup; + } + + if(s->f_res == s->s.dpi_x && s->f_mode == s->s.mode){ + DBG (10, "calibrate_fine: already done\n"); + goto cleanup; + } + + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibration_fine: ERROR: cannot clean_params\n"); + goto cleanup; + } + + /* make buffers to hold the images */ + ret = image_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot load buffers\n"); + goto cleanup; + } + + /*blast the existing fine cal data so reading code wont apply it*/ + ret = offset_buffers(s,0); + ret = gain_buffers(s,0); + + /* need to tell it we want duplex */ + ret = ssm_buffer(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot ssm buffer\n"); + goto cleanup; + } + + /* set window command */ + ret = set_window(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot set window\n"); + goto cleanup; + } + + /*handle fifth pass (fine offset), lamp off*/ + DBG (15, "calibrate_fine: offset\n"); + ret = calibration_scan(s,0xff); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot make offset cal scan\n"); + goto cleanup; + } + + ret = offset_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot load offset buffers\n"); + goto cleanup; + } + + for(i=0;i<2;i++){ + for(j=0; js.valid_Bpl; j++){ + min = 0; + for(k=j;ks.Bpl;k+=s->s.Bpl){ + min += s->buffers[i][k]; } - if (asc == 0x80 && ascq == 0x02) { - DBG (5, "Hardware error: RAM check error\n"); - return SANE_STATUS_IO_ERROR; + s->f_offset[i][j] = min/lines; + } + hexdump(15, "off:", s->f_offset[i], s->s.valid_Bpl); + } + + /*handle sixth pass (fine gain), lamp on*/ + DBG (15, "calibrate_fine: gain\n"); + ret = calibration_scan(s,0xfe); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot make gain cal scan\n"); + goto cleanup; + } + + ret = gain_buffers(s,1); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibrate_fine: ERROR: cannot load gain buffers\n"); + goto cleanup; + } + + for(i=0;i<2;i++){ + for(j=0; js.valid_Bpl; j++){ + max = 0; + for(k=j;ks.Bpl;k+=s->s.Bpl){ + max += s->buffers[i][k]; } - if (asc == 0x80 && ascq == 0x03) { - DBG (5, "Hardware error: ROM check error\n"); + s->f_gain[i][j] = max/lines; + + if(s->f_gain[i][j] < 1) + s->f_gain[i][j] = 1; + } + hexdump(15, "gain:", s->f_gain[i], s->s.valid_Bpl); + } + + /* log current cal type */ + s->f_res = s->s.dpi_x; + s->f_mode = s->s.mode; + + cleanup: + + /* recover user settings */ + s->u.tl_y = old_tl_y; + s->u.br_y = old_br_y; + s->u.source = old_source; + + DBG (10, "calibrate_fine: finish %d\n",ret); + + return ret; +} + +/* + * sends AFE params, and ingests entire duplex image into buffers + */ +static SANE_Status +calibration_scan (struct scanner *s, int scan) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + DBG (10, "calibration_scan: start\n"); + + /* clean scan params for new scan */ + ret = clean_params(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibration_scan: ERROR: cannot clean_params\n"); + return ret; + } + + /* start scanning */ + ret = start_scan (s,scan); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "calibration_scan: ERROR: cannot start_scan\n"); + return ret; + } + + while(!s->s.eof[SIDE_FRONT] && !s->s.eof[SIDE_BACK]){ + ret = read_from_scanner_duplex(s,1); + } + + DBG (10, "calibration_scan: finished\n"); + + return ret; +} + +/* + * sends AFE and exposure params + */ +static SANE_Status +write_AFE(struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + unsigned char cmd[COR_CAL_len]; + size_t cmdLen = COR_CAL_len; + + unsigned char pay[CC_pay_len]; + size_t payLen = CC_pay_len; + + DBG (10, "write_AFE: start\n"); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, COR_CAL_code); + set_CC_xferlen(cmd,payLen); + + memset(pay,0,payLen); + set_CC_f_gain(pay,s->c_gain[SIDE_FRONT]); + set_CC_unk1(pay,1); + set_CC_f_offset(pay,s->c_offset[SIDE_FRONT]); + set_CC_unk2(pay,1); + set_CC_exp_f_r1(pay,s->c_exposure[SIDE_FRONT][CHAN_RED]); + set_CC_exp_f_g1(pay,s->c_exposure[SIDE_FRONT][CHAN_GREEN]); + set_CC_exp_f_b1(pay,s->c_exposure[SIDE_FRONT][CHAN_BLUE]); + set_CC_exp_f_r2(pay,s->c_exposure[SIDE_FRONT][CHAN_RED]); + set_CC_exp_f_g2(pay,s->c_exposure[SIDE_FRONT][CHAN_GREEN]); + set_CC_exp_f_b2(pay,s->c_exposure[SIDE_FRONT][CHAN_BLUE]); + + set_CC_b_gain(pay,s->c_gain[SIDE_BACK]); + set_CC_b_offset(pay,s->c_offset[SIDE_BACK]); + set_CC_exp_b_r1(pay,s->c_exposure[SIDE_BACK][CHAN_RED]); + set_CC_exp_b_g1(pay,s->c_exposure[SIDE_BACK][CHAN_GREEN]); + set_CC_exp_b_b1(pay,s->c_exposure[SIDE_BACK][CHAN_BLUE]); + set_CC_exp_b_r2(pay,s->c_exposure[SIDE_BACK][CHAN_RED]); + set_CC_exp_b_g2(pay,s->c_exposure[SIDE_BACK][CHAN_GREEN]); + set_CC_exp_b_b2(pay,s->c_exposure[SIDE_BACK][CHAN_BLUE]); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + if (ret != SANE_STATUS_GOOD) + return ret; + + DBG (10, "write_AFE: finish\n"); + + return ret; +} + +/* + * frees/callocs buffers to hold the fine cal offset data + */ +static SANE_Status +offset_buffers (struct scanner *s, int setup) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int side; + + DBG (10, "offset_buffers: start\n"); + + for(side=0;side<2;side++){ + + if (s->f_offset[side]) { + DBG (15, "offset_buffers: free f_offset %d.\n",side); + free(s->f_offset[side]); + s->f_offset[side] = NULL; + } + + if(setup){ + s->f_offset[side] = calloc (1,s->s.Bpl); + if (!s->f_offset[side]) { + DBG (5, "offset_buffers: error, no f_offset %d.\n",side); + return SANE_STATUS_NO_MEM; + } + } + } + + DBG (10, "offset_buffers: finish\n"); + + return ret; +} + +/* + * frees/callocs buffers to hold the fine cal gain data + */ +static SANE_Status +gain_buffers (struct scanner *s, int setup) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int side; + + DBG (10, "gain_buffers: start\n"); + + for(side=0;side<2;side++){ + + if (s->f_gain[side]) { + DBG (15, "gain_buffers: free f_gain %d.\n",side); + free(s->f_gain[side]); + s->f_gain[side] = NULL; + } + + if(setup){ + s->f_gain[side] = calloc (1,s->s.Bpl); + if (!s->f_gain[side]) { + DBG (5, "gain_buffers: error, no f_gain %d.\n",side); + return SANE_STATUS_NO_MEM; + } + } + } + + DBG (10, "gain_buffers: finish\n"); + + return ret; +} + +/* + * @@ Section 6 - SANE cleanup functions + */ +/* + * Cancels a scan. + * + * It has been said on the mailing list that sane_cancel is a bit of a + * misnomer because it is routinely called to signal the end of a + * batch - quoting David Mosberger-Tang: + * + * > In other words, the idea is to have sane_start() be called, and + * > collect as many images as the frontend wants (which could in turn + * > consist of multiple frames each as indicated by frame-type) and + * > when the frontend is done, it should call sane_cancel(). + * > Sometimes it's better to think of sane_cancel() as "sane_stop()" + * > but that name would have had some misleading connotations as + * > well, that's why we stuck with "cancel". + * + * The current consensus regarding duplex and ADF scans seems to be + * the following call sequence: sane_start; sane_read (repeat until + * EOF); sane_start; sane_read... and then call sane_cancel if the + * batch is at an end. I.e. do not call sane_cancel during the run but + * as soon as you get a SANE_STATUS_NO_DOCS. + * + * From the SANE spec: + * This function is used to immediately or as quickly as possible + * cancel the currently pending operation of the device represented by + * handle h. This function can be called at any time (as long as + * handle h is a valid handle) but usually affects long-running + * operations only (such as image acquisition). It is safe to call + * this function asynchronously (e.g., from within a signal handler). + * It is important to note that completion of this operaton does not + * imply that the currently pending operation has been cancelled. It + * only guarantees that cancellation has been initiated. Cancellation + * completes only when the cancelled call returns (typically with a + * status value of SANE_STATUS_CANCELLED). Since the SANE API does + * not require any other operations to be re-entrant, this implies + * that a frontend must not call any other operation until the + * cancelled operation has returned. + */ +void +sane_cancel (SANE_Handle handle) +{ + struct scanner * s = (struct scanner *) handle; + + DBG (10, "sane_cancel: start\n"); + s->cancelled = 1; + + /* if there is no other running function to check, we do it */ + if(!s->reading) + check_for_cancel(s); + + DBG (10, "sane_cancel: finish\n"); +} + +/* checks started and cancelled flags in scanner struct, + * sends cancel command to scanner if required. don't call + * this function asyncronously, wait for pending operation */ +static SANE_Status +check_for_cancel(struct scanner *s) +{ + SANE_Status ret=SANE_STATUS_GOOD; + + DBG (10, "check_for_cancel: start\n"); + + if(s->started && s->cancelled){ + unsigned char cmd[CANCEL_len]; + size_t cmdLen = CANCEL_len; + + DBG (15, "check_for_cancel: cancelling\n"); + + /* cancel scan */ + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, CANCEL_code); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + if(ret){ + DBG (5, "check_for_cancel: ignoring bad cancel: %d\n",ret); + } + + ret = object_position(s,SANE_FALSE); + if(ret){ + DBG (5, "check_for_cancel: ignoring bad eject: %d\n",ret); + } + + s->started = 0; + s->cancelled = 0; + ret = SANE_STATUS_CANCELLED; + } + else if(s->cancelled){ + DBG (15, "check_for_cancel: already cancelled\n"); + s->cancelled = 0; + ret = SANE_STATUS_CANCELLED; + } + + DBG (10, "check_for_cancel: finish %d\n",ret); + return ret; +} + +/* + * Ends use of the scanner. + * + * From the SANE spec: + * This function terminates the association between the device handle + * passed in argument h and the device it represents. If the device is + * presently active, a call to sane_cancel() is performed first. After + * this function returns, handle h must not be used anymore. + */ +void +sane_close (SANE_Handle handle) +{ + struct scanner * s = (struct scanner *) handle; + + DBG (10, "sane_close: start\n"); + disconnect_fd(s); + image_buffers(s,0); + offset_buffers(s,0); + gain_buffers(s,0); + DBG (10, "sane_close: finish\n"); +} + +static SANE_Status +disconnect_fd (struct scanner *s) +{ + DBG (10, "disconnect_fd: start\n"); + + if(s->fd > -1){ + if (s->connection == CONNECTION_USB) { + DBG (15, "disconnecting usb device\n"); + sanei_usb_close (s->fd); + } + else if (s->connection == CONNECTION_SCSI) { + DBG (15, "disconnecting scsi device\n"); + sanei_scsi_close (s->fd); + } + s->fd = -1; + } + + DBG (10, "disconnect_fd: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * Terminates the backend. + * + * From the SANE spec: + * This function must be called to terminate use of a backend. The + * function will first close all device handles that still might be + * open (it is recommended to close device handles explicitly through + * a call to sane_close(), but backends are required to release all + * resources upon a call to this function). After this function + * returns, no function other than sane_init() may be called + * (regardless of the status value returned by sane_exit(). Neglecting + * to call this function may result in some resources not being + * released properly. + */ +void +sane_exit (void) +{ + struct scanner *dev, *next; + + DBG (10, "sane_exit: start\n"); + + for (dev = scanner_devList; dev; dev = next) { + disconnect_fd(dev); + next = dev->next; + free (dev); + } + + if (sane_devArray) + free (sane_devArray); + + scanner_devList = NULL; + sane_devArray = NULL; + + DBG (10, "sane_exit: finish\n"); +} + + +/* + * @@ Section 7 - misc helper functions + */ +static void +default_globals(void) +{ + global_buffer_size = global_buffer_size_default; + global_padded_read = global_padded_read_default; + global_vendor_name[0] = 0; + global_model_name[0] = 0; + global_version_name[0] = 0; +} + +/* + * Called by the SANE SCSI core and our usb code on device errors + * parses the request sense return data buffer, + * decides the best SANE_Status for the problem, produces debug msgs, + * and copies the sense buffer into the scanner struct + */ +static SANE_Status +sense_handler (int fd, unsigned char * sensed_data, void *arg) +{ + struct scanner *s = arg; + unsigned int sense = get_RS_sense_key (sensed_data); + unsigned int asc = get_RS_ASC (sensed_data); + unsigned int ascq = get_RS_ASCQ (sensed_data); + unsigned int eom = get_RS_EOM (sensed_data); + unsigned int ili = get_RS_ILI (sensed_data); + unsigned int info = get_RS_information (sensed_data); + + DBG (5, "sense_handler: start\n"); + + /* kill compiler warning */ + fd = fd; + + /* copy the rs return data into the scanner struct + so that the caller can use it if he wants + memcpy(&s->rs_buffer,sensed_data,RS_return_size); + */ + + DBG (5, "Sense=%#02x, ASC=%#02x, ASCQ=%#02x, EOM=%d, ILI=%d, info=%#08x\n", sense, asc, ascq, eom, ili, info); + + switch (sense) { + case 0: + if (ili == 1) { + s->rs_info = info; + DBG (5, "No sense: EOM remainder:%d\n",info); + return SANE_STATUS_EOF; + } + DBG (5, "No sense: unknown asc/ascq\n"); + return SANE_STATUS_GOOD; + + case 1: + if (asc == 0x37 && ascq == 0x00) { + DBG (5, "Recovered error: parameter rounded\n"); + return SANE_STATUS_GOOD; + } + DBG (5, "Recovered error: unknown asc/ascq\n"); + return SANE_STATUS_GOOD; + + case 2: + if (asc == 0x04 && ascq == 0x01) { + DBG (5, "Not ready: previous command unfinished\n"); + return SANE_STATUS_DEVICE_BUSY; + } + DBG (5, "Not ready: unknown asc/ascq\n"); + return SANE_STATUS_DEVICE_BUSY; + + case 3: + if (asc == 0x36 && ascq == 0x00) { + DBG (5, "Medium error: no cartridge\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x3a && ascq == 0x00) { + DBG (5, "Medium error: hopper empty\n"); + return SANE_STATUS_NO_DOCS; + } + if (asc == 0x80 && ascq == 0x00) { + DBG (5, "Medium error: paper jam\n"); + return SANE_STATUS_JAMMED; + } + if (asc == 0x80 && ascq == 0x01) { + DBG (5, "Medium error: cover open\n"); + return SANE_STATUS_COVER_OPEN; + } + if (asc == 0x81 && ascq == 0x01) { + DBG (5, "Medium error: double feed\n"); + return SANE_STATUS_JAMMED; + } + if (asc == 0x81 && ascq == 0x02) { + DBG (5, "Medium error: skew detected\n"); + return SANE_STATUS_JAMMED; + } + if (asc == 0x81 && ascq == 0x04) { + DBG (5, "Medium error: staple detected\n"); + return SANE_STATUS_JAMMED; + } + DBG (5, "Medium error: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 4: + if (asc == 0x60 && ascq == 0x00) { + DBG (5, "Hardware error: lamp error\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x80 && ascq == 0x01) { + DBG (5, "Hardware error: CPU check error\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x80 && ascq == 0x02) { + DBG (5, "Hardware error: RAM check error\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x80 && ascq == 0x03) { + DBG (5, "Hardware error: ROM check error\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x80 && ascq == 0x04) { + DBG (5, "Hardware error: hardware check error\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "Hardware error: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 5: + if (asc == 0x1a && ascq == 0x00) { + DBG (5, "Illegal request: Parameter list error\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x20 && ascq == 0x00) { + DBG (5, "Illegal request: invalid command\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x24 && ascq == 0x00) { + DBG (5, "Illegal request: invalid CDB field\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x25 && ascq == 0x00) { + DBG (5, "Illegal request: unsupported logical unit\n"); + return SANE_STATUS_UNSUPPORTED; + } + if (asc == 0x26 && ascq == 0x00) { + DBG (5, "Illegal request: invalid field in parm list\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x2c && ascq == 0x00) { + DBG (5, "Illegal request: command sequence error\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x2c && ascq == 0x01) { + DBG (5, "Illegal request: too many windows\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x3a && ascq == 0x00) { + DBG (5, "Illegal request: no paper\n"); + return SANE_STATUS_NO_DOCS; + } + if (asc == 0x3d && ascq == 0x00) { + DBG (5, "Illegal request: invalid IDENTIFY\n"); + return SANE_STATUS_INVAL; + } + if (asc == 0x55 && ascq == 0x00) { + DBG (5, "Illegal request: scanner out of memory\n"); + return SANE_STATUS_NO_MEM; + } + DBG (5, "Illegal request: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + case 6: + if (asc == 0x29 && ascq == 0x00) { + DBG (5, "Unit attention: device reset\n"); + return SANE_STATUS_GOOD; + } + if (asc == 0x2a && ascq == 0x00) { + DBG (5, "Unit attention: param changed by 2nd initiator\n"); + return SANE_STATUS_GOOD; + } + DBG (5, "Unit attention: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + case 7: + DBG (5, "Data protect: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 8: + DBG (5, "Blank check: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 9: + DBG (5, "Vendor defined: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 0xa: + DBG (5, "Copy aborted: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 0xb: + if (asc == 0x00 && ascq == 0x00) { + DBG (5, "Aborted command: no sense/cancelled\n"); + return SANE_STATUS_CANCELLED; + } + if (asc == 0x45 && ascq == 0x00) { + DBG (5, "Aborted command: reselect failure\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x47 && ascq == 0x00) { + DBG (5, "Aborted command: SCSI parity error\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x48 && ascq == 0x00) { + DBG (5, "Aborted command: initiator error message\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x49 && ascq == 0x00) { + DBG (5, "Aborted command: invalid message\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x80 && ascq == 0x00) { + DBG (5, "Aborted command: timeout\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "Aborted command: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + case 0xc: + DBG (5, "Equal: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 0xd: + DBG (5, "Volume overflow: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + case 0xe: + if (asc == 0x3b && ascq == 0x0d) { + DBG (5, "Miscompare: too many docs\n"); + return SANE_STATUS_IO_ERROR; + } + if (asc == 0x3b && ascq == 0x0e) { + DBG (5, "Miscompare: too few docs\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "Miscompare: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + + default: + DBG (5, "Unknown Sense Code\n"); + return SANE_STATUS_IO_ERROR; + } + + DBG (5, "sense_handler: should never happen!\n"); + + return SANE_STATUS_IO_ERROR; +} + +/* + * take a bunch of pointers, send commands to scanner + */ +static SANE_Status +do_cmd(struct scanner *s, int runRS, int shortTime, + unsigned char * cmdBuff, size_t cmdLen, + unsigned char * outBuff, size_t outLen, + unsigned char * inBuff, size_t * inLen +) +{ + if (s->connection == CONNECTION_SCSI) { + return do_scsi_cmd(s, runRS, shortTime, + cmdBuff, cmdLen, + outBuff, outLen, + inBuff, inLen + ); + } + if (s->connection == CONNECTION_USB) { + return do_usb_cmd(s, runRS, shortTime, + cmdBuff, cmdLen, + outBuff, outLen, + inBuff, inLen + ); + } + return SANE_STATUS_INVAL; +} + +static SANE_Status +do_scsi_cmd(struct scanner *s, int runRS, int shortTime, + unsigned char * cmdBuff, size_t cmdLen, + unsigned char * outBuff, size_t outLen, + unsigned char * inBuff, size_t * inLen +) +{ + int ret; + size_t actLen = 0; + + /*shut up compiler*/ + runRS=runRS; + shortTime=shortTime; + + DBG(10, "do_scsi_cmd: start\n"); + + DBG(25, "cmd: writing %d bytes\n", (int)cmdLen); + hexdump(30, "cmd: >>", cmdBuff, cmdLen); + + if(outBuff && outLen){ + DBG(25, "out: writing %d bytes\n", (int)outLen); + hexdump(30, "out: >>", outBuff, outLen); + } + if (inBuff && inLen){ + DBG(25, "in: reading %d bytes\n", (int)*inLen); + memset(inBuff,0,*inLen); + actLen = *inLen; + } + + ret = sanei_scsi_cmd2(s->fd, cmdBuff, cmdLen, outBuff, outLen, inBuff, inLen); + + if(ret != SANE_STATUS_GOOD && ret != SANE_STATUS_EOF){ + DBG(5,"do_scsi_cmd: return '%s'\n",sane_strstatus(ret)); + return ret; + } + + if (inBuff && inLen){ + if(ret == SANE_STATUS_EOF){ + DBG(25, "in: short read, remainder %lu bytes\n", (u_long)s->rs_info); + *inLen -= s->rs_info; + } + hexdump(30, "in: <<", inBuff, *inLen); + DBG(25, "in: read %d bytes\n", (int)*inLen); + } + + DBG(10, "do_scsi_cmd: finish\n"); + + return ret; +} + +static SANE_Status +do_usb_cmd(struct scanner *s, int runRS, int shortTime, + unsigned char * cmdBuff, size_t cmdLen, + unsigned char * outBuff, size_t outLen, + unsigned char * inBuff, size_t * inLen +) +{ + size_t cmdOffset = 0; + size_t cmdLength = 0; + size_t cmdActual = 0; + unsigned char * cmdBuffer = NULL; + int cmdTimeout = 0; + + size_t outOffset = 0; + size_t outLength = 0; + size_t outActual = 0; + unsigned char * outBuffer = NULL; + int outTimeout = 0; + + size_t inOffset = 0; + size_t inLength = 0; + size_t inActual = 0; + unsigned char * inBuffer = NULL; + int inTimeout = 0; + + size_t statOffset = 0; + size_t statLength = 0; + size_t statActual = 0; + unsigned char * statBuffer = NULL; + int statTimeout = 0; + + int ret = 0; + int ret2 = 0; + + DBG (10, "do_usb_cmd: start\n"); + + /****************************************************************/ + /* the command stage */ + { + cmdOffset = USB_HEADER_LEN; + cmdLength = cmdOffset+USB_COMMAND_LEN; + cmdActual = cmdLength; + cmdTimeout = USB_COMMAND_TIME; + + /* change timeout */ + if(shortTime) + cmdTimeout/=60; + sanei_usb_set_timeout(cmdTimeout); + + /* build buffer */ + cmdBuffer = calloc(cmdLength,1); + if(!cmdBuffer){ + DBG(5,"cmd: no mem\n"); + return SANE_STATUS_NO_MEM; + } + + /* build a USB packet around the SCSI command */ + cmdBuffer[3] = cmdLength-4; + cmdBuffer[5] = 1; + cmdBuffer[6] = 0x90; + memcpy(cmdBuffer+cmdOffset,cmdBuff,cmdLen); + + /* write the command out */ + DBG(25, "cmd: writing %d bytes, timeout %d\n", (int)cmdLength, cmdTimeout); + hexdump(30, "cmd: >>", cmdBuffer, cmdLength); + ret = sanei_usb_write_bulk(s->fd, cmdBuffer, &cmdActual); + DBG(25, "cmd: wrote %d bytes, retVal %d\n", (int)cmdActual, ret); + + if(cmdLength != cmdActual){ + DBG(5,"cmd: wrong size %d/%d\n", (int)cmdLength, (int)cmdActual); + free(cmdBuffer); + return SANE_STATUS_IO_ERROR; + } + if(ret != SANE_STATUS_GOOD){ + DBG(5,"cmd: write error '%s'\n",sane_strstatus(ret)); + free(cmdBuffer); + return ret; + } + free(cmdBuffer); + } + + /****************************************************************/ + /* the output stage */ + if(outBuff && outLen){ + + outOffset = USB_HEADER_LEN; + outLength = outOffset+outLen; + outActual = outLength; + outTimeout = USB_DATA_TIME; + + /* change timeout */ + if(shortTime) + outTimeout/=60; + sanei_usb_set_timeout(outTimeout); + + /* build outBuffer */ + outBuffer = calloc(outLength,1); + if(!outBuffer){ + DBG(5,"out: no mem\n"); + return SANE_STATUS_NO_MEM; + } + + /* build a USB packet around the SCSI command */ + outBuffer[3] = outLength-4; + outBuffer[5] = 2; + outBuffer[6] = 0xb0; + memcpy(outBuffer+outOffset,outBuff,outLen); + + /* write the command out */ + DBG(25, "out: writing %d bytes, timeout %d\n", (int)outLength, outTimeout); + hexdump(30, "out: >>", outBuffer, outLength); + ret = sanei_usb_write_bulk(s->fd, outBuffer, &outActual); + DBG(25, "out: wrote %d bytes, retVal %d\n", (int)outActual, ret); + + if(outLength != outActual){ + DBG(5,"out: wrong size %d/%d\n", (int)outLength, (int)outActual); + free(outBuffer); return SANE_STATUS_IO_ERROR; } - if (asc == 0x80 && ascq == 0x04) { - DBG (5, "Hardware error: hardware check error\n"); + if(ret != SANE_STATUS_GOOD){ + DBG(5,"out: write error '%s'\n",sane_strstatus(ret)); + free(outBuffer); + return ret; + } + free(outBuffer); + } + + /****************************************************************/ + /* the input stage */ + if(inBuff && inLen){ + + inOffset = 0; + if(s->padded_read) + inOffset = USB_HEADER_LEN; + + inLength = inOffset+*inLen; + inActual = inLength; + + /*blast caller's copy in case we error out*/ + *inLen = 0; + + inTimeout = USB_DATA_TIME; + + /* change timeout */ + if(shortTime) + inTimeout/=60; + sanei_usb_set_timeout(inTimeout); + + /* build inBuffer */ + inBuffer = calloc(inLength,1); + if(!inBuffer){ + DBG(5,"in: no mem\n"); + return SANE_STATUS_NO_MEM; + } + + DBG(25, "in: reading %d bytes, timeout %d\n", (int)inLength, inTimeout); + ret = sanei_usb_read_bulk(s->fd, inBuffer, &inActual); + DBG(25, "in: read %d bytes, retval %d\n", (int)inActual, ret); + hexdump(30, "in: <<", inBuffer, inActual); + + if(!inActual){ + DBG(5,"in: got no data, clearing\n"); + free(inBuffer); + return do_usb_clear(s,1,runRS); + } + if(inActual < inOffset){ + DBG(5,"in: read shorter than inOffset\n"); + free(inBuffer); return SANE_STATUS_IO_ERROR; } - DBG (5, "Hardware error: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + if(ret != SANE_STATUS_GOOD){ + DBG(5,"in: return error '%s'\n",sane_strstatus(ret)); + free(inBuffer); + return ret; + } + + /* note that inBuffer is not copied and freed here...*/ + } + + /****************************************************************/ + /* the status stage */ + statOffset = 0; + if(s->padded_read) + statOffset = USB_HEADER_LEN; + + statLength = statOffset+USB_STATUS_LEN; + statActual = statLength; + statTimeout = USB_STATUS_TIME; + + /* change timeout */ + if(shortTime) + statTimeout/=60; + sanei_usb_set_timeout(statTimeout); + + /* build statBuffer */ + statBuffer = calloc(statLength,1); + if(!statBuffer){ + DBG(5,"stat: no mem\n"); + if(inBuffer) free(inBuffer); + return SANE_STATUS_NO_MEM; + } + + DBG(25, "stat: reading %d bytes, timeout %d\n", (int)statLength, statTimeout); + ret2 = sanei_usb_read_bulk(s->fd, statBuffer, &statActual); + DBG(25, "stat: read %d bytes, retval %d\n", (int)statActual, ret2); + hexdump(30, "stat: <<", statBuffer, statActual); + + /*weird status*/ + if(ret2 != SANE_STATUS_GOOD){ + DBG(5,"stat: clearing error '%s'\n",sane_strstatus(ret2)); + ret2 = do_usb_clear(s,1,runRS); + } + /*short read*/ + else if(statLength != statActual){ + DBG(5,"stat: clearing short %d/%d\n",(int)statLength,(int)statActual); + ret2 = do_usb_clear(s,1,runRS); + } + /*inspect the last byte of the status response*/ + else if(statBuffer[statLength-1]){ + DBG(5,"stat: status %d\n",statBuffer[statLength-1]); + ret2 = do_usb_clear(s,0,runRS); + } + free(statBuffer); + + /* if status said EOF, adjust input with remainder count */ + if(ret2 == SANE_STATUS_EOF && inBuffer){ + + /* EOF is ok */ + ret2 = SANE_STATUS_GOOD; + + if(inActual < inLength - s->rs_info){ + DBG(5,"in: shorter read than RS, ignoring: %d < %d-%d\n", + (int)inActual,(int)inLength,(int)s->rs_info); + } + else if(s->rs_info){ + DBG(5,"in: longer read than RS, updating: %d to %d-%d\n", + (int)inActual,(int)inLength,(int)s->rs_info); + inActual = inLength - s->rs_info; + } + } + + /* bail out on bad RS status */ + if(ret2){ + if(inBuffer) free(inBuffer); + DBG(5,"stat: bad RS status, %d\n", ret2); + return ret2; + } + + /* now that we have read status, deal with input buffer */ + if(inBuffer){ + if(inLength != inActual){ + ret = SANE_STATUS_EOF; + DBG(5,"in: short read, %d/%d\n", (int)inLength,(int)inActual); + } + + /* ignore the USB packet around the SCSI command */ + *inLen = inActual - inOffset; + memcpy(inBuff,inBuffer+inOffset,*inLen); + + free(inBuffer); + } + + DBG (10, "do_usb_cmd: finish\n"); + + return ret; +} + +static SANE_Status +do_usb_clear(struct scanner *s, int clear, int runRS) +{ + SANE_Status ret, ret2; + + DBG (10, "do_usb_clear: start\n"); + + usleep(100000); + + if(clear){ + DBG (15, "do_usb_clear: clear halt\n"); + ret = sanei_usb_clear_halt(s->fd); + if(ret != SANE_STATUS_GOOD){ + DBG(5,"do_usb_clear: cant clear halt, returning %d\n", ret); + return ret; + } + } + + /* caller is interested in having RS run on errors */ + if(runRS){ + + unsigned char rs_cmd[REQUEST_SENSE_len]; + size_t rs_cmdLen = REQUEST_SENSE_len; + + unsigned char rs_in[RS_return_size]; + size_t rs_inLen = RS_return_size; + + memset(rs_cmd,0,rs_cmdLen); + set_SCSI_opcode(rs_cmd, REQUEST_SENSE_code); + set_RS_return_size(rs_cmd, rs_inLen); + + DBG(25,"rs sub call >>\n"); + ret2 = do_cmd( + s,0,0, + rs_cmd, rs_cmdLen, + NULL,0, + rs_in, &rs_inLen + ); + DBG(25,"rs sub call <<\n"); + + if(ret2 == SANE_STATUS_EOF){ + DBG(5,"rs: got EOF, returning IO_ERROR\n"); + return SANE_STATUS_IO_ERROR; + } + if(ret2 != SANE_STATUS_GOOD){ + DBG(5,"rs: return error '%s'\n",sane_strstatus(ret2)); + return ret2; + } + + /* parse the rs data */ + ret2 = sense_handler( 0, rs_in, (void *)s ); + + DBG (10, "do_usb_clear: finish after RS\n"); + return ret2; + } + + DBG (10, "do_usb_clear: finish with io error\n"); + + return SANE_STATUS_IO_ERROR; +} + +static SANE_Status +wait_scanner(struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + unsigned char cmd[TEST_UNIT_READY_len]; + size_t cmdLen = TEST_UNIT_READY_len; + + DBG (10, "wait_scanner: start\n"); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,TEST_UNIT_READY_code); + + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + + if (ret != SANE_STATUS_GOOD) { + DBG(5,"WARNING: Brain-dead scanner. Hitting with stick\n"); + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + } + if (ret != SANE_STATUS_GOOD) { + DBG(5,"WARNING: Brain-dead scanner. Hitting with stick again\n"); + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + } - case 5: - if (asc == 0x1a && ascq == 0x00) { - DBG (5, "Illegal request: Parameter list error\n"); - return SANE_STATUS_INVAL; - } - if (asc == 0x20 && ascq == 0x00) { - DBG (5, "Illegal request: invalid command\n"); - return SANE_STATUS_INVAL; - } - if (asc == 0x24 && ascq == 0x00) { - DBG (5, "Illegal request: invalid CDB field\n"); - return SANE_STATUS_INVAL; - } - if (asc == 0x25 && ascq == 0x00) { - DBG (5, "Illegal request: unsupported logical unit\n"); - return SANE_STATUS_UNSUPPORTED; - } - if (asc == 0x26 && ascq == 0x00) { - DBG (5, "Illegal request: invalid field in parm list\n"); - return SANE_STATUS_INVAL; + if (ret != SANE_STATUS_GOOD) { + DBG (5, "wait_scanner: error '%s'\n", sane_strstatus (ret)); + } + + DBG (10, "wait_scanner: finish\n"); + + return ret; +} + +/* s->u.page_x stores the user setting + * for the paper width in adf. sometimes, + * we need a value that differs from this + * due to using FB or overscan. + */ +static int +get_page_width(struct scanner *s) +{ + int width = s->u.page_x; + + /* scanner max for fb */ + if(s->u.source == SOURCE_FLATBED){ + return s->max_x_fb; + } + + /* cant overscan larger than scanner max */ + if(width > s->valid_x){ + return s->valid_x; + } + + /* overscan adds a margin to both sides */ + return width; +} + +/* s->u.page_y stores the user setting + * for the paper height in adf. sometimes, + * we need a value that differs from this + * due to using FB or overscan. + */ +static int +get_page_height(struct scanner *s) +{ + int height = s->u.page_y; + + /* scanner max for fb */ + if(s->u.source == SOURCE_FLATBED){ + return s->max_y_fb; + } + + /* cant overscan larger than scanner max */ + if(height > s->max_y){ + return s->max_y; + } + + /* overscan adds a margin to both sides */ + return height; +} + + +/** + * Convenience method to determine longest string size in a list. + */ +static size_t +maxStringSize (const SANE_String_Const strings[]) +{ + size_t size, max_size = 0; + int i; + + for (i = 0; strings[i]; ++i) { + size = strlen (strings[i]) + 1; + if (size > max_size) + max_size = size; + } + + return max_size; +} + +/* + * Prints a hex dump of the given buffer onto the debug output stream. + */ +static void +hexdump (int level, char *comment, unsigned char *p, int l) +{ + int i; + char line[70]; /* 'xxx: xx xx ... xx xx abc */ + char *hex = line+4; + char *bin = line+53; + + if(DBG_LEVEL < level) + return; + + line[0] = 0; + + DBG (level, "%s\n", comment); + + for (i = 0; i < l; i++, p++) { + + /* at start of line */ + if ((i % 16) == 0) { + + /* not at start of first line, print current, reset */ + if (i) { + DBG (level, "%s\n", line); } - if (asc == 0x2c && ascq == 0x00) { - DBG (5, "Illegal request: command sequence error\n"); - return SANE_STATUS_INVAL; + + memset(line,0x20,69); + line[69] = 0; + hex = line + 4; + bin = line + 53; + + sprintf (line, "%3.3x:", i); + } + + /* the hex section */ + sprintf (hex, " %2.2x", *p); + hex += 3; + *hex = ' '; + + /* the char section */ + if(*p >= 0x20 && *p <= 0x7e){ + *bin=*p; + } + else{ + *bin='.'; + } + bin++; + } + + /* print last (partial) line */ + DBG (level, "%s\n", line); +} + +/** + * An advanced method we don't support but have to define. + */ +SANE_Status +sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) +{ + DBG (10, "sane_set_io_mode\n"); + DBG (15, "%d %p\n", non_blocking, h); + return SANE_STATUS_UNSUPPORTED; +} + +/** + * An advanced method we don't support but have to define. + */ +SANE_Status +sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) +{ + DBG (10, "sane_get_select_fd\n"); + DBG (15, "%p %d\n", h, *fdp); + return SANE_STATUS_UNSUPPORTED; +} + +/* + * @@ Section 8 - Image processing functions + */ + +/* Look in image for likely upper and left paper edges, then rotate + * image so that upper left corner of paper is upper left of image. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_deskew(struct scanner *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + int pwidth = s->i.width; + int width = s->i.Bpl; + int height = s->i.height; + + double TSlope = 0; + int TXInter = 0; + int TYInter = 0; + double TSlopeHalf = 0; + int TOffsetHalf = 0; + + double LSlope = 0; + int LXInter = 0; + int LYInter = 0; + double LSlopeHalf = 0; + int LOffsetHalf = 0; + + int rotateX = 0; + int rotateY = 0; + + int * topBuf = NULL, * botBuf = NULL; + + DBG (10, "buffer_deskew: start\n"); + + /* get buffers for edge detection */ + topBuf = getTransitionsY(s,side,1); + if(!topBuf){ + DBG (5, "buffer_deskew: cant gTY\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + if(0){ + int i; + for(i=0;i=0 && topBuf[i] < height) + s->buffers[side][topBuf[i]*width+i] = 0; + } + } + + botBuf = getTransitionsY(s,side,0); + if(!botBuf){ + DBG (5, "buffer_deskew: cant gTY\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + /* find best top line */ + ret = getEdgeIterate (pwidth, height, s->i.dpi_y, topBuf, + &TSlope, &TXInter, &TYInter); + if(ret){ + DBG(5,"buffer_deskew: gEI error: %d",ret); + goto cleanup; + } + DBG(15,"top: %04.04f %d %d\n",TSlope,TXInter,TYInter); + + /* slope is too shallow, don't want to divide by 0 */ + if(fabs(TSlope) < 0.0001){ + DBG(15,"buffer_deskew: slope too shallow: %0.08f\n",TSlope); + goto cleanup; + } + + /* find best left line, perpendicular to top line */ + LSlope = (double)-1/TSlope; + ret = getEdgeSlope (pwidth, height, topBuf, botBuf, LSlope, + &LXInter, &LYInter); + if(ret){ + DBG(5,"buffer_deskew: gES error: %d",ret); + goto cleanup; + } + DBG(15,"buffer_deskew: left: %04.04f %d %d\n",LSlope,LXInter,LYInter); + + /* find point about which to rotate */ + TSlopeHalf = tan(atan(TSlope)/2); + TOffsetHalf = LYInter; + DBG(15,"buffer_deskew: top half: %04.04f %d\n",TSlopeHalf,TOffsetHalf); + + LSlopeHalf = tan((atan(LSlope) + ((LSlope < 0)?-M_PI_2:M_PI_2))/2); + LOffsetHalf = - LSlopeHalf * TXInter; + DBG(15,"buffer_deskew: left half: %04.04f %d\n",LSlopeHalf,LOffsetHalf); + + rotateX = (LOffsetHalf-TOffsetHalf) / (TSlopeHalf-LSlopeHalf); + rotateY = TSlopeHalf * rotateX + TOffsetHalf; + DBG(15,"buffer_deskew: rotate: %d %d\n",rotateX,rotateY); + + ret = rotateOnCenter (s, side, rotateX, rotateY, TSlope); + if(ret){ + DBG(5,"buffer_deskew: gES error: %d",ret); + goto cleanup; + } + + cleanup: + if(topBuf) + free(topBuf); + if(botBuf) + free(botBuf); + + DBG (10, "buffer_deskew: finish\n"); + return ret; +} + +/* Look in image for likely left/right/bottom paper edges, then crop + * image to match. Does not attempt to rotate the image. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_crop(struct scanner *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + int bwidth = s->i.Bpl; + int width = s->i.width; + int height = s->i.height; + + int top = 0; + int bot = 0; + int left = width; + int right = 0; + + int * topBuf = NULL, * botBuf = NULL; + int * leftBuf = NULL, * rightBuf = NULL; + int leftCount = 0, rightCount = 0, botCount = 0; + int i; + + DBG (10, "buffer_crop: start\n"); + + /* get buffers to find sides and bottom */ + topBuf = getTransitionsY(s,side,1); + if(!topBuf){ + DBG (5, "buffer_crop: no topBuf\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + botBuf = getTransitionsY(s,side,0); + if(!botBuf){ + DBG (5, "buffer_crop: no botBuf\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + leftBuf = getTransitionsX(s,side,1); + if(!leftBuf){ + DBG (5, "buffer_crop: no leftBuf\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + rightBuf = getTransitionsX(s,side,0); + if(!rightBuf){ + DBG (5, "buffer_crop: no rightBuf\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + /* loop thru top and bottom lists, look for l and r extremes */ + for(i=0; i topBuf[i]){ + if(left > i){ + left = i; } - if (asc == 0x2c && ascq == 0x01) { - DBG (5, "Illegal request: too many windows\n"); - return SANE_STATUS_INVAL; + + leftCount++; + if(leftCount > 3){ + break; } - if (asc == 0x3a && ascq == 0x00) { - DBG (5, "Illegal request: no paper\n"); - return SANE_STATUS_NO_DOCS; + } + else{ + leftCount = 0; + left = width; + } + } + + for(i=width-1; i>=0; i--){ + if(botBuf[i] > topBuf[i]){ + if(right < i){ + right = i; } - if (asc == 0x3d && ascq == 0x00) { - DBG (5, "Illegal request: invalid IDENTIFY\n"); - return SANE_STATUS_INVAL; + + rightCount++; + if(rightCount > 3){ + break; } - if (asc == 0x55 && ascq == 0x00) { - DBG (5, "Illegal request: scanner out of memory\n"); - return SANE_STATUS_NO_MEM; + } + else{ + rightCount = 0; + right = -1; + } + } + + /* loop thru left and right lists, look for bottom extreme */ + for(i=height-1; i>=0; i--){ + if(rightBuf[i] > leftBuf[i]){ + if(bot < i){ + bot = i; } - DBG (5, "Illegal request: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; - break; - case 6: - if (asc == 0x29 && ascq == 0x00) { - DBG (5, "Unit attention: device reset\n"); - return SANE_STATUS_GOOD; + botCount++; + if(botCount > 3){ + break; } - if (asc == 0x2a && ascq == 0x00) { - DBG (5, "Unit attention: param changed by 2nd initiator\n"); - return SANE_STATUS_GOOD; + } + else{ + botCount = 0; + bot = -1; + } + } + + DBG (15, "buffer_crop: t:%d b:%d l:%d r:%d\n",top,bot,left,right); + + /* now crop the image */ + /*FIXME: crop duplex backside at same time?*/ + if(left < right && top < bot){ + + int pixels = 0; + int bytes = 0; + unsigned char * line = NULL; + + /*convert left and right to bytes, figure new byte and pixel width */ + switch (s->i.mode) { + + case MODE_COLOR: + pixels = right-left; + bytes = pixels * 3; + left *= 3; + right *= 3; + break; + + case MODE_GRAYSCALE: + pixels = right-left; + bytes = right-left; + break; + + case MODE_LINEART: + case MODE_HALFTONE: + left /= 8; + right = (right+7)/8; + bytes = right-left; + pixels = bytes * 8; + break; + } + + DBG (15, "buffer_crop: l:%d r:%d p:%d b:%d\n",left,right,pixels,bytes); + + line = malloc(bytes); + if(!line){ + DBG (5, "buffer_crop: no line\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + s->i.bytes_sent[side] = 0; + + for(i=top; ibuffers[side] + i*bwidth + left, bytes); + memcpy(s->buffers[side] + s->i.bytes_sent[side], line, bytes); + s->i.bytes_sent[side] += bytes; + } + + s->i.bytes_tot[side] = s->i.bytes_sent[side]; + s->i.width = pixels; + s->i.height = bot-top; + s->i.Bpl = bytes; + + free(line); + } + + cleanup: + if(topBuf) + free(topBuf); + if(botBuf) + free(botBuf); + if(leftBuf) + free(leftBuf); + if(rightBuf) + free(rightBuf); + + DBG (10, "buffer_crop: finish\n"); + return ret; +} + +/* Look in image for disconnected 'spots' of the requested size. + * Replace the spots with the average color of the surrounding pixels. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_despeck(struct scanner *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i,j,k,l,n; + int w = s->i.Bpl; + int pw = s->i.width; + int h = s->i.height; + int t = w*h; + int d = s->swdespeck; + + DBG (10, "buffer_despeck: start\n"); + + switch (s->i.mode){ + + case MODE_COLOR: + for(i=w; ibuffers[side][i + j*3 + k*w + l*3 + n]; + } + + if(tmp < thresh) + thresh = tmp; + } + } + + thresh = (thresh + 255*3 + 255*3)/3; + + /*loop over rows and columns around window */ + for(k=-1; kbuffers[side][i + j*3 + k*w + l*3 + n]; + outer[n] += tmp[n]; + } + if(tmp[0]+tmp[1]+tmp[2] < thresh){ + hits++; + break; + } + } + } + + for(n=0; n<3; n++){ + outer[n] /= (4*d + 4); + } + + /*no hits, overwrite with avg surrounding color*/ + if(!hits){ + for(k=0; kbuffers[side][i + j*3 + k*w + l*3 + n] = outer[n]; + } + } + } + } + + } } - DBG (5, "Unit attention: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; break; - case 7: - DBG (5, "Data protect: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + case MODE_GRAYSCALE: + for(i=w; ibuffers[side][i + j + k*w + l] < thresh) + thresh = s->buffers[side][i + j + k*w + l]; + } + } - case 8: - DBG (5, "Blank check: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + thresh = (thresh + 255 + 255)/3; + + /*loop over rows and columns around window */ + for(k=-1; kbuffers[side][i + j + k*w + l]; - case 0xb: - if (asc == 0x00 && ascq == 0x00) { - DBG (5, "Aborted command: no sense/cancelled\n"); - return SANE_STATUS_CANCELLED; - } - if (asc == 0x45 && ascq == 0x00) { - DBG (5, "Aborted command: reselect failure\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x47 && ascq == 0x00) { - DBG (5, "Aborted command: SCSI parity error\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x48 && ascq == 0x00) { - DBG (5, "Aborted command: initiator error message\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x49 && ascq == 0x00) { - DBG (5, "Aborted command: invalid message\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x80 && ascq == 0x00) { - DBG (5, "Aborted command: timeout\n"); - return SANE_STATUS_IO_ERROR; + if(tmp < thresh){ + hits++; + break; + } + + outer += tmp; + } + } + + outer /= (4*d + 4); + + /*no hits, overwrite with avg surrounding color*/ + if(!hits){ + for(k=0; kbuffers[side][i + j + k*w + l] = outer; + } + } + } + + } } - DBG (5, "Aborted command: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; break; - case 0xc: - DBG (5, "Equal: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + case MODE_LINEART: + case MODE_HALFTONE: + for(i=w; ibuffers[side][i + k*w + (j+l)/8] >> (7-(j+l)%8) & 1; + } + } - case 0xd: - DBG (5, "Volume overflow: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + if(!curr) + continue; - case 0xe: - if (asc == 0x3b && ascq == 0x0d) { - DBG (5, "Miscompare: too many docs\n"); - return SANE_STATUS_IO_ERROR; - } - if (asc == 0x3b && ascq == 0x0e) { - DBG (5, "Miscompare: too few docs\n"); - return SANE_STATUS_IO_ERROR; + /*loop over rows and columns around window */ + for(k=-1; kbuffers[side][i + k*w + (j+l)/8] >> (7-(j+l)%8) & 1; + + if(hits) + break; + } + } + + /*no hits, overwrite with white*/ + if(!hits){ + for(k=0; kbuffers[side][i + k*w + (j+l)/8] &= ~(1 << (7-(j+l)%8)); + } + } + } + + } } - DBG (5, "Miscompare: unknown asc/ascq\n"); - return SANE_STATUS_IO_ERROR; + break; default: - DBG (5, "Unknown Sense Code\n"); - return SANE_STATUS_IO_ERROR; + break; } - DBG (5, "sense_handler: should never happen!\n"); - - return SANE_STATUS_IO_ERROR; + DBG (10, "buffer_despeck: finish\n"); + return ret; } -/* - * take a bunch of pointers, send commands to scanner - */ -static SANE_Status -do_cmd(struct scanner *s, int runRS, int shortTime, - unsigned char * cmdBuff, size_t cmdLen, - unsigned char * outBuff, size_t outLen, - unsigned char * inBuff, size_t * inLen -) -{ - if (s->connection == CONNECTION_SCSI) { - return do_scsi_cmd(s, runRS, shortTime, - cmdBuff, cmdLen, - outBuff, outLen, - inBuff, inLen - ); - } - if (s->connection == CONNECTION_USB) { - return do_usb_cmd(s, runRS, shortTime, - cmdBuff, cmdLen, - outBuff, outLen, - inBuff, inLen - ); +/* Loop thru the image width and look for first color change in each column. + * Return a malloc'd array. Caller is responsible for freeing. */ +int * +getTransitionsY (struct scanner *s, int side, int top) +{ + int * buff; + + int i, j, k; + int near, far; + int winLen = 9; + + int width = s->i.width; + int height = s->i.height; + int depth = 1; + + /* defaults for bottom-up */ + int firstLine = height-1; + int lastLine = -1; + int direction = -1; + + DBG (10, "getTransitionsY: start\n"); + + buff = calloc(width,sizeof(int)); + if(!buff){ + DBG (5, "getTransitionsY: no buff\n"); + return NULL; + } + + /* override for top-down */ + if(top){ + firstLine = 0; + lastLine = height; + direction = 1; + } + + /* load the buff array with y value for first color change from edge + * gray/color uses a different algo from binary/halftone */ + switch (s->i.mode) { + + case MODE_COLOR: + depth = 3; + + case MODE_GRAYSCALE: + + for(i=0; ibuffers[side][(firstLine*width+i) * depth + k]; + } + near *= winLen; + far = near; + + /* move windows, check delta */ + for(j=firstLine+direction; j!=lastLine; j+=direction){ + + int farLine = j-winLen*2*direction; + int nearLine = j-winLen*direction; + + if(farLine < 0 || farLine >= height){ + farLine = firstLine; + } + if(nearLine < 0 || nearLine >= height){ + nearLine = firstLine; + } + + for(k=0; kbuffers[side][(farLine*width+i)*depth+k]; + far += s->buffers[side][(nearLine*width+i)*depth+k]; + + near -= s->buffers[side][(nearLine*width+i)*depth+k]; + near += s->buffers[side][(j*width+i)*depth+k]; + } + + if(abs(near - far) > winLen*depth*9){ + buff[i] = j; + break; + } + } + } + break; + + case MODE_LINEART: + case MODE_HALFTONE: + for(i=0; ibuffers[side][(firstLine*width+i)/8] >> (7-(i%8)) & 1; + + /* move */ + for(j=firstLine+direction; j!=lastLine; j+=direction){ + if((s->buffers[side][(j*width+i)/8] >> (7-(i%8)) & 1) != near){ + buff[i] = j; + break; + } + } + } + break; + + } + + /* blast any stragglers with no neighbors within .5 inch */ + for(i=0;ii.dpi_y/2) + sum++; } - return SANE_STATUS_INVAL; + if(sum < 2) + buff[i] = lastLine; + } + + DBG (10, "getTransitionsY: finish\n"); + + return buff; } -static SANE_Status -do_scsi_cmd(struct scanner *s, int runRS, int shortTime, - unsigned char * cmdBuff, size_t cmdLen, - unsigned char * outBuff, size_t outLen, - unsigned char * inBuff, size_t * inLen -) +/* Loop thru the image height and look for first color change in each row. + * Return a malloc'd array. Caller is responsible for freeing. */ +int * +getTransitionsX (struct scanner *s, int side, int left) { - int ret; - size_t actLen = 0; + int * buff; - /*shut up compiler*/ - runRS=runRS; - shortTime=shortTime; + int i, j, k; + int near, far; + int winLen = 9; - DBG(10, "do_scsi_cmd: start\n"); + int bwidth = s->i.Bpl; + int width = s->i.width; + int height = s->i.height; + int depth = 1; - DBG(25, "cmd: writing %d bytes\n", (int)cmdLen); - hexdump(30, "cmd: >>", cmdBuff, cmdLen); + /* defaults for right-first */ + int firstCol = width-1; + int lastCol = -1; + int direction = -1; - if(outBuff && outLen){ - DBG(25, "out: writing %d bytes\n", (int)outLen); - hexdump(30, "out: >>", outBuff, outLen); + DBG (10, "getTransitionsX: start\n"); + + buff = calloc(height,sizeof(int)); + if(!buff){ + DBG (5, "getTransitionsY: no buff\n"); + return NULL; } - if (inBuff && inLen){ - DBG(25, "in: reading %d bytes\n", (int)*inLen); - memset(inBuff,0,*inLen); - actLen = *inLen; + + /* override for left-first*/ + if(left){ + firstCol = 0; + lastCol = width; + direction = 1; } - ret = sanei_scsi_cmd2(s->fd, cmdBuff, cmdLen, outBuff, outLen, inBuff, inLen); + /* load the buff array with x value for first color change from edge + * gray/color uses a different algo from binary/halftone */ + switch (s->i.mode) { + + case MODE_COLOR: + depth = 3; + + case MODE_GRAYSCALE: + + for(i=0; ibuffers[side][i*bwidth + k]; + } + near *= winLen; + far = near; + + /* move windows, check delta */ + for(j=firstCol+direction; j!=lastCol; j+=direction){ + + int farCol = j-winLen*2*direction; + int nearCol = j-winLen*direction; + + if(farCol < 0 || farCol >= width){ + farCol = firstCol; + } + if(nearCol < 0 || nearCol >= width){ + nearCol = firstCol; + } + + for(k=0; kbuffers[side][i*bwidth + farCol*depth + k]; + far += s->buffers[side][i*bwidth + nearCol*depth + k]; + + near -= s->buffers[side][i*bwidth + nearCol*depth + k]; + near += s->buffers[side][i*bwidth + j*depth + k]; + } + + if(abs(near - far) > winLen*depth*9){ + buff[i] = j; + break; + } + } + } + break; + + case MODE_LINEART: + case MODE_HALFTONE: + for(i=0; ibuffers[side][i*bwidth + firstCol/8] >> (7-(firstCol%8)) & 1; + + /* move */ + for(j=firstCol+direction; j!=lastCol; j+=direction){ + if((s->buffers[side][i*bwidth + j/8] >> (7-(j%8)) & 1) != near){ + buff[i] = j; + break; + } + } + } + break; - if(ret != SANE_STATUS_GOOD && ret != SANE_STATUS_EOF){ - DBG(5,"do_scsi_cmd: return '%s'\n",sane_strstatus(ret)); - return ret; } - if (inBuff && inLen){ - if(ret == SANE_STATUS_EOF){ - DBG(25, "in: short read, remainder %lu bytes\n", (u_long)s->rs_info); - *inLen -= s->rs_info; + /* blast any stragglers with no neighbors within .5 inch */ + for(i=0;ii.dpi_x/2) + sum++; } - hexdump(30, "in: <<", inBuff, *inLen); - DBG(25, "in: read %d bytes\n", (int)*inLen); + if(sum < 2) + buff[i] = lastCol; } - DBG(10, "do_scsi_cmd: finish\n"); + DBG (10, "getTransitionsX: finish\n"); - return ret; + return buff; } -static SANE_Status -do_usb_cmd(struct scanner *s, int runRS, int shortTime, - unsigned char * cmdBuff, size_t cmdLen, - unsigned char * outBuff, size_t outLen, - unsigned char * inBuff, size_t * inLen -) +/* Loop thru a getTransitions array, and use a simplified Hough transform + * to divide likely edges into a 2-d array of bins. Then weight each + * bin based on its angle and offset. Return the 'best' bin. */ +SANE_Status +getLine (int height, int width, int * buff, + int slopes, double minSlope, double maxSlope, + int offsets, int minOffset, int maxOffset, + double * finSlope, int * finOffset, int * finDensity) { - size_t cmdOffset; - size_t cmdLength; - size_t cmdActual; - unsigned char * cmdBuffer; - int cmdTimeout; - - size_t outOffset; - size_t outLength; - size_t outActual; - unsigned char * outBuffer; - int outTimeout; - - size_t inOffset; - size_t inLength; - size_t inActual; - unsigned char * inBuffer; - int inTimeout; - - size_t statOffset; - size_t statLength; - size_t statActual; - unsigned char * statBuffer; - int statTimeout; + SANE_Status ret = 0; - int ret = 0; - int ret2 = 0; + int ** lines = NULL; + int i, j; + int rise, run; + double slope; + int offset; + int sIndex, oIndex; + int hWidth = width/2; - DBG (10, "do_usb_cmd: start\n"); + double * slopeCenter = NULL; + int * slopeScale = NULL; + double * offsetCenter = NULL; + int * offsetScale = NULL; - /****************************************************************/ - /* the command stage */ - { - cmdOffset = USB_HEADER_LEN; - cmdLength = cmdOffset+USB_COMMAND_LEN; - cmdActual = cmdLength; - cmdTimeout = USB_COMMAND_TIME; + int maxDensity = 1; + double absMaxSlope = fabs(maxSlope); + double absMinSlope = fabs(minSlope); + int absMaxOffset = abs(maxOffset); + int absMinOffset = abs(minOffset); - /* change timeout */ - if(shortTime) - cmdTimeout/=60; - sanei_usb_set_timeout(cmdTimeout); + DBG(10,"getLine: start %+0.4f %+0.4f %d %d\n", + minSlope,maxSlope,minOffset,maxOffset); - /* build buffer */ - cmdBuffer = calloc(cmdLength,1); - if(!cmdBuffer){ - DBG(5,"cmd: no mem\n"); - return SANE_STATUS_NO_MEM; - } - - /* build a USB packet around the SCSI command */ - cmdBuffer[3] = cmdLength-4; - cmdBuffer[5] = 1; - cmdBuffer[6] = 0x90; - memcpy(cmdBuffer+cmdOffset,cmdBuff,cmdLen); - - /* write the command out */ - DBG(25, "cmd: writing %d bytes, timeout %d\n", (int)cmdLength, cmdTimeout); - hexdump(30, "cmd: >>", cmdBuffer, cmdLength); - ret = sanei_usb_write_bulk(s->fd, cmdBuffer, &cmdActual); - DBG(25, "cmd: wrote %d bytes, retVal %d\n", (int)cmdActual, ret); - - if(cmdLength != cmdActual){ - DBG(5,"cmd: wrong size %d/%d\n", (int)cmdLength, (int)cmdActual); - free(cmdBuffer); - return SANE_STATUS_IO_ERROR; - } - if(ret != SANE_STATUS_GOOD){ - DBG(5,"cmd: write error '%s'\n",sane_strstatus(ret)); - free(cmdBuffer); - return ret; - } - free(cmdBuffer); - } + /*silence compiler*/ + height = height; - /****************************************************************/ - /* the output stage */ - if(outBuff && outLen){ + if(absMaxSlope < absMinSlope) + absMaxSlope = absMinSlope; - outOffset = USB_HEADER_LEN; - outLength = outOffset+outLen; - outActual = outLength; - outTimeout = USB_DATA_TIME; + if(absMaxOffset < absMinOffset) + absMaxOffset = absMinOffset; - /* change timeout */ - if(shortTime) - outTimeout/=60; - sanei_usb_set_timeout(outTimeout); + /* build an array of pretty-print values for slope */ + slopeCenter = calloc(slopes,sizeof(double)); + if(!slopeCenter){ + DBG(5,"getLine: cant load slopeCenter\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } - /* build outBuffer */ - outBuffer = calloc(outLength,1); - if(!outBuffer){ - DBG(5,"out: no mem\n"); - return SANE_STATUS_NO_MEM; - } - - /* build a USB packet around the SCSI command */ - outBuffer[3] = outLength-4; - outBuffer[5] = 2; - outBuffer[6] = 0xb0; - memcpy(outBuffer+outOffset,outBuff,outLen); - - /* write the command out */ - DBG(25, "out: writing %d bytes, timeout %d\n", (int)outLength, outTimeout); - hexdump(30, "out: >>", outBuffer, outLength); - ret = sanei_usb_write_bulk(s->fd, outBuffer, &outActual); - DBG(25, "out: wrote %d bytes, retVal %d\n", (int)outActual, ret); - - if(outLength != outActual){ - DBG(5,"out: wrong size %d/%d\n", (int)outLength, (int)outActual); - free(outBuffer); - return SANE_STATUS_IO_ERROR; - } - if(ret != SANE_STATUS_GOOD){ - DBG(5,"out: write error '%s'\n",sane_strstatus(ret)); - free(outBuffer); - return ret; - } - free(outBuffer); - } + /* build an array of scaling factors for slope */ + slopeScale = calloc(slopes,sizeof(int)); + if(!slopeScale){ + DBG(5,"getLine: cant load slopeScale\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } - /****************************************************************/ - /* the input stage */ - if(inBuff && inLen){ + for(j=0;jpadded_read) - inOffset = USB_HEADER_LEN; + /* find central value of this 'bucket' */ + slopeCenter[j] = ( + (double)j*(maxSlope-minSlope)/slopes+minSlope + + (double)(j+1)*(maxSlope-minSlope)/slopes+minSlope + )/2; - inLength = inOffset+*inLen; - inActual = inLength; + /* scale value from the requested range into an inverted 100-1 range + * input close to 0 makes output close to 100 */ + slopeScale[j] = 101 - fabs(slopeCenter[j])*100/absMaxSlope; + } - /*blast caller's copy in case we error out*/ - *inLen = 0; + /* build an array of pretty-print values for offset */ + offsetCenter = calloc(offsets,sizeof(double)); + if(!offsetCenter){ + DBG(5,"getLine: cant load offsetCenter\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } - inTimeout = USB_DATA_TIME; + /* build an array of scaling factors for offset */ + offsetScale = calloc(offsets,sizeof(int)); + if(!offsetScale){ + DBG(5,"getLine: cant load offsetScale\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } - /* change timeout */ - if(shortTime) - inTimeout/=60; - sanei_usb_set_timeout(inTimeout); + for(j=0;jfd, inBuffer, &inActual); - DBG(25, "in: read %d bytes, retval %d\n", (int)inActual, ret); - hexdump(30, "in: <<", inBuffer, inActual); + /* find central value of this 'bucket'*/ + offsetCenter[j] = ( + (double)j/offsets*(maxOffset-minOffset)+minOffset + + (double)(j+1)/offsets*(maxOffset-minOffset)+minOffset + )/2; - if(!inActual){ - DBG(5,"in: got no data, clearing\n"); - free(inBuffer); - return do_usb_clear(s,1,runRS); - } - if(inActual < inOffset){ - DBG(5,"in: read shorter than inOffset\n"); - free(inBuffer); - return SANE_STATUS_IO_ERROR; - } - if(ret != SANE_STATUS_GOOD){ - DBG(5,"in: return error '%s'\n",sane_strstatus(ret)); - free(inBuffer); - return ret; - } + /* scale value from the requested range into an inverted 100-1 range + * input close to 0 makes output close to 100 */ + offsetScale[j] = 101 - fabs(offsetCenter[j])*100/absMaxOffset; + } - /* note that inBuffer is not copied and freed here...*/ + /* build 2-d array of 'density', divided into slope and offset ranges */ + lines = calloc(slopes, sizeof(int *)); + if(!lines){ + DBG(5,"getLine: cant load lines\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + for(i=0;ipadded_read) - statOffset = USB_HEADER_LEN; + for(i=0;i= maxSlope || slope < minSlope) + continue; - /* build statBuffer */ - statBuffer = calloc(statLength,1); - if(!statBuffer){ - DBG(5,"stat: no mem\n"); - if(inBuffer) free(inBuffer); - return SANE_STATUS_NO_MEM; - } - - DBG(25, "stat: reading %d bytes, timeout %d\n", (int)statLength, statTimeout); - ret2 = sanei_usb_read_bulk(s->fd, statBuffer, &statActual); - DBG(25, "stat: read %d bytes, retval %d\n", (int)statActual, ret2); - hexdump(30, "stat: <<", statBuffer, statActual); - - /*weird status*/ - if(ret2 != SANE_STATUS_GOOD){ - DBG(5,"stat: clearing error '%s'\n",sane_strstatus(ret2)); - ret2 = do_usb_clear(s,1,runRS); - } - /*short read*/ - else if(statLength != statActual){ - DBG(5,"stat: clearing short %d/%d\n",(int)statLength,(int)statActual); - ret2 = do_usb_clear(s,1,runRS); - } - /*inspect the last byte of the status response*/ - else if(statBuffer[statLength-1]){ - DBG(5,"stat: status %d\n",statBuffer[statLength-1]); - ret2 = do_usb_clear(s,0,runRS); - } - free(statBuffer); + /* offset in center of width, not y intercept! */ + offset = slope * hWidth + buff[i] - slope * i; + if(offset >= maxOffset || offset < minOffset) + continue; - /* if status said EOF, adjust input with remainder count */ - if(ret2 == SANE_STATUS_EOF && inBuffer){ + sIndex = (slope - minSlope) * slopes/(maxSlope-minSlope); + if(sIndex >= slopes) + continue; - /* EOF is ok */ - ret2 = SANE_STATUS_GOOD; + oIndex = (offset - minOffset) * offsets/(maxOffset-minOffset); + if(oIndex >= offsets) + continue; - if(inActual < inLength - s->rs_info){ - DBG(5,"in: shorter read than RS, ignoring: %d < %d-%d\n", - (int)inActual,(int)inLength,(int)s->rs_info); - } - else if(s->rs_info){ - DBG(5,"in: longer read than RS, updating: %d to %d-%d\n", - (int)inActual,(int)inLength,(int)s->rs_info); - inActual = inLength - s->rs_info; - } + lines[sIndex][oIndex]++; } + } - /* bail out on bad RS status */ - if(ret2){ - if(inBuffer) free(inBuffer); - DBG(5,"stat: bad RS status, %d\n", ret2); - return ret2; + /* go thru array, and find most dense line (highest number) */ + for(i=0;i maxDensity) + maxDensity = lines[i][j]; } + } + + DBG(15,"getLine: maxDensity %d\n",maxDensity); - /* now that we have read status, deal with input buffer */ - if(inBuffer){ - if(inLength != inActual){ - ret = SANE_STATUS_EOF; - DBG(5,"in: short read, %d/%d\n", (int)inLength,(int)inActual); + *finSlope = 0; + *finOffset = 0; + *finDensity = 0; + + /* go thru array, and scale densities to % of maximum, plus adjust for + * prefered (smaller absolute value) slope and offset */ + for(i=0;i *finDensity){ + *finDensity = lines[i][j]; + *finSlope = slopeCenter[i]; + *finOffset = offsetCenter[j]; } + } + } - /* ignore the USB packet around the SCSI command */ - *inLen = inActual - inOffset; - memcpy(inBuff,inBuffer+inOffset,*inLen); + if(0){ + DBG(15,"offsetCenter: "); + for(j=0;jfd); - if(ret != SANE_STATUS_GOOD){ - DBG(5,"do_usb_clear: cant clear halt, returning %d\n", ret); - return ret; + DBG(15,"\n"); + + for(i=0;i>\n"); - ret2 = do_cmd( - s,0,0, - rs_cmd, rs_cmdLen, - NULL,0, - rs_in, &rs_inLen - ); - DBG(25,"rs sub call <<\n"); + int slopes = 11; + int offsets = 11; + double maxSlope = 1; + double minSlope = -1; + int maxOffset = resolution/6; + int minOffset = -resolution/6; + + double topSlope = 0; + int topOffset = 0; + int topDensity = 0; - if(ret2 == SANE_STATUS_EOF){ - DBG(5,"rs: got EOF, returning IO_ERROR\n"); - return SANE_STATUS_IO_ERROR; + int i,j; + int pass = 0; + + DBG(10,"getEdgeIterate: start\n"); + + while(pass++ < 7){ + double sStep = (maxSlope-minSlope)/slopes; + int oStep = (maxOffset-minOffset)/offsets; + + double slope = 0; + int offset = 0; + int density = 0; + int go = 0; + + topSlope = 0; + topOffset = 0; + topDensity = 0; + + /* find lines 4 times with slightly moved params, + * to bypass binning errors, highest density wins */ + for(i=0;i<2;i++){ + double sStep2 = sStep*i/2; + for(j=0;j<2;j++){ + int oStep2 = oStep*j/2; + ret = getLine(height,width,buff,slopes,minSlope+sStep2,maxSlope+sStep2,offsets,minOffset+oStep2,maxOffset+oStep2,&slope,&offset,&density); + if(ret){ + DBG(5,"getEdgeIterate: getLine error %d\n",ret); + return ret; } - if(ret2 != SANE_STATUS_GOOD){ - DBG(5,"rs: return error '%s'\n",sane_strstatus(ret2)); - return ret2; + DBG(15,"getEdgeIterate: %d %d %+0.4f %d %d\n",i,j,slope,offset,density); + + if(density > topDensity){ + topSlope = slope; + topOffset = offset; + topDensity = density; } + } + } - /* parse the rs data */ - ret2 = sense_handler( 0, rs_in, (void *)s ); + DBG(15,"getEdgeIterate: ok %+0.4f %d %d\n",topSlope,topOffset,topDensity); - DBG (10, "do_usb_clear: finish after RS\n"); - return ret2; + /* did not find anything promising on first pass, + * give up instead of fixating on some small, pointless feature */ + if(pass == 1 && topDensity < width/5){ + DBG(5,"getEdgeIterate: density too small %d %d\n",topDensity,width); + topOffset = 0; + topSlope = 0; + break; } - DBG (10, "do_usb_clear: finish with io error\n"); + /* if slope can zoom in some more, do so. */ + if(sStep >= 0.0001){ + minSlope = topSlope - sStep; + maxSlope = topSlope + sStep; + go = 1; + } + + /* if offset can zoom in some more, do so. */ + if(oStep){ + minOffset = topOffset - oStep; + maxOffset = topOffset + oStep; + go = 1; + } - return SANE_STATUS_IO_ERROR; + /* cannot zoom in more, bail out */ + if(!go){ + break; + } + + DBG(15,"getEdgeIterate: zoom: %+0.4f %+0.4f %d %d\n", + minSlope,maxSlope,minOffset,maxOffset); + } + + /* topOffset is in the center of the image, + * convert to x and y intercept */ + if(topSlope != 0){ + *finYInter = topOffset - topSlope * width/2; + *finXInter = *finYInter / -topSlope; + *finSlope = topSlope; + } + else{ + *finYInter = 0; + *finXInter = 0; + *finSlope = 0; + } + + DBG(10,"getEdgeIterate: finish\n"); + + return 0; } -static SANE_Status -wait_scanner(struct scanner *s) +/* find the left side of paper by moving a line + * perpendicular to top slope across the image + * the 'left-most' point on the paper is the + * one with the smallest X intercept + * return x and y intercepts */ +SANE_Status +getEdgeSlope (int width, int height, int * top, int * bot, + double slope, int * finXInter, int * finYInter) { - SANE_Status ret = SANE_STATUS_GOOD; - unsigned char cmd[TEST_UNIT_READY_len]; - size_t cmdLen = TEST_UNIT_READY_len; + int i; + int topXInter, topYInter; + int botXInter, botYInter; + int leftCount; - DBG (10, "wait_scanner: start\n"); + DBG(10,"getEdgeSlope: start\n"); - memset(cmd,0,cmdLen); - set_SCSI_opcode(cmd,TEST_UNIT_READY_code); + topXInter = width; + topYInter = 0; + leftCount = 0; - ret = do_cmd ( - s, 0, 1, - cmd, cmdLen, - NULL, 0, - NULL, NULL - ); - - ret = do_cmd ( - s, 0, 1, - cmd, cmdLen, - NULL, 0, - NULL, NULL - ); - - if (ret != SANE_STATUS_GOOD) { - DBG(5,"WARNING: Brain-dead scanner. Hitting with stick\n"); - ret = do_cmd ( - s, 0, 1, - cmd, cmdLen, - NULL, 0, - NULL, NULL - ); - } - if (ret != SANE_STATUS_GOOD) { - DBG(5,"WARNING: Brain-dead scanner. Hitting with stick again\n"); - ret = do_cmd ( - s, 0, 1, - cmd, cmdLen, - NULL, 0, - NULL, NULL - ); - } + for(i=0;i txi){ + topXInter = txi; + topYInter = tyi; + } + + leftCount++; + if(leftCount > 5){ + break; + } + } + else{ + topXInter = width; + topYInter = 0; + leftCount = 0; + } } - DBG (10, "wait_scanner: finish\n"); + botXInter = width; + botYInter = 0; + leftCount = 0; - return ret; -} + for(i=0;i -1){ -/* s->page_width stores the user setting - * for the paper width in adf. sometimes, - * we need a value that differs from this - * due to using FB or overscan. - */ -static int -get_page_width(struct scanner *s) -{ - int width = s->page_width; + int byi = bot[i] - (slope * i); + int bxi = byi/-slope; - /* scanner max for fb */ - if(s->source == SOURCE_FLATBED){ - return s->max_x_fb; + if(botXInter > bxi){ + botXInter = bxi; + botYInter = byi; + } + + leftCount++; + if(leftCount > 5){ + break; + } + } + else{ + botXInter = width; + botYInter = 0; + leftCount = 0; + } } - /* cant overscan larger than scanner max */ - if(width > s->max_x){ - return s->max_x; + if(botXInter < topXInter){ + *finXInter = botXInter; + *finYInter = botYInter; + } + else{ + *finXInter = topXInter; + *finYInter = topYInter; } - /* overscan adds a margin to both sides */ - return width; + DBG(10,"getEdgeSlope: finish\n"); + + return 0; } -/* s->page_height stores the user setting - * for the paper height in adf. sometimes, - * we need a value that differs from this - * due to using FB or overscan. - */ -static int -get_page_height(struct scanner *s) +/* function to do a simple rotation by a given slope, around + * a given point. The point can be outside of image to get + * proper edge alignment. Unused areas filled with bg color + * FIXME: Do in-place rotation to save memory */ +SANE_Status +rotateOnCenter (struct scanner *s, int side, + int centerX, int centerY, double slope) { - int height = s->page_height; - - /* scanner max for fb */ - if(s->source == SOURCE_FLATBED){ - return s->max_y_fb; + double slopeRad = -atan(slope); + double slopeSin = sin(slopeRad); + double slopeCos = cos(slopeRad); + + int bwidth = s->i.Bpl; + int pwidth = s->i.width; + int height = s->i.height; + int depth = 1; + int bg_color = s->lut[s->bg_color]; + + unsigned char * outbuf; + int i, j, k; + + DBG(10,"rotateOnCenter: start: %d %d\n",centerX,centerY); + + outbuf = malloc(s->i.bytes_tot[side]); + if(!outbuf){ + DBG(15,"rotateOnCenter: no outbuf\n"); + return SANE_STATUS_NO_MEM; } - /* cant overscan larger than scanner max */ - if(height > s->max_y){ - return s->max_y; - } + switch (s->i.mode){ - /* overscan adds a margin to both sides */ - return height; -} + case MODE_COLOR: + depth = 3; + case MODE_GRAYSCALE: + memset(outbuf,bg_color,s->i.bytes_tot[side]); -/** - * Convenience method to determine longest string size in a list. - */ -static size_t -maxStringSize (const SANE_String_Const strings[]) -{ - size_t size, max_size = 0; - int i; + for (i=0; i= pwidth) + continue; + + sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); + if (sourceY < 0 || sourceY >= height) + continue; + + for (k=0; kbuffers[side][sourceY*bwidth+sourceX*depth+k]; + } + } + } + break; - for (i = 0; strings[i]; ++i) { - size = strlen (strings[i]) + 1; - if (size > max_size) - max_size = size; + case MODE_LINEART: + case MODE_HALFTONE: + memset(outbuf,(bg_colorthreshold)?0xff:0x00,s->i.bytes_tot[side]); + + for (i=0; i= pwidth) + continue; + + sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); + if (sourceY < 0 || sourceY >= height) + continue; + + /* wipe out old bit */ + outbuf[i*bwidth + j/8] &= ~(1 << (7-(j%8))); + + /* fill in new bit */ + outbuf[i*bwidth + j/8] |= + ((s->buffers[side][sourceY*bwidth + sourceX/8] + >> (7-(sourceX%8))) & 1) << (7-(j%8)); + } + } + break; } - return max_size; + memcpy(s->buffers[side],outbuf,s->i.bytes_tot[side]); + + free(outbuf); + + DBG(10,"rotateOnCenter: finish\n"); + + return 0; } -/* - * Prints a hex dump of the given buffer onto the debug output stream. - */ -static void -hexdump (int level, char *comment, unsigned char *p, int l) -{ - int i; - char line[70]; /* 'xxx: xx xx ... xx xx abc */ - char *hex = line+4; - char *bin = line+53; +/* Function to build a lookup table (LUT), often + used by scanners to implement brightness/contrast/gamma + or by backends to speed binarization/thresholding - if(DBG_LEVEL < level) - return; + offset and slope inputs are -127 to +127 - line[0] = 0; + slope rotates line around central input/output val, + 0 makes horizontal line - DBG (level, "%s\n", comment); + pos zero neg + . x . . x + . x . . x + out . x .xxxxxxxxxxx . x + . x . . x + ....x....... ............ .......x.... + in in in - for (i = 0; i < l; i++, p++) { + offset moves line vertically, and clamps to output range + 0 keeps the line crossing the center of the table - /* at start of line */ - if ((i % 16) == 0) { + pos zero neg + . xxxxxxxx . xx . + . x . x . + out x . x . x + . . x . x + ............ xx.......... xxxxxxxx.... + in in - /* not at start of first line, print current, reset */ - if (i) { - DBG (level, "%s\n", line); - } + out_min/max provide bounds on output values, + useful when building thresholding lut. + 0 and 255 are good defaults otherwise. + */ +static SANE_Status +load_lut (unsigned char * lut, + int in_bits, int out_bits, + int out_min, int out_max, + int slope, int offset) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i, j; + double shift, rise; + int max_in_val = (1 << in_bits) - 1; + int max_out_val = (1 << out_bits) - 1; + unsigned char * lut_p = lut; - memset(line,0x20,69); - line[69] = 0; - hex = line + 4; - bin = line + 53; + DBG (10, "load_lut: start %d %d\n", slope, offset); - sprintf (line, "%3.3x:", i); - } + /* slope is converted to rise per unit run: + * first [-127,127] to [-.999,.999] + * then to [-PI/4,PI/4] then [0,PI/2] + * then take the tangent (T.O.A) + * then multiply by the normal linear slope + * because the table may not be square, i.e. 1024x256*/ + rise = tan((double)slope/128 * M_PI_4 + M_PI_4) * max_out_val / max_in_val; - /* the hex section */ - sprintf (hex, " %2.2x", *p); - hex += 3; - *hex = ' '; + /* line must stay vertically centered, so figure + * out vertical offset at central input value */ + shift = (double)max_out_val/2 - (rise*max_in_val/2); - /* the char section */ - if(*p >= 0x20 && *p <= 0x7e){ - *bin=*p; + /* convert the user offset setting to scale of output + * first [-127,127] to [-1,1] + * then to [-max_out_val/2,max_out_val/2]*/ + shift += (double)offset / 127 * max_out_val / 2; + + for(i=0;i<=max_in_val;i++){ + j = rise*i + shift; + + if(jout_max){ + j=out_max; } - bin++; + + *lut_p=j; + lut_p++; } - /* print last (partial) line */ - DBG (level, "%s\n", line); -} + hexdump(5, "load_lut: ", lut, max_in_val+1); -/** - * An advanced method we don't support but have to define. - */ -SANE_Status -sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) -{ - DBG (10, "sane_set_io_mode\n"); - DBG (15, "%d %p\n", non_blocking, h); - return SANE_STATUS_UNSUPPORTED; + DBG (10, "load_lut: finish\n"); + return ret; } -/** - * An advanced method we don't support but have to define. - */ -SANE_Status -sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) -{ - DBG (10, "sane_get_select_fd\n"); - DBG (15, "%p %d\n", h, *fdp); - return SANE_STATUS_UNSUPPORTED; -} diff -Nru sane-backends-1.0.20/backend/canon_dr-cmd.h sane-backends-1.0.21/backend/canon_dr-cmd.h --- sane-backends-1.0.20/backend/canon_dr-cmd.h 2009-03-28 06:57:15.000000000 +1100 +++ sane-backends-1.0.21/backend/canon_dr-cmd.h 2010-04-05 23:18:03.000000000 +1000 @@ -206,6 +206,8 @@ #define SR_datatype_panel 0x84 #define SR_datatype_counters 0x8c #define SR_datatype_endorser 0x90 +#define SR_datatype_fineoffset 0x90 +#define SR_datatype_finegain 0x91 /* ==================================================================== */ /* READ */ @@ -213,6 +215,8 @@ #define READ_len 10 #define set_R_datatype_code(sb, val) sb[0x02] = val +#define set_R_xfer_uid(sb, val) sb[4] = val +#define set_R_xfer_lid(sb, val) sb[5] = val #define set_R_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3) /*image needs no macros?*/ @@ -223,6 +227,7 @@ #define R_PANEL_len 0x08 #define get_R_PANEL_start(in) getbitfield(in, 1, 7) #define get_R_PANEL_stop(in) getbitfield(in, 1, 6) +#define get_R_PANEL_butt3(in) getbitfield(in, 1, 2) #define get_R_PANEL_new_file(in) getbitfield(in+1, 1, 0) #define get_R_PANEL_count_only(in) getbitfield(in+1, 1, 1) #define get_R_PANEL_bypass_mode(in) getbitfield(in+1, 1, 2) @@ -235,6 +240,13 @@ /*endorser unread?*/ +/*fine gain*/ +#define R_FINE_uid_gray 0x07 +#define R_FINE_uid_red 0x0c +#define R_FINE_uid_green 0x0a +#define R_FINE_uid_blue 0x09 +#define R_FINE_uid_unknown 0x14 + /* ==================================================================== */ /* SEND */ #define SEND_code 0x2a @@ -307,18 +319,20 @@ #define SSM_PAGE_len 0x0e #define set_SSM_page_len(sb, val) sb[0x05] = val -/* for DF page */ +/* for DF (0x30) page */ #define set_SSM_DF_deskew_roll(sb, val) setbitfield(sb+7, 1, 5, val) #define set_SSM_DF_staple(sb, val) setbitfield(sb+7, 1, 4, val) #define set_SSM_DF_thick(sb, val) setbitfield(sb+7, 1, 2, val) #define set_SSM_DF_len(sb, val) setbitfield(sb+7, 1, 0, val) #define set_SSM_DF_textdir(sb, val) setbitfield(sb+9, 0xf, 0, val) -/* for BUFFER page */ -#define set_SSM_BUFF_duplex(sb, val) sb[0x06] = val -#define set_SSM_BUFF_async(sb, val) sb[0x0a] = val +/* for BUFFER (0x32) page */ +#define set_SSM_BUFF_duplex(sb, val) setbitfield(sb+6, 1, 1, val) +#define set_SSM_BUFF_unk(sb, val) sb[0x07] = val +#define set_SSM_BUFF_async(sb, val) setbitfield(sb+0x0a, 1, 6, val) +#define set_SSM_BUFF_ald(sb, val) setbitfield(sb+0x0a, 1, 5, val) -/* for DO page */ +/* for DO (0x36) page */ #define SSM_DO_none 0 #define SSM_DO_red 1 #define SSM_DO_green 2 @@ -345,6 +359,28 @@ /* the payload */ #define CC_pay_len 0x20 +#define set_CC_f_gain(sb, val) sb[0] = val +#define set_CC_unk1(sb, val) sb[1] = val +#define set_CC_f_offset(sb, val) sb[2] = val +#define set_CC_unk2(sb, val) sb[3] = val + +#define set_CC_exp_f_r1(sb, val) putnbyte(sb + 0x04, val, 2) +#define set_CC_exp_f_g1(sb, val) putnbyte(sb + 0x06, val, 2) +#define set_CC_exp_f_b1(sb, val) putnbyte(sb + 0x08, val, 2) +#define set_CC_exp_f_r2(sb, val) putnbyte(sb + 0x0a, val, 2) +#define set_CC_exp_f_g2(sb, val) putnbyte(sb + 0x0c, val, 2) +#define set_CC_exp_f_b2(sb, val) putnbyte(sb + 0x0e, val, 2) + +#define set_CC_b_gain(sb, val) sb[0x10] = val +#define set_CC_b_offset(sb, val) sb[0x12] = val + +#define set_CC_exp_b_r1(sb, val) putnbyte(sb + 0x14, val, 2) +#define set_CC_exp_b_g1(sb, val) putnbyte(sb + 0x16, val, 2) +#define set_CC_exp_b_b1(sb, val) putnbyte(sb + 0x18, val, 2) +#define set_CC_exp_b_r2(sb, val) putnbyte(sb + 0x1a, val, 2) +#define set_CC_exp_b_g2(sb, val) putnbyte(sb + 0x1c, val, 2) +#define set_CC_exp_b_b2(sb, val) putnbyte(sb + 0x1e, val, 2) + /* ==================================================================== */ /* window descriptor macros for SET_WINDOW and GET_WINDOW */ diff -Nru sane-backends-1.0.20/backend/canon_dr.conf.in sane-backends-1.0.21/backend/canon_dr.conf.in --- sane-backends-1.0.20/backend/canon_dr.conf.in 2009-04-08 06:29:09.000000000 +1000 +++ sane-backends-1.0.21/backend/canon_dr.conf.in 2010-04-05 23:18:03.000000000 +1000 @@ -111,3 +111,15 @@ # DR-7090C usb 0x1083 0x1620 +# DR-9050C +usb 0x1083 0x1622 + +# DR-7550C +usb 0x1083 0x1623 + +# DR-6050C +usb 0x1083 0x1624 + +# DR-6010C +usb 0x1083 0x1626 + diff -Nru sane-backends-1.0.20/backend/canon_dr.h sane-backends-1.0.21/backend/canon_dr.h --- sane-backends-1.0.20/backend/canon_dr.h 2009-04-08 06:29:38.000000000 +1000 +++ sane-backends-1.0.21/backend/canon_dr.h 2010-04-05 23:18:03.000000000 +1000 @@ -18,8 +18,7 @@ OPT_STANDARD_GROUP, OPT_SOURCE, /*fb/adf/front/back/duplex*/ OPT_MODE, /*mono/gray/color*/ - OPT_X_RES, /*a range or a list*/ - OPT_Y_RES, /*a range or a list*/ + OPT_RES, /*a range or a list*/ OPT_GEOMETRY_GROUP, OPT_TL_X, @@ -41,15 +40,20 @@ OPT_DF_THICKNESS, OPT_DF_LENGTH, OPT_ROLLERDESKEW, + OPT_SWDESKEW, + OPT_SWDESPECK, + OPT_SWCROP, OPT_STAPLEDETECT, OPT_DROPOUT_COLOR_F, OPT_DROPOUT_COLOR_B, OPT_BUFFERMODE, + OPT_SIDE, /*sensor group*/ OPT_SENSOR_GROUP, OPT_START, OPT_STOP, + OPT_BUTT3, OPT_NEWFILE, OPT_COUNTONLY, OPT_BYPASSMODE, @@ -59,6 +63,45 @@ NUM_OPTIONS }; +struct img_params +{ + int mode; /*color,lineart,etc*/ + int source; /*fb,adf front,adf duplex,etc*/ + + int dpi_x; /*these are in dpi */ + int dpi_y; + + int tl_x; /*these are in 1200dpi units */ + int tl_y; + int br_x; + int br_y; + int page_x; + int page_y; + + int width; /*these are in pixels*/ + int height; + + SANE_Frame format; /*SANE_FRAME_**/ + int bpp; /* 1,8,24 */ + int Bpl; /* in bytes */ + + int valid_width; /*some machines have black padding*/ + int valid_Bpl; + + /* done yet? */ + int eof[2]; + + /* how far we have read/written */ + int bytes_sent[2]; + + /* total to read/write */ + int bytes_tot[2]; + + /* dumb scanners send extra data */ + int skip_lines[2]; + +}; + struct scanner { /* --------------------------------------------------------------------- */ @@ -91,26 +134,12 @@ int min_x_res; int min_y_res; - int std_res_200; - int std_res_180; - int std_res_160; - int std_res_150; - int std_res_120; - int std_res_100; - int std_res_75; - int std_res_60; - int std_res_1200; - int std_res_800; - int std_res_600; - int std_res_480; - int std_res_400; - int std_res_320; - int std_res_300; - int std_res_240; - - /* max scan size in pixels comes from scanner in basic res units */ - int max_x_basic; - int max_y_basic; + int std_res_x[16]; + int std_res_y[16]; + + /* max scan size in pixels converted to 1200dpi units */ + int max_x; + int max_y; /*FIXME: 4 more unknown values here*/ int can_grayscale; @@ -126,14 +155,16 @@ int contrast_steps; /* the scan size in 1/1200th inches, NOT basic_units or sane units */ - int max_x; - int max_y; int min_x; int min_y; + int valid_x; int max_x_fb; int max_y_fb; - int can_color; /* actually might be in vpd, but which bit? */ + int can_color; /* actually might be in vpd, but which bit? */ + int need_ccal; /* scanner needs software to help with afe calibration */ + int need_fcal; /* scanner needs software to help with fine calibration */ + int need_fcal_buffer; /* software to apply calibration stored in scanner*/ int has_counter; int has_rif; @@ -153,11 +184,16 @@ int unknown_byte2; /* weird byte, required, meaning unknown */ int padded_read; /* some machines need extra 12 bytes on reads */ int fixed_width; /* some machines always scan full width */ + int even_Bpl; /* some machines require even bytes per line */ int gray_interlace[2]; /* different models interlace heads differently */ int color_interlace[2]; /* different models interlace colors differently */ int duplex_interlace; /* different models interlace sides differently */ int jpeg_interlace; /* different models interlace jpeg sides differently */ + int duplex_offset; /* number of lines of padding added to front (1/1200)*/ + + int sw_lut; /* no hardware brightness/contrast support */ + int bg_color; /* needed to fill in after rotation */ int reverse_by_mode[6]; /* mode specific */ @@ -182,10 +218,8 @@ SANE_String_Const mode_list[7]; SANE_String_Const source_list[5]; - SANE_Int x_res_list[17]; - SANE_Int y_res_list[17]; - SANE_Range x_res_range; - SANE_Range y_res_range; + SANE_Int res_list[17]; + SANE_Range res_range; /*geometry group*/ SANE_Range tl_x_range; @@ -203,6 +237,7 @@ /*advanced group*/ SANE_String_Const compress_list[3]; SANE_Range compress_arg_range; + SANE_Range swdespeck_range; SANE_String_Const do_color_list[8]; /*sensor group*/ @@ -211,20 +246,9 @@ /* --------------------------------------------------------------------- */ /* changeable vars to hold user input. modified by SANE_Options above */ - /*mode group*/ - int mode; /*color,lineart,etc*/ - int source; /*fb,adf front,adf duplex,etc*/ - int resolution_x; /* X resolution in dpi */ - int resolution_y; /* Y resolution in dpi */ - - /*geometry group*/ - /* The desired size of the scan, all in 1/1200 inch */ - int tl_x; - int tl_y; - int br_x; - int br_y; - int page_width; - int page_height; + /* the user's requested image params */ + /* exposed in standard and geometry option groups */ + struct img_params u; /*enhancement group*/ int brightness; @@ -241,21 +265,38 @@ int dropout_color_b; int buffermode; int rollerdeskew; + int swdeskew; + int swdespeck; + int swcrop; int stapledetect; /* --------------------------------------------------------------------- */ /* values which are derived from setting the options above */ /* the user never directly modifies these */ - /* this is defined in sane spec as a struct containing: - SANE_Frame format; - SANE_Bool last_frame; - SANE_Int lines; - SANE_Int depth; ( binary=1, gray=8, color=8 (!24) ) - SANE_Int pixels_per_line; - SANE_Int bytes_per_line; - */ - SANE_Parameters params; + /* the scanner image params (what we ask from scanner) */ + struct img_params s; + + /* the intermediate image params (like user, but possible higher depth) */ + struct img_params i; + + /* the brightness/contrast LUT for dumb scanners */ + unsigned char lut[256]; + + /* --------------------------------------------------------------------- */ + /* values which are set by calibration functions */ + int c_res; + int c_mode; + + int c_offset[2]; + int c_gain[2]; + int c_exposure[2][3]; + + int f_res; + int f_mode; + + unsigned char * f_offset[2]; + unsigned char * f_gain[2]; /* --------------------------------------------------------------------- */ /* values which are set by scanning functions to keep track of pages, etc */ @@ -267,19 +308,6 @@ int jpeg_stage; int jpeg_ff_offset; - /* scanner done yet? */ - int eof_rx[2]; - - /* total to read/write */ - int bytes_tot[2]; - - /* how far we have read */ - int bytes_rx[2]; - int lines_rx[2]; /*only used by 3091*/ - - /* how far we have written */ - int bytes_tx[2]; - unsigned char * buffers[2]; /* --------------------------------------------------------------------- */ @@ -292,6 +320,7 @@ int panel_start; int panel_stop; + int panel_butt3; int panel_new_file; int panel_count_only; int panel_bypass_mode; @@ -308,11 +337,37 @@ #define SIDE_FRONT 0 #define SIDE_BACK 1 +#define CHAN_RED 0 +#define CHAN_GREEN 1 +#define CHAN_BLUE 2 + #define SOURCE_FLATBED 0 #define SOURCE_ADF_FRONT 1 #define SOURCE_ADF_BACK 2 #define SOURCE_ADF_DUPLEX 3 +static const int dpi_list[] = { +60,75,100,120,150,160,180,200, +240,300,320,400,480,600,800,1200 +}; + +#define DPI_60 0 +#define DPI_75 1 +#define DPI_100 2 +#define DPI_120 3 +#define DPI_150 4 +#define DPI_160 5 +#define DPI_180 6 +#define DPI_200 7 +#define DPI_240 8 +#define DPI_300 9 +#define DPI_320 10 +#define DPI_400 11 +#define DPI_480 12 +#define DPI_600 13 +#define DPI_800 14 +#define DPI_1200 15 + #define COMP_NONE WD_cmp_NONE #define COMP_JPEG WD_cmp_JPEG @@ -341,6 +396,7 @@ #define GRAY_INTERLACE_NONE 0 #define GRAY_INTERLACE_2510 1 +#define GRAY_INTERLACE_gG 2 #define COLOR_INTERLACE_RGB 0 #define COLOR_INTERLACE_BGR 1 @@ -361,7 +417,6 @@ /* ------------------------------------------------------------------------- */ -#define MM_PER_INCH 25.4 #define MM_PER_UNIT_UNFIX SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0)) #define MM_PER_UNIT_FIX SANE_FIX(SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))) @@ -469,24 +524,60 @@ static int get_page_height (struct scanner *s); static SANE_Status set_window (struct scanner *s); +static SANE_Status update_params (struct scanner *s, int calib); +static SANE_Status update_i_params (struct scanner *s); +static SANE_Status clean_params (struct scanner *s); static SANE_Status read_panel(struct scanner *s, SANE_Int option); static SANE_Status send_panel(struct scanner *s); -static SANE_Status start_scan (struct scanner *s); +static SANE_Status start_scan (struct scanner *s, int type); -static SANE_Status cancel(struct scanner *s); +static SANE_Status check_for_cancel(struct scanner *s); -static SANE_Status read_from_scanner(struct scanner *s, int side); -static SANE_Status read_from_scanner_duplex(struct scanner *s); +static SANE_Status read_from_scanner(struct scanner *s, int side, int exact); +static SANE_Status read_from_scanner_duplex(struct scanner *s, int exact); static SANE_Status copy_simplex(struct scanner *s, unsigned char * buf, int len, int side); - static SANE_Status copy_duplex(struct scanner *s, unsigned char * buf, int len); +static SANE_Status copy_line(struct scanner *s, unsigned char * buf, int side); + +static SANE_Status buffer_despeck(struct scanner *s, int side); +static SANE_Status buffer_deskew(struct scanner *s, int side); +static SANE_Status buffer_crop(struct scanner *s, int side); + +int * getTransitionsY (struct scanner *s, int side, int top); +int * getTransitionsX (struct scanner *s, int side, int top); + +SANE_Status getEdgeIterate (int width, int height, int resolution, + int * buff, double * finSlope, int * finXInter, int * finYInter); + +SANE_Status getEdgeSlope (int width, int height, int * top, int * bot, + double slope, int * finXInter, int * finYInter); + +SANE_Status rotateOnCenter (struct scanner *s, int side, + int centerX, int centerY, double slope); + +SANE_Status getLine (int height, int width, int * buff, + int slopes, double minSlope, double maxSlope, + int offsets, int minOffset, int maxOffset, + double * finSlope, int * finOffset, int * finDensity); + +static SANE_Status load_lut (unsigned char * lut, int in_bits, int out_bits, + int out_min, int out_max, int slope, int offset); static SANE_Status read_from_buffer(struct scanner *s, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len, int side); -static SANE_Status setup_buffers (struct scanner *s); +static SANE_Status image_buffers (struct scanner *s, int setup); +static SANE_Status offset_buffers (struct scanner *s, int setup); +static SANE_Status gain_buffers (struct scanner *s, int setup); + +static SANE_Status calibrate_AFE(struct scanner *s); +static SANE_Status calibrate_fine(struct scanner *s); +static SANE_Status calibrate_fine_buffer(struct scanner *s); + +static SANE_Status write_AFE (struct scanner *s); +static SANE_Status calibration_scan (struct scanner *s, int); static void hexdump (int level, char *comment, unsigned char *p, int l); static void default_globals (void); diff -Nru sane-backends-1.0.20/backend/canon_pp.c sane-backends-1.0.21/backend/canon_pp.c --- sane-backends-1.0.20/backend/canon_pp.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/canon_pp.c 2009-06-09 13:03:35.000000000 +1000 @@ -40,7 +40,7 @@ ----- - canon_pp.c: $Revision: 1.16 $ + canon_pp.c: $Revision$ This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners @@ -61,7 +61,7 @@ #endif #ifndef VERSION -#define VERSION "$Revision: 1.16 $" +#define VERSION "$Revision$" #endif #include diff -Nru sane-backends-1.0.20/backend/canon_pp-dev.c sane-backends-1.0.21/backend/canon_pp-dev.c --- sane-backends-1.0.20/backend/canon_pp-dev.c 2004-01-12 09:24:06.000000000 +1100 +++ sane-backends-1.0.21/backend/canon_pp-dev.c 2009-06-09 13:03:35.000000000 +1000 @@ -43,7 +43,7 @@ This file is part of the canon_pp backend, supporting Canon CanoScan Parallel scanners and also distributed as part of the stand-alone driver. - canon_pp-dev.c: $Revision: 1.11 $ + canon_pp-dev.c: $Revision$ Misc constants for Canon CanoScan Parallel scanners and high-level scan functions. @@ -86,7 +86,7 @@ /* Definitions which only apply to SANE compiles */ #ifndef VERSION -#define VERSION "$Revision: 1.11 $" +#define VERSION "$Revision$" #endif #define DEBUG_DECLARE_ONLY diff -Nru sane-backends-1.0.20/backend/canon_pp-dev.h sane-backends-1.0.21/backend/canon_pp-dev.h --- sane-backends-1.0.20/backend/canon_pp-dev.h 2002-10-01 01:25:10.000000000 +1000 +++ sane-backends-1.0.21/backend/canon_pp-dev.h 2009-06-09 13:03:35.000000000 +1000 @@ -40,7 +40,7 @@ ----- - canon_pp-dev.h: $Revision: 1.7 $ + canon_pp-dev.h: $Revision$ This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners and also part of the stand-alone driver. diff -Nru sane-backends-1.0.20/backend/canon_pp.h sane-backends-1.0.21/backend/canon_pp.h --- sane-backends-1.0.20/backend/canon_pp.h 2004-01-12 09:24:06.000000000 +1100 +++ sane-backends-1.0.21/backend/canon_pp.h 2009-06-09 13:03:35.000000000 +1000 @@ -40,7 +40,7 @@ ----- - canon_pp.h: $Revision: 1.6 $ + canon_pp.h: $Revision$ This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners diff -Nru sane-backends-1.0.20/backend/canon_pp-io.c sane-backends-1.0.21/backend/canon_pp-io.c --- sane-backends-1.0.20/backend/canon_pp-io.c 2004-01-12 09:24:06.000000000 +1100 +++ sane-backends-1.0.21/backend/canon_pp-io.c 2009-06-09 13:03:35.000000000 +1000 @@ -43,7 +43,7 @@ This file is part of the canon_pp backend, supporting Canon CanoScan Parallel scanners and also distributed as part of the stand-alone driver. - canon_pp-io.c: $Revision: 1.9 $ + canon_pp-io.c: $Revision$ Low Level Function library for Canon CanoScan Parallel Scanners by Simon Krix @@ -76,7 +76,7 @@ /* Definitions which only apply to SANE compiles */ #ifndef VERSION -#define VERSION "$Revision: 1.9 $" +#define VERSION "$Revision$" #endif /* Fix problem with DBG macro definition having a - in the name */ diff -Nru sane-backends-1.0.20/backend/canon_pp-io.h sane-backends-1.0.21/backend/canon_pp-io.h --- sane-backends-1.0.20/backend/canon_pp-io.h 2002-09-16 23:42:37.000000000 +1000 +++ sane-backends-1.0.21/backend/canon_pp-io.h 2009-06-09 13:03:35.000000000 +1000 @@ -40,7 +40,7 @@ ----- - canon_pp-io.h: $Revision: 1.2 $ + canon_pp-io.h: $Revision$ This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners and also distributed as part of the stand-alone diff -Nru sane-backends-1.0.20/backend/canon-sane.c sane-backends-1.0.21/backend/canon-sane.c --- sane-backends-1.0.20/backend/canon-sane.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/canon-sane.c 2010-04-05 23:18:03.000000000 +1000 @@ -700,8 +700,8 @@ if (s->val[option].s) free (s->val[option].s); s->val[option].s = strdup (val); - if (!strcmp (val, SANE_I18N("Lineart")) - || !strcmp (val, SANE_I18N("Halftone"))) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) + || !strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) { /* For Lineart and Halftone: */ /* Enable "threshold" */ @@ -728,7 +728,7 @@ s->opt[OPT_CUSTOM_GAMMA].cap &= ~SANE_CAP_INACTIVE; if (s->val[OPT_CUSTOM_GAMMA].w) { - if (!strcmp (val, SANE_I18N("Color")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_COLOR) || !strcmp (val, SANE_I18N("Fine color"))) { s->opt[OPT_CUSTOM_GAMMA_BIND].cap &= ~SANE_CAP_INACTIVE; @@ -934,9 +934,9 @@ { const char *mode = s->val[OPT_MODE].s; - if (!strcmp (mode, SANE_I18N("Gray"))) + if (!strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY)) s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (!strcmp (mode, SANE_I18N("Color")) + else if (!strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) || !strcmp (mode, SANE_I18N("Fine color"))) { s->opt[OPT_CUSTOM_GAMMA_BIND].cap &= ~SANE_CAP_INACTIVE; @@ -1057,8 +1057,8 @@ } mode = s->val[OPT_MODE].s; - if (!strcmp (mode, SANE_I18N("Lineart")) - || !strcmp (mode, SANE_I18N("Halftone"))) + if (!strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) + || !strcmp (mode, SANE_VALUE_SCAN_MODE_HALFTONE)) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line / 8; @@ -1066,13 +1066,13 @@ s->params.pixels_per_line = s->params.bytes_per_line * 8; s->params.depth = 1; } - else if (!strcmp (mode, SANE_I18N("Gray"))) + else if (!strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY)) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; s->params.depth = 8; } - else if (!strcmp (mode, SANE_I18N("Color")) + else if (!strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) || !strcmp (mode, SANE_I18N("Fine color"))) { s->params.format = SANE_FRAME_RGB; @@ -1266,8 +1266,8 @@ if (s->hw->info.model != CS2700 && s->hw->info.model != FS2710) { - if (!strcmp (mode_str, SANE_I18N("Lineart")) - || !strcmp (mode_str, SANE_I18N("Halftone"))) + if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) + || !strcmp (mode_str, SANE_VALUE_SCAN_MODE_HALFTONE)) s->RIF = s->val[OPT_HNEGATIVE].w; else s->RIF = !s->val[OPT_HNEGATIVE].w; @@ -1299,22 +1299,22 @@ s->ShadowB = s->val[OPT_SHADOW_B].w; } - if (!strcmp (mode_str, SANE_I18N("Lineart"))) + if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART)) { mode = 4; s->image_composition = 0; } - else if (!strcmp (mode_str, SANE_I18N("Halftone"))) + else if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_HALFTONE)) { mode = 4; s->image_composition = 1; } - else if (!strcmp (mode_str, SANE_I18N("Gray"))) + else if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_GRAY)) { mode = 5; s->image_composition = 2; } - else if (!strcmp (mode_str, SANE_I18N("Color")) + else if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_COLOR) || !strcmp (mode_str, SANE_I18N("Fine color"))) { mode = 6; @@ -1395,7 +1395,7 @@ #if 0 wbuf[34] = (((600 < s->val[OPT_X_RESOLUTION].w) || (600 < s->val[OPT_Y_RESOLUTION].w)) - && (strcmp (s->val[OPT_MODE].s, SANE_I18N("Lineart")) != 0)) + && (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) != 0)) ? 12 : s->bpp; #endif wbuf[36] = 0; @@ -1620,7 +1620,7 @@ s->bytes_to_read = s->params.bytes_per_line * s->params.lines; mode_str = s->val[OPT_MODE].s; - if (!strcmp (mode_str, SANE_I18N("Lineart"))) + if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART)) { if (((600 < s->val[OPT_X_RESOLUTION].w) || (600 < s->val[OPT_Y_RESOLUTION].w))) @@ -1630,9 +1630,9 @@ } s->params.pixels_per_line = s->params.bytes_per_line * 8; } - else if (!strcmp (mode_str, SANE_I18N("Gray"))) + else if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_GRAY)) s->params.pixels_per_line = s->params.bytes_per_line; - else if (!strcmp (mode_str, SANE_I18N("Color")) + else if (!strcmp (mode_str, SANE_VALUE_SCAN_MODE_COLOR) || !strcmp (mode_str, SANE_I18N("Fine color"))) s->params.pixels_per_line = s->params.bytes_per_line / 3; else @@ -1737,7 +1737,7 @@ set up an intermediate buffer which is twice as large as buf, and then map this buffer to buf. */ - if (!strcmp (s->val[OPT_MODE].s, SANE_I18N("Color"))) + if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR)) { if (max_len > s->auxbuf_len) { /* extend buffer? */ @@ -2054,7 +2054,7 @@ secondimage = s->inbuffer; - if (!strcmp (s->val[OPT_MODE].s, SANE_I18N("Color"))) + if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR)) { maxpix = pixel_per_line / 2; for (pix = 0; (int) pix < maxpix; pix++) @@ -2067,7 +2067,7 @@ s->outbuffer[6 * pix + 5] = firstimage[3 * pix + 2]; } } - else if (!strcmp (s->val[OPT_MODE].s, SANE_I18N("Gray"))) + else if (!strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) { for (pix = 0; pix < pixel_per_line / 2; pix++) { diff -Nru sane-backends-1.0.20/backend/cardscan.c sane-backends-1.0.21/backend/cardscan.c --- sane-backends-1.0.20/backend/cardscan.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/cardscan.c 2010-04-05 23:18:03.000000000 +1000 @@ -1,6 +1,9 @@ /* sane - Scanner Access Now Easy. - This file is part of the SANE package. + This file is part of the SANE package, and implements a SANE backend + for various Corex Cardscan scanners. + + Copyright (C) 2007-2010 m. allan noah This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -53,10 +56,15 @@ Section 6 - misc functions Changes: - V 1.0.0, 2007-05-09, MAN (SANE v1.0.19) + v0, 2007-05-09, MAN (SANE v1.0.19) - initial release - V 1.0.1, 2008-02-14, MAN - - sanei_config_read has already cleaned string (#310597) + v1, 2008-02-14, MAN + - sanei_config_read has already cleaned string (#310597) + v2, 2010-02-10, MAN + - add lines_per_block config option + - add has_cal_buffer config option + - basic support for 600c + - clean #include lines ################################################## DATA FROM TRACE OF WINDOWS DRIVER: @@ -203,34 +211,20 @@ * @@ Section 1 - Init */ -#include "sane/config.h" +#include "../include/sane/config.h" + +#include /*memcpy...*/ +#include /*isspace*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#ifdef HAVE_LIBC_H -# include /* NeXTStep/OpenStep */ -#endif - -#include "sane/sanei_backend.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" -#include "sane/sanei_config.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" #include "cardscan.h" #define DEBUG 1 -#define BUILD 1 +#define BUILD 2 /* values for SANE_DEBUG_CARDSCAN env var: - errors 5 @@ -242,9 +236,12 @@ - useless noise 35 */ +int global_has_cal_buffer = 1; +int global_lines_per_block = 16; + /* ------------------------------------------------------------------------- */ -static const char string_Grayscale[] = "Gray"; -static const char string_Color[] = "Color"; +#define STRING_GRAYSCALE SANE_VALUE_SCAN_MODE_GRAY +#define STRING_COLOR SANE_VALUE_SCAN_MODE_COLOR /* * used by attach* and sane_get_devices @@ -329,7 +326,10 @@ local_only = local_only; /* get rid of compiler warning */ DBG (10, "sane_get_devices: start\n"); - + + global_has_cal_buffer = 1; + global_lines_per_block = 16; + fp = sanei_config_open (CONFIG_FILE); if (fp) { @@ -352,6 +352,44 @@ DBG (15, "sane_get_devices: looking for '%s'\n", lp); sanei_usb_attach_matching_devices(lp, attach_one); } + + else if (!strncmp(lp, "has_cal_buffer", 14) && isspace (lp[14])) { + + int buf; + lp += 14; + lp = sanei_config_skip_whitespace (lp); + buf = atoi (lp); + + if(buf){ + global_has_cal_buffer = 1; + } + else{ + global_has_cal_buffer = 0; + } + + DBG (15, "sane_get_devices: setting \"has_cal_buffer\" to %d\n", + global_has_cal_buffer); + } + + else if (!strncmp(lp, "lines_per_block", 15) && isspace (lp[15])) { + + int buf; + lp += 15; + lp = sanei_config_skip_whitespace (lp); + buf = atoi (lp); + + if(buf < 1 || buf > 32){ + DBG (15, + "sane_get_devices: \"lines_per_block\"=%d\n out of range", + buf + ); + continue; + } + + DBG (15, "sane_get_devices: \"lines_per_block\" is %d\n", buf); + global_lines_per_block = buf; + } + else{ DBG (5, "sane_get_devices: config line \"%s\" ignored.\n", lp); } @@ -444,6 +482,9 @@ if(pid == 0x0005){ s->product_name = "800c"; } + else if(pid == 0x0002){ + s->product_name = "600c"; + } else{ DBG (5, "Unknown product, using default settings\n"); s->product_name = "Unknown"; @@ -457,16 +498,27 @@ DBG (15, "attach_one: Found %s scanner %s at %s\n", s->vendor_name, s->product_name, s->device_name); - + + /*copy config file settings*/ + s->has_cal_buffer = global_has_cal_buffer; + s->lines_per_block = global_lines_per_block; + s->color_block_size = s->lines_per_block * PIXELS_PER_LINE * 3; + s->gray_block_size = s->lines_per_block * PIXELS_PER_LINE; + /* try to get calibration */ - DBG (15, "attach_one: scanner calibration\n"); - - ret = load_calibration(s); - if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot calibrate, incompatible?\n"); - free (s->device_name); - free (s); - return ret; + if(s->has_cal_buffer){ + DBG (15, "attach_one: scanner calibration\n"); + + ret = load_calibration(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot calibrate, incompatible?\n"); + free (s->device_name); + free (s); + return ret; + } + } + else{ + DBG (15, "attach_one: skipping calibration\n"); } /* set SANE option 'values' to good defaults */ @@ -722,8 +774,8 @@ /* scan mode */ else if(option==OPT_MODE){ i=0; - s->mode_list[i++]=string_Grayscale; - s->mode_list[i++]=string_Color; + s->mode_list[i++]=STRING_GRAYSCALE; + s->mode_list[i++]=STRING_COLOR; s->mode_list[i]=NULL; opt->name = SANE_NAME_SCAN_MODE; @@ -800,10 +852,10 @@ case OPT_MODE: if(s->mode == MODE_GRAYSCALE){ - strcpy (val, string_Grayscale); + strcpy (val, STRING_GRAYSCALE); } else if(s->mode == MODE_COLOR){ - strcpy (val, string_Color); + strcpy (val, STRING_COLOR); } return SANE_STATUS_GOOD; } @@ -845,7 +897,7 @@ /* Mode Group */ case OPT_MODE: - if (!strcmp (val, string_Grayscale)) { + if (!strcmp (val, STRING_GRAYSCALE)) { tmp = MODE_GRAYSCALE; } else{ @@ -1165,13 +1217,15 @@ SANE_Status ret=SANE_STATUS_GOOD; /*cmd len-le16 move lines ??? ??? ??? ???*/ unsigned char cmd[] = - {0x12, 0x06, 0x00, 0x01, 0x10, 0x60, 0x00, 0x18, 0x05}; - size_t bytes = HEADER_SIZE + GRAY_BLOCK_SIZE; + {0x12, 0x06, 0x00, 0x01, 0x01, 0x60, 0x00, 0x18, 0x05}; + size_t bytes = HEADER_SIZE + s->gray_block_size; unsigned char * buf; int i,j; DBG (10, "read_from_scanner_gray: start\n"); - + + cmd[4] = s->lines_per_block; + buf = malloc(bytes); if(!buf){ DBG(5, "read_from_scanner_gray: not enough mem for buffer: %lu\n", @@ -1191,15 +1245,15 @@ DBG(15, "read_from_scanner_gray: got GOOD\n"); if(!buf[1]){ - s->paperless_lines += LINES_PER_PASS; + s->paperless_lines += s->lines_per_block; } - s->bytes_rx = GRAY_BLOCK_SIZE; + s->bytes_rx = s->gray_block_size; - /*memcpy(s->buffer,buf+HEADER_SIZE,GRAY_BLOCK_SIZE);*/ + /*memcpy(s->buffer,buf+HEADER_SIZE,s->gray_block_size);*/ /* reorder the gray data into the struct's buffer */ - for(i=0;igray_block_size;i+=PIXELS_PER_LINE){ for(j=0;jcolor_block_size; unsigned char * buf; int i,j,k; DBG (10, "read_from_scanner_color: start\n"); + cmd[4] = s->lines_per_block; + buf = malloc(bytes); if(!buf){ DBG(5, "read_from_scanner_color: not enough mem for buffer: %lu\n", @@ -1254,15 +1310,15 @@ DBG(15, "read_from_scanner_color: got GOOD\n"); if(!buf[1]){ - s->paperless_lines += LINES_PER_PASS; + s->paperless_lines += s->lines_per_block; } - s->bytes_rx = COLOR_BLOCK_SIZE; + s->bytes_rx = s->color_block_size; - /*memcpy(s->buffer,buf+HEADER_SIZE,COLOR_BLOCK_SIZE);*/ + /*memcpy(s->buffer,buf+HEADER_SIZE,s->color_block_size);*/ /* reorder the color data into the struct's buffer */ - for(i=0;icolor_block_size;i+=PIXELS_PER_LINE*3){ for(j=0;j */ -#include "_stdint.h" +#include "../include/_stdint.h" #include "../include/sane/sane.h" #include "../include/sane/sanei.h" diff -Nru sane-backends-1.0.20/backend/coolscan3.c sane-backends-1.0.21/backend/coolscan3.c --- sane-backends-1.0.20/backend/coolscan3.c 2009-04-21 11:08:03.000000000 +1000 +++ sane-backends-1.0.21/backend/coolscan3.c 2010-04-05 23:18:03.000000000 +1000 @@ -30,18 +30,18 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include -#include -#include -#include -#include -#include -#include +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_debug.h" +#include "../include/sane/sanei_config.h" #define BACKEND_NAME coolscan3 -#include /* must be last */ +#include "../include/sane/sanei_backend.h" /* must be last */ #define CS3_VERSION_MAJOR 1 #define CS3_VERSION_MINOR 0 @@ -451,15 +451,18 @@ /*o.cap |= SANE_CAP_INACTIVE; */ break; -/* case CS3_OPTION_INFRARED: + case CS3_OPTION_INFRARED: o.name = "infrared"; o.title = "Read infrared channel"; o.desc = "Read infrared channel in addition to scan colors"; o.type = SANE_TYPE_BOOL; o.size = WSIZE; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; +#ifndef SANE_FRAME_RGBI + o.cap |= SANE_CAP_INACTIVE; +#endif break; -*/ + case CS3_OPTION_DEPTH: o.name = "depth"; o.title = "Bit depth per channel"; @@ -1396,15 +1399,16 @@ p->bytes_per_line = s->n_colors * s->logical_width * s->bytes_per_pixel; - if (s->infrared) { #ifdef SANE_FRAME_RGBI + if (s->infrared) { p->format = SANE_FRAME_RGBI; -#else - p->format = SANE_FRAME_RGB; -#endif + } else { +#endif p->format = SANE_FRAME_RGB; /* XXXXXXXX CCCCCCCCCC */ +#ifdef SANE_FRAME_RGBI } +#endif p->last_frame = SANE_TRUE; p->lines = s->logical_height; diff -Nru sane-backends-1.0.20/backend/coolscan.c sane-backends-1.0.21/backend/coolscan.c --- sane-backends-1.0.20/backend/coolscan.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/coolscan.c 2010-04-05 23:18:03.000000000 +1000 @@ -68,7 +68,7 @@ # include "lalloca.h" /* MUST come first for AIX! */ #endif -#include "sane/config.h" +#include "../include/sane/config.h" #include "lalloca.h" #include @@ -83,16 +83,16 @@ #include #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_debug.h" -#include "sane/sanei_thread.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_debug.h" +#include "../include/sane/sanei_thread.h" -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define COOLSCAN_CONFIG_FILE "coolscan.conf" -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "coolscan.h" #include "coolscan-scsidef.h" @@ -1872,7 +1872,6 @@ /* ------------------------------------------------------------------------- */ -#define MM_PER_INCH 25.4 /* ilu per mm */ #define length_quant SANE_UNFIX(SANE_FIX(MM_PER_INCH / 2700.0)) @@ -1891,8 +1890,8 @@ 0 }; -static const char colorStr[] = "Color"; -static const char grayStr[] = "Gray"; +static const char colorStr[] = SANE_VALUE_SCAN_MODE_COLOR; +static const char grayStr[] = SANE_VALUE_SCAN_MODE_GRAY; static const char rgbiStr[] = "RGBI"; static const char iredStr[] = "Infrared"; diff -Nru sane-backends-1.0.20/backend/dc210.c sane-backends-1.0.21/backend/dc210.c --- sane-backends-1.0.20/backend/dc210.c 2008-11-27 08:21:23.000000000 +1100 +++ sane-backends-1.0.21/backend/dc210.c 2010-04-05 23:18:03.000000000 +1000 @@ -57,7 +57,7 @@ ***************************************************************************/ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -65,15 +65,15 @@ #include #include #include -#include "sane/sanei_jpeg.h" +#include "../include/sane/sanei_jpeg.h" #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" #define BACKEND_NAME dc210 -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "dc210.h" diff -Nru sane-backends-1.0.20/backend/dc240.c sane-backends-1.0.21/backend/dc240.c --- sane-backends-1.0.20/backend/dc240.c 2008-11-27 08:21:24.000000000 +1100 +++ sane-backends-1.0.21/backend/dc240.c 2010-04-05 23:18:03.000000000 +1000 @@ -60,7 +60,7 @@ ***************************************************************************/ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -68,15 +68,15 @@ #include #include #include -#include "sane/sanei_jpeg.h" +#include "../include/sane/sanei_jpeg.h" #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" #define BACKEND_NAME dc240 -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "dc240.h" diff -Nru sane-backends-1.0.20/backend/dc25.c sane-backends-1.0.21/backend/dc25.c --- sane-backends-1.0.20/backend/dc25.c 2008-11-27 08:21:24.000000000 +1100 +++ sane-backends-1.0.21/backend/dc25.c 2010-04-05 23:18:03.000000000 +1000 @@ -3,7 +3,7 @@ dc25.c - $Id: dc25.c,v 1.18 2008-11-26 21:21:24 kitno-guest Exp $ + $Id$ This file (C) 1998 Peter Fales @@ -89,7 +89,7 @@ ***************************************************************************/ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -98,12 +98,12 @@ #include #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" #define BACKEND_NAME dc25 -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "dc25.h" @@ -1850,7 +1850,7 @@ fp = sanei_config_open (DC25_CONFIG_FILE); DBG (127, - "sane_init() $Id: dc25.c,v 1.18 2008-11-26 21:21:24 kitno-guest Exp $\n"); + "sane_init() $Id$\n"); if (!fp) { diff -Nru sane-backends-1.0.20/backend/dll.c sane-backends-1.0.21/backend/dll.c --- sane-backends-1.0.20/backend/dll.c 2009-02-06 01:36:36.000000000 +1100 +++ sane-backends-1.0.21/backend/dll.c 2010-04-05 23:18:03.000000000 +1000 @@ -57,7 +57,7 @@ #include #endif -#include "sane/config.h" +#include "../include/sane/config.h" #include "lalloca.h" #include @@ -98,11 +98,11 @@ #include #include -#include "sane/sane.h" -#include "sane/sanei.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" #define BACKEND_NAME dll -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX # define PATH_MAX 1024 @@ -119,7 +119,7 @@ #endif -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define DLL_CONFIG_FILE "dll.conf" #define DLL_ALIASES_FILE "dll.aliases" diff -Nru sane-backends-1.0.20/backend/dll.conf.in sane-backends-1.0.21/backend/dll.conf.in --- sane-backends-1.0.20/backend/dll.conf.in 2009-03-05 01:55:34.000000000 +1100 +++ sane-backends-1.0.21/backend/dll.conf.in 2010-04-05 23:18:03.000000000 +1000 @@ -38,6 +38,8 @@ hpljm1005 hs2p ibm +kodak +kvs1025 leo lexmark ma1509 @@ -50,6 +52,7 @@ mustek_usb2 nec niash +#p5 pie pint pixma diff -Nru sane-backends-1.0.20/backend/dmc.c sane-backends-1.0.21/backend/dmc.c --- sane-backends-1.0.20/backend/dmc.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/dmc.c 2010-04-05 23:18:03.000000000 +1000 @@ -44,29 +44,29 @@ This file implements a SANE backend for the Polaroid Digital Microscope Camera. */ -/* $Id: dmc.c,v 1.6 2009-02-26 03:15:39 cbagwell-guest Exp $ */ +/* $Id$ */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include "sane/sane.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" #define BACKEND_NAME dmc -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define DMC_CONFIG_FILE "dmc.conf" #include "dmc.h" diff -Nru sane-backends-1.0.20/backend/dmc.h sane-backends-1.0.21/backend/dmc.h --- sane-backends-1.0.20/backend/dmc.h 2003-09-13 02:10:33.000000000 +1000 +++ sane-backends-1.0.21/backend/dmc.h 2009-06-09 13:03:36.000000000 +1000 @@ -38,7 +38,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ -/* $Id: dmc.h,v 1.2 2003-09-12 16:10:33 hmg-guest Exp $ */ +/* $Id$ */ #ifndef polaroid_dmc_h #define polaroid_dmc_h diff -Nru sane-backends-1.0.20/backend/epjitsu.c sane-backends-1.0.21/backend/epjitsu.c --- sane-backends-1.0.20/backend/epjitsu.c 2009-01-25 12:29:25.000000000 +1100 +++ sane-backends-1.0.21/backend/epjitsu.c 2010-04-05 23:18:03.000000000 +1000 @@ -41,9 +41,10 @@ -------------------------------------------------------------------------- This file implements a SANE backend for the Fujitsu fi-60F, the - ScanSnap S300, and (hopefully) other Epson-based Fujitsu scanners. + ScanSnap S300/S1300, and (hopefully) other Epson-based scanners. - Copyright 2007-2008 by m. allan noah + Copyright 2007-2010 by m. allan noah + Copyright 2009 by Richard Goedeken Development funded by Microdea, Inc., TrueCheck, Inc. and Archivista, GmbH @@ -120,6 +121,11 @@ - change page length autodetection condition v18 2009-01-21, MAN - dont export private symbols + v19 2009-08-31, RG + - rewritten calibration routines + v20 2010-02-09, MAN + - cleanup #include lines & copyright + - add S1300 SANE FLOW DIAGRAM @@ -151,35 +157,28 @@ * @@ Section 1 - Init */ -#include "sane/config.h" +#include "../include/sane/config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#ifdef HAVE_LIBC_H -# include /* NeXTStep/OpenStep */ -#endif - -#include "sane/sanei_backend.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" -#include "sane/sanei_config.h" +#include /*memcpy...*/ +#include /*isspace*/ +#include /*tan*/ +#include /*usleep*/ +#include /*time*/ + +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" #include "epjitsu.h" #include "epjitsu-cmd.h" #define DEBUG 1 -#define BUILD 18 +#define BUILD 20 + +#ifndef MAX3 + #define MAX3(a,b,c) ((a) > (b) ? ((a) > (c) ? a : c) : ((b) > (c) ? b : c)) +#endif unsigned char global_firmware_filename[PATH_MAX]; @@ -193,15 +192,22 @@ - useless noise 35 */ +/* Calibration settings */ +#define COARSE_OFFSET_TARGET 15 +static int coarse_gain_min[3] = { 88, 88, 88 }; /* front, back, FI-60F 3rd plane */ +static int coarse_gain_max[3] = { 92, 92, 92 }; +static int fine_gain_target[3] = {185, 150, 170}; /* front, back, FI-60F is this ok? */ +static float white_factor[3] = {1.0, 0.93, 0.98}; /* Blue, Red, Green */ + /* ------------------------------------------------------------------------- */ -static const char string_Flatbed[] = "Flatbed"; -static const char string_ADFFront[] = "ADF Front"; -static const char string_ADFBack[] = "ADF Back"; -static const char string_ADFDuplex[] = "ADF Duplex"; - -static const char string_Lineart[] = "Lineart"; -static const char string_Grayscale[] = "Gray"; -static const char string_Color[] = "Color"; +#define STRING_FLATBED SANE_I18N("Flatbed") +#define STRING_ADFFRONT SANE_I18N("ADF Front") +#define STRING_ADFBACK SANE_I18N("ADF Back") +#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex") + +#define STRING_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define STRING_GRAYSCALE SANE_VALUE_SCAN_MODE_GRAY +#define STRING_COLOR SANE_VALUE_SCAN_MODE_COLOR /* * used by attach* and sane_get_devices @@ -452,10 +458,10 @@ DBG (15, "attach_one: Found %s scanner %s at %s\n", s->sane.vendor, s->sane.model, s->sane.name); - if (strstr (s->sane.model, "S300")){ + if (strstr (s->sane.model, "S300") || strstr (s->sane.model, "S1300")){ unsigned char stat; - DBG (15, "attach_one: Found S300\n"); + DBG (15, "attach_one: Found S300/S1300\n"); stat = get_stat(s); if(stat & 0x01){ @@ -936,12 +942,12 @@ else if(option==OPT_SOURCE){ i=0; if(s->has_fb){ - s->source_list[i++]=string_Flatbed; + s->source_list[i++]=STRING_FLATBED; } if(s->has_adf){ - s->source_list[i++]=string_ADFFront; - s->source_list[i++]=string_ADFBack; - s->source_list[i++]=string_ADFDuplex; + s->source_list[i++]=STRING_ADFFRONT; + s->source_list[i++]=STRING_ADFBACK; + s->source_list[i++]=STRING_ADFDUPLEX; } s->source_list[i]=NULL; @@ -960,9 +966,9 @@ /* scan mode */ else if(option==OPT_MODE){ i=0; - s->mode_list[i++]=string_Lineart; - s->mode_list[i++]=string_Grayscale; - s->mode_list[i++]=string_Color; + s->mode_list[i++]=STRING_LINEART; + s->mode_list[i++]=STRING_GRAYSCALE; + s->mode_list[i++]=STRING_COLOR; s->mode_list[i]=NULL; opt->name = SANE_NAME_SCAN_MODE; @@ -1387,16 +1393,16 @@ case OPT_SOURCE: if(s->source == SOURCE_FLATBED){ - strcpy (val, string_Flatbed); + strcpy (val, STRING_FLATBED); } else if(s->source == SOURCE_ADF_FRONT){ - strcpy (val, string_ADFFront); + strcpy (val, STRING_ADFFRONT); } else if(s->source == SOURCE_ADF_BACK){ - strcpy (val, string_ADFBack); + strcpy (val, STRING_ADFBACK); } else if(s->source == SOURCE_ADF_DUPLEX){ - strcpy (val, string_ADFDuplex); + strcpy (val, STRING_ADFDUPLEX); } else{ DBG(5,"missing option val for source\n"); @@ -1405,13 +1411,13 @@ case OPT_MODE: if(s->mode == MODE_LINEART){ - strcpy (val, string_Lineart); + strcpy (val, STRING_LINEART); } else if(s->mode == MODE_GRAYSCALE){ - strcpy (val, string_Grayscale); + strcpy (val, STRING_GRAYSCALE); } else if(s->mode == MODE_COLOR){ - strcpy (val, string_Color); + strcpy (val, STRING_COLOR); } return SANE_STATUS_GOOD; @@ -1527,13 +1533,13 @@ /* Mode Group */ case OPT_SOURCE: - if (!strcmp (val, string_ADFFront)) { + if (!strcmp (val, STRING_ADFFRONT)) { tmp = SOURCE_ADF_FRONT; } - else if (!strcmp (val, string_ADFBack)) { + else if (!strcmp (val, STRING_ADFBACK)) { tmp = SOURCE_ADF_BACK; } - else if (!strcmp (val, string_ADFDuplex)) { + else if (!strcmp (val, STRING_ADFDUPLEX)) { tmp = SOURCE_ADF_DUPLEX; } else{ @@ -1548,10 +1554,10 @@ return SANE_STATUS_GOOD; case OPT_MODE: - if (!strcmp (val, string_Lineart)) { + if (!strcmp (val, STRING_LINEART)) { tmp = MODE_LINEART; } - else if (!strcmp (val, string_Grayscale)) { + else if (!strcmp (val, STRING_GRAYSCALE)) { tmp = MODE_GRAYSCALE; } else{ @@ -1659,12 +1665,10 @@ static void update_transfer_totals(struct transfer * t) { - t->total_pix = t->width_pix * t->height; - t->total_bytes = t->width_bytes * t->height; - + if (t->image == NULL) return; + + t->total_bytes = t->line_stride * t->image->height; t->rx_bytes = 0; - t->tx_bytes = 0; - t->done = 0; } @@ -1681,14 +1685,16 @@ int max_y; int min_y; - int act_width; - int req_width; + int act_width; /* total data width output, in pixels per side (always 3 sides) */ + int req_width; /* stride in pixels per side between color planes (always 3 sides) */ int head_width; int pad_width; int block_height; int cal_width; + int cal_headwidth; + int cal_reqwidth; unsigned char * sw_coarsecal; unsigned char * sw_finecal; @@ -1703,67 +1709,67 @@ static struct model_res settings[] = { /*S300 AC*/ -/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw */ - { MODEL_S300, 150, 150, 0, 1296, 32, 2662, 32, 4256, 1480, 1296, 184, 41, 8512, +/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw cal_hedw cal_reqw */ + { MODEL_S300, 150, 150, 0, 1296, 32, 2662, 32, 4256, 1480, 1296, 184, 41, 8512, 2592, 2960, setWindowCoarseCal_S300_150, setWindowFineCal_S300_150, setWindowSendCal_S300_150, sendCal1Header_S300_150, sendCal2Header_S300_150, setWindowScan_S300_150 }, - { MODEL_S300, 225, 200, 0, 1944, 32, 3993, 32, 6144, 2100, 1944, 156, 28, 8192, + { MODEL_S300, 225, 200, 0, 1944, 32, 3993, 32, 6144, 2100, 1944, 156, 28, 8192, 2592, 2800, setWindowCoarseCal_S300_225, setWindowFineCal_S300_225, setWindowSendCal_S300_225, sendCal1Header_S300_225, sendCal2Header_S300_225, setWindowScan_S300_225 }, - { MODEL_S300, 300, 300, 0, 2592, 32, 5324, 32, 8192, 2800, 2592, 208, 21, 8192, + { MODEL_S300, 300, 300, 0, 2592, 32, 5324, 32, 8192, 2800, 2592, 208, 21, 8192, 2592, 2800, setWindowCoarseCal_S300_300, setWindowFineCal_S300_300, setWindowSendCal_S300_300, sendCal1Header_S300_300, sendCal2Header_S300_300, setWindowScan_S300_300 }, - { MODEL_S300, 600, 600, 0, 5184, 32, 10648, 32, 16064, 5440, 5184, 256, 10, 16064, + { MODEL_S300, 600, 600, 0, 5184, 32, 10648, 32, 16064, 5440, 5184, 256, 10, 16064, 5184, 5440, setWindowCoarseCal_S300_600, setWindowFineCal_S300_600, setWindowSendCal_S300_600, sendCal1Header_S300_600, sendCal2Header_S300_600, setWindowScan_S300_600 }, /*S300 USB*/ -/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw */ - { MODEL_S300, 150, 150, 1, 1296, 32, 2662, 32, 7216, 2960, 1296, 1664, 24, 14432, +/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw cal_hedw cal_reqw */ + { MODEL_S300, 150, 150, 1, 1296, 32, 2662, 32, 7216, 2960, 1296, 1664, 24, 14432, 2592, 5920, setWindowCoarseCal_S300_150_U, setWindowFineCal_S300_150_U, setWindowSendCal_S300_150_U, sendCal1Header_S300_150_U, sendCal2Header_S300_150_U, setWindowScan_S300_150_U }, - { MODEL_S300, 225, 200, 1, 1944, 32, 3993, 32, 10584, 4320, 1944, 2376, 16, 14112, + { MODEL_S300, 225, 200, 1, 1944, 32, 3993, 32, 10584, 4320, 1944, 2376, 16, 14112, 2592, 5760, setWindowCoarseCal_S300_225_U, setWindowFineCal_S300_225_U, setWindowSendCal_S300_225_U, sendCal1Header_S300_225_U, sendCal2Header_S300_225_U, setWindowScan_S300_225_U }, - { MODEL_S300, 300, 300, 1, 2592, 32, 5324, 32, 15872, 6640, 2592, 4048, 11, 15872, + { MODEL_S300, 300, 300, 1, 2592, 32, 5324, 32, 15872, 6640, 2592, 4048, 11, 15872, 2592, 6640, setWindowCoarseCal_S300_300_U, setWindowFineCal_S300_300_U, setWindowSendCal_S300_300_U, sendCal1Header_S300_300_U, sendCal2Header_S300_300_U, setWindowScan_S300_300_U }, - { MODEL_S300, 600, 600, 1, 5184, 32, 10648, 32, 16064, 5440, 5184, 256, 10, 16064, + { MODEL_S300, 600, 600, 1, 5184, 32, 10648, 32, 16064, 5440, 5184, 256, 10, 16064, 5184, 5440, setWindowCoarseCal_S300_600, setWindowFineCal_S300_600, setWindowSendCal_S300_600, sendCal1Header_S300_600, sendCal2Header_S300_600, setWindowScan_S300_600 }, /*fi-60F*/ -/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw */ - { MODEL_FI60F, 150, 150, 0, 600, 32, 875, 32, 1480, 1480, 216, 1114, 41, 1480, +/* model xres yres u mxx mnx mxy mny actw reqw hedw padw bh calw cal_hedw cal_reqw */ + { MODEL_FI60F, 150, 150, 0, 648, 32, 875, 32, 1480, 632, 216, 416, 41, 1480, 216, 632, setWindowCoarseCal_FI60F_150, setWindowFineCal_FI60F_150, setWindowSendCal_FI60F_150, sendCal1Header_FI60F_150, sendCal2Header_FI60F_150, setWindowScan_FI60F_150 }, - { MODEL_FI60F, 300, 300, 0, 1296, 32, 1749, 32, 2400, 2400, 432, 526, 72, 2400, + { MODEL_FI60F, 300, 300, 0, 1296, 32, 1749, 32, 2400, 958, 432, 526, 72, 2400, 432, 958, setWindowCoarseCal_FI60F_300, setWindowFineCal_FI60F_300, setWindowSendCal_FI60F_300, sendCal1Header_FI60F_300, sendCal2Header_FI60F_300, setWindowScan_FI60F_300 }, - { MODEL_FI60F, 600, 600, 0, 2592, 32, 3498, 32, 2848, 2848, 864, 114, 61, 2848, + { MODEL_FI60F, 600, 600, 0, 2592, 32, 3498, 32, 2848, 978, 864, 114, 61, 2848, 864, 978, setWindowCoarseCal_FI60F_600, setWindowFineCal_FI60F_600, setWindowSendCal_FI60F_600, sendCal1Header_FI60F_600, sendCal2Header_FI60F_600, setWindowScan_FI60F_600 }, - { MODEL_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + { MODEL_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL }, }; @@ -1776,6 +1782,7 @@ { SANE_Status ret = SANE_STATUS_GOOD; + int img_heads, img_pages, width; int i=0; DBG (10, "change_params: start\n"); @@ -1794,17 +1801,11 @@ s->max_y = settings[i].max_y * 1200/s->resolution_y; s->min_y = settings[i].min_y * 1200/s->resolution_y; - /*current dpi*/ - s->scan.width_pix = settings[i].act_width; - s->block.height = settings[i].block_height; - - s->req_width = settings[i].req_width; - s->head_width = settings[i].head_width; - s->pad_width = settings[i].pad_width; - - s->coarsecal.width_pix = settings[i].cal_width; - s->coarsecal.width_bytes = settings[i].cal_width*3; + s->page_width = s->max_x; + s->br_x = s->max_x; + s->br_y = s->max_y; + /*current dpi*/ s->setWindowCoarseCal = settings[i].sw_coarsecal; s->setWindowCoarseCalLen = SET_WINDOW_LEN; @@ -1827,56 +1828,82 @@ } i++; } while (settings[i].model); - - /*flatbed and adf in autodetect always ask for all*/ - if(s->source == SOURCE_FLATBED || !s->page_height){ - s->scan.height = s->max_y * s->resolution_y / 1200; - } - /* adf with specified paper size requires padding (~1/2in) */ - else{ - s->scan.height = (s->page_height+600) * s->resolution_y / 1200; + + if (!settings[i].model) + { + return SANE_STATUS_INVAL; } - /* FIXME: make these vals dynamic? */ - s->front.width_pix = s->max_x * s->resolution_x / 1200; - s->page_width = s->max_x; - s->br_x = s->max_x; - s->br_y = s->max_y; - - /*FIXME: fi-60f gray or binary could scan in 8 bit gray*/ - if (s->model == MODEL_FI60F && s->mode != MODE_COLOR){ - s->scan.width_bytes = s->scan.width_pix*3; + if (s->model == MODEL_S300) + { + img_heads = 1; /* image width is the same as the plane width on the S300 */ + img_pages = 2; } - else{ - s->scan.width_bytes = s->scan.width_pix*3; + else /* (s->model == MODEL_FI60F) */ + { + img_heads = 3; /* image width is 3* the plane width on the FI-60F */ + img_pages = 1; } - update_transfer_totals(&s->scan); - + + /* set up the transfer structs */ + s->cal_image.plane_width = settings[i].cal_headwidth; + s->cal_image.plane_stride = settings[i].cal_reqwidth * 3; + s->cal_image.line_stride = settings[i].cal_width * 3; + s->cal_image.raw_data = NULL; + s->cal_image.image = NULL; + + s->cal_data.plane_width = settings[i].cal_headwidth; /* width is the same, but there are 2 bytes per pixel component */ + s->cal_data.plane_stride = settings[i].cal_reqwidth * 6; + s->cal_data.line_stride = settings[i].cal_width * 6; + s->cal_data.raw_data = NULL; + s->cal_data.image = &s->sendcal; + + s->block_xfr.plane_width = settings[i].head_width; + s->block_xfr.plane_stride = settings[i].req_width * 3; + s->block_xfr.line_stride = settings[i].act_width * 3; + s->block_xfr.raw_data = NULL; + s->block_xfr.image = &s->block_img; + + /* set up the block image used during scanning operation */ + width = s->block_xfr.plane_width * img_heads; + s->block_img.width_pix = width; + s->block_img.width_bytes = width * 3; + s->block_img.height = settings[i].block_height; + s->block_img.pages = img_pages; + s->block_img.buffer = NULL; + + /* set up the calibration image blocks */ + width = s->cal_image.plane_width * img_heads; + s->coarsecal.width_pix = s->darkcal.width_pix = s->lightcal.width_pix = width; + s->coarsecal.width_bytes = s->darkcal.width_bytes = s->lightcal.width_bytes = width * 3; s->coarsecal.height = 1; - update_transfer_totals(&s->coarsecal); - - s->darkcal.height = 16; - s->darkcal.width_pix = s->coarsecal.width_pix; - s->darkcal.width_bytes = s->coarsecal.width_bytes; - update_transfer_totals(&s->darkcal); - - s->lightcal.height = 16; - s->lightcal.width_pix = s->coarsecal.width_pix; - s->lightcal.width_bytes = s->coarsecal.width_bytes; - update_transfer_totals(&s->lightcal); - - /* 2 bytes per channel (gain&offset) */ + s->darkcal.height = s->lightcal.height = 16; + s->coarsecal.pages = s->darkcal.pages = s->lightcal.pages = img_pages; + s->coarsecal.buffer = s->darkcal.buffer = s->lightcal.buffer = NULL; + + /* set up the calibration data block */ + width = s->cal_data.plane_width * img_heads; + s->sendcal.width_pix = width; + s->sendcal.width_bytes = width * 6; /* 2 bytes of cal data per pixel component */ s->sendcal.height = 1; - s->sendcal.width_pix = s->coarsecal.width_pix * 2; - s->sendcal.width_bytes = s->coarsecal.width_bytes * 2; - update_transfer_totals(&s->sendcal); - - /* fill in block settings */ - s->block.width_bytes = s->scan.width_bytes; - s->block.width_pix = s->scan.width_pix; - update_transfer_totals(&s->block); + s->sendcal.pages = img_pages; + s->sendcal.buffer = NULL; + + /* set up the fullscan parameters */ + s->fullscan.width_bytes = s->block_xfr.line_stride; + if(s->source == SOURCE_FLATBED || !s->page_height) + { + /* flatbed and adf in autodetect always ask for all*/ + s->fullscan.height = s->max_y * s->resolution_y / 1200; + } + else + { + /* adf with specified paper size requires padding (~1/2in) */ + s->fullscan.height = (s->page_height+600) * s->resolution_y / 1200; + } /* fill in front settings */ + s->front.width_pix = s->block_img.width_pix; switch (s->mode) { case MODE_COLOR: s->front.width_bytes = s->front.width_pix*3; @@ -1888,22 +1915,30 @@ s->front.width_bytes = s->front.width_pix/8; break; } - /*output image might be taller than scan due to interpolation*/ - s->front.height = s->scan.height * s->resolution_x / s->resolution_y; - update_transfer_totals(&s->front); + s->front.height = s->fullscan.height * s->resolution_x / s->resolution_y; + s->front.pages = 1; + s->front.buffer = NULL; + + /* back settings always same as front settings */ + s->back.width_pix = s->front.width_pix; + s->back.width_bytes = s->front.width_bytes; + s->back.height = s->front.height; + s->back.pages = 1; + s->back.buffer = NULL; /* dynamic threshold temp buffer, in gray */ s->dt.width_pix = s->front.width_pix; s->dt.width_bytes = s->front.width_pix; s->dt.height = 1; - update_transfer_totals(&s->dt); + s->dt.pages = 1; + s->dt.buffer = NULL; - /* back settings always same as front settings */ - s->back.height = s->front.height; - s->back.width_pix = s->front.width_pix; - s->back.width_bytes = s->front.width_bytes; - update_transfer_totals(&s->back); + /* set up the pointers to the page images in the page structs */ + s->pages[SIDE_FRONT].image = &s->front; + s->pages[SIDE_BACK].image = &s->back; + s->pages[SIDE_FRONT].done = 0; + s->pages[SIDE_BACK].done = 0; DBG (10, "change_params: finish\n"); @@ -2064,6 +2099,7 @@ { struct scanner *s = handle; SANE_Status ret; + int i; DBG (10, "sane_start: start\n"); @@ -2172,16 +2208,22 @@ DBG(15,"sane_start: reset counters\n"); /* reset scan */ - update_transfer_totals(&s->scan); + s->fullscan.done = 0; + s->fullscan.rx_bytes = 0; + s->fullscan.total_bytes = s->fullscan.width_bytes * s->fullscan.height; /* reset block */ - update_transfer_totals(&s->block); + update_transfer_totals(&s->block_xfr); - /* reset front */ - update_transfer_totals(&s->front); - - /* reset back */ - update_transfer_totals(&s->back); + /* reset front and back page counters */ + for (i = 0; i < 2; i++) + { + struct image *page_img = s->pages[i].image; + s->pages[i].bytes_total = page_img->width_bytes * page_img->height; + s->pages[i].bytes_scanned = 0; + s->pages[i].bytes_read = 0; + s->pages[i].done = 0; + } ret = scan(s); if (ret != SANE_STATUS_GOOD) { @@ -2208,39 +2250,56 @@ DBG (10, "setup_buffers: start\n"); /* temporary cal data */ - s->coarsecal.buffer = calloc (1,s->coarsecal.total_bytes+8); + s->coarsecal.buffer = calloc (1,s->coarsecal.width_bytes * s->coarsecal.height * s->coarsecal.pages); if(!s->coarsecal.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup coarse cal buffer\n"); return SANE_STATUS_NO_MEM; } - s->darkcal.buffer = calloc (1,s->darkcal.total_bytes+8); + s->darkcal.buffer = calloc (1,s->darkcal.width_bytes * s->darkcal.height * s->darkcal.pages); if(!s->darkcal.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup fine cal buffer\n"); return SANE_STATUS_NO_MEM; } - s->lightcal.buffer = calloc (1,s->lightcal.total_bytes+8); + s->lightcal.buffer = calloc (1,s->lightcal.width_bytes * s->lightcal.height * s->lightcal.pages); if(!s->lightcal.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup fine cal buffer\n"); return SANE_STATUS_NO_MEM; } - s->sendcal.buffer = calloc (1,s->sendcal.total_bytes+8); + s->sendcal.buffer = calloc (1,s->sendcal.width_bytes * s->sendcal.height * s->sendcal.pages); if(!s->sendcal.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup send cal buffer\n"); return SANE_STATUS_NO_MEM; } + s->cal_image.raw_data = calloc(1, s->cal_image.line_stride * 16 + 8); /* maximum 16 lines input for fine calibration */ + if(!s->cal_image.raw_data){ + DBG (5, "setup_buffers: ERROR: failed to setup calibration input raw data buffer\n"); + return SANE_STATUS_NO_MEM; + } + + s->cal_data.raw_data = calloc(1, s->cal_data.line_stride); /* only 1 line of data is sent */ + if(!s->cal_data.raw_data){ + DBG (5, "setup_buffers: ERROR: failed to setup calibration output raw data buffer\n"); + return SANE_STATUS_NO_MEM; + } + /* grab up to 512K at a time */ - s->block.buffer = calloc (1,s->block.total_bytes+8); - if(!s->block.buffer){ - DBG (5, "setup_buffers: ERROR: failed to setup block buffer\n"); + s->block_img.buffer = calloc (1,s->block_img.width_bytes * s->block_img.height * s->block_img.pages); + if(!s->block_img.buffer){ + DBG (5, "setup_buffers: ERROR: failed to setup block image buffer\n"); + return SANE_STATUS_NO_MEM; + } + s->block_xfr.raw_data = calloc(1, s->block_xfr.line_stride * s->block_img.height + 8); + if(!s->block_xfr.raw_data){ + DBG (5, "setup_buffers: ERROR: failed to setup block raw data buffer\n"); return SANE_STATUS_NO_MEM; } /* one grayscale line for dynamic threshold */ - s->dt.buffer = calloc (1,s->dt.total_bytes); + s->dt.buffer = calloc (1,s->dt.width_bytes * s->dt.height * s->dt.pages); if(!s->dt.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup dt buffer\n"); return SANE_STATUS_NO_MEM; @@ -2249,7 +2308,7 @@ /* make image buffer to hold frontside data */ if(s->source != SOURCE_ADF_BACK){ - s->front.buffer = calloc (1,s->front.total_bytes+8); + s->front.buffer = calloc (1,s->front.width_bytes * s->front.height * s->front.pages); if(!s->front.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup front buffer\n"); return SANE_STATUS_NO_MEM; @@ -2259,7 +2318,7 @@ /* make image buffer to hold backside data */ if(s->source == SOURCE_ADF_DUPLEX || s->source == SOURCE_ADF_BACK){ - s->back.buffer = calloc (1,s->back.total_bytes+8); + s->back.buffer = calloc (1,s->back.width_bytes * s->back.height * s->back.pages); if(!s->back.buffer){ DBG (5, "setup_buffers: ERROR: failed to setup back buffer\n"); return SANE_STATUS_NO_MEM; @@ -2297,8 +2356,9 @@ size_t payLen = 28; unsigned char pay[28]; - /*size_t i;*/ - int try = 0, direction = -1; + int try_count, cal_good[2], x, i, j; + int param[2], zcount[2], high_param[2], low_param[2], avg[2], maxval[2]; + int rgb_avg[2][3], rgb_hicount[2][3]; DBG (10, "coarsecal: start\n"); @@ -2323,7 +2383,28 @@ return ret; } - while(try++ < 1){ + try_count = 8; + param[0] = 63; + param[1] = 63; + low_param[0] = low_param[1] = -64; /* The S300 will accept coarse offsets from -128 to 127 */ + high_param[0] = high_param[1] = 63; /* By our range is limited to converge faster */ + cal_good[0] = cal_good[1] = 0; + + while (try_count > 0){ + try_count--; + + /* update the coarsecal payload to use our new dark offset parameters */ + if (s->model == MODEL_S300) + { + pay[5] = param[0]; + pay[7] = param[1]; + } + else /* (s->model == MODEL_FI60F) */ + { + pay[5] = param[0]; + pay[7] = param[0]; + pay[9] = param[0]; + } /* send coarse cal (c6) */ cmd[0] = 0x1b; @@ -2364,6 +2445,8 @@ DBG (5, "coarsecal: c6 payload bad status?\n"); return SANE_STATUS_IO_ERROR; } + + DBG(15, "coarsecal offset: parameter front: %i back: %i\n", param[0], param[1]); /* send scan d2 command */ cmd[0] = 0x1b; @@ -2386,31 +2469,66 @@ return SANE_STATUS_IO_ERROR; } - s->coarsecal.rx_bytes = 0; - s->coarsecal.tx_bytes = 0; + s->cal_image.image = &s->coarsecal; + update_transfer_totals(&s->cal_image); - while(!s->coarsecal.done){ - ret = read_from_scanner(s,&s->coarsecal); + while(!s->cal_image.done){ + ret = read_from_scanner(s,&s->cal_image); if(ret){ DBG (5, "coarsecal: cant read from scanner\n"); return ret; } } - s->coarsecal.done = 0; + /* convert the raw data into normal packed pixel data */ + descramble_raw(s, &s->cal_image); - /* FIXME inspect data, change coarse cal data */ - if(s->model == MODEL_S300){ - pay[5] += direction; - pay[7] += direction; + /* gather statistics: count the proportion of 0-valued pixels */ + /* since the lamp is off, there's no point in looking at the green or blue data - they're all from the same sensor anyway */ + zcount[0] = zcount[1] = 0; + avg[0] = avg[1] = 0; + maxval[0] = maxval[1] = 0; + for (j = 0; j < s->coarsecal.pages; j++) + { + int page_offset = j * s->coarsecal.width_bytes * s->coarsecal.height; + for (x = 0; x < s->coarsecal.width_bytes; x++) + { + int val = s->coarsecal.buffer[page_offset + x]; + avg[j] += val; + if (val == 0) zcount[j]++; + if (val > maxval[j]) maxval[j] = val; + } } - else{ - pay[5] += direction; - pay[7] += direction; - pay[9] += direction; + /* convert the zero counts from a pixel count to a proportion in tenths of a percent */ + for (j = 0; j < s->coarsecal.pages; j++) + { + avg[j] /= s->coarsecal.width_bytes; + zcount[j] = zcount[j] * 1000 / s->coarsecal.width_bytes; } + DBG(15, "coarsecal offset: average pixel values front: %i back: %i\n", avg[0], avg[1]); + DBG(15, "coarsecal offset: maximum pixel values front: %i back: %i\n", maxval[0], maxval[1]); + DBG(15, "coarsecal offset: 0-valued pixel count front: %f%% back: %f%%\n", zcount[0] / 10.0f, zcount[1] / 10.0f); - hexdump(15, "c6 payload: ", pay, payLen); - } + /* check the values, adjust parameters if they are not within the target range */ + for (j = 0; j < s->coarsecal.pages; j++) + { + if (!cal_good[j]) + { + if (avg[j] > COARSE_OFFSET_TARGET) + { + high_param[j] = param[j]; + param[j] = (low_param[j] + high_param[j]) / 2; + } + else if (avg[j] < COARSE_OFFSET_TARGET) + { + low_param[j] = param[j]; + param[j] = (low_param[j] + high_param[j]) / 2; + } + else cal_good[j] = 1; + } + } + if (cal_good[0] + cal_good[1] == s->coarsecal.pages) break; + + } /* continue looping for up to 8 tries */ /* light cal, lamp on */ ret = lamp(s,1); @@ -2419,10 +2537,15 @@ return ret; } - try = 0; - direction = -1; + try_count = 8; + param[0] = pay[11]; + param[1] = pay[13]; + low_param[0] = low_param[1] = 0; + high_param[0] = high_param[1] = 63; + cal_good[0] = cal_good[1] = 0; - while(try++ < 1){ + while (try_count > 0){ + try_count--; /* send coarse cal (c6) */ cmd[0] = 0x1b; @@ -2464,6 +2587,8 @@ return SANE_STATUS_IO_ERROR; } + DBG(15, "coarsecal gain: parameter front: %i back: %i\n", param[0], param[1]); + /* send scan d2 command */ cmd[0] = 0x1b; cmd[1] = 0xd2; @@ -2485,30 +2610,96 @@ return SANE_STATUS_IO_ERROR; } - s->coarsecal.rx_bytes = 0; - s->coarsecal.tx_bytes = 0; + s->cal_image.image = &s->coarsecal; + update_transfer_totals(&s->cal_image); - while(!s->coarsecal.done){ - ret = read_from_scanner(s,&s->coarsecal); + while(!s->cal_image.done){ + ret = read_from_scanner(s,&s->cal_image); if(ret){ DBG (5, "coarsecal: cant read from scanner\n"); return ret; } } - s->coarsecal.done = 0; + /* convert the raw data into normal packed pixel data */ + descramble_raw(s, &s->cal_image); - /* FIXME inspect data, change coarse cal data */ - if(s->model == MODEL_S300){ - pay[11] += direction; - pay[13] += direction; + /* gather statistics: count the proportion of 255-valued pixels in each color channel */ + /* count the average pixel value in each color channel */ + for (i = 0; i < s->coarsecal.pages; i++) + for (j = 0; j < 3; j++) + rgb_avg[i][j] = rgb_hicount[i][j] = 0; + for (i = 0; i < s->coarsecal.pages; i++) + { + for (x = 0; x < s->coarsecal.width_pix; x++) + { + /* get color channel values and count of pixels pegged at 255 */ + unsigned char *rgbpix = s->coarsecal.buffer + (i * s->coarsecal.width_bytes * s->coarsecal.height) + x * 3; + for (j = 0; j < 3; j++) + { + rgb_avg[i][j] += rgbpix[j]; + if (rgbpix[j] == 255) + rgb_hicount[i][j]++; + } + } } - else{ - pay[11] += direction; - pay[13] += direction; - pay[15] += direction; + /* apply the color correction factors to the averages */ + for (i = 0; i < s->coarsecal.pages; i++) + for (j = 0; j < 3; j++) + rgb_avg[i][j] *= white_factor[j]; + /* set the gain so that none of the color channels are clipping, ie take the highest channel values */ + for (i = 0; i < s->coarsecal.pages; i++) + { + avg[i] = MAX3(rgb_avg[i][0], rgb_avg[i][1], rgb_avg[i][2]) / s->coarsecal.width_pix; + for (j = 0; j < 3; j++) + rgb_avg[i][j] /= s->coarsecal.width_pix; } + /* convert the 255-counts from a pixel count to a proportion in tenths of a percent */ + for (i = 0; i < s->coarsecal.pages; i++) + { + for (j = 0; j < 3; j++) + { + rgb_hicount[i][j] = rgb_hicount[i][j] * 1000 / s->coarsecal.width_pix; + } + zcount[i] = MAX3(rgb_hicount[i][0], rgb_hicount[i][1], rgb_hicount[i][2]); + } + DBG(15, "coarsecal gain: average RGB values front: (%i,%i,%i) back: (%i,%i,%i)\n", + rgb_avg[0][0], rgb_avg[0][1], rgb_avg[0][2], rgb_avg[1][0], rgb_avg[1][1], rgb_avg[1][2]); + DBG(15, "coarsecal gain: 255-valued pixel count front: (%g,%g,%g) back: (%g,%g,%g)\n", + rgb_hicount[0][0]/10.0f, rgb_hicount[0][1]/10.0f, rgb_hicount[0][2]/10.0f, + rgb_hicount[1][0]/10.0f, rgb_hicount[1][1]/10.0f, rgb_hicount[1][2]/10.0f); + + /* check the values, adjust parameters if they are not within the target range */ + for (x = 0; x < s->coarsecal.pages; x++) + { + if (!cal_good[x]) + { + if (zcount[x] > 9 || avg[x] > coarse_gain_max[x]) + { + high_param[x] = param[x]; + param[x] = (low_param[x] + high_param[x]) / 2; + } + else if (avg[x] < coarse_gain_min[x]) + { + low_param[x] = param[x]; + param[x] = (low_param[x] + high_param[x]) / 2; + } + else cal_good[x] = 1; + } + } + if (cal_good[0] + cal_good[1] == s->coarsecal.pages) break; - hexdump(15, "c6 payload: ", pay, payLen); + /* update the coarsecal payload to use the new gain parameters */ + if (s->model == MODEL_S300) + { + pay[11] = param[0]; + pay[13] = param[1]; + } + else /* (s->model == MODEL_FI60F) */ + { + pay[11] = param[0]; + pay[13] = param[0]; + pay[15] = param[0]; + } } DBG (10, "coarsecal: finish\n"); @@ -2516,7 +2707,7 @@ } static SANE_Status -finecal(struct scanner *s) +finecal_send_cal(struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -2526,196 +2717,32 @@ size_t statLen = 1; unsigned char stat[2]; - int i,j; - - DBG (10, "finecal: start\n"); - - /* ask for 16 lines */ - ret = set_window(s, WINDOW_FINECAL); - if(ret){ - DBG (5, "finecal: error sending setwindowcal\n"); - return ret; - } - - /* dark cal, lamp off */ - ret = lamp(s,0); - if(ret){ - DBG (5, "finecal: error lamp off\n"); - return ret; - } - - /* send scan d2 command */ - cmd[0] = 0x1b; - cmd[1] = 0xd2; - stat[0] = 0; - statLen = 1; - - ret = do_cmd( - s, 0, - cmd, cmdLen, - NULL, 0, - stat, &statLen - ); - if(ret){ - DBG (5, "finecal: error sending d2 cmd\n"); - return ret; - } - if(stat[0] != 6){ - DBG (5, "finecal: cmd bad d2 status?\n"); - return SANE_STATUS_IO_ERROR; - } - - s->darkcal.rx_bytes = 0; - s->darkcal.tx_bytes = 0; - - while(!s->darkcal.done){ - ret = read_from_scanner(s,&s->darkcal); - if(ret){ - DBG (5, "finecal: cant read from scanner\n"); - return ret; - } - } - s->darkcal.done = 0; - - /* grab rows with lamp on */ - ret = lamp(s,1); - if(ret){ - DBG (5, "finecal: error lamp on\n"); - return ret; - } - - /* send scan d2 command */ - cmd[0] = 0x1b; - cmd[1] = 0xd2; - stat[0] = 0; - statLen = 1; - - ret = do_cmd( - s, 0, - cmd, cmdLen, - NULL, 0, - stat, &statLen - ); - if(ret){ - DBG (5, "finecal: error sending d2 cmd\n"); - return ret; - } - if(stat[0] != 6){ - DBG (5, "finecal: cmd bad d2 status?\n"); - return SANE_STATUS_IO_ERROR; - } - - s->lightcal.rx_bytes = 0; - s->lightcal.tx_bytes = 0; - - while(!s->lightcal.done){ - ret = read_from_scanner(s,&s->lightcal); - if(ret){ - DBG (5, "finecal: cant read from scanner\n"); - return ret; - } - } - s->lightcal.done = 0; - - /* sum up light and dark scans */ - for(j=0; jdarkcal.width_bytes; j++){ - - int dtotal=0, ltotal=0, gain=0, offset=0; - - /*s300 has two bytes of NULL out of every 6*/ - if(s->model == MODEL_S300 && (j%3) == 2){ - s->sendcal.buffer[j*2] = 0; - s->sendcal.buffer[j*2+1] = 0; - continue; - } - - for(i=0; idarkcal.height; i++){ - dtotal += s->darkcal.buffer[i*s->darkcal.width_bytes+j]; - } - - for(i=0; ilightcal.height; i++){ - ltotal += s->lightcal.buffer[i*s->lightcal.width_bytes+j]; - } - - /* even bytes of payload (offset) */ - /* larger numbers - greater dark offset? */ - - if(s->model == MODEL_S300){ - /* S300 front side 150dpi color empirically determined*/ - offset = dtotal - ltotal/93 - 0xa4; - } - else{ - /* fi-60F 600dpi color empirically determined*/ - offset = dtotal - ltotal/100 + 8; - } - - if(offset < 1){ - s->sendcal.buffer[j*2] = 0; - } - else if(offset > 0xfe){ - s->sendcal.buffer[j*2] = 0xff; - } - else{ - s->sendcal.buffer[j*2] = offset; - } - - /* odd bytes of payload (gain) */ - /* smaller numbers increase gain (contrast) */ - - if(s->model == MODEL_S300){ - if(j%3 == 0){ - /* S300 front side 150dpi color empirically determined */ - gain = ltotal * 17/100 - dtotal/5 - 0x38; - } - else{ - /* S300 back side 150dpi color empirically determined */ - gain = ltotal * 21/100 - dtotal/5 - 0x4f; - } - } - else{ - /* fi-60F 600dpi color empirically determined*/ - /* FIXME: too much gain? */ - gain = ltotal * 2/19 - dtotal/9 - 50; - } - - if(gain < 1){ - s->sendcal.buffer[j*2+1] = 0; - } - else if(gain > 0xfe){ - s->sendcal.buffer[j*2+1] = 0xff; - } - else{ - s->sendcal.buffer[j*2+1] = gain; - } - - } - - if(DBG_LEVEL >= 15){ - FILE * foo = fopen("epjitsu_finecal.pnm","w"); - fprintf(foo,"P5\n%d\n%d\n255\n",s->darkcal.width_bytes,s->darkcal.height*2+2); - fwrite(s->darkcal.buffer,s->darkcal.total_bytes-8,1,foo); - fwrite(s->lightcal.buffer,s->lightcal.total_bytes-8,1,foo); - - /* write out even (offset) and odd (gain) bytes on separate lines */ - for(i=0;isendcal.total_bytes;i+=2){ - fwrite(s->sendcal.buffer+i,1,1,foo); - } - for(i=1;isendcal.total_bytes;i+=2){ - fwrite(s->sendcal.buffer+i,1,1,foo); - } - fclose(foo); - } + int i, j, k; + unsigned short *p_out, *p_in = (unsigned short *) s->sendcal.buffer; + int planes = (s->model == MODEL_S300) ? 2 : 3; + + /* scramble the raster buffer data into scanner raw format */ + memset(s->cal_data.raw_data, 0, s->cal_data.line_stride); + for (i = 0; i < planes; i++) + for (j = 0; j < s->cal_data.plane_width; j++) + for (k = 0; k < 3; k++) + { + p_out = (unsigned short *) (s->cal_data.raw_data + k * s->cal_data.plane_stride + j * 6 + i * 2); + *p_out = *p_in++; /* dark offset, gain */ + } ret = set_window(s, WINDOW_SENDCAL); if(ret){ - DBG (5, "finecal: error sending setwindow\n"); + DBG (5, "finecal_send_cal: error sending setwindow\n"); return ret; } /*first unknown cal block*/ + cmd[0] = 0x1b; cmd[1] = 0xc3; + stat[0] = 0; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -2723,11 +2750,11 @@ stat, &statLen ); if(ret){ - DBG (5, "finecal: error sending c3 cmd\n"); + DBG (5, "finecal_send_cal: error sending c3 cmd\n"); return ret; } if(stat[0] != 6){ - DBG (5, "finecal: cmd bad c3 status?\n"); + DBG (5, "finecal_send_cal: cmd bad c3 status?\n"); return SANE_STATUS_IO_ERROR; } @@ -2738,16 +2765,16 @@ ret = do_cmd( s, 0, s->sendCal1Header, s->sendCal1HeaderLen, - s->sendcal.buffer, s->sendcal.total_bytes, + s->cal_data.raw_data, s->cal_data.line_stride, stat, &statLen ); if(ret){ - DBG (5, "finecal: error sending c3 payload\n"); + DBG (5, "finecal_send_cal: error sending c3 payload\n"); return ret; } if(stat[0] != 6){ - DBG (5, "finecal: payload bad c3 status?\n"); + DBG (5, "finecal_send_cal: payload bad c3 status?\n"); return SANE_STATUS_IO_ERROR; } @@ -2763,11 +2790,11 @@ ); if(ret){ - DBG (5, "finecal: error sending c4 cmd\n"); + DBG (5, "finecal_send_cal: error sending c4 cmd\n"); return ret; } if(stat[0] != 6){ - DBG (5, "finecal: cmd bad c4 status?\n"); + DBG (5, "finecal_send_cal: cmd bad c4 status?\n"); return SANE_STATUS_IO_ERROR; } @@ -2778,58 +2805,49 @@ ret = do_cmd( s, 0, s->sendCal2Header, s->sendCal2HeaderLen, - s->sendcal.buffer, s->sendcal.total_bytes, + s->cal_data.raw_data, s->cal_data.line_stride, stat, &statLen ); if(ret){ - DBG (5, "finecal: error sending c4 payload\n"); + DBG (5, "finecal_send_cal: error sending c4 payload\n"); return ret; } if(stat[0] != 6){ - DBG (5, "finecal: payload bad c4 status?\n"); + DBG (5, "finecal_send_cal: payload bad c4 status?\n"); return SANE_STATUS_IO_ERROR; } - DBG (10, "cal: finish\n"); return ret; } static SANE_Status -lamp(struct scanner *s, unsigned char set) +finecal_get_line(struct scanner *s, struct image *img) { SANE_Status ret = SANE_STATUS_GOOD; - unsigned char cmd[2]; + size_t cmdLen = 2; - unsigned char stat[1]; + unsigned char cmd[2]; + size_t statLen = 1; - - DBG (10, "lamp: start (%d)\n", set); + unsigned char stat[2]; - /*send cmd*/ - cmd[0] = 0x1b; - cmd[1] = 0xd0; - - ret = do_cmd( - s, 0, - cmd, cmdLen, - NULL, 0, - stat, &statLen - ); + int round_offset = img->height / 2; + int i, j, k; + + /* ask for 16 lines */ + ret = set_window(s, WINDOW_FINECAL); if(ret){ - DBG (5, "lamp: error sending cmd\n"); + DBG (5, "finecal_get_line: error sending setwindowcal\n"); return ret; } - if(stat[0] != 6){ - DBG (5, "lamp: cmd bad status?\n"); - return SANE_STATUS_IO_ERROR; - } - /*send payload*/ - cmd[0] = set; - cmdLen = 1; + /* send scan d2 command */ + cmd[0] = 0x1b; + cmd[1] = 0xd2; + stat[0] = 0; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -2837,22 +2855,293 @@ stat, &statLen ); if(ret){ - DBG (5, "lamp: error sending payload\n"); + DBG (5, "finecal_get_line: error sending d2 cmd\n"); return ret; } if(stat[0] != 6){ - DBG (5, "lamp: payload bad status?\n"); + DBG (5, "finecal_get_line: cmd bad d2 status?\n"); return SANE_STATUS_IO_ERROR; } - DBG (10, "lamp: finish\n"); - return ret; -} + s->cal_image.image = img; + update_transfer_totals(&s->cal_image); -static SANE_Status -set_window(struct scanner *s, int window) -{ - SANE_Status ret = SANE_STATUS_GOOD; + while(!s->cal_image.done){ + ret = read_from_scanner(s,&s->cal_image); + if(ret){ + DBG (5, "finecal_get_line: cant read from scanner\n"); + return ret; + } + } + /* convert the raw data into normal packed pixel data */ + descramble_raw(s, &s->cal_image); + + /* average the columns of pixels together and put the results in the top line(s) */ + for (i = 0; i < img->pages; i++) + { + unsigned char *linepix = img->buffer + i * img->width_bytes * img->height; + unsigned char *avgpix = img->buffer + i * img->width_bytes; + for (j = 0; j < img->width_bytes; j++) + { + int total = 0; + + for (k = 0; k < img->height; k++) + total += linepix[j + k * img->width_bytes]; + + avgpix[j] = (total + round_offset) / img->height; + } + } + return ret; +} + +/* roundf() is c99, so we provide our own, though this version wont return -0 */ +static float +round2(float x) +{ + return (float)(x >= 0.0) ? (int)(x+0.5) : (int)(x-0.5); +} + +static SANE_Status +finecal(struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + const int max_pages = (s->model == MODEL_S300 ? 2 : 1); + int gain_delta = 0xff - 0xbf; + float *gain_slope, *last_error; + int i, j, k, idx, try_count, cal_good; + + DBG (10, "finecal: start\n"); + + /* set fine dark offset to 0 and fix all fine gains to lowest parameter (0xFF) */ + for (i = 0; i < s->sendcal.width_bytes * s->sendcal.pages / 2; i++) + { + s->sendcal.buffer[i*2] = 0; + s->sendcal.buffer[i*2+1] = 0xff; + } + ret = finecal_send_cal(s); + if(ret) return ret; + + /* grab rows with lamp on */ + ret = lamp(s,1); + if(ret){ + DBG (5, "finecal: error lamp on\n"); + return ret; + } + + /* read the low-gain average of 16 lines */ + ret = finecal_get_line(s, &s->darkcal); + if(ret) return ret; + + /* set fine dark offset to 0 and fine gain to a fixed higher-gain parameter (0xBF) */ + for (i = 0; i < s->sendcal.width_bytes * s->sendcal.pages / 2; i++) + { + s->sendcal.buffer[i*2] = 0; + s->sendcal.buffer[i*2+1] = 0xbf; + } + ret = finecal_send_cal(s); + if(ret) return ret; + + /* read the high-gain average of 16 lines */ + ret = finecal_get_line(s, &s->lightcal); + if(ret) return ret; + + /* calculate the per pixel slope of pixel value delta over gain delta */ + gain_slope = malloc(s->lightcal.width_bytes * s->lightcal.pages * sizeof(float)); + if (!gain_slope) + return SANE_STATUS_NO_MEM; + idx = 0; + for (i = 0; i < s->lightcal.pages; i++) + { + for (j = 0; j < s->lightcal.width_pix; j++) + { + for (k = 0; k < 3; k++) + { + int value_delta = s->lightcal.buffer[idx] - s->darkcal.buffer[idx]; + /* limit this slope to 1 or less, to avoid overshoot if the lightcal ref input is clipped at 255 */ + if (value_delta < gain_delta) + gain_slope[idx] = -1.0; + else + gain_slope[idx] = (float) -gain_delta / value_delta; + idx++; + } + } + } + + /* keep track of the last iteration's pixel error. If we overshoot, we can reduce the value of the gain slope */ + last_error = malloc(s->lightcal.width_bytes * s->lightcal.pages * sizeof(float)); + if (!last_error) + { + free(gain_slope); + return SANE_STATUS_NO_MEM; + } + for (i = 0; i < s->lightcal.width_bytes * s->lightcal.pages; i++) + last_error[i] = 0.0; + + /* fine calibration feedback loop */ + try_count = 8; + while (try_count > 0) + { + int min_value[2][3], max_value[2][3]; + float avg_value[2][3], variance[2][3]; + int high_pegs = 0, low_pegs = 0; + try_count--; + + /* clear statistics arrays */ + for (i = 0; i < max_pages; i++) + { + for (k = 0; k < 3; k++) + { + min_value[i][k] = 0xff; + max_value[i][k] = 0; + avg_value[i][k] = 0; + variance[i][k] = 0; + } + } + + /* gather statistics and calculate new fine gain parameters based on observed error and the value/gain slope */ + idx = 0; + for (i = 0; i < max_pages; i++) + { + for (j = 0; j < s->lightcal.width_pix; j++) + { + for (k = 0; k < 3; k++) + { + int pixvalue = s->lightcal.buffer[idx]; + float pixerror = (fine_gain_target[i] * white_factor[k] - pixvalue); + int oldgain = s->sendcal.buffer[idx * 2 + 1]; + int newgain; + /* if we overshot the last correction, reduce the gain_slope */ + if (pixerror * last_error[idx] < 0.0) + gain_slope[idx] *= 0.75; + last_error[idx] = pixerror; + /* set the new gain */ + newgain = oldgain + (int) round2(pixerror * gain_slope[idx]); + if (newgain < 0) + { + low_pegs++; + s->sendcal.buffer[idx * 2 + 1] = 0; + } + else if (newgain > 0xff) + { + high_pegs++; + s->sendcal.buffer[idx * 2 + 1] = 0xff; + } + else + s->sendcal.buffer[idx * 2 + 1] = newgain; + /* update statistics */ + if (pixvalue < min_value[i][k]) min_value[i][k] = pixvalue; + if (pixvalue > max_value[i][k]) max_value[i][k] = pixvalue; + avg_value[i][k] += pixerror; + variance[i][k] += (pixerror * pixerror); + idx++; + } + } + } + /* finish the statistics calculations */ + cal_good = 1; + for (i = 0; i < max_pages; i++) + { + for (k = 0; k < 3; k++) + { + float sum = avg_value[i][k]; + float sum2 = variance[i][k]; + avg_value[i][k] = sum / s->lightcal.width_pix; + variance[i][k] = ((sum2 - (sum * sum / s->lightcal.width_pix)) / s->lightcal.width_pix); + /* if any color channel is too far out of whack, set cal_good to 0 so we'll iterate again */ + if (fabs(avg_value[i][k]) > 1.0 || variance[i][k] > 3.0) + cal_good = 0; + } + } + + /* print debug info */ + DBG (15, "finecal: -------------------- Gain\n"); + DBG (15, "finecal: RGB Average Error - Front: (%.1f,%.1f,%.1f) - Back: (%.1f,%.1f,%.1f)\n", + avg_value[0][0], avg_value[0][1], avg_value[0][2], avg_value[1][0], avg_value[1][1], avg_value[1][2]); + DBG (15, "finecal: RGB Maximum - Front: (%i,%i,%i) - Back: (%i,%i,%i)\n", + max_value[0][0], max_value[0][1], max_value[0][2], max_value[1][0], max_value[1][1], max_value[1][2]); + DBG (15, "finecal: RGB Minimum - Front: (%i,%i,%i) - Back: (%i,%i,%i)\n", + min_value[0][0], min_value[0][1], min_value[0][2], min_value[1][0], min_value[1][1], min_value[1][2]); + DBG (15, "finecal: Variance - Front: (%.1f,%.1f,%.1f) - Back: (%.1f,%.1f,%.1f)\n", + variance[0][0], variance[0][1], variance[0][2], variance[1][0], variance[1][1], variance[1][2]); + DBG (15, "finecal: Pegged gain parameters - High (0xff): %i - Low (0): %i\n", high_pegs, low_pegs); + + /* break out of the loop if our calibration is done */ + if (cal_good) break; + + /* send the new calibration and read a new line */ + ret = finecal_send_cal(s); + if(ret) { free(gain_slope); free(last_error); return ret; } + ret = finecal_get_line(s, &s->lightcal); + if(ret) { free(gain_slope); free(last_error); return ret; } + } + + /* release the memory for the reference slope data */ + free(gain_slope); + free(last_error); + + DBG (10, "finecal: finish\n"); + return ret; +} + +static SANE_Status +lamp(struct scanner *s, unsigned char set) +{ + SANE_Status ret = SANE_STATUS_GOOD; + unsigned char cmd[2]; + size_t cmdLen = 2; + unsigned char stat[1]; + size_t statLen = 1; + + DBG (10, "lamp: start (%d)\n", set); + + /*send cmd*/ + cmd[0] = 0x1b; + cmd[1] = 0xd0; + + ret = do_cmd( + s, 0, + cmd, cmdLen, + NULL, 0, + stat, &statLen + ); + if(ret){ + DBG (5, "lamp: error sending cmd\n"); + return ret; + } + if(stat[0] != 6){ + DBG (5, "lamp: cmd bad status?\n"); + return SANE_STATUS_IO_ERROR; + } + + /*send payload*/ + cmd[0] = set; + cmdLen = 1; + statLen = 1; + + ret = do_cmd( + s, 0, + cmd, cmdLen, + NULL, 0, + stat, &statLen + ); + if(ret){ + DBG (5, "lamp: error sending payload\n"); + return ret; + } + if(stat[0] != 6){ + DBG (5, "lamp: payload bad status?\n"); + return SANE_STATUS_IO_ERROR; + } + + DBG (10, "lamp: finish\n"); + return ret; +} + +static SANE_Status +set_window(struct scanner *s, int window) +{ + SANE_Status ret = SANE_STATUS_GOOD; unsigned char cmd[] = {0x1b, 0xd1}; size_t cmdLen = sizeof(cmd); @@ -2879,7 +3168,7 @@ case WINDOW_SCAN: payload = s->setWindowScan; paylen = s->setWindowScanLen; - set_SW_ypix(payload,s->scan.height); + set_SW_ypix(payload,s->fullscan.height); break; default: DBG (5, "set_window: unknown window\n"); @@ -3221,7 +3510,7 @@ { struct scanner *s = (struct scanner *) handle; SANE_Status ret=SANE_STATUS_GOOD; - struct transfer * tp; + struct page * page; DBG (10, "sane_read: start si:%d len:%d max:%d\n",s->side,*len,max_len); @@ -3233,36 +3522,30 @@ return SANE_STATUS_CANCELLED; } - if(s->side == SIDE_FRONT){ - tp = &s->front; - } - else{ - tp = &s->back; - } + page = &s->pages[s->side]; /* have sent all of current buffer */ - if(tp->done){ + if(page->done){ DBG (10, "sane_read: returning eof\n"); return SANE_STATUS_EOF; } /* scan not finished, get more into block buffer */ - if(!s->scan.done){ - + if(!s->fullscan.done) + { /* block buffer currently empty, clean up */ - if(!s->block.rx_bytes){ - + if(!s->block_xfr.rx_bytes) + { /* block buffer bigger than remainder of scan, shrink block */ - int remainTotal = s->scan.total_bytes - s->scan.rx_bytes; - if(remainTotal < s->block.total_bytes){ - DBG (15, "sane_read: shrinking block to %lu\n", - (unsigned long)remainTotal); - s->block.total_bytes = remainTotal; - } - + int remainTotal = s->fullscan.total_bytes - s->fullscan.rx_bytes; + if(remainTotal < s->block_xfr.total_bytes) + { + DBG (15, "sane_read: shrinking block to %lu\n", (unsigned long)remainTotal); + s->block_xfr.total_bytes = remainTotal; + } /* send d3 cmd for S300 */ - if(s->model == MODEL_S300){ - + if(s->model == MODEL_S300) + { unsigned char cmd[] = {0x1b, 0xd3}; size_t cmdLen = 2; unsigned char stat[1]; @@ -3285,21 +3568,23 @@ return SANE_STATUS_IO_ERROR; } } - } + } - /*while(!s->block.done){*/ - ret = read_from_scanner(s, &s->block); + ret = read_from_scanner(s, &s->block_xfr); if(ret){ DBG (5, "sane_read: cant read from scanner\n"); return ret; } /* block filled, copy to front/back */ - if(s->block.done){ - + if(s->block_xfr.done) + { DBG (15, "sane_read: block buffer full\n"); - s->block.done = 0; + /* convert the raw data into normal packed pixel data */ + descramble_raw(s, &s->block_xfr); + + s->block_xfr.done = 0; /* get the 0x43 cmd for the S300 */ if(s->model == MODEL_S300){ @@ -3323,102 +3608,73 @@ } /*copy backside data into buffer*/ - if( s->source == SOURCE_ADF_DUPLEX - || s->source == SOURCE_ADF_BACK ){ - - switch (s->mode) { - case MODE_COLOR: - ret = copy_S300_color(s,SIDE_BACK); - break; - - case MODE_GRAYSCALE: - ret = copy_S300_gray(s,SIDE_BACK); - break; - - default: - ret = copy_S300_binary(s,SIDE_BACK); - break; - } - } + if( s->source == SOURCE_ADF_DUPLEX || s->source == SOURCE_ADF_BACK ) + ret = copy_block_to_page(s, SIDE_BACK); /*copy frontside data into buffer*/ - if( s->source != SOURCE_ADF_BACK ){ - - switch (s->mode) { - case MODE_COLOR: - ret = copy_S300_color(s,SIDE_FRONT); - break; - - case MODE_GRAYSCALE: - ret = copy_S300_gray(s,SIDE_FRONT); - break; - - default: - ret = copy_S300_binary(s,SIDE_FRONT); - break; - } - } + if( s->source != SOURCE_ADF_BACK ) + ret = copy_block_to_page(s, SIDE_FRONT); if(ret){ DBG (5, "sane_read: cant copy to front/back\n"); return ret; } - s->scan.rx_bytes += s->block.rx_bytes; + s->fullscan.rx_bytes += s->block_xfr.rx_bytes; /* autodetect mode, check for change length */ if( s->source != SOURCE_FLATBED && !s->page_height ){ int get = (in[6] << 8) | in[7]; /*always have to get full blocks*/ - if(get % s->block.height){ - get += s->block.height - (get % s->block.height); + if(get % s->block_img.height){ + get += s->block_img.height - (get % s->block_img.height); } - if(get < s->scan.height){ + if(get < s->fullscan.height){ DBG (15, "sane_read: paper out? %d\n",get); - s->scan.total_bytes = s->scan.width_bytes * get; + s->fullscan.total_bytes = s->fullscan.width_bytes * get; } } } else { /*fi-60f*/ - ret = fill_frontback_buffers_FI60F(s); + ret = copy_block_to_page(s, SIDE_FRONT); if(ret){ DBG (5, "sane_read: cant copy to front/back\n"); return ret; } - s->scan.rx_bytes += s->block.rx_bytes; + s->fullscan.rx_bytes += s->block_xfr.rx_bytes; } /* reset for next pass */ - update_transfer_totals(&s->block); + update_transfer_totals(&s->block_xfr); /* scan now finished */ - if(s->scan.rx_bytes == s->scan.total_bytes){ + if(s->fullscan.rx_bytes == s->fullscan.total_bytes){ DBG (15, "sane_read: last block\n"); - s->scan.done = 1; + s->fullscan.done = 1; } } } - *len = tp->rx_bytes - tp->tx_bytes; + *len = page->bytes_scanned - page->bytes_read; if(*len > max_len){ *len = max_len; } if(*len){ DBG (10, "sane_read: copy rx:%d tx:%d tot:%d len:%d\n", - tp->rx_bytes,tp->tx_bytes,tp->total_bytes,*len); + page->bytes_scanned, page->bytes_read, page->bytes_total,*len); - memcpy(buf,tp->buffer+tp->tx_bytes,*len); - tp->tx_bytes += *len; + memcpy(buf, page->image->buffer + page->bytes_read, *len); + page->bytes_read += *len; /* sent it all, return eof on next read */ - if(s->scan.done && tp->tx_bytes == tp->rx_bytes){ + if(s->fullscan.done && page->bytes_read == page->bytes_scanned){ DBG (10, "sane_read: side done\n"); - tp->done=1; + page->done = 1; } } @@ -3427,6 +3683,41 @@ return ret; } +/* de-scrambles the raw data from the scanner into the image buffer */ +static SANE_Status +descramble_raw(struct scanner *s, struct transfer * tp) +{ + SANE_Status ret = SANE_STATUS_GOOD; + unsigned char *p_in, *p_out = tp->image->buffer; + int height = tp->total_bytes / tp->line_stride; + int i, j, k, l; + + if (s->model == MODEL_S300) + { + for (i = 0; i < 2; i++) /* page, front/back */ + for (j = 0; j < height; j++) /* row (y)*/ + for (k = 0; k < tp->plane_width; k++) /* column (x) */ + for (l = 0; l < 3; l++) /* color component */ + { + p_in = (unsigned char *) tp->raw_data + (j * tp->line_stride) + (l * tp->plane_stride) + k * 3 + i; + *p_out++ = *p_in; + } + } + else /* MODEL_FI60F */ + { + for (i = 0; i < height; i++) /* row (y)*/ + for (j = 0; j < 3; j++) /* read head */ + for (k = 0; k < tp->plane_width; k++) /* column within the read head */ + for (l = 0; l < 3; l++) /* color component */ + { + p_in = (unsigned char *) tp->raw_data + (i * tp->line_stride) + (l * tp->plane_stride) + k * 3 + j; + *p_out++ = *p_in; + } + } + + return ret; +} + /* fills block buffer a little per pass */ static SANE_Status read_from_scanner(struct scanner *s, struct transfer * tp) @@ -3440,6 +3731,12 @@ bytes = remainBlock; } + if (tp->image == NULL) + { + DBG(5, "internal error: read_from_scanner called with no destination image.\n"); + return SANE_STATUS_INVAL; + } + DBG (10, "read_from_scanner: start rB:%lu len:%lu\n", (unsigned long)remainBlock, (unsigned long)bytes); @@ -3452,7 +3749,7 @@ s, 0, NULL, 0, NULL, 0, - tp->buffer+tp->rx_bytes, &bytes + tp->raw_data + tp->rx_bytes, &bytes ); /* full read or short read */ @@ -3474,413 +3771,133 @@ } DBG (10, "read_from_scanner: finish rB:%lu len:%lu\n", - (unsigned long)(tp->total_bytes-tp->rx_bytes), (unsigned long)bytes); + (unsigned long)(tp->total_bytes - tp->rx_bytes), (unsigned long)bytes); return ret; } -/* copies block buffer into front or back buffer */ -/* moves rx_bytes forward */ +/* copies block buffer into front or back image buffer */ +/* converts pixel data from RGB Color to the output format */ static SANE_Status -copy_S300_color(struct scanner *s,int side) +copy_block_to_page(struct scanner *s,int side) { - SANE_Status ret=SANE_STATUS_GOOD; - struct transfer * tp; - int i,j; - - DBG (10, "copy_S300_color: start\n"); - - /*front side data*/ - if(side == SIDE_FRONT){ - tp = &s->front; - - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - int lineStart = tp->rx_bytes; - - for(j=0; jwidth_pix; j++){ - - /*red*/ - tp->buffer[tp->rx_bytes++] - = s->block.buffer[i + s->req_width*3 + j*3]; - - /*green*/ - tp->buffer[tp->rx_bytes++] - = s->block.buffer[i + s->req_width*6 + j*3]; - - /*blue*/ - tp->buffer[tp->rx_bytes++] - = s->block.buffer[i + j*3]; - } - - /*have filled last row of buffer, bail out*/ - if(tp->rx_bytes == tp->total_bytes){ - return ret; - } - - /*add a periodic row because of non-square pixels*/ - /*FIXME: only works with 225x200*/ - if(s->resolution_x > s->resolution_y - && tp->rx_bytes/tp->width_bytes % 9 == 8 - ){ - memcpy(tp->buffer+tp->rx_bytes,tp->buffer+lineStart,tp->width_bytes); - tp->rx_bytes+=tp->width_bytes; - } - } - } - - /*back side data*/ - else{ - tp = &s->back; - - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - int lineStart = tp->rx_bytes; - - for(j=0; jwidth_pix; j++){ - - /*red*/ - tp->buffer[tp->rx_bytes++] = - s->block.buffer[i + s->req_width*3 + (tp->width_pix-1)*3 - j*3 + 1]; - - /*green*/ - tp->buffer[tp->rx_bytes++] = - s->block.buffer[i + s->req_width*6 + (tp->width_pix-1)*3 - j*3 + 1]; - - /*blue*/ - tp->buffer[tp->rx_bytes++] = - s->block.buffer[i + (tp->width_pix-1)*3 - j*3 + 1]; - } - - /*have filled last row of buffer, bail out*/ - if(tp->rx_bytes == tp->total_bytes){ - return ret; - } - - /*add a periodic row because of non-square pixels*/ - /*FIXME: only works with 225x200*/ - if(s->resolution_x > s->resolution_y - && tp->rx_bytes/tp->width_bytes % 9 == 8 - ){ - memcpy(tp->buffer+tp->rx_bytes,tp->buffer+lineStart,tp->width_bytes); - tp->rx_bytes+=tp->width_bytes; - } - } - } - - DBG (10, "copy_S300_color: finish\n"); - - return ret; -} - -static SANE_Status -copy_S300_gray(struct scanner *s,int side) -{ - SANE_Status ret=SANE_STATUS_GOOD; - struct transfer * tp; + SANE_Status ret = SANE_STATUS_GOOD; + struct transfer * block = &s->block_xfr; + struct page * page = &s->pages[side]; + int height = block->total_bytes / block->line_stride; + int width = block->image->width_pix; + int block_page_stride = block->image->width_bytes * block->image->height; + int page_y_offset = page->bytes_scanned / page->image->width_bytes; + int line_reverse = (side == SIDE_BACK) || (s->model == MODEL_FI60F); int i,j; - DBG (10, "copy_S300_gray: start\n"); - - /*front side data*/ - if(side == SIDE_FRONT){ - tp = &s->front; - - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - int lineStart = tp->rx_bytes; - - for(j=0; jwidth_pix; j++){ - - tp->buffer[tp->rx_bytes++] = - - /*red*/ - ( s->block.buffer[i + s->req_width*3 + j*3] - - /*green*/ - + s->block.buffer[i + s->req_width*6 + j*3] - - /*blue*/ - + s->block.buffer[i + j*3]) / 3; - } - - /*have filled last row of buffer, bail out*/ - if(tp->rx_bytes == tp->total_bytes){ - return ret; - } + DBG (10, "copy_block_to_page: start\n"); + /* loop over all the lines in the block */ + for (i = 0; i < height; i++) + { + unsigned char * p_in = block->image->buffer + (side * block_page_stride) + (i * block->image->width_bytes); + unsigned char * p_out = page->image->buffer + ((i + page_y_offset) * page->image->width_bytes); + unsigned char * lineStart = p_out; + /* reverse order for back side or FI-60F scanner */ + if (line_reverse) + p_in += (width - 1) * 3; + /* convert all of the pixels in this row */ + for (j = 0; j < width; j++) + { + unsigned char r, g, b; + if (s->model == MODEL_S300) + { r = p_in[1]; g = p_in[2]; b = p_in[0]; } + else /* (s->model == MODEL_FI60F) */ + { r = p_in[0]; g = p_in[1]; b = p_in[2]; } + if (s->mode == MODE_COLOR) + { + *p_out++ = r; + *p_out++ = g; + *p_out++ = b; + } + else if (s->mode == MODE_GRAYSCALE) + { + *p_out++ = (r + g + b) / 3; + } + else if (s->mode == MODE_LINEART) + { + s->dt.buffer[j] = (r + g + b) / 3; + } + if (line_reverse) + p_in -= 3; + else + p_in += 3; + } + /* for MODE_LINEART, binarize the gray line stored in the temp image buffer */ + if (s->mode == MODE_LINEART) + binarize_line(s, lineStart, width); /*add a periodic row because of non-square pixels*/ /*FIXME: only works with 225x200*/ - if(s->resolution_x > s->resolution_y - && tp->rx_bytes/tp->width_bytes % 9 == 8 - ){ - memcpy(tp->buffer+tp->rx_bytes,tp->buffer+lineStart,tp->width_bytes); - tp->rx_bytes+=tp->width_bytes; + if (s->resolution_x > s->resolution_y && (i + page_y_offset) % 9 == 8) + { + memcpy(lineStart + page->image->width_bytes, lineStart, page->image->width_bytes); + page_y_offset += 1; + page->bytes_scanned += page->image->width_bytes; } - } } - /*back side data*/ - else{ - tp = &s->back; - - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - int lineStart = tp->rx_bytes; - - for(j=0; jwidth_pix; j++){ - - tp->buffer[tp->rx_bytes++] = - /*red*/ - (s->block.buffer[i + s->req_width*3 + (tp->width_pix-1)*3 - j*3 + 1] - - /*green*/ - +s->block.buffer[i + s->req_width*6 + (tp->width_pix-1)*3 - j*3 + 1] - - /*blue*/ - +s->block.buffer[i + (tp->width_pix-1)*3 - j*3 + 1]) / 3; - } - - /*have filled last row of buffer, bail out*/ - if(tp->rx_bytes == tp->total_bytes){ - return ret; - } - - /*add a periodic row because of non-square pixels*/ - /*FIXME: only works with 225x200*/ - if(s->resolution_x > s->resolution_y - && tp->rx_bytes/tp->width_bytes % 9 == 8 - ){ - memcpy(tp->buffer+tp->rx_bytes,tp->buffer+lineStart,tp->width_bytes); - tp->rx_bytes+=tp->width_bytes; - } - } - } + /* update the page counter of bytes scanned */ + page->bytes_scanned += page->image->width_bytes * height; - DBG (10, "copy_S300_gray: finish\n"); + DBG (10, "copy_block_to_page: finish\n"); return ret; } /*uses the threshold/threshold_curve to control binarization*/ static SANE_Status -copy_S300_binary(struct scanner *s,int side) +binarize_line(struct scanner *s, unsigned char *lineOut, int width) { - SANE_Status ret=SANE_STATUS_GOOD; - struct transfer * tp; - int i,j,windowX; - - DBG (10, "copy_S300_binary: start\n"); + SANE_Status ret = SANE_STATUS_GOOD; + int j, windowX, sum = 0; /* ~1mm works best, but the window needs to have odd # of pixels */ - windowX = 6 * s->resolution_x/150; - if(!(windowX % 2)){ - windowX++; - } - - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - int sum = 0; - int lineStart = 0; - - /*first, load a gray line into the dt buffer*/ - if(side == SIDE_FRONT){ - tp = &s->front; - - for(j=0; jwidth_pix; j++){ - - s->dt.buffer[j] = - - /*red*/ - ( s->block.buffer[i + s->req_width*3 + j*3] - - /*green*/ - + s->block.buffer[i + s->req_width*6 + j*3] - - /*blue*/ - + s->block.buffer[i + j*3]) / 3; - } - } - else{ - tp = &s->back; - - for(j=0; jwidth_pix; j++){ - - s->dt.buffer[j] = - - /*red*/ - (s->block.buffer[i + s->req_width*3 + (tp->width_pix-1)*3 - j*3 + 1] - - /*green*/ - +s->block.buffer[i + s->req_width*6 + (tp->width_pix-1)*3 - j*3 + 1] - - /*blue*/ - +s->block.buffer[i + (tp->width_pix-1)*3 - j*3 + 1]) / 3; - } - } + windowX = 6 * s->resolution_x / 150; + if (!(windowX % 2)) windowX++; - /*second, prefill the sliding sum*/ - for(j=0; jdt.buffer[j]; - } - - lineStart = tp->rx_bytes; - - /* third, walk the dt buffer, update the sliding sum, */ - /* determine threshold, output bits */ - for(j=0; jwidth_pix; j++){ + /* third, walk the dt buffer, update the sliding sum, */ + /* determine threshold, output bits */ + for (j = 0; j < width; j++) + { /*output image location*/ - int offset = j%8; + int offset = j % 8; unsigned char mask = 0x80 >> offset; int thresh = s->threshold; /* move sum/update threshold only if there is a curve*/ - if(s->threshold_curve){ - int addCol = j + windowX/2; - int dropCol = addCol - windowX; - - if(dropCol >= 0 && addCol < tp->width_pix){ - sum -= s->dt.buffer[dropCol]; - sum += s->dt.buffer[addCol]; - } - - thresh = s->dt_lut[sum/windowX]; + if (s->threshold_curve) + { + int addCol = j + windowX/2; + int dropCol = addCol - windowX; + + if (dropCol >= 0 && addCol < width) + { + sum -= s->dt.buffer[dropCol]; + sum += s->dt.buffer[addCol]; + } + thresh = s->dt_lut[sum/windowX]; } /*use average to lookup threshold*/ - /* white */ - if(s->dt.buffer[j] > thresh){ - tp->buffer[tp->rx_bytes] &= ~mask; - } - /* black */ - else{ - tp->buffer[tp->rx_bytes] |= mask; - } + if (s->dt.buffer[j] > thresh) + *lineOut &= ~mask; /* white */ + else + *lineOut |= mask; /* black */ - if(offset == 7){ - tp->rx_bytes++; - } - } - - /*have filled last row of buffer, bail out*/ - if(tp->rx_bytes == tp->total_bytes){ - return ret; + if (offset == 7) + lineOut++; } - /*add a periodic row because of non-square pixels*/ - /*FIXME: only works with 225x200*/ - if(s->resolution_x > s->resolution_y - && tp->rx_bytes/tp->width_bytes % 9 == 8 - ){ - memcpy(tp->buffer+tp->rx_bytes,tp->buffer+lineStart,tp->width_bytes); - tp->rx_bytes+=tp->width_bytes; - } - } - - DBG (10, "copy_S300_binary: finish\n"); - - return ret; -} - -/* copies block_buffer into front and back buffers */ -/* moves front/back rx_bytes forward */ -static SANE_Status -fill_frontback_buffers_FI60F(struct scanner *s) -{ - SANE_Status ret=SANE_STATUS_GOOD; - int i,j,k; - - DBG (10, "fill_frontback_buffers_FI60F: start\n"); - - switch (s->mode) { - case MODE_COLOR: - - /* reorder the img data into the struct's buffer */ - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - DBG (15, "fill_frontback_buffers_FI60F: offset %d\n", i); - - for(k=0; k<3; k++){ - - for(j=0; jhead_width; j++){ - - /* red */ - s->front.buffer[s->front.rx_bytes++] = - s->block.buffer[i+(s->head_width-1-j)*3+2-k]; - - /* green */ - s->front.buffer[s->front.rx_bytes++] = - s->block.buffer[i+(s->head_width*2+s->pad_width-1-j)*3+2-k]; - - /* blue */ - s->front.buffer[s->front.rx_bytes++] = - s->block.buffer[i+(s->head_width*3+s->pad_width*2-1-j)*3+2-k]; - } - } - } - - break; - - case MODE_GRAYSCALE: - - /* reorder the img data into the struct's buffer */ - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - DBG (15, "fill_frontback_buffers_FI60F: offset %d\n", i); - - for(k=0; k<3; k++){ - - for(j=0; jhead_width; j++){ - - /* GS = red green blue / 3 */ - s->front.buffer[s->front.rx_bytes++] = - ( s->block.buffer[i+(s->head_width-1-j)*3+2-k] - + s->block.buffer[i+(s->head_width*2+s->pad_width-1-j)*3+2-k] - + s->block.buffer[i+(s->head_width*3+s->pad_width*2-1-j)*3+2-k] - )/3; - } - } - } - break; - - default: /* binary */ - - /* put binary data into buffer */ - for(i=0; iblock.rx_bytes-8; i+=s->block.width_bytes){ - - DBG (15, "fill_frontback_buffers_FI60F: offset %d\n", i); - - for(k=0; k<3; k++){ - - for(j=0; jhead_width; j++){ - - int offset = j%8; - unsigned char mask = 0x80 >> offset; - int curr = s->block.buffer[i+(s->head_width-1-j)*3+2-k] - + s->block.buffer[i+(s->head_width*2+s->pad_width-1-j)*3+2-k] - + s->block.buffer[i+(s->head_width*3+s->pad_width*2-1-j)*3+2-k]; - - /* looks white */ - if(curr > s->threshold){ - s->front.buffer[s->front.rx_bytes] &= ~mask; - } - else{ - s->front.buffer[s->front.rx_bytes] |= mask; - } - - if(offset == 7){ - s->front.rx_bytes++; - } - } - } - } - - break; - } - - DBG (10, "fill_frontback_buffers_FI60F: finish\n"); - return ret; } @@ -4006,10 +4023,24 @@ s->sendcal.buffer = NULL; } + if(s->cal_image.raw_data){ + free(s->cal_image.raw_data); + s->cal_image.raw_data = NULL; + } + + if(s->cal_data.raw_data){ + free(s->cal_data.raw_data); + s->cal_data.raw_data = NULL; + } + /* image slice */ - if(s->block.buffer){ - free(s->block.buffer); - s->block.buffer = NULL; + if(s->block_img.buffer){ + free(s->block_img.buffer); + s->block_img.buffer = NULL; + } + if(s->block_xfr.raw_data){ + free(s->block_xfr.raw_data); + s->block_xfr.raw_data = NULL; } /* dynamic thresh slice */ @@ -4296,3 +4327,4 @@ return s->page_height; } + diff -Nru sane-backends-1.0.20/backend/epjitsu-cmd.h sane-backends-1.0.21/backend/epjitsu-cmd.h --- sane-backends-1.0.20/backend/epjitsu-cmd.h 2008-09-25 13:15:49.000000000 +1000 +++ sane-backends-1.0.21/backend/epjitsu-cmd.h 2010-04-05 23:18:03.000000000 +1000 @@ -79,7 +79,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x60, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0x3840 bytes) */ @@ -121,7 +121,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0x42c0 bytes) */ @@ -163,7 +163,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */ @@ -207,7 +207,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */ @@ -251,7 +251,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc000 bytes) */ @@ -295,7 +295,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0x17880 bytes) */ @@ -338,7 +338,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x08, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */ @@ -382,7 +382,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */ @@ -426,7 +426,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */ diff -Nru sane-backends-1.0.20/backend/epjitsu.conf.in sane-backends-1.0.21/backend/epjitsu.conf.in --- sane-backends-1.0.20/backend/epjitsu.conf.in 2009-02-24 01:24:27.000000000 +1100 +++ sane-backends-1.0.21/backend/epjitsu.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -31,3 +31,7 @@ # Fujitsu S300M firmware @DATADIR@/sane/epjitsu/300M_0C00.nal usb 0x04c5 0x117f + +# Fujitsu S1300 +firmware @DATADIR@/sane/epjitsu/1300_0C26.nal +usb 0x04c5 0x11ed diff -Nru sane-backends-1.0.20/backend/epjitsu.h sane-backends-1.0.21/backend/epjitsu.h --- sane-backends-1.0.20/backend/epjitsu.h 2009-01-25 12:29:25.000000000 +1100 +++ sane-backends-1.0.21/backend/epjitsu.h 2010-04-05 23:18:04.000000000 +1000 @@ -51,21 +51,34 @@ #define MAX_IMG_PASS 0x10000 #define MAX_IMG_BLOCK 0x80000 -struct transfer { - int height; - +struct image { int width_pix; int width_bytes; + int height; + int pages; - int total_pix; - int total_bytes; + unsigned char * buffer; +}; - int rx_bytes; - int tx_bytes; +struct transfer { + int plane_width; /* in RGB pixels */ + int plane_stride; /* in bytes */ + int line_stride; /* in bytes */ + int total_bytes; + int rx_bytes; int done; - unsigned char * buffer; + unsigned char * raw_data; + struct image * image; +}; + +struct page { + int bytes_total; + int bytes_scanned; + int bytes_read; + int done; + struct image *image; }; struct scanner @@ -185,42 +198,46 @@ int started; int side; - /* requested size params (almost no relation to actual data?) */ - int req_width; /* pixel width of first read-head? */ - int head_width; - int pad_width; - - /* holds temp buffer for getting 1 line of cal data */ - struct transfer coarsecal; - - /* holds temp buffer for getting 32 lines of cal data */ - struct transfer darkcal; - - /* holds temp buffer for getting 32 lines of cal data */ - struct transfer lightcal; + /* holds temp buffers for getting 16 lines of cal data */ + struct transfer cal_image; + struct image coarsecal; + struct image darkcal; + struct image lightcal; /* holds temp buffer for building calibration data */ - struct transfer sendcal; + struct transfer cal_data; + struct image sendcal; /* scanner transmits more data per line than requested */ /* due to padding and/or duplex interlacing */ - /* the scan struct holds these larger numbers, but buffer is unused */ - struct transfer scan; + /* the scan struct holds these larger numbers, but image buffer is unused */ + struct { + int done; + int height; + int rx_bytes; + int width_bytes; + int total_bytes; + } fullscan; + + /* The page structs contain data about the progress as the application reads */ + /* data from the front/back image buffers via the sane_read() function */ + struct page pages[2]; /* scanner transmits data in blocks, up to 512k */ /* but always ends on a scanline. */ /* the block struct holds the most recent buffer */ - struct transfer block; + struct transfer block_xfr; + struct image block_img; /* temporary buffers used by dynamic threshold code */ - struct transfer dt; + struct image dt; unsigned char dt_lut[256]; /* final-sized front image, always used */ - struct transfer front; + struct image front; /* final-sized back image, only used during duplex/backside */ - struct transfer back; + struct image back; /* --------------------------------------------------------------------- */ /* values used by the command and data sending function */ @@ -263,7 +280,6 @@ /* ------------------------------------------------------------------------- */ -#define MM_PER_INCH 25.4 #define MM_PER_UNIT_UNFIX SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0)) #define MM_PER_UNIT_FIX SANE_FIX(SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))) @@ -355,10 +371,9 @@ static SANE_Status scan(struct scanner *s); static SANE_Status read_from_scanner(struct scanner *s, struct transfer *tp); -static SANE_Status copy_S300_color(struct scanner *s, int side); -static SANE_Status copy_S300_gray(struct scanner *s, int side); -static SANE_Status copy_S300_binary(struct scanner *s, int side); -static SANE_Status fill_frontback_buffers_FI60F(struct scanner *s); +static SANE_Status descramble_raw(struct scanner *s, struct transfer * tp); +static SANE_Status copy_block_to_page(struct scanner *s, int side); +static SANE_Status binarize_line(struct scanner *s, unsigned char *lineOut, int width); static SANE_Status get_hardware_status (struct scanner *s); diff -Nru sane-backends-1.0.20/backend/epson2.c sane-backends-1.0.21/backend/epson2.c --- sane-backends-1.0.20/backend/epson2.c 2009-04-30 23:15:19.000000000 +1000 +++ sane-backends-1.0.21/backend/epson2.c 2010-04-05 23:18:04.000000000 +1000 @@ -5,7 +5,7 @@ * Work on epson.[ch] file from the SANE package. * Please see those files for additional copyrights. * - * Copyright (C) 2006-07 Tower Technologies + * Copyright (C) 2006-10 Tower Technologies * Author: Alessandro Zummo * * This file is part of the SANE package. @@ -17,15 +17,18 @@ #define EPSON2_VERSION 1 #define EPSON2_REVISION 0 -#define EPSON2_BUILD 117 +#define EPSON2_BUILD 124 /* debugging levels: * * 127 e2_recv buffer * 125 e2_send buffer + * 32 more network progression + * 24 network header + * 23 network info * 20 usb cmd counters * 18 sane_read - * 17 setvalue + * 17 setvalue, getvalue, control_option * 15 e2_send, e2_recv calls * 13 e2_cmd_info_block * 12 epson_cmd_simple @@ -41,7 +44,7 @@ * warnings */ -#include "../include/sane/config.h" +#include "sane/config.h" #include "epson2.h" @@ -55,125 +58,23 @@ #include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include "sane/saneopts.h" +#include "sane/sanei_scsi.h" +#include "sane/sanei_usb.h" +#include "sane/sanei_pio.h" +#include "sane/sanei_tcp.h" +#include "sane/sanei_udp.h" +#include "sane/sanei_backend.h" +#include "sane/sanei_config.h" #include "epson2-io.h" #include "epson2-commands.h" +#include "epson2-ops.h" #include "epson2_scsi.h" #include "epson_usb.h" #include "epson2_net.h" -static EpsonCmdRec epson_cmd[] = { - -/* - * request identity - * | request identity2 - * | | request status - * | | | request command parameter - * | | | | set color mode - * | | | | | start scanning - * | | | | | | set data format - * | | | | | | | set resolution - * | | | | | | | | set zoom - * | | | | | | | | | set scan area - * | | | | | | | | | | set brightness - * | | | | | | | | | | | set gamma - * | | | | | | | | | | | | set halftoning - * | | | | | | | | | | | | | set color correction - * | | | | | | | | | | | | | | initialize scanner - * | | | | | | | | | | | | | | | set speed - * | | | | | | | | | | | | | | | | set lcount - * | | | | | | | | | | | | | | | | | mirror image - * | | | | | | | | | | | | | | | | | | set gamma table - * | | | | | | | | | | | | | | | | | | | set outline emphasis - * | | | | | | | | | | | | | | | | | | | | set dither - * | | | | | | | | | | | | | | | | | | | | | set color correction coefficients - * | | | | | | | | | | | | | | | | | | | | | | request extended status - * | | | | | | | | | | | | | | | | | | | | | | | control an extension - * | | | | | | | | | | | | | | | | | | | | | | | | forward feed / eject - * | | | | | | | | | | | | | | | | | | | | | | | | | feed - * | | | | | | | | | | | | | | | | | | | | | | | | | | request push button status - * | | | | | | | | | | | | | | | | | | | | | | | | | | | control auto area segmentation - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | set film type - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set exposure time - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set bay - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set threshold - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set focus position - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request extended identity - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request scanner status - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - */ - {"A1", 'I', 0x0, 'F', 'S', 0x0, 'G', 0x0, 'R', 0x0, 'A', 0x0, - {-0, 0, 0}, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0}, - {"A2", 'I', 0x0, 'F', 'S', 0x0, 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 0x0, '@', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B1", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 0x0, 'A', 0x0, - {-0, 0, 0}, 0x0, 'B', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B2", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 0x0, '@', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B3", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 'M', '@', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 'm', - 'f', 'e', 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B4", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 'M', '@', 'g', 'd', 0x0, 'z', 'Q', 'b', 'm', - 'f', 'e', 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B5", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 'M', '@', 'g', 'd', 'K', 'z', 'Q', 'b', 'm', - 'f', 'e', 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B6", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 'B', 'M', '@', 'g', 'd', 'K', 'z', 'Q', 'b', 'm', - 'f', 'e', 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"B7", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-4, 3, 0}, 'Z', 'B', 'M', '@', 'g', 'd', 'K', 'z', 'Q', 'b', 'm', - 'f', 'e', '\f', 0x00, '!', 's', 'N', 0x0, 0x0, 't', 0x0, 0x0, 'I', - 'F'}, - {"B8", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-4, 3, 0}, 'Z', 'B', 'M', '@', 'g', 'd', 'K', 'z', 'Q', 'b', 'm', - 'f', 'e', '\f', 0x19, '!', 's', 'N', 0x0, 0x0, 0x0, 'p', 'q', 'I', - 'F'}, - {"F5", 'I', 0x0, 'F', 'S', 'C', 'G', 'D', 'R', 'H', 'A', 'L', - {-3, 3, 0}, 'Z', 0x0, 'M', '@', 'g', 'd', 'K', 'z', 'Q', 0x0, 'm', - 0x0, 'e', '\f', 0x00, 0x0, 0x0, 'N', 'T', 'P', 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"D1", 'I', 'i', 'F', 0x0, 'C', 'G', 'D', 'R', 0x0, 'A', 0x0, - {-0, 0, 0}, 'Z', 0x0, 0x0, '@', 'g', 'd', 0x0, 'z', 0x0, 0x0, 0x0, - 'f', 0x0, 0x00, 0x00, '!', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"D7", 'I', 'i', 'F', 0x0, 'C', 'G', 'D', 'R', 0x0, 'A', 0x0, - {-0, 0, 0}, 'Z', 0x0, 0x0, '@', 'g', 'd', 0x0, 'z', 0x0, 0x0, 0x0, - 'f', 0x0, 0x00, 0x00, '!', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, - {"D8", 'I', 'i', 'F', 0x0, 'C', 'G', 'D', 'R', 0x0, 'A', 0x0, - {-0, 0, 0}, 'Z', 0x0, 0x0, '@', 'g', 'd', 0x0, 'z', 0x0, 0x0, 0x0, - 'f', 'e', 0x00, 0x00, '!', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0}, -}; - /* * Definition of the mode_param struct, that is used to * specify the valid parameters for the different scan modes. @@ -181,24 +82,20 @@ * The depth variable gets updated when the bit depth is modified. */ -struct mode_param -{ - int color; - int flags; - int dropout_mask; - int depth; -}; - -static struct mode_param mode_params[] = { +struct mode_param mode_params[] = { {0, 0x00, 0x30, 1}, {0, 0x00, 0x30, 8}, - {1, 0x02, 0x00, 8} + {1, 0x02, 0x00, 8}, + {0, 0x00, 0x30, 1} }; -static const SANE_String_Const mode_list[] = { - SANE_I18N("Binary"), - SANE_I18N("Gray"), - SANE_I18N("Color"), +static SANE_String_Const mode_list[] = { + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, +#ifdef SANE_FRAME_IR + SANE_I18N("Infrared"), +#endif NULL }; @@ -220,17 +117,13 @@ * of the scanner. */ -static SANE_String_Const source_list[] = { +SANE_String_Const source_list[] = { FBF_STR, NULL, NULL, NULL }; -/* some defines to make handling the TPU easier */ -#define FILM_TYPE_NEGATIVE (1L << 0) -#define FILM_TYPE_SLIDE (1L << 1) - static const SANE_String_Const film_list[] = { SANE_I18N("Positive Film"), SANE_I18N("Negative Film"), @@ -239,8 +132,6 @@ NULL }; -static int film_params[] = { 0, 1, 2, 3 }; - static const SANE_String_Const focus_list[] = { SANE_I18N("Focus on glass"), SANE_I18N("Focus 2.5mm above glass"), @@ -250,7 +141,7 @@ #define HALFTONE_NONE 0x01 #define HALFTONE_TET 0x03 -static const int halftone_params[] = { +const int halftone_params[] = { HALFTONE_NONE, 0x00, 0x10, @@ -299,13 +190,6 @@ NULL }; -static const int dropout_params[] = { - 0x00, /* none */ - 0x10, /* red */ - 0x20, /* green */ - 0x30 /* blue */ -}; - static const SANE_String_Const dropout_list[] = { SANE_I18N("None"), SANE_I18N("Red"), @@ -314,46 +198,44 @@ NULL }; -/* - * Color correction: - * One array for the actual parameters that get sent to the scanner (color_params[]), - * one array for the strings that get displayed in the user interface (color_list[]) - * and one array to mark the user defined color correction (dolor_userdefined[]). - */ -static const int color_params[] = { - 0x00, - 0x01, - 0x10, - 0x20, - 0x40, - 0x80 -}; - -static const SANE_Bool color_userdefined[] = { +static const SANE_Bool correction_userdefined[] = { SANE_FALSE, SANE_TRUE, - SANE_FALSE, - SANE_FALSE, - SANE_FALSE, - SANE_FALSE + SANE_TRUE, }; -static const SANE_String_Const color_list[] = { - SANE_I18N("No Correction"), - SANE_I18N("User defined"), - SANE_I18N("Impact-dot printers"), - SANE_I18N("Thermal printers"), - SANE_I18N("Ink-jet printers"), - SANE_I18N("CRT monitors"), +static const SANE_String_Const correction_list[] = { + SANE_I18N("None"), + SANE_I18N("Built in CCT profile"), + SANE_I18N("User defined CCT profile"), NULL }; +enum { + CORR_NONE, CORR_AUTO, CORR_USER +}; + +static const SANE_String_Const cct_mode_list[] = { + "Automatic", + "Reflective", + "Colour negatives", + "Monochrome negatives", + "Colour positives", + NULL +}; + +enum { + CCT_AUTO, CCT_REFLECTIVE, CCT_COLORNEG, CCT_MONONEG, + CCT_COLORPOS +}; + /* * Gamma correction: - * The A and B level scanners work differently than the D level scanners, therefore - * I define two different sets of arrays, plus one set of variables that get set to - * the actally used params and list arrays at runtime. + * The A and B level scanners work differently than the D level scanners, + * therefore I define two different sets of arrays, plus one set of + * variables that get set to the actally used params and list arrays at runtime. */ + static int gamma_params_ab[] = { 0x01, 0x03, @@ -396,7 +278,7 @@ }; static SANE_Bool *gamma_userdefined; -static int *gamma_params; +int *gamma_params; /* Bay list: * this is used for the FilmScan @@ -416,27 +298,16 @@ /* minimum, maximum, quantization */ static const SANE_Range u8_range = { 0, 255, 0 }; static const SANE_Range s8_range = { -127, 127, 0 }; - -/* used for several boolean choices */ -static int switch_params[] = { - 0, - 1 -}; - -#define mirror_params switch_params +static const SANE_Range fx_range = { SANE_FIX(-2.0), SANE_FIX(2.0), 0 }; static const SANE_Range outline_emphasis_range = { -2, 2, 0 }; -static SANE_Word *bitDepthList = NULL; - - - /* * List of pointers to devices - will be dynamically allocated depending * on the number of devices found. */ -static const SANE_Device **devlist = 0; +static const SANE_Device **devlist; /* Some utility functions */ @@ -455,86 +326,18 @@ return max_size; } -typedef struct -{ - unsigned char code; - unsigned char status; - - unsigned char buf[4]; - -} EpsonDataRec; - -static SANE_Status color_shuffle(SANE_Handle handle, int *new_length); static SANE_Status attach_one_usb(SANE_String_Const devname); static SANE_Status attach_one_net(SANE_String_Const devname); -static void filter_resolution_list(Epson_Scanner * s); - - -static SANE_Bool -e2_model(Epson_Scanner * s, const char *model) -{ - if (s->hw->model == NULL) - return SANE_FALSE; - - if (strncmp(s->hw->model, model, strlen(model)) == 0) - return SANE_TRUE; - - return SANE_FALSE; -} - -/* A little helper function to correct the extended status reply - * gotten from scanners with known buggy firmware. - */ -static void -fix_up_extended_status_reply(Epson_Scanner * s, unsigned char *buf) -{ - if (e2_model(s, "ES-9000H") || e2_model(s, "GT-30000")) { - DBG(1, "fixing up buggy ADF max scan dimensions.\n"); - buf[2] = 0xB0; - buf[3] = 0x6D; - buf[4] = 0x60; - buf[5] = 0x9F; - } -} static void print_params(const SANE_Parameters params) { - DBG(6, "params.format = %d\n", params.format); - DBG(6, "params.last_frame = %d\n", params.last_frame); - DBG(6, "params.bytes_per_line = %d\n", params.bytes_per_line); + DBG(6, "params.format = %d\n", params.format); + DBG(6, "params.last_frame = %d\n", params.last_frame); + DBG(6, "params.bytes_per_line = %d\n", params.bytes_per_line); DBG(6, "params.pixels_per_line = %d\n", params.pixels_per_line); - DBG(6, "params.lines = %d\n", params.lines); - DBG(6, "params.depth = %d\n", params.depth); -} - -static void -e2_set_cmd_level(SANE_Handle handle, unsigned char *level) -{ - Epson_Scanner *s = (Epson_Scanner *) handle; - Epson_Device *dev = s->hw; - - int n; - - DBG(1, "%s: %c%c\n", __func__, level[0], level[1]); - - /* set command type and level */ - for (n = 0; n < NELEMS(epson_cmd); n++) { - char type_level[3]; - sprintf(type_level, "%c%c", level[0], level[1]); - if (!strncmp(type_level, epson_cmd[n].level, 2)) - break; - } - - if (n < NELEMS(epson_cmd)) { - dev->cmd = &epson_cmd[n]; - } else { - dev->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; - DBG(1, " unknown type %c or level %c, using %s\n", - level[0], level[1], dev->cmd->level); - } - - s->hw->level = dev->cmd->level[1] - '0'; + DBG(6, "params.lines = %d\n", params.lines); + DBG(6, "params.depth = %d\n", params.depth); } /* @@ -545,7 +348,7 @@ */ static void -close_scanner(Epson_Scanner * s) +close_scanner(Epson_Scanner *s) { DBG(7, "%s: fd = %d\n", __func__, s->fd); @@ -557,9 +360,8 @@ esci_request_status(s, NULL); /* request extended status. This toggles w_cmd_count only */ - if (w_cmd_count % 2) { + if (w_cmd_count % 2) esci_request_extended_status(s, NULL, NULL); - } if (s->hw->connection == SANE_EPSON_NET) { sanei_epson_net_unlock(s); @@ -573,7 +375,6 @@ } s->fd = -1; - return; } static void @@ -584,17 +385,17 @@ SANE_Status status; char *ip, *query = "EPSONP\x00\xff\x00\x00\x00\x00\x00\x00\x00"; - u_char buf[76]; + unsigned char buf[76]; struct timeval to; - long save_flags, flags; + long save_flags, flags; status = sanei_udp_open_broadcast(&fd); if (status != SANE_STATUS_GOOD) return; - sanei_udp_write_broadcast(fd, 3289, (u_char *) query, 15); + sanei_udp_write_broadcast(fd, 3289, (unsigned char *) query, 15); DBG(5, "%s, sent discovery packet\n", __func__); @@ -604,9 +405,9 @@ FD_ZERO(&rfds); FD_SET(fd, &rfds); - save_flags = flags = fcntl(fd, F_GETFL, 0L); - flags |= O_NONBLOCK; - fcntl(fd, F_SETFL, flags); + save_flags = flags = fcntl(fd, F_GETFL, 0L); + flags |= O_NONBLOCK; + fcntl(fd, F_SETFL, flags); if (select(fd + 1, &rfds, NULL, NULL, &to) > 0) { while ((len = sanei_udp_recvfrom(fd, buf, 76, &ip)) == 76) { DBG(5, " response from %s\n", ip); @@ -616,16 +417,13 @@ attach_one_net(ip); } } - fcntl(fd, F_SETFL, save_flags); + fcntl(fd, F_SETFL, save_flags); DBG(5, "%s, end\n", __func__); sanei_udp_close(fd); } - - - /* * open_scanner() * @@ -634,11 +432,11 @@ */ static SANE_Status -open_scanner(Epson_Scanner * s) +open_scanner(Epson_Scanner *s) { SANE_Status status = 0; - DBG(7, "%s\n", __func__); + DBG(7, "%s: %s\n", __func__, s->hw->sane.name); if (s->fd != -1) { DBG(5, "scanner is already open: fd = %d\n", s->fd); @@ -648,1018 +446,452 @@ if (s->hw->connection == SANE_EPSON_NET) { unsigned char buf[5]; - /* Sleep a bit or the network scanner will not be ready */ - sleep(1); + /* device name has the form net:ipaddr */ + status = sanei_tcp_open(&s->hw->sane.name[4], 1865, &s->fd); + if (status == SANE_STATUS_GOOD) { - status = sanei_tcp_open(s->hw->sane.name, 1865, &s->fd); - if (status != SANE_STATUS_GOOD) - goto end; + ssize_t read; + struct timeval tv; - s->netlen = 0; - /* the scanner sends a kind of welcome msg */ - e2_recv(s, buf, 5, &status); + tv.tv_sec = 5; + tv.tv_usec = 0; - /* lock the scanner for use by sane */ - sanei_epson_net_lock(s); + setsockopt(s->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)); + + s->netlen = 0; + + DBG(32, "awaiting welcome message\n"); + + /* the scanner sends a kind of welcome msg */ + read = e2_recv(s, buf, 5, &status); + if (read != 5) + return SANE_STATUS_IO_ERROR; + + DBG(32, "welcome message received, locking the scanner...\n"); + + /* lock the scanner for use by sane */ + sanei_epson_net_lock(s); + + DBG(32, "scanner locked\n"); + } + } else if (s->hw->connection == SANE_EPSON_SCSI) status = sanei_scsi_open(s->hw->sane.name, &s->fd, sanei_epson2_scsi_sense_handler, NULL); else if (s->hw->connection == SANE_EPSON_PIO) - status = sanei_pio_open(s->hw->sane.name, &s->fd); + /* device name has the form pio:0xnnn */ + status = sanei_pio_open(&s->hw->sane.name[4], &s->fd); + else if (s->hw->connection == SANE_EPSON_USB) status = sanei_usb_open(s->hw->sane.name, &s->fd); - end: + if (status == SANE_STATUS_ACCESS_DENIED) { + DBG(1, "please check that you have permissions on the device.\n"); + DBG(1, "if this is a multi-function device with a printer,\n"); + DBG(1, "disable any conflicting driver (like usblp).\n"); + } - if (status != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) DBG(1, "%s open failed: %s\n", s->hw->sane.name, - sane_strstatus(status)); + sane_strstatus(status)); + else + DBG(5, "scanner opened\n"); return status; } - -static int num_devices = 0; /* number of scanners attached to backend */ -static Epson_Device *first_dev = NULL; /* first EPSON scanner in list */ -static Epson_Scanner *first_handle = NULL; - -static SANE_Status -e2_set_model(Epson_Scanner * s, unsigned char *model, size_t len) +static SANE_Status detect_scsi(struct Epson_Scanner *s) { - unsigned char *buf; - char *p; + SANE_Status status; struct Epson_Device *dev = s->hw; - buf = malloc(len + 1); - if (buf == NULL) - return SANE_STATUS_NO_MEM; + char buf[INQUIRY_BUF_SIZE + 1]; + size_t buf_size = INQUIRY_BUF_SIZE; - memcpy(buf, model, len); - buf[len] = '\0'; + char *vendor = buf + 8; + char *model = buf + 16; + char *rev = buf + 32; - p = strchr((const char *) buf, ' '); - if (p != NULL) - *p = '\0'; + status = sanei_epson2_scsi_inquiry(s->fd, buf, &buf_size); + if (status != SANE_STATUS_GOOD) { + DBG(1, "%s: inquiry failed: %s\n", __func__, + sane_strstatus(status)); + return status; + } - if (dev->model) - free(dev->model); + buf[INQUIRY_BUF_SIZE] = 0; + DBG(1, "inquiry data:\n"); + DBG(1, " vendor : %.8s\n", vendor); + DBG(1, " model : %.16s\n", model); + DBG(1, " revision: %.4s\n", rev); + + if (buf[0] != TYPE_PROCESSOR) { + DBG(1, "%s: device is not of processor type (%d)\n", + __func__, buf[0]); + return SANE_STATUS_INVAL; + } - dev->model = strndup((const char *) buf, len); - dev->sane.model = dev->model; + if (strncmp(vendor, "EPSON", 5) != 0) { + DBG(1, + "%s: device doesn't look like an EPSON scanner\n", + __func__); + return SANE_STATUS_INVAL; + } + + if (strncmp(model, "SCANNER ", 8) != 0 + && strncmp(model, "FilmScan 200", 12) != 0 + && strncmp(model, "Perfection", 10) != 0 + && strncmp(model, "Expression", 10) != 0 + && strncmp(model, "GT", 2) != 0) { + DBG(1, "%s: this EPSON scanner is not supported\n", + __func__); + return SANE_STATUS_INVAL; + } - DBG(10, "%s: model is '%s'\n", __func__, dev->model); + if (strncmp(model, "FilmScan 200", 12) == 0) { + dev->sane.type = "film scanner"; + e2_set_model(s, (unsigned char *) model, 12); + } - free(buf); + /* Issue a test unit ready SCSI command. The FilmScan 200 + * requires it for a sort of "wake up". We might eventually + * get the return code and reissue it in case of failure. + */ + sanei_epson2_scsi_test_unit_ready(s->fd); return SANE_STATUS_GOOD; } static SANE_Status -e2_add_resolution(Epson_Scanner * s, int r) +detect_usb(struct Epson_Scanner *s) { - struct Epson_Device *dev = s->hw; + SANE_Status status; + int vendor, product; + int i, numIds; + SANE_Bool is_valid; - dev->res_list_size++; - dev->res_list = (SANE_Int *) realloc(dev->res_list, - dev->res_list_size * - sizeof(SANE_Word)); + /* if the sanei_usb_get_vendor_product call is not supported, + * then we just ignore this and rely on the user to config + * the correct device. + */ - DBG(10, "%s: add (dpi): %d\n", __func__, r); + status = sanei_usb_get_vendor_product(s->fd, &vendor, &product); + if (status != SANE_STATUS_GOOD) { + DBG(1, "the device cannot be verified - will continue\n"); + return SANE_STATUS_GOOD; + } + + /* check the vendor ID to see if we are dealing with an EPSON device */ + if (vendor != SANE_EPSON_VENDOR_ID) { + /* this is not a supported vendor ID */ + DBG(1, "not an Epson device at %s (vendor id=0x%x)\n", + s->hw->sane.name, vendor); + return SANE_STATUS_INVAL; + } - if (dev->res_list == NULL) - return SANE_STATUS_NO_MEM; + numIds = sanei_epson_getNumberOfUSBProductIds(); + is_valid = SANE_FALSE; + i = 0; + + /* check all known product IDs to verify that we know + about the device */ + while (i != numIds && !is_valid) { + if (product == sanei_epson_usb_product_ids[i]) + is_valid = SANE_TRUE; + i++; + } - dev->res_list[dev->res_list_size - 1] = (SANE_Int) r; + if (is_valid == SANE_FALSE) { + DBG(1, "the device at %s is not a supported (product id=0x%x)\n", + s->hw->sane.name, product); + return SANE_STATUS_INVAL; + } + + DBG(1, "found valid Epson scanner: 0x%x/0x%x (vendorID/productID)\n", + vendor, product); - return SANE_STATUS_GOOD; + return SANE_STATUS_GOOD; } +static int num_devices; /* number of scanners attached to backend */ +static Epson_Device *first_dev; /* first EPSON scanner in list */ -/* Helper function to correct the dpi - * gotten from scanners with known buggy firmware. - * - Epson Perfection 4990 Photo / GT-X800 - * - Epson Perfection 4870 Photo / GT-X700 (untested) - */ -static void -fix_up_dpi(Epson_Scanner * s) +static struct Epson_Scanner * +scanner_create(struct Epson_Device *dev, SANE_Status *status) { - SANE_Status status; - /* - * EPSON Programming guide for - * EPSON Color Image Scanner Perfection 4870/4990 - */ + struct Epson_Scanner *s; - if (e2_model(s, "GT-X800") - || e2_model(s, "GT-X700")) { - status = e2_add_resolution(s, 4800); - status = e2_add_resolution(s, 6400); - status = e2_add_resolution(s, 9600); - status = e2_add_resolution(s, 12800); + s = malloc(sizeof(struct Epson_Scanner)); + if (s == NULL) { + *status = SANE_STATUS_NO_MEM; + return NULL; } -} -static void -e2_set_fbf_area(Epson_Scanner * s, int x, int y, int unit) -{ - struct Epson_Device *dev = s->hw; + memset(s, 0x00, sizeof(struct Epson_Scanner)); - if (x == 0 || y == 0) - return; + s->fd = -1; + s->hw = dev; - dev->fbf_x_range.min = 0; - dev->fbf_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); - dev->fbf_x_range.quant = 0; - - dev->fbf_y_range.min = 0; - dev->fbf_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); - dev->fbf_y_range.quant = 0; - - DBG(5, "%s: %f,%f %f,%f %d [mm]\n", - __func__, - SANE_UNFIX(dev->fbf_x_range.min), - SANE_UNFIX(dev->fbf_y_range.min), - SANE_UNFIX(dev->fbf_x_range.max), - SANE_UNFIX(dev->fbf_y_range.max), unit); + return s; } -static void -e2_set_adf_area(struct Epson_Scanner *s, int x, int y, int unit) +static struct Epson_Scanner * +device_detect(const char *name, int type, SANE_Status *status) { - struct Epson_Device *dev = s->hw; + struct Epson_Scanner *s; + struct Epson_Device *dev; - dev->adf_x_range.min = 0; - dev->adf_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); - dev->adf_x_range.quant = 0; - - dev->adf_y_range.min = 0; - dev->adf_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); - dev->adf_y_range.quant = 0; - - DBG(5, "%s: %f,%f %f,%f %d [mm]\n", - __func__, - SANE_UNFIX(dev->adf_x_range.min), - SANE_UNFIX(dev->adf_y_range.min), - SANE_UNFIX(dev->adf_x_range.max), - SANE_UNFIX(dev->adf_y_range.max), unit); -} + /* try to find the device in our list */ + for (dev = first_dev; dev; dev = dev->next) { + if (strcmp(dev->sane.name, name) == 0) { -static void -e2_set_tpu_area(struct Epson_Scanner *s, int x, int y, int unit) -{ - struct Epson_Device *dev = s->hw; + /* the device might have been just probed, + * sleep a bit. + */ + if (dev->connection == SANE_EPSON_NET) + sleep(1); - dev->tpu_x_range.min = 0; - dev->tpu_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); - dev->tpu_x_range.quant = 0; - - dev->tpu_y_range.min = 0; - dev->tpu_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); - dev->tpu_y_range.quant = 0; - - DBG(5, "%s: %f,%f %f,%f %d [mm]\n", - __func__, - SANE_UNFIX(dev->tpu_x_range.min), - SANE_UNFIX(dev->tpu_y_range.min), - SANE_UNFIX(dev->tpu_x_range.max), - SANE_UNFIX(dev->tpu_y_range.max), unit); -} + return scanner_create(dev, status); + } + } -static void -e2_add_depth(Epson_Device * dev, SANE_Word depth) -{ - if (dev->maxDepth == 0) - dev->maxDepth = depth; + if (type == SANE_EPSON_NODEV) { + *status = SANE_STATUS_INVAL; + return NULL; + } + + /* alloc and clear our device structure */ + dev = malloc(sizeof(*dev)); + if (!dev) { + *status = SANE_STATUS_NO_MEM; + return NULL; + } + memset(dev, 0x00, sizeof(struct Epson_Device)); - bitDepthList[0]++; - bitDepthList[bitDepthList[0]] = depth; -} + s = scanner_create(dev, status); + if (s == NULL) + return NULL; -static SANE_Status -e2_discover_capabilities(Epson_Scanner *s) -{ - SANE_Status status; + e2_dev_init(dev, name, type); - unsigned char scanner_status; - Epson_Device *dev = s->hw; + *status = open_scanner(s); + if (*status != SANE_STATUS_GOOD) { + free(s); + return NULL; + } - SANE_String_Const *source_list_add = source_list; + /* from now on, close_scanner() must be called */ - DBG(5, "%s\n", __func__); + /* SCSI and USB requires special care */ + if (dev->connection == SANE_EPSON_SCSI) { - /* ESC I, request identity - * this must be the first command on the FilmScan 200 - */ - if (dev->connection != SANE_EPSON_NET) { - unsigned int n, k, x = 0, y = 0; - unsigned char *buf, *area; - size_t len; + *status = detect_scsi(s); - status = esci_request_identity(s, &buf, &len); - if (status != SANE_STATUS_GOOD) - return status; + } else if (dev->connection == SANE_EPSON_USB) { - e2_set_cmd_level(s, &buf[0]); + *status = detect_usb(s); + } - /* Setting available resolutions and xy ranges for sane frontend. */ - /* cycle thru the resolutions, saving them in a list */ - for (n = 2, k = 0; n < len; n += k) { - - area = buf + n; - - switch (*area) { - case 'R': - { - int val = area[2] << 8 | area[1]; - - status = e2_add_resolution(s, val); - k = 3; - continue; - } - case 'A': - { - x = area[2] << 8 | area[1]; - y = area[4] << 8 | area[3]; - - DBG(1, "maximum scan area: %dx%d\n", x, y); - k = 5; - continue; - } - default: - break; - } - } + if (*status != SANE_STATUS_GOOD) + goto close; - /* min and max dpi */ - dev->dpi_range.min = dev->res_list[0]; - dev->dpi_range.max = dev->res_list[dev->res_list_size - 1]; - dev->dpi_range.quant = 0; + /* set name and model (if not already set) */ + if (dev->model == NULL) + e2_set_model(s, (unsigned char *) "generic", 7); - e2_set_fbf_area(s, x, y, dev->dpi_range.max); + dev->name = strdup(name); + dev->sane.name = dev->name; - free(buf); - } + /* ESC @, reset */ + *status = esci_reset(s); + if (*status != SANE_STATUS_GOOD) + goto close; - /* ESC F, request status */ - status = esci_request_status(s, &scanner_status); - if (status != SANE_STATUS_GOOD) - return status;; + *status = e2_discover_capabilities(s); + if (*status != SANE_STATUS_GOOD) + goto close; - /* set capabilities */ - if (scanner_status & STATUS_OPTION) - dev->extension = SANE_TRUE; + if (source_list[0] == NULL || dev->dpi_range.min == 0) { + DBG(1, "something is wrong in the discovery process, aborting.\n"); + *status = SANE_STATUS_IO_ERROR; + goto close; + } - if (scanner_status & STATUS_EXT_COMMANDS) - dev->extended_commands = 1; + e2_dev_post_init(dev); - /* - * Extended status flag request (ESC f). - * this also requests the scanner device name from the the scanner. - * It seems unsupported on the network transport (CX11NF/LP-A500), - * so avoid it if the device support extended commands. - */ + *status = esci_reset(s); + if (*status != SANE_STATUS_GOOD) + goto close; - if (!dev->extended_commands && dev->cmd->request_extended_status) { - unsigned char *es; - size_t es_len; + DBG(1, "scanner model: %s\n", dev->model); - status = esci_request_extended_status(s, &es, &es_len); - if (status != SANE_STATUS_GOOD) - return status; + /* add this scanner to the device list */ - /* - * Get the device name and copy it to dev->sane.model. - * The device name starts at es[0x1A] and is up to 16 bytes long - * We are overwriting whatever was set previously! - */ - if (es_len == CMD_SIZE_EXT_STATUS) /* 42 */ - e2_set_model(s, es + 0x1A, 16); + num_devices++; + dev->next = first_dev; + first_dev = dev; - if (es[0] & EXT_STATUS_LID) - DBG(1, "LID detected\n"); + return s; - if (es[0] & EXT_STATUS_PB) - DBG(1, "push button detected\n"); - else - dev->cmd->request_push_button_status = 0; +close: + close_scanner(s); + free(s); + return NULL; +} - /* Flatbed */ - *source_list_add++ = FBF_STR; - e2_set_fbf_area(s, es[13] << 8 | es[12], es[15] << 8 | es[14], - dev->dpi_range.max); +static SANE_Status +attach(const char *name, int type) +{ + SANE_Status status; + Epson_Scanner *s; - /* ADF */ - if (dev->extension && (es[1] & EXT_STATUS_IST)) { - DBG(1, "ADF detected\n"); + DBG(7, "%s: devname = %s, type = %d\n", __func__, name, type); - fix_up_extended_status_reply(s, es); + s = device_detect(name, type, &status); + if(s == NULL) + return status; - dev->duplex = (es[0] & EXT_STATUS_ADFS) != 0; - if (dev->duplex) - DBG(1, "ADF supports duplex\n"); + close_scanner(s); + free(s); + return status; +} - if (es[1] & EXT_STATUS_EN) { - DBG(1, "ADF is enabled\n"); - dev->x_range = &dev->adf_x_range; - dev->y_range = &dev->adf_y_range; - } +static SANE_Status +attach_one_scsi(const char *dev) +{ + DBG(7, "%s: dev = %s\n", __func__, dev); + return attach(dev, SANE_EPSON_SCSI); +} - e2_set_adf_area(s, es[3] << 8 | es[2], - es[5] << 8 | es[4], - dev->dpi_range.max); - *source_list_add++ = ADF_STR; +SANE_Status +attach_one_usb(const char *dev) +{ + DBG(7, "%s: dev = %s\n", __func__, dev); + return attach(dev, SANE_EPSON_USB); +} - dev->ADF = SANE_TRUE; - } +static SANE_Status +attach_one_net(const char *dev) +{ + char name[18]; - /* TPU */ - if (dev->extension && (es[6] & EXT_STATUS_IST)) { - DBG(1, "TPU detected\n"); - - if (es[6] & EXT_STATUS_EN) { - DBG(1, "TPU is enabled\n"); - dev->x_range = &dev->tpu_x_range; - dev->y_range = &dev->tpu_y_range; - } + DBG(7, "%s: dev = %s\n", __func__, dev); - e2_set_tpu_area(s, - (es[8] << 8 | es[7]), - (es[10] << 8 | es[9]), - dev->dpi_range.max); + strcpy(name, "net:"); + strcat(name, dev); + return attach(name, SANE_EPSON_NET); +} - *source_list_add++ = TPU_STR; - dev->TPU = SANE_TRUE; - } +static SANE_Status +attach_one_pio(const char *dev) +{ + DBG(7, "%s: dev = %s\n", __func__, dev); + return attach(dev, SANE_EPSON_PIO); +} - free(es); - } +static SANE_Status +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +{ + int vendor, product; - /* FS I, request extended identity */ - if (dev->extended_commands && dev->cmd->request_extended_identity) { - unsigned char buf[80]; + int len = strlen(line); - status = esci_request_extended_identity(s, buf); - if (status != SANE_STATUS_GOOD) - return status; + DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); + + if (sscanf(line, "usb %i %i", &vendor, &product) == 2) { + /* add the vendor and product IDs to the list of + known devices before we call the attach function */ - e2_set_cmd_level(s, &buf[0]); + int numIds = sanei_epson_getNumberOfUSBProductIds(); - dev->maxDepth = buf[67]; + if (vendor != 0x4b8) + return SANE_STATUS_INVAL; /* this is not an EPSON device */ - /* set model name. it will probably be - * different than the one reported by request_identity - * for the same unit (i.e. LP-A500 vs CX11) . - */ - e2_set_model(s, &buf[46], 16); + sanei_epson_usb_product_ids[numIds - 1] = product; + sanei_usb_attach_matching_devices(line, attach_one_usb); - dev->optical_res = le32atoh(&buf[4]); + } else if (strncmp(line, "usb", 3) == 0 && len == 3) { - dev->dpi_range.min = le32atoh(&buf[8]); - dev->dpi_range.max = le32atoh(&buf[12]); + int i, numIds; - /* Flatbed */ - *source_list_add++ = FBF_STR; + numIds = sanei_epson_getNumberOfUSBProductIds(); - e2_set_fbf_area(s, le32atoh(&buf[20]), - le32atoh(&buf[24]), dev->optical_res); + for (i = 0; i < numIds; i++) { + sanei_usb_find_devices(0x4b8, + sanei_epson_usb_product_ids[i], attach_one_usb); + } - /* ADF */ - if (le32atoh(&buf[28]) > 0) { - e2_set_adf_area(s, le32atoh(&buf[28]), - le32atoh(&buf[32]), dev->optical_res); + } else if (strncmp(line, "net", 3) == 0) { - if (!dev->ADF) { - *source_list_add++ = ADF_STR; - dev->ADF = SANE_TRUE; - } - } + /* remove the "net" sub string */ + const char *name = sanei_config_skip_whitespace(line + 3); - /* TPU */ + if (strncmp(name, "autodiscovery", 13) == 0) + e2_network_discovery(); + else + attach_one_net(name); - if (e2_model(s, "GT-X800")) { - if (le32atoh(&buf[68]) > 0 && !dev->TPU) { - e2_set_tpu_area(s, - le32atoh(&buf[68]), - le32atoh(&buf[72]), - dev->optical_res); - - *source_list_add++ = TPU_STR; - dev->TPU = SANE_TRUE; - dev->TPU2 = SANE_TRUE; - } - } + } else if (strncmp(line, "pio", 3) == 0) { - if (le32atoh(&buf[36]) > 0 && !dev->TPU) { - e2_set_tpu_area(s, - le32atoh(&buf[36]), - le32atoh(&buf[40]), dev->optical_res); + /* remove the "pio" sub string */ + const char *name = sanei_config_skip_whitespace(line + 3); - *source_list_add++ = TPU_STR; - dev->TPU = SANE_TRUE; - } + attach_one_pio(name); - /* fix problem with broken report of dpi */ - fix_up_dpi(s); + } else { + sanei_config_attach_matching_devices(line, attach_one_scsi); } + return SANE_STATUS_GOOD; +} - *source_list_add = NULL; /* add end marker to source list */ - - /* - * request identity 2 (ESC i), if available will - * get the information from the scanner and store it in dev - */ +static void +free_devices(void) +{ + Epson_Device *dev, *next; - if (dev->cmd->request_identity2 && dev->connection != SANE_EPSON_NET) { - unsigned char *buf; - status = esci_request_identity2(s, &buf); - if (status != SANE_STATUS_GOOD) - return status; + DBG(5, "%s\n", __func__); - /* the first two bytes of the buffer contain the optical resolution */ - dev->optical_res = buf[1] << 8 | buf[0]; - - /* - * the 4th and 5th byte contain the line distance. Both values have to - * be identical, otherwise this software can not handle this scanner. - */ - if (buf[4] != buf[5]) { - status = SANE_STATUS_INVAL; - return status; - } - - dev->max_line_distance = buf[4]; - } - - /* - * Check for the max. supported color depth and assign - * the values to the bitDepthList. - */ - bitDepthList = malloc(sizeof(SANE_Word) * 4); - if (bitDepthList == NULL) { - DBG(1, "out of memory (line %d)\n", __LINE__); - return SANE_STATUS_NO_MEM; - } - - bitDepthList[0] = 0; - - /* maximum depth discovery */ - DBG(3, "discovering max depth, NAKs are expected\n"); - - if (dev->maxDepth >= 16 || dev->maxDepth == 0) { - if (esci_set_data_format(s, 16) == SANE_STATUS_GOOD) - e2_add_depth(dev, 16); - } - - if (dev->maxDepth >= 14 || dev->maxDepth == 0) { - if (esci_set_data_format(s, 14) == SANE_STATUS_GOOD) - e2_add_depth(dev, 14); - } - - if (dev->maxDepth >= 12 || dev->maxDepth == 0) { - if (esci_set_data_format(s, 12) == SANE_STATUS_GOOD) - e2_add_depth(dev, 12); - } - - /* add default depth */ - e2_add_depth(dev, 8); - - DBG(1, "maximum supported color depth: %d\n", dev->maxDepth); - - /* - * Check for "request focus position" command. If this command is - * supported, then the scanner does also support the "set focus - * position" command. - * XXX ??? - */ - - if (esci_request_focus_position(s, &s->currentFocusPosition) == - SANE_STATUS_GOOD) { - DBG(1, "setting focus is supported\n"); - dev->focusSupport = SANE_TRUE; - s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE; - - /* reflect the current focus position in the GUI */ - if (s->currentFocusPosition < 0x4C) { - /* focus on glass */ - s->val[OPT_FOCUS].w = 0; - } else { - /* focus 2.5mm above glass */ - s->val[OPT_FOCUS].w = 1; - } - - } else { - DBG(1, "setting focus is not supported\n"); - dev->focusSupport = SANE_FALSE; - s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE; - s->val[OPT_FOCUS].w = 0; /* on glass - just in case */ - } - - /* Set defaults for no extension. */ - dev->x_range = &dev->fbf_x_range; - dev->y_range = &dev->fbf_y_range; - - /* - * Correct for a firmware bug in some Perfection 1650 scanners: - * Firmware version 1.08 reports only half the vertical scan area, we have - * to double the number. To find out if we have to do this, we just compare - * is the vertical range is smaller than the horizontal range. - */ - - if ((dev->x_range->max - dev->x_range->min) > - (dev->y_range->max - dev->y_range->min)) { - DBG(1, "found buggy scan area, doubling it.\n"); - dev->y_range->max += (dev->y_range->max - dev->y_range->min); - dev->need_double_vertical = SANE_TRUE; - dev->need_color_reorder = SANE_TRUE; - } - - /* FS F, request scanner status */ - if (dev->extended_commands) { - unsigned char buf[16]; - - status = esci_request_scanner_status(s, buf); - if (status != SANE_STATUS_GOOD) - return status; - } - - return status; -} - -/* attach device to backend */ - -static SANE_Status -attach(const char *name, Epson_Device * *devp, int type) -{ - SANE_Status status; - Epson_Scanner *s; - struct Epson_Device *dev; - int port; - - DBG(1, "epson2 backend, version %i.%i.%i\n", - EPSON2_VERSION, EPSON2_REVISION, EPSON2_BUILD); - - DBG(7, "%s: devname = %s, type = %d\n", __func__, name, type); - - for (dev = first_dev; dev; dev = dev->next) { - if (strcmp(dev->sane.name, name) == 0) { - if (devp) { - *devp = dev; - } - return SANE_STATUS_GOOD; - } - } - - - /* alloc and clear our device structure */ - dev = malloc(sizeof(*dev)); - if (!dev) { - DBG(1, "out of memory (line %d)\n", __LINE__); - return SANE_STATUS_NO_MEM; - } - memset(dev, 0x00, sizeof(struct Epson_Device)); - - /* check for PIO devices */ - /* can we convert the device name to an integer? This is only possible - with PIO devices */ - if (type != SANE_EPSON_NET) { - port = atoi(name); - if (port != 0) - type = SANE_EPSON_PIO; - } - - if (strncmp - (name, SANE_EPSON_CONFIG_PIO, - strlen(SANE_EPSON_CONFIG_PIO)) == 0) { - /* we have a match for the PIO string and adjust the device name */ - name += strlen(SANE_EPSON_CONFIG_PIO); - name = sanei_config_skip_whitespace(name); - type = SANE_EPSON_PIO; - } - - - s = malloc(sizeof(struct Epson_Scanner)); - if (s == NULL) - return SANE_STATUS_NO_MEM; - - memset(s, 0x00, sizeof(struct Epson_Scanner)); - - - /* - * set dummy values. - */ - - s->fd = -1; - s->hw = dev; - - dev->name = NULL; - dev->model = NULL; - - dev->sane.name = NULL; - dev->sane.model = NULL; - - dev->sane.type = "flatbed scanner"; - dev->sane.vendor = "Epson"; - - dev->optical_res = 0; /* just to have it initialized */ - dev->color_shuffle = SANE_FALSE; - dev->extension = SANE_FALSE; - dev->use_extension = SANE_FALSE; - - dev->need_color_reorder = SANE_FALSE; - dev->need_double_vertical = SANE_FALSE; - - dev->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; /* default function level */ - dev->connection = type; - - /* Change default level when using a network connection */ - if (dev->connection == SANE_EPSON_NET) - dev->cmd = &epson_cmd[EPSON_LEVEL_B7]; - - DBG(3, "%s: opening %s, type = %d\n", __func__, name, - dev->connection); - - dev->last_res = 0; - dev->last_res_preview = 0; /* set resolution to safe values */ - - dev->res_list_size = 0; - dev->res_list = NULL; - - if (dev->connection == SANE_EPSON_NET) { - unsigned char buf[5]; - - if (strncmp(name, "autodiscovery", 13) == 0) { - e2_network_discovery(); - status = SANE_STATUS_INVAL; - goto free; - } - - status = sanei_tcp_open(name, 1865, &s->fd); - if (status != SANE_STATUS_GOOD) { - DBG(1, "%s: %s open failed: %s\n", __func__, - name, sane_strstatus(status)); - goto free; - } - - s->netlen = 0; - - /* the scanner sends a kind of welcome msg */ - /* XXX use a shorter timeout here */ - e2_recv(s, buf, 5, &status); - - /* lock the scanner for use by sane */ - sanei_epson_net_lock(s); - - } else if (dev->connection == SANE_EPSON_SCSI) { - char buf[INQUIRY_BUF_SIZE + 1]; - size_t buf_size = INQUIRY_BUF_SIZE; - - char *vendor = buf + 8; - char *model = buf + 16; - char *rev = buf + 32; - - status = sanei_scsi_open(name, &s->fd, - sanei_epson2_scsi_sense_handler, - NULL); - if (status != SANE_STATUS_GOOD) { - DBG(1, "%s: open failed: %s\n", __func__, - sane_strstatus(status)); - goto free; - } - status = sanei_epson2_scsi_inquiry(s->fd, buf, &buf_size); - if (status != SANE_STATUS_GOOD) { - DBG(1, "%s: inquiry failed: %s\n", __func__, - sane_strstatus(status)); - goto free; - } - - buf[INQUIRY_BUF_SIZE] = 0; - DBG(1, "inquiry data:\n"); - DBG(1, " vendor : %.8s\n", vendor); - DBG(1, " model : %.16s\n", model); - DBG(1, " revision: %.4s\n", rev); - - if (buf[0] != TYPE_PROCESSOR) { - DBG(1, "%s: device is not of processor type (%d)\n", - __func__, buf[0]); - return SANE_STATUS_INVAL; - } - - if (strncmp(vendor, "EPSON", 5) != 0) { - DBG(1, - "%s: device doesn't look like an EPSON scanner\n", - __func__); - close_scanner(s); - return SANE_STATUS_INVAL; - } - - if (strncmp(model, "SCANNER ", 8) != 0 - && strncmp(model, "FilmScan 200", 12) != 0 - && strncmp(model, "Perfection", 10) != 0 - && strncmp(model, "Expression", 10) != 0 - && strncmp(model, "GT", 2) != 0) { - DBG(1, "%s: this EPSON scanner is not supported\n", - __func__); - close_scanner(s); - return SANE_STATUS_INVAL; - } - - if (strncmp(model, "FilmScan 200", 12) == 0) { - dev->sane.type = "film scanner"; - e2_set_model(s, (unsigned char *) model, 12); - } - } - /* use the SANEI functions to handle a PIO device */ - else if (dev->connection == SANE_EPSON_PIO) { - if (SANE_STATUS_GOOD != - (status = sanei_pio_open(name, &s->fd))) { - DBG(1, - "cannot open %s as a parallel-port device: %s\n", - name, sane_strstatus(status)); - goto free; - } - } - /* use the SANEI functions to handle a USB device */ - else if (dev->connection == SANE_EPSON_USB) { - SANE_Word vendor; - SANE_Word product; - SANE_Bool isLibUSB; - - isLibUSB = (strncmp(name, "libusb:", strlen("libusb:")) == 0); - - if ((!isLibUSB) && (strlen(name) == 0)) { - int i; - int numIds; - - numIds = sanei_epson_getNumberOfUSBProductIds(); - - for (i = 0; i < numIds; i++) { - product = sanei_epson_usb_product_ids[i]; - vendor = 0x4b8; - - status = sanei_usb_find_devices(vendor, - product, - attach_one_usb); - } - return SANE_STATUS_INVAL; /* return - the attach_one_usb() - will take care of this */ - } - - status = sanei_usb_open(name, &s->fd); - - if (status != SANE_STATUS_GOOD) { - goto free; - } - - /* if the sanei_usb_get_vendor_product call is not supported, - then we just ignore this and rely on the user to config - the correct device. - */ - - if (sanei_usb_get_vendor_product(s->fd, &vendor, &product) == - SANE_STATUS_GOOD) { - int i; /* loop variable */ - int numIds; - SANE_Bool is_valid; - - /* check the vendor ID to see if we are dealing with an EPSON device */ - if (vendor != SANE_EPSON_VENDOR_ID) { - /* this is not a supported vendor ID */ - DBG(1, - "the device at %s is not manufactured by EPSON (vendor id=0x%x)\n", - name, vendor); - sanei_usb_close(s->fd); - s->fd = -1; - return SANE_STATUS_INVAL; - } - - numIds = sanei_epson_getNumberOfUSBProductIds(); - is_valid = SANE_FALSE; - i = 0; - - /* check all known product IDs to verify that we know - about the device */ - while (i != numIds && !is_valid) { - if (product == sanei_epson_usb_product_ids[i]) - is_valid = SANE_TRUE; - i++; - } - - if (is_valid == SANE_FALSE) { - DBG(1, - "the device at %s is not a supported EPSON scanner (product id=0x%x)\n", - name, product); - sanei_usb_close(s->fd); - s->fd = -1; - return SANE_STATUS_INVAL; - } - DBG(1, - "found valid EPSON scanner: 0x%x/0x%x (vendorID/productID)\n", - vendor, product); - } else - DBG(1, - "cannot use IOCTL interface to verify that device is a scanner - will continue\n"); - } - - /* set name and model (if not already set) */ - if (dev->model == NULL) - e2_set_model(s, (unsigned char *) "generic", 7); - - dev->name = strdup(name); - dev->sane.name = dev->name; - - - /* Issue a test unit ready SCSI command. The FilmScan 200 - * requires it for a sort of "wake up". We might eventually - * get the return code and reissue it in case of failure. - */ - if (dev->connection == SANE_EPSON_SCSI) - sanei_epson2_scsi_test_unit_ready(s->fd); - - /* ESC @, reset */ - esci_reset(s); - - status = e2_discover_capabilities(s); - if (status != SANE_STATUS_GOOD) - goto free; - - /* If we have been unable to obtain supported resolutions - * due to the fact we are on the network transport, - * add some convenient ones - */ - - if (dev->res_list_size == 0 && dev->connection == SANE_EPSON_NET) { - - int val = (dev->dpi_range.min < 150) ? 150 : dev->dpi_range.min; - - DBG(1, "networked scanner, faking resolution list (%d-%d)\n", - dev->dpi_range.min, dev->dpi_range.max); - - if (dev->dpi_range.min <= 50) - e2_add_resolution(s, 50); - - if (dev->dpi_range.min <= 75) - e2_add_resolution(s, 75); - - if (dev->dpi_range.min <= 100) - e2_add_resolution(s, 100); - - while (val <= dev->dpi_range.max) { - e2_add_resolution(s, val); - val *= 2; - } - } - - /* - * Copy the resolution list to the resolution_list array so that the frontend can - * display the correct values - */ - - dev->resolution_list = - malloc((dev->res_list_size + 1) * sizeof(SANE_Word)); - - if (dev->resolution_list == NULL) { - status = SANE_STATUS_NO_MEM; - goto free; - } - - *(dev->resolution_list) = dev->res_list_size; - memcpy(&(dev->resolution_list[1]), dev->res_list, - dev->res_list_size * sizeof(SANE_Word)); - - /* XXX necessary? */ - esci_reset(s); - - DBG(1, "scanner model: %s\n", dev->model); - - /* establish defaults */ - dev->need_reset_on_source_change = SANE_FALSE; - - if (e2_model(s, "ES-9000H") || e2_model(s, "GT-30000")) { - dev->cmd->set_focus_position = 0; - dev->cmd->feed = 0x19; - } - - if (e2_model(s, "GT-8200") || e2_model(s, "Perfection1650") - || e2_model(s, "Perfection1640") || e2_model(s, "GT-8700")) { - dev->cmd->feed = 0; - dev->cmd->set_focus_position = 0; - dev->need_reset_on_source_change = SANE_TRUE; + for (dev = first_dev; dev; dev = next) { + next = dev->next; + free(dev->name); + free(dev->model); + free(dev); } - /* we are done with this one, prepare for the next scanner */ - num_devices++; - dev->next = first_dev; - first_dev = dev; - - if (devp) - *devp = dev; + free(devlist); - free: - close_scanner(s); - free(s); - return status; + first_dev = NULL; } -/* - * Part of the SANE API: Attaches the scanner with the device name in *dev. - */ - -static SANE_Status -attach_one(const char *dev) +static void +probe_devices(void) { - DBG(7, "%s: dev = %s\n", __func__, dev); - return attach(dev, 0, SANE_EPSON_SCSI); -} + DBG(5, "%s\n", __func__); -SANE_Status -attach_one_usb(const char *dev) -{ - DBG(7, "%s: dev = %s\n", __func__, dev); - return attach(dev, 0, SANE_EPSON_USB); -} + free_devices(); -static SANE_Status -attach_one_net(const char *dev) -{ - DBG(7, "%s: dev = %s\n", __func__, dev); - return attach(dev, 0, SANE_EPSON_NET); + sanei_configure_attach(EPSON2_CONFIG_FILE, NULL, + attach_one_config); } SANE_Status -sane_init(SANE_Int * version_code, SANE_Auth_Callback authorize) +sane_init(SANE_Int *version_code, SANE_Auth_Callback __sane_unused__ authorize) { - size_t len; - FILE *fp; - - authorize = authorize; /* get rid of compiler warning */ - - /* sanei_authorization(devicename, STRINGIFY(BACKEND_NAME), auth_callback); */ - DBG_INIT(); DBG(2, "%s: " PACKAGE " " VERSION "\n", __func__); + DBG(1, "epson2 backend, version %i.%i.%i\n", + EPSON2_VERSION, EPSON2_REVISION, EPSON2_BUILD); + if (version_code != NULL) *version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, V_MINOR, EPSON2_BUILD); sanei_usb_init(); - if ((fp = sanei_config_open(EPSON2_CONFIG_FILE))) { - char line[PATH_MAX]; - - DBG(3, "%s: reading config file, %s\n", __func__, - EPSON2_CONFIG_FILE); - - while (sanei_config_read(line, sizeof(line), fp)) { - int vendor, product; - - if (line[0] == '#') /* ignore line comments */ - continue; - - len = strlen(line); - if (len == 0) - continue; /* ignore empty lines */ - - DBG(120, " %s\n", line); - - if (sscanf(line, "usb %i %i", &vendor, &product) == 2) { - int numIds; - - /* add the vendor and product IDs to the list of - known devices before we call the attach function */ - numIds = sanei_epson_getNumberOfUSBProductIds - (); - if (vendor != 0x4b8) - continue; /* this is not an EPSON device */ - - sanei_epson_usb_product_ids[numIds - 1] = - product; - sanei_usb_attach_matching_devices(line, - attach_one_usb); - } else if (strncmp(line, "usb", 3) == 0) { - const char *name; - /* remove the "usb" sub string */ - name = sanei_config_skip_whitespace(line + 3); - attach_one_usb(name); - } else if (strncmp(line, "net", 3) == 0) { - const char *name; - /* remove the "net" sub string */ - name = sanei_config_skip_whitespace(line + 3); - attach_one_net(name); - } else { - sanei_config_attach_matching_devices(line, - attach_one); - } - } - fclose(fp); - } - - /* read the option section and assign the connection type to the - scanner structure - which we don't have at this time. So I have - to come up with something :-) */ - return SANE_STATUS_GOOD; } @@ -1667,30 +899,19 @@ void sane_exit(void) { - Epson_Device *dev, *next; - - for (dev = first_dev; dev; dev = next) { - next = dev->next; - free(dev->name); - free(dev->model); - free(dev); - } - - free(devlist); + DBG(5, "%s\n", __func__); + free_devices(); } SANE_Status -sane_get_devices(const SANE_Device * **device_list, SANE_Bool local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) { Epson_Device *dev; int i; DBG(5, "%s\n", __func__); - local_only = local_only; /* just to get rid of the compailer warning */ - - if (devlist) - free(devlist); + probe_devices(); devlist = malloc((num_devices + 1) * sizeof(devlist[0])); if (!devlist) { @@ -1698,8 +919,10 @@ return SANE_STATUS_NO_MEM; } - for (i = 0, dev = first_dev; i < num_devices; dev = dev->next, i++) { - DBG(1, " %d: %s\n", i, dev->model); + DBG(5, "%s - results:\n", __func__); + + for (i = 0, dev = first_dev; i < num_devices && dev; dev = dev->next, i++) { + DBG(1, " %d (%d): %s\n", i, dev->connection, dev->model); devlist[i] = &dev->sane; } @@ -1711,13 +934,11 @@ } static SANE_Status -init_options(Epson_Scanner * s) +init_options(Epson_Scanner *s) { int i; - DBG(5, "%s\n", __func__); - - for (i = 0; i < NUM_OPTIONS; ++i) { + for (i = 0; i < NUM_OPTIONS; i++) { s->opt[i].size = sizeof(SANE_Word); s->opt[i].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; } @@ -1745,6 +966,10 @@ s->opt[OPT_MODE].constraint.string_list = mode_list; s->val[OPT_MODE].w = 0; /* Binary */ + /* disable infrared on unsupported scanners */ + if (!e2_model(s, "GT-X800") && !e2_model(s, "GT-X700")) + mode_list[MODE_INFRARED] = NULL; + /* bit depth */ s->opt[OPT_BIT_DEPTH].name = SANE_NAME_BIT_DEPTH; s->opt[OPT_BIT_DEPTH].title = SANE_TITLE_BIT_DEPTH; @@ -1752,11 +977,11 @@ s->opt[OPT_BIT_DEPTH].type = SANE_TYPE_INT; s->opt[OPT_BIT_DEPTH].unit = SANE_UNIT_NONE; s->opt[OPT_BIT_DEPTH].constraint_type = SANE_CONSTRAINT_WORD_LIST; - s->opt[OPT_BIT_DEPTH].constraint.word_list = bitDepthList; + s->opt[OPT_BIT_DEPTH].constraint.word_list = s->hw->depth_list; s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; - s->val[OPT_BIT_DEPTH].w = bitDepthList[1]; /* the first "real" element is the default */ + s->val[OPT_BIT_DEPTH].w = s->hw->depth_list[1]; /* the first "real" element is the default */ - if (bitDepthList[0] == 1) /* only one element in the list -> hide the option */ + if (s->hw->depth_list[0] == 1) /* only one element in the list -> hide the option */ s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; /* halftone */ @@ -1768,6 +993,7 @@ s->opt[OPT_HALFTONE].size = max_string_size(halftone_list_7); s->opt[OPT_HALFTONE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + /* XXX use defines */ if (s->hw->level >= 7) s->opt[OPT_HALFTONE].constraint.string_list = halftone_list_7; else if (s->hw->level >= 4) @@ -1777,9 +1003,8 @@ s->val[OPT_HALFTONE].w = 1; /* Halftone A */ - if (!s->hw->cmd->set_halftoning) { + if (!s->hw->cmd->set_halftoning) s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE; - } /* dropout */ s->opt[OPT_DROPOUT].name = "dropout"; @@ -1804,9 +1029,8 @@ s->opt[OPT_BRIGHTNESS].constraint.range = &s->hw->cmd->bright_range; s->val[OPT_BRIGHTNESS].w = 0; /* Normal */ - if (!s->hw->cmd->set_bright) { + if (!s->hw->cmd->set_bright) s->opt[OPT_BRIGHTNESS].cap |= SANE_CAP_INACTIVE; - } /* sharpness */ s->opt[OPT_SHARPNESS].name = "sharpness"; @@ -1830,6 +1054,7 @@ s->opt[OPT_GAMMA_CORRECTION].type = SANE_TYPE_STRING; s->opt[OPT_GAMMA_CORRECTION].constraint_type = SANE_CONSTRAINT_STRING_LIST; + /* * special handling for D1 function level - at this time I'm not * testing for D1, I'm just assuming that all D level scanners will @@ -1854,26 +1079,8 @@ gamma_params = gamma_params_ab; } - if (!s->hw->cmd->set_gamma) { + if (!s->hw->cmd->set_gamma) s->opt[OPT_GAMMA_CORRECTION].cap |= SANE_CAP_INACTIVE; - } - - - /* gamma vector */ - -/* - 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].unit = SANE_UNIT_NONE; - s->opt[ OPT_GAMMA_VECTOR].size = 256 * sizeof (SANE_Word); - s->opt[ OPT_GAMMA_VECTOR].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[ OPT_GAMMA_VECTOR].constraint.range = &u8_range; - s->val[ OPT_GAMMA_VECTOR].wa = &s->gamma_table [ 0] [ 0]; -*/ - /* red gamma vector */ s->opt[OPT_GAMMA_VECTOR_R].name = SANE_NAME_GAMMA_VECTOR_R; @@ -1887,7 +1094,6 @@ s->opt[OPT_GAMMA_VECTOR_R].constraint.range = &u8_range; s->val[OPT_GAMMA_VECTOR_R].wa = &s->gamma_table[0][0]; - /* green gamma vector */ s->opt[OPT_GAMMA_VECTOR_G].name = SANE_NAME_GAMMA_VECTOR_G; s->opt[OPT_GAMMA_VECTOR_G].title = SANE_TITLE_GAMMA_VECTOR_G; @@ -1917,13 +1123,11 @@ && gamma_userdefined[s->val[OPT_GAMMA_CORRECTION].w] == SANE_TRUE) { -/* s->opt[ OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; */ s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap &= ~SANE_CAP_INACTIVE; } else { -/* s->opt[ OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; */ s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; @@ -1948,20 +1152,17 @@ s->opt[OPT_COLOR_CORRECTION].name = "color-correction"; s->opt[OPT_COLOR_CORRECTION].title = SANE_I18N("Color correction"); s->opt[OPT_COLOR_CORRECTION].desc = - SANE_I18N - ("Sets the color correction table for the selected output device."); + SANE_I18N("Sets the color correction table for the selected output device."); s->opt[OPT_COLOR_CORRECTION].type = SANE_TYPE_STRING; - s->opt[OPT_COLOR_CORRECTION].size = 32; + s->opt[OPT_COLOR_CORRECTION].size = max_string_size(correction_list); s->opt[OPT_COLOR_CORRECTION].cap |= SANE_CAP_ADVANCED; - s->opt[OPT_COLOR_CORRECTION].constraint_type = - SANE_CONSTRAINT_STRING_LIST; - s->opt[OPT_COLOR_CORRECTION].constraint.string_list = color_list; - s->val[OPT_COLOR_CORRECTION].w = 5; /* scanner default: CRT monitors */ + s->opt[OPT_COLOR_CORRECTION].constraint_type = SANE_CONSTRAINT_STRING_LIST; + s->opt[OPT_COLOR_CORRECTION].constraint.string_list = correction_list; + s->val[OPT_COLOR_CORRECTION].w = CORR_AUTO; - if (!s->hw->cmd->set_color_correction) { + if (!s->hw->cmd->set_color_correction) s->opt[OPT_COLOR_CORRECTION].cap |= SANE_CAP_INACTIVE; - } /* resolution */ s->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; @@ -1985,112 +1186,9 @@ s->opt[OPT_THRESHOLD].constraint.range = &u8_range; s->val[OPT_THRESHOLD].w = 0x80; - if (!s->hw->cmd->set_threshold) { + if (!s->hw->cmd->set_threshold) s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; - } - - s->opt[OPT_CCT_GROUP].title = - SANE_I18N("Color correction coefficients"); - s->opt[OPT_CCT_GROUP].desc = - SANE_I18N("Matrix multiplication of RGB"); - s->opt[OPT_CCT_GROUP].type = SANE_TYPE_GROUP; - s->opt[OPT_CCT_GROUP].cap = SANE_CAP_ADVANCED; - - /* color correction coefficients */ - s->opt[OPT_CCT_1].name = "cct-1"; - s->opt[OPT_CCT_2].name = "cct-2"; - s->opt[OPT_CCT_3].name = "cct-3"; - s->opt[OPT_CCT_4].name = "cct-4"; - s->opt[OPT_CCT_5].name = "cct-5"; - s->opt[OPT_CCT_6].name = "cct-6"; - s->opt[OPT_CCT_7].name = "cct-7"; - s->opt[OPT_CCT_8].name = "cct-8"; - s->opt[OPT_CCT_9].name = "cct-9"; - - s->opt[OPT_CCT_1].title = SANE_I18N("Green"); - s->opt[OPT_CCT_2].title = SANE_I18N("Shift green to red"); - s->opt[OPT_CCT_3].title = SANE_I18N("Shift green to blue"); - s->opt[OPT_CCT_4].title = SANE_I18N("Shift red to green"); - s->opt[OPT_CCT_5].title = SANE_I18N("Red"); - s->opt[OPT_CCT_6].title = SANE_I18N("Shift red to blue"); - s->opt[OPT_CCT_7].title = SANE_I18N("Shift blue to green"); - s->opt[OPT_CCT_8].title = SANE_I18N("Shift blue to red"); - s->opt[OPT_CCT_9].title = SANE_I18N("Blue"); - - s->opt[OPT_CCT_1].desc = SANE_I18N("Controls green level"); - s->opt[OPT_CCT_2].desc = - SANE_I18N("Adds to red based on green level"); - s->opt[OPT_CCT_3].desc = - SANE_I18N("Adds to blue based on green level"); - s->opt[OPT_CCT_4].desc = - SANE_I18N("Adds to green based on red level"); - s->opt[OPT_CCT_5].desc = SANE_I18N("Controls red level"); - s->opt[OPT_CCT_6].desc = SANE_I18N("Adds to blue based on red level"); - s->opt[OPT_CCT_7].desc = - SANE_I18N("Adds to green based on blue level"); - s->opt[OPT_CCT_8].desc = SANE_I18N("Adds to red based on blue level"); - s->opt[OPT_CCT_9].desc = SANE_I18N("Controls blue level"); - - s->opt[OPT_CCT_1].type = SANE_TYPE_INT; - s->opt[OPT_CCT_2].type = SANE_TYPE_INT; - s->opt[OPT_CCT_3].type = SANE_TYPE_INT; - s->opt[OPT_CCT_4].type = SANE_TYPE_INT; - s->opt[OPT_CCT_5].type = SANE_TYPE_INT; - s->opt[OPT_CCT_6].type = SANE_TYPE_INT; - s->opt[OPT_CCT_7].type = SANE_TYPE_INT; - s->opt[OPT_CCT_8].type = SANE_TYPE_INT; - s->opt[OPT_CCT_9].type = SANE_TYPE_INT; - - s->opt[OPT_CCT_1].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_2].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_3].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_4].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_5].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_6].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_7].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_8].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - s->opt[OPT_CCT_9].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; - - s->opt[OPT_CCT_1].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_2].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_3].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_4].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_5].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_6].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_7].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_8].unit = SANE_UNIT_NONE; - s->opt[OPT_CCT_9].unit = SANE_UNIT_NONE; - - s->opt[OPT_CCT_1].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_2].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_3].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_4].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_5].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_6].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_7].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_8].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_CCT_9].constraint_type = SANE_CONSTRAINT_RANGE; - - s->opt[OPT_CCT_1].constraint.range = &s8_range; - s->opt[OPT_CCT_2].constraint.range = &s8_range; - s->opt[OPT_CCT_3].constraint.range = &s8_range; - s->opt[OPT_CCT_4].constraint.range = &s8_range; - s->opt[OPT_CCT_5].constraint.range = &s8_range; - s->opt[OPT_CCT_6].constraint.range = &s8_range; - s->opt[OPT_CCT_7].constraint.range = &s8_range; - s->opt[OPT_CCT_8].constraint.range = &s8_range; - s->opt[OPT_CCT_9].constraint.range = &s8_range; - - s->val[OPT_CCT_1].w = 32; - s->val[OPT_CCT_2].w = 0; - s->val[OPT_CCT_3].w = 0; - s->val[OPT_CCT_4].w = 0; - s->val[OPT_CCT_5].w = 32; - s->val[OPT_CCT_6].w = 0; - s->val[OPT_CCT_7].w = 0; - s->val[OPT_CCT_8].w = 0; - s->val[OPT_CCT_9].w = 32; /* "Advanced" group: */ s->opt[OPT_ADVANCED_GROUP].title = SANE_I18N("Advanced"); @@ -2098,6 +1196,38 @@ s->opt[OPT_ADVANCED_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_ADVANCED_GROUP].cap = SANE_CAP_ADVANCED; + /* "Color correction" group: */ + s->opt[OPT_CCT_GROUP].title = SANE_I18N("Color correction"); + s->opt[OPT_CCT_GROUP].desc = ""; + s->opt[OPT_CCT_GROUP].type = SANE_TYPE_GROUP; + s->opt[OPT_CCT_GROUP].cap = SANE_CAP_ADVANCED; + + /* XXX disabled for now */ + s->opt[OPT_CCT_MODE].name = "cct-type"; + s->opt[OPT_CCT_MODE].title = "CCT Profile Type"; + s->opt[OPT_CCT_MODE].desc = "Color correction profile type"; + s->opt[OPT_CCT_MODE].type = SANE_TYPE_STRING; + s->opt[OPT_CCT_MODE].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE; + s->opt[OPT_CCT_MODE].size = max_string_size(cct_mode_list); + s->opt[OPT_CCT_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + s->opt[OPT_CCT_MODE].constraint.string_list = cct_mode_list; + s->val[OPT_CCT_MODE].w = CCT_AUTO; + + s->opt[OPT_CCT_PROFILE].name = "cct-profile"; + s->opt[OPT_CCT_PROFILE].title = "CCT Profile"; + s->opt[OPT_CCT_PROFILE].desc = "Color correction profile data"; + s->opt[OPT_CCT_PROFILE].type = SANE_TYPE_FIXED; + s->opt[OPT_CCT_PROFILE].cap |= SANE_CAP_ADVANCED; + s->opt[OPT_CCT_PROFILE].unit = SANE_UNIT_NONE; + s->opt[OPT_CCT_PROFILE].constraint_type = SANE_CONSTRAINT_RANGE; + s->opt[OPT_CCT_PROFILE].constraint.range = &fx_range; + s->opt[OPT_CCT_PROFILE].size = 9 * sizeof(SANE_Word); + s->val[OPT_CCT_PROFILE].wa = s->cct_table; + +/* if (!s->hw->cmd->set_color_correction) + s->opt[OPT_FILM_TYPE].cap |= SANE_CAP_INACTIVE; +*/ + /* mirror */ s->opt[OPT_MIRROR].name = "mirror"; s->opt[OPT_MIRROR].title = SANE_I18N("Mirror image"); @@ -2121,16 +1251,6 @@ if (!s->hw->cmd->control_auto_area_segmentation) s->opt[OPT_AAS].cap |= SANE_CAP_INACTIVE; - /* limit resolution list */ - s->opt[OPT_LIMIT_RESOLUTION].name = "short-resolution"; - s->opt[OPT_LIMIT_RESOLUTION].title = - SANE_I18N("Short resolution list"); - s->opt[OPT_LIMIT_RESOLUTION].desc = - SANE_I18N("Display a shortened resolution list"); - s->opt[OPT_LIMIT_RESOLUTION].type = SANE_TYPE_BOOL; - s->val[OPT_LIMIT_RESOLUTION].w = SANE_FALSE; - - /* "Preview settings" group: */ s->opt[OPT_PREVIEW_GROUP].title = SANE_TITLE_PREVIEW; s->opt[OPT_PREVIEW_GROUP].desc = ""; @@ -2240,13 +1360,12 @@ s->opt[OPT_FOCUS].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_FOCUS].constraint.string_list = focus_list; s->val[OPT_FOCUS].w = 0; - s->opt[OPT_FOCUS].cap |= SANE_CAP_ADVANCED; - if (s->hw->focusSupport == SANE_TRUE) { + + if (s->hw->focusSupport == SANE_TRUE) s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE; - } else { + else s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE; - } /* forward feed / eject */ s->opt[OPT_EJECT].name = "eject"; @@ -2309,58 +1428,91 @@ s->opt[OPT_WAIT_FOR_BUTTON].constraint.range = NULL; s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_ADVANCED; - if (!s->hw->cmd->request_push_button_status) { + if (!s->hw->cmd->request_push_button_status) s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_INACTIVE; - } return SANE_STATUS_GOOD; } SANE_Status -sane_open(SANE_String_Const name, SANE_Handle * handle) +sane_open(SANE_String_Const name, SANE_Handle *handle) { SANE_Status status; - Epson_Device *dev; - Epson_Scanner *s; + Epson_Scanner *s = NULL; + + int l = strlen(name); DBG(7, "%s: name = %s\n", __func__, name); - /* search for device */ - if (name[0]) { - for (dev = first_dev; dev; dev = dev->next) - if (strcmp(dev->sane.name, name) == 0) - break; - } else - dev = first_dev; + /* probe if empty device name provided */ + if (l == 0) { - if (!dev) { - DBG(1, "error opening the device\n"); - return SANE_STATUS_INVAL; - } + probe_devices(); - s = calloc(sizeof(Epson_Scanner), 1); - if (!s) { - DBG(1, "out of memory (line %d)\n", __LINE__); - return SANE_STATUS_NO_MEM; + if (first_dev == NULL) { + DBG(1, "no device detected\n"); + return SANE_STATUS_INVAL; + } + + s = device_detect(first_dev->sane.name, first_dev->connection, + &status); + if (s == NULL) { + DBG(1, "cannot open a perfectly valid device (%s)," + " please report to the authors\n", name); + return SANE_STATUS_INVAL; + } + + } else { + + if (strncmp(name, "net:", 4) == 0) { + s = device_detect(name, SANE_EPSON_NET, &status); + if (s == NULL) + return status; + } else if (strncmp(name, "libusb:", 7) == 0) { + s = device_detect(name, SANE_EPSON_USB, &status); + if (s == NULL) + return status; + } else if (strncmp(name, "pio:", 4) == 0) { + s = device_detect(name, SANE_EPSON_PIO, &status); + if (s == NULL) + return status; + } else { + + /* as a last resort, check for a match + * in the device list. This should handle SCSI + * devices and platforms without libusb. + */ + + if (first_dev == NULL) + probe_devices(); + + s = device_detect(name, SANE_EPSON_NODEV, &status); + if (s == NULL) { + DBG(1, "invalid device name: %s\n", name); + return SANE_STATUS_INVAL; + } + } } - s->fd = -1; - s->hw = dev; - init_options(s); + /* s is always valid here */ - /* insert newly opened handle into list of open handles */ - s->next = first_handle; - first_handle = s; + DBG(1, "handle obtained\n"); + + init_options(s); *handle = (SANE_Handle) s; status = open_scanner(s); - if (status != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) { + free(s); return status; + } - esci_reset(s); - + status = esci_reset(s); + if (status != SANE_STATUS_GOOD) + close_scanner(s); + return status; } @@ -2368,7 +1520,7 @@ sane_close(SANE_Handle handle) { int i; - Epson_Scanner *s, *prev; + Epson_Scanner *s; /* * XXX Test if there is still data pending from @@ -2377,24 +1529,6 @@ s = (Epson_Scanner *) handle; - /* remove handle from list of open handles */ - prev = 0; - for (s = first_handle; s; s = s->next) { - if (s == handle) - break; - prev = s; - } - - if (!s) { - DBG(1, "%s: invalid handle (0x%p)\n", __func__, handle); - return; - } - - if (prev) - prev->next = s->next; - else - first_handle = s->next; - if (s->fd != -1) close_scanner(s); @@ -2414,28 +1548,27 @@ if (option < 0 || option >= NUM_OPTIONS) return NULL; - return (s->opt + option); + return s->opt + option; } static const SANE_String_Const * -search_string_list(const SANE_String_Const * list, SANE_String value) +search_string_list(const SANE_String_Const *list, SANE_String value) { - while (*list != NULL && strcmp(value, *list) != 0) { - ++list; - } + while (*list != NULL && strcmp(value, *list) != 0) + list++; return ((*list == NULL) ? NULL : list); } /* - Activate, deactivate an option. Subroutines so we can add - debugging info if we want. The change flag is set to TRUE - if we changed an option. If we did not change an option, + Activate, deactivate an option. Subroutines so we can add + debugging info if we want. The change flag is set to TRUE + if we changed an option. If we did not change an option, then the value of the changed flag is not modified. */ static void -activateOption(Epson_Scanner * s, SANE_Int option, SANE_Bool * change) +activateOption(Epson_Scanner *s, SANE_Int option, SANE_Bool *change) { if (!SANE_OPTION_IS_ACTIVE(s->opt[option].cap)) { s->opt[option].cap &= ~SANE_CAP_INACTIVE; @@ -2444,7 +1577,7 @@ } static void -deactivateOption(Epson_Scanner * s, SANE_Int option, SANE_Bool * change) +deactivateOption(Epson_Scanner *s, SANE_Int option, SANE_Bool *change) { if (SANE_OPTION_IS_ACTIVE(s->opt[option].cap)) { s->opt[option].cap |= SANE_CAP_INACTIVE; @@ -2453,8 +1586,8 @@ } static void -setOptionState(Epson_Scanner * s, SANE_Bool state, SANE_Int option, - SANE_Bool * change) +setOptionState(Epson_Scanner *s, SANE_Bool state, SANE_Int option, + SANE_Bool *change) { if (state) activateOption(s, option, change); @@ -2469,12 +1602,14 @@ SANE_Option_Descriptor *sopt = &(s->opt[option]); Option_Value *sval = &(s->val[option]); + DBG(17, "%s: option = %d\n", __func__, option); + switch (option) { -/* case OPT_GAMMA_VECTOR: */ case OPT_GAMMA_VECTOR_R: case OPT_GAMMA_VECTOR_G: case OPT_GAMMA_VECTOR_B: + case OPT_CCT_PROFILE: memcpy(value, sval->wa, sopt->size); break; @@ -2490,23 +1625,14 @@ case OPT_BRIGHTNESS: case OPT_SHARPNESS: case OPT_AUTO_EJECT: - case OPT_CCT_1: - case OPT_CCT_2: - case OPT_CCT_3: - case OPT_CCT_4: - case OPT_CCT_5: - case OPT_CCT_6: - case OPT_CCT_7: - case OPT_CCT_8: - case OPT_CCT_9: case OPT_THRESHOLD: case OPT_BIT_DEPTH: case OPT_WAIT_FOR_BUTTON: - case OPT_LIMIT_RESOLUTION: *((SANE_Word *) value) = sval->w; break; case OPT_MODE: + case OPT_CCT_MODE: case OPT_ADF_MODE: case OPT_HALFTONE: case OPT_DROPOUT: @@ -2539,17 +1665,21 @@ * Threshold is available when halftone is NONE, and depth is 1. */ static void -handle_depth_halftone(Epson_Scanner * s, SANE_Bool * reload) +handle_depth_halftone(Epson_Scanner *s, SANE_Bool *reload) { int hti = s->val[OPT_HALFTONE].w; int mdi = s->val[OPT_MODE].w; SANE_Bool aas = SANE_FALSE; SANE_Bool thresh = SANE_FALSE; + /* this defaults to false */ + setOptionState(s, thresh, OPT_THRESHOLD, reload); + if (!s->hw->cmd->control_auto_area_segmentation) return; if (mode_params[mdi].depth == 1) { + if (halftone_params[hti] != HALFTONE_TET) aas = SANE_TRUE; @@ -2569,7 +1699,7 @@ */ static void -handle_source(Epson_Scanner * s, SANE_Int optindex, char *value) +change_source(Epson_Scanner *s, SANE_Int optindex, char *value) { int force_max = SANE_FALSE; SANE_Bool dummy; @@ -2671,15 +1801,15 @@ } static SANE_Status -setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int * info) +setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int *info) { Epson_Scanner *s = (Epson_Scanner *) handle; SANE_Option_Descriptor *sopt = &(s->opt[option]); Option_Value *sval = &(s->val[option]); SANE_Status status; - const SANE_String_Const *optval; - int optindex; + const SANE_String_Const *optval = NULL; + int optindex = 0; SANE_Bool reload = SANE_FALSE; DBG(17, "%s: option = %d, value = %p\n", __func__, option, value); @@ -2693,16 +1823,9 @@ DBG(17, "%s: constrained val = %d\n", __func__, *(SANE_Word *) value); - s->option_has_changed = SANE_TRUE; - - optval = NULL; - optindex = 0; - - if (sopt->constraint_type == SANE_CONSTRAINT_STRING_LIST) { optval = search_string_list(sopt->constraint.string_list, (char *) value); - if (optval == NULL) return SANE_STATUS_INVAL; optindex = optval - sopt->constraint.string_list; @@ -2710,25 +1833,15 @@ switch (option) { -/* case OPT_GAMMA_VECTOR: */ case OPT_GAMMA_VECTOR_R: case OPT_GAMMA_VECTOR_G: case OPT_GAMMA_VECTOR_B: + case OPT_CCT_PROFILE: memcpy(sval->wa, value, sopt->size); /* Word arrays */ break; - case OPT_CCT_1: - case OPT_CCT_2: - case OPT_CCT_3: - case OPT_CCT_4: - case OPT_CCT_5: - case OPT_CCT_6: - case OPT_CCT_7: - case OPT_CCT_8: - case OPT_CCT_9: - sval->w = *((SANE_Word *) value); /* Simple values */ - break; - + case OPT_CCT_MODE: + case OPT_ADF_MODE: case OPT_DROPOUT: case OPT_FILM_TYPE: case OPT_BAY: @@ -2764,55 +1877,33 @@ break; case OPT_SOURCE: - handle_source(s, optindex, (char *) value); + change_source(s, optindex, (char *) value); reload = SANE_TRUE; break; case OPT_MODE: { SANE_Bool isColor = mode_params[optindex].color; - SANE_Bool userDefined = - color_userdefined[s->val[OPT_COLOR_CORRECTION].w]; sval->w = optindex; + /* halftoning available only on bw scans */ if (s->hw->cmd->set_halftoning != 0) - setOptionState(s, - mode_params[optindex].depth == - 1, OPT_HALFTONE, &reload); + setOptionState(s, mode_params[optindex].depth == 1, + OPT_HALFTONE, &reload); + /* disable dropout on non-color scans */ setOptionState(s, !isColor, OPT_DROPOUT, &reload); if (s->hw->cmd->set_color_correction) setOptionState(s, isColor, OPT_COLOR_CORRECTION, &reload); - if (s->hw->cmd->set_color_correction_coefficients) { - setOptionState(s, isColor - && userDefined, OPT_CCT_1, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_2, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_3, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_4, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_5, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_6, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_7, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_8, &reload); - setOptionState(s, isColor - && userDefined, OPT_CCT_9, &reload); - } - /* if binary, then disable the bit depth selection */ if (optindex == 0) { s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; } else { - if (bitDepthList[0] == 1) + if (s->hw->depth_list[0] == 1) s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; else { @@ -2829,10 +1920,6 @@ break; } - case OPT_ADF_MODE: - sval->w = optindex; - break; - case OPT_BIT_DEPTH: sval->w = *((SANE_Word *) value); mode_params[s->val[OPT_MODE].w].depth = sval->w; @@ -2846,19 +1933,7 @@ case OPT_COLOR_CORRECTION: { - SANE_Bool f = color_userdefined[optindex]; - sval->w = optindex; - setOptionState(s, f, OPT_CCT_1, &reload); - setOptionState(s, f, OPT_CCT_2, &reload); - setOptionState(s, f, OPT_CCT_3, &reload); - setOptionState(s, f, OPT_CCT_4, &reload); - setOptionState(s, f, OPT_CCT_5, &reload); - setOptionState(s, f, OPT_CCT_6, &reload); - setOptionState(s, f, OPT_CCT_7, &reload); - setOptionState(s, f, OPT_CCT_8, &reload); - setOptionState(s, f, OPT_CCT_9, &reload); - break; } @@ -2868,7 +1943,6 @@ sval->w = optindex; -/* setOptionState(s, f, OPT_GAMMA_VECTOR, &reload ); */ setOptionState(s, f, OPT_GAMMA_VECTOR_R, &reload); setOptionState(s, f, OPT_GAMMA_VECTOR_G, &reload); setOptionState(s, f, OPT_GAMMA_VECTOR_B, &reload); @@ -2888,12 +1962,6 @@ sval->w = *((SANE_Word *) value); break; - case OPT_LIMIT_RESOLUTION: - sval->w = *((SANE_Word *) value); - filter_resolution_list(s); - reload = SANE_TRUE; - break; - default: return SANE_STATUS_INVAL; } @@ -2908,952 +1976,71 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, - void *value, SANE_Int * info) + void *value, SANE_Int *info) { - if (option < 0 || option >= NUM_OPTIONS) - return SANE_STATUS_INVAL; - - if (info != NULL) - *info = 0; - - switch (action) { - case SANE_ACTION_GET_VALUE: - return getvalue(handle, option, value); - - case SANE_ACTION_SET_VALUE: - return setvalue(handle, option, value, info); - - default: - return SANE_STATUS_INVAL; - } - - return SANE_STATUS_GOOD; -} - -static SANE_Status -e2_set_extended_scanning_parameters(Epson_Scanner * s) -{ - unsigned char buf[64]; - - const struct mode_param *mparam; - - DBG(1, "%s\n", __func__); - - mparam = &mode_params[s->val[OPT_MODE].w]; - - memset(buf, 0x00, sizeof(buf)); - - /* ESC R, resolution */ - htole32a(&buf[0], s->val[OPT_RESOLUTION].w); - htole32a(&buf[4], s->val[OPT_RESOLUTION].w); - - /* ESC A, scanning area */ - htole32a(&buf[8], s->left); - htole32a(&buf[12], s->top); - htole32a(&buf[16], s->params.pixels_per_line); - htole32a(&buf[20], s->params.lines); - - /* - * The byte sequence mode was introduced in B5, - *for B[34] we need line sequence mode - */ - - /* ESC C, set color */ - if ((s->hw->cmd->level[0] == 'D' - || (s->hw->cmd->level[0] == 'B' && s->hw->level >= 5)) - && mparam->flags == 0x02) { - buf[24] = 0x13; - } else { - buf[24] = mparam->flags | (mparam->dropout_mask - & dropout_params[s-> - val[OPT_DROPOUT]. - w]); - } - - /* ESC D, set data format */ - mparam = &mode_params[s->val[OPT_MODE].w]; - buf[25] = mparam->depth; - - /* ESC e, control option */ - if (s->hw->extension) { - - char extensionCtrl; - extensionCtrl = (s->hw->use_extension ? 1 : 0); - if (s->hw->use_extension && (s->val[OPT_ADF_MODE].w == 1)) - extensionCtrl = 2; - - /* Test for TPU2 - * Epson Perfection 4990 Command Specifications - * JZIS-0075 Rev. A, page 31 - */ - if (s->hw->use_extension && s->hw->TPU2) - extensionCtrl = 5; - - /* ESC e */ - buf[26] = extensionCtrl; - - /* XXX focus */ - } - - /* ESC g, scanning mode (normal or high speed) */ - if (s->val[OPT_PREVIEW].w) - buf[27] = 1; /* High speed */ - else - buf[27] = 0; - - /* ESC d, block line number */ - buf[28] = s->lcount; - - /* ESC Z, set gamma correction */ - buf[29] = 0x01; /* default */ - - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_GAMMA_CORRECTION].cap)) { - char val; - if (s->hw->cmd->level[0] == 'D') { - /* The D1 level has only the two user defined gamma - * settings. - */ - val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; - } else { - val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; - - /* - * If "Default" is selected then determine the actual value - * to send to the scanner: If bilevel mode, just send the - * value from the table (0x01), for grayscale or color mode - * add one and send 0x02. - */ - - if (s->val[OPT_GAMMA_CORRECTION].w == 0) { - val += mparam->depth == 1 ? 0 : 1; - } - } - - buf[29] = val; - } - - /* ESC L, set brightness */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_BRIGHTNESS].cap)) - buf[30] = s->val[OPT_BRIGHTNESS].w; - - /* ESC B, set halftoning mode / halftone processing */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_HALFTONE].cap)) - buf[32] = halftone_params[s->val[OPT_HALFTONE].w]; - - /* ESC s, auto area segmentation */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_AAS].cap)) - buf[34] = s->val[OPT_AAS].w; - - /* ESC Q, set sharpness / sharpness control */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_SHARPNESS].cap)) - buf[35] = s->val[OPT_SHARPNESS].w; - - /* ESC K, set data order / mirroring */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_MIRROR].cap)) - buf[36] = mirror_params[s->val[OPT_MIRROR].w]; - - s->invert_image = SANE_FALSE; /* default: do no invert the image */ - - /* ESC N, film type */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_FILM_TYPE].cap)) { - s->invert_image = - (s->val[OPT_FILM_TYPE].w == FILM_TYPE_NEGATIVE); - buf[37] = film_params[s->val[OPT_FILM_TYPE].w]; - } - - /* ESC M, color correction */ - buf[31] = color_params[s->val[OPT_COLOR_CORRECTION].w]; - - /* ESC t, threshold */ - buf[33] = s->val[OPT_THRESHOLD].w; - - return esci_set_scanning_parameter(s, buf); -} - -static SANE_Status -e2_set_scanning_parameters(Epson_Scanner * s) -{ - SANE_Status status; - struct mode_param *mparam = &mode_params[s->val[OPT_MODE].w]; - unsigned char color_mode; - - DBG(1, "%s\n", __func__); - - /* - * There is some undocumented special behavior with the TPU enable/disable. - * TPU power ESC e status - * on 0 NAK - * on 1 ACK - * off 0 ACK - * off 1 NAK - * - * It makes no sense to scan with TPU powered on and source flatbed, because - * light will come from both sides. - */ - - if (s->hw->extension) { - - int extensionCtrl; - extensionCtrl = (s->hw->use_extension ? 1 : 0); - if (s->hw->use_extension && (s->val[OPT_ADF_MODE].w == 1)) - extensionCtrl = 2; - - status = esci_control_extension(s, extensionCtrl); - if (status != SANE_STATUS_GOOD) { - DBG(1, "you may have to power %s your TPU\n", - s->hw->use_extension ? "on" : "off"); - DBG(1, - "and you may also have to restart the SANE frontend.\n"); - return status; - } - - /* XXX use request_extended_status and analyze - * buffer to set the scan area for - * ES-9000H and GT-30000 - */ - - /* - * set the focus position according to the extension used: - * if the TPU is selected, then focus 2.5mm above the glass, - * otherwise focus on the glass. Scanners that don't support - * this feature, will just ignore these calls. - */ - - if (s->hw->focusSupport == SANE_TRUE) { - if (s->val[OPT_FOCUS].w == 0) { - DBG(1, "setting focus to glass surface\n"); - esci_set_focus_position(s, 0x40); - } else { - DBG(1, - "setting focus to 2.5mm above glass\n"); - esci_set_focus_position(s, 0x59); - } - } - } - - /* ESC C, Set color */ - color_mode = mparam->flags | (mparam->dropout_mask - & dropout_params[s->val[OPT_DROPOUT]. - w]); - - /* - * The byte sequence mode was introduced in B5, for B[34] we need line sequence mode - * XXX Check what to do for the FilmScan 200 - */ - if ((s->hw->cmd->level[0] == 'D' - || (s->hw->cmd->level[0] == 'B' && s->hw->level >= 5)) - && mparam->flags == 0x02) - color_mode = 0x13; - - status = esci_set_color_mode(s, color_mode); - if (status != SANE_STATUS_GOOD) - return status; - - /* ESC D, set data format */ - DBG(1, "%s: setting data format to %d bits\n", __func__, - mparam->depth); - status = esci_set_data_format(s, mparam->depth); - if (status != SANE_STATUS_GOOD) - return status; - - /* ESC B, set halftoning mode */ - if (s->hw->cmd->set_halftoning - && SANE_OPTION_IS_ACTIVE(s->opt[OPT_HALFTONE].cap)) { - status = esci_set_halftoning(s, - halftone_params[s-> - val - [OPT_HALFTONE]. - w]); - if (status != SANE_STATUS_GOOD) - return status; - } - - /* ESC L, set brightness */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_BRIGHTNESS].cap)) { - status = esci_set_bright(s, s->val[OPT_BRIGHTNESS].w); - if (status != SANE_STATUS_GOOD) - return status; - } - - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_AAS].cap)) { - status = esci_set_auto_area_segmentation(s, - s->val[OPT_AAS].w); - if (status != SANE_STATUS_GOOD) - return status; - } - - s->invert_image = SANE_FALSE; /* default: to not inverting the image */ - - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_FILM_TYPE].cap)) { - s->invert_image = - (s->val[OPT_FILM_TYPE].w == FILM_TYPE_NEGATIVE); - status = esci_set_film_type(s, - film_params[s->val[OPT_FILM_TYPE]. - w]); - if (status != SANE_STATUS_GOOD) - return status; - } - - if (s->hw->cmd->set_gamma - && SANE_OPTION_IS_ACTIVE(s->opt[OPT_GAMMA_CORRECTION].cap)) { - int val; - if (s->hw->cmd->level[0] == 'D') { - /* - * The D1 level has only the two user defined gamma - * settings. - */ - val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; - } else { - val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; - - /* - * If "Default" is selected then determine the actual value - * to send to the scanner: If bilevel mode, just send the - * value from the table (0x01), for grayscale or color mode - * add one and send 0x02. - */ - -/* if( s->val[ OPT_GAMMA_CORRECTION].w <= 1) { */ - if (s->val[OPT_GAMMA_CORRECTION].w == 0) { - val += mparam->depth == 1 ? 0 : 1; - } - } - - status = esci_set_gamma(s, val); - if (status != SANE_STATUS_GOOD) - return status; - } - - if (s->hw->cmd->set_threshold != 0 - && SANE_OPTION_IS_ACTIVE(s->opt[OPT_THRESHOLD].cap)) { - status = esci_set_threshold(s, s->val[OPT_THRESHOLD].w); - if (status != SANE_STATUS_GOOD) - return status; - } - - /* XXX ESC Z here */ - - /* ESC M, set color correction */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_COLOR_CORRECTION].cap)) { - status = esci_set_color_correction(s, - color_params[s-> - val - [OPT_COLOR_CORRECTION]. - w]); - if (status != SANE_STATUS_GOOD) - return status; - } - - /* ESC Q, set sharpness */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_SHARPNESS].cap)) { - - status = esci_set_sharpness(s, s->val[OPT_SHARPNESS].w); - if (status != SANE_STATUS_GOOD) - return status; - } - - /* ESC g, set scanning mode */ - if (s->val[OPT_PREVIEW].w) - status = esci_set_speed(s, 1); - else - status = esci_set_speed(s, 0); - - if (status != SANE_STATUS_GOOD) - return status; + DBG(17, "%s: action = %x, option = %d\n", __func__, action, option); - /* ESC K, set data order */ - if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_MIRROR].cap)) { - status = esci_mirror_image(s, mirror_params[s->val[OPT_MIRROR].w]); - if (status != SANE_STATUS_GOOD) - return status; - } - - /* ESC R */ - status = esci_set_resolution(s, s->val[OPT_RESOLUTION].w, - s->val[OPT_RESOLUTION].w); - if (status != SANE_STATUS_GOOD) - return status; - - /* ESC H, set zoom */ - /* not implemented */ - - /* ESC A, set scanning area */ - status = esci_set_scan_area(s, s->left, s->top, - s->params.pixels_per_line, - s->params.lines); - - if (status != SANE_STATUS_GOOD) - return status; - - /* ESC d, set block line number / set line counter */ - status = esci_set_lcount(s, s->lcount); - if (status != SANE_STATUS_GOOD) - return status; - - return SANE_STATUS_GOOD; -} - -/* - * This function is part of the SANE API and gets called when the front end - * requests information aobut the scan configuration (e.g. color depth, mode, - * bytes and pixels per line, number of lines. This information is returned - * in the SANE_Parameters structure. - * - * Once a scan was started, this routine has to report the correct values, if - * it is called before the scan is actually started, the values are based on - * the current settings. - */ - -SANE_Status -sane_get_parameters(SANE_Handle handle, SANE_Parameters * params) -{ - Epson_Scanner *s = (Epson_Scanner *) handle; - int dpi, max_x, max_y; - int bytes_per_pixel; - - DBG(5, "%s\n", __func__); - - /* - * If sane_start was already called, then just retrieve the parameters - * from the scanner data structure - */ - - if (!s->eof && s->ptr != NULL) { - DBG(5, "returning saved params structure\n"); - - if (params != NULL) { - DBG(1, - "restoring parameters from saved parameters\n"); - *params = s->params; - } - - DBG(5, "resolution = %d, preview = %d\n", - s->val[OPT_RESOLUTION].w, s->val[OPT_PREVIEW].w); - - DBG(5, "get para tlx %f tly %f brx %f bry %f [mm]\n", - SANE_UNFIX(s->val[OPT_TL_X].w), - SANE_UNFIX(s->val[OPT_TL_Y].w), - SANE_UNFIX(s->val[OPT_BR_X].w), - SANE_UNFIX(s->val[OPT_BR_Y].w)); - - print_params(s->params); - - return SANE_STATUS_GOOD; - } - - /* otherwise initialize the params structure and gather the data */ - - memset(&s->params, 0, sizeof(SANE_Parameters)); - - dpi = s->val[OPT_RESOLUTION].w; - - max_x = max_y = 0; - - /* XXX check this */ - s->params.pixels_per_line = - (SANE_UNFIX(s->val[OPT_BR_X].w - - s->val[OPT_TL_X].w) / (MM_PER_INCH * dpi)) + 0.5; - s->params.lines = - (SANE_UNFIX(s->val[OPT_BR_Y].w - - s->val[OPT_TL_Y].w) / (MM_PER_INCH * dpi)) + 0.5; - - /* - * Make sure that the number of lines is correct for color shuffling: - * The shuffling alghorithm produces 2xline_distance lines at the - * beginning and the same amount at the end of the scan that are not - * useable. If s->params.lines gets negative, 0 lines are reported - * back to the frontend. - */ - if (s->hw->color_shuffle) { - s->params.lines -= 4 * s->line_distance; - if (s->params.lines < 0) { - s->params.lines = 0; - } - DBG(1, - "adjusted params.lines for color_shuffle by %d to %d\n", - 4 * s->line_distance, s->params.lines); - } - - DBG(5, "resolution = %d, preview = %d\n", - s->val[OPT_RESOLUTION].w, s->val[OPT_PREVIEW].w); - - DBG(5, "get para %p %p tlx %f tly %f brx %f bry %f [mm]\n", - (void *) s, (void *) s->val, SANE_UNFIX(s->val[OPT_TL_X].w), - SANE_UNFIX(s->val[OPT_TL_Y].w), SANE_UNFIX(s->val[OPT_BR_X].w), - SANE_UNFIX(s->val[OPT_BR_Y].w)); - - - /* - * Calculate bytes_per_pixel and bytes_per_line for - * any color depths. - * - * The default color depth is stored in mode_params.depth: - */ - - if (mode_params[s->val[OPT_MODE].w].depth == 1) - s->params.depth = 1; - else - s->params.depth = s->val[OPT_BIT_DEPTH].w; - - if (s->params.depth > 8) { - s->params.depth = 16; /* - * The frontends can only handle 8 or 16 bits - * for gray or color - so if it's more than 8, - * it gets automatically set to 16. This works - * as long as EPSON does not come out with a - * scanner that can handle more than 16 bits - * per color channel. - */ - - } - - bytes_per_pixel = s->params.depth / 8; /* this works because it can only be set to 1, 8 or 16 */ - if (s->params.depth % 8) { /* just in case ... */ - bytes_per_pixel++; - } - - /* pixels_per_line is rounded to the next 8bit boundary */ - s->params.pixels_per_line = s->params.pixels_per_line & ~7; - - s->params.last_frame = SANE_TRUE; - - if (mode_params[s->val[OPT_MODE].w].color) { - s->params.format = SANE_FRAME_RGB; - s->params.bytes_per_line = - 3 * s->params.pixels_per_line * bytes_per_pixel; - } else { - s->params.format = SANE_FRAME_GRAY; - s->params.bytes_per_line = - s->params.pixels_per_line * s->params.depth / 8; - } - - if (NULL != params) - *params = s->params; - - print_params(s->params); - - return SANE_STATUS_GOOD; -} - -static void -e2_setup_block_mode(Epson_Scanner * s) -{ - s->block = SANE_TRUE; - s->lcount = sanei_scsi_max_request_size / s->params.bytes_per_line; - - /* XXX Check if we can do this with other scanners, - * by bus type - */ - DBG(1, "max req size: %d\n", sanei_scsi_max_request_size); - - if (s->lcount < 3 && e2_model(s, "GT-X800")) { - s->lcount = 21; - DBG(17, - "%s: set lcount = %i bigger than sanei_scsi_max_request_size\n", - __func__, s->lcount); - } - - if (s->lcount >= 255) { - s->lcount = 255; - } - - /* XXX why this? */ - if (s->hw->TPU && s->hw->use_extension && s->lcount > 32) { - s->lcount = 32; - } - - /* - * The D1 series of scanners only allow an even line number - * for bi-level scanning. If a bit depth of 1 is selected, then - * make sure the next lower even number is selected. - */ - if (s->lcount > 3 && s->lcount % 2) { - s->lcount -= 1; - } - - DBG(1, "line count is %d\n", s->lcount); -} - - -static SANE_Status -e2_init_parameters(Epson_Scanner * s) -{ - int dpi, max_y, max_x, bytes_per_pixel; - struct mode_param *mparam; - - memset(&s->params, 0, sizeof(SANE_Parameters)); - - max_x = max_y = 0; - dpi = s->val[OPT_RESOLUTION].w; - - mparam = &mode_params[s->val[OPT_MODE].w]; - - if (SANE_UNFIX(s->val[OPT_BR_Y].w) == 0 || - SANE_UNFIX(s->val[OPT_BR_X].w) == 0) - return SANE_STATUS_INVAL; - - s->left = SANE_UNFIX(s->val[OPT_TL_X].w) / MM_PER_INCH * - s->val[OPT_RESOLUTION].w + 0.5; - - s->top = SANE_UNFIX(s->val[OPT_TL_Y].w) / MM_PER_INCH * - s->val[OPT_RESOLUTION].w + 0.5; - - /* XXX check this */ - s->params.pixels_per_line = - SANE_UNFIX(s->val[OPT_BR_X].w - - s->val[OPT_TL_X].w) / MM_PER_INCH * dpi + 0.5; - s->params.lines = - SANE_UNFIX(s->val[OPT_BR_Y].w - - s->val[OPT_TL_Y].w) / MM_PER_INCH * dpi + 0.5; - - /* - * Make sure that the number of lines is correct for color shuffling: - * The shuffling alghorithm produces 2xline_distance lines at the - * beginning and the same amount at the end of the scan that are not - * useable. If s->params.lines gets negative, 0 lines are reported - * back to the frontend. - */ - if (s->hw->color_shuffle) { - s->params.lines -= 4 * s->line_distance; - if (s->params.lines < 0) { - s->params.lines = 0; - } - DBG(1, - "adjusted params.lines for color_shuffle by %d to %d\n", - 4 * s->line_distance, s->params.lines); - } - - DBG(1, "%s: %p %p tlx %f tly %f brx %f bry %f [mm]\n", - __func__, (void *) s, (void *) s->val, - SANE_UNFIX(s->val[OPT_TL_X].w), SANE_UNFIX(s->val[OPT_TL_Y].w), - SANE_UNFIX(s->val[OPT_BR_X].w), SANE_UNFIX(s->val[OPT_BR_Y].w)); - - /* - * Calculate bytes_per_pixel and bytes_per_line for - * any color depths. - * - * The default color depth is stored in mode_params.depth: - */ - - if (mode_params[s->val[OPT_MODE].w].depth == 1) - s->params.depth = 1; - else - s->params.depth = s->val[OPT_BIT_DEPTH].w; - - if (s->params.depth > 8) { - s->params.depth = 16; /* - * The frontends can only handle 8 or 16 bits - * for gray or color - so if it's more than 8, - * it gets automatically set to 16. This works - * as long as EPSON does not come out with a - * scanner that can handle more than 16 bits - * per color channel. - */ - } - - /* this works because it can only be set to 1, 8 or 16 */ - bytes_per_pixel = s->params.depth / 8; - if (s->params.depth % 8) { /* just in case ... */ - bytes_per_pixel++; - } - - /* pixels_per_line is rounded to the next 8bit boundary */ - s->params.pixels_per_line = s->params.pixels_per_line & ~7; - - s->params.last_frame = SANE_TRUE; - - if (mode_params[s->val[OPT_MODE].w].color) { - s->params.format = SANE_FRAME_RGB; - s->params.bytes_per_line = - 3 * s->params.pixels_per_line * bytes_per_pixel; - } else { - s->params.format = SANE_FRAME_GRAY; - s->params.bytes_per_line = - s->params.pixels_per_line * s->params.depth / 8; - } - - /* - * Calculate correction for line_distance in D1 scanner: - * Start line_distance lines earlier and add line_distance lines at the end - * - * Because the actual line_distance is not yet calculated we have to do this - * first. - */ - - s->hw->color_shuffle = SANE_FALSE; - s->current_output_line = 0; - s->lines_written = 0; - s->color_shuffle_line = 0; - - if ((s->hw->optical_res != 0) && (mparam->depth == 8) - && (mparam->flags != 0)) { - s->line_distance = - s->hw->max_line_distance * dpi / s->hw->optical_res; - if (s->line_distance != 0) { - s->hw->color_shuffle = SANE_TRUE; - } else - s->hw->color_shuffle = SANE_FALSE; - } - - /* - * Modify the scan area: If the scanner requires color shuffling, then we try to - * scan more lines to compensate for the lines that will be removed from the scan - * due to the color shuffling alghorithm. - * At this time we add two times the line distance to the number of scan lines if - * this is possible - if not, then we try to calculate the number of additional - * lines according to the selected scan area. - */ - - if (s->hw->color_shuffle == SANE_TRUE) { - - /* start the scan 2 * line_distance earlier */ - s->top -= 2 * s->line_distance; - if (s->top < 0) { - s->top = 0; - } - - /* scan 4*line_distance lines more */ - s->params.lines += 4 * s->line_distance; - } - - /* - * If (s->top + s->params.lines) is larger than the max scan area, reset - * the number of scan lines: - */ - if (SANE_UNFIX(s->val[OPT_BR_Y].w) / MM_PER_INCH * dpi < - (s->params.lines + s->top)) { - s->params.lines = - ((int) SANE_UNFIX(s->val[OPT_BR_Y].w) / MM_PER_INCH * - dpi + 0.5) - s->top; - } - - s->block = SANE_FALSE; - s->lcount = 1; - - /* - * The set line count commands needs to be sent for certain scanners in - * color mode. The D1 level requires it, we are however only testing for - * 'D' and not for the actual numeric level. - */ - - if ((s->hw->cmd->level[0] == 'B') && (s->hw->level >= 5)) - e2_setup_block_mode(s); - else if ((s->hw->cmd->level[0] == 'B') && (s->hw->level == 4) - && (!mode_params[s->val[OPT_MODE].w].color)) - e2_setup_block_mode(s); - else if (s->hw->cmd->level[0] == 'D') - e2_setup_block_mode(s); - - print_params(s->params); - - return SANE_STATUS_GOOD; -} - -static void -e2_wait_button(Epson_Scanner * s) -{ - DBG(5, "%s\n", __func__); - - s->hw->wait_for_button = SANE_TRUE; - - while (s->hw->wait_for_button == SANE_TRUE) { - unsigned char button_status = 0; - - if (s->canceling == SANE_TRUE) { - s->hw->wait_for_button = SANE_FALSE; - } - /* get the button status from the scanner */ - else if (esci_request_push_button_status(s, &button_status) == - SANE_STATUS_GOOD) { - if (button_status) - s->hw->wait_for_button = SANE_FALSE; - else - sleep(1); - } else { - /* we run into an error condition, just continue */ - s->hw->wait_for_button = SANE_FALSE; - } - } -} - - -static SANE_Status -e2_check_warm_up(Epson_Scanner * s, SANE_Bool * wup) -{ - SANE_Status status; - - DBG(5, "%s\n", __func__); - - *wup = SANE_FALSE; - - if (s->hw->extended_commands) { - unsigned char buf[16]; - - status = esci_request_scanner_status(s, buf); - if (status != SANE_STATUS_GOOD) - return status; - - if (buf[0] & FSF_STATUS_MAIN_WU) - *wup = SANE_TRUE; - - } else { - unsigned char *es; - - /* this command is not available on some scanners */ - if (!s->hw->cmd->request_extended_status) - return SANE_STATUS_GOOD; - - status = esci_request_extended_status(s, &es, NULL); - if (status != SANE_STATUS_GOOD) - return status; - - if (es[0] & EXT_STATUS_WU) - *wup = SANE_TRUE; - - free(es); - } - - return status; -} - -static SANE_Status -e2_wait_warm_up(Epson_Scanner * s) -{ - SANE_Status status; - SANE_Bool wup; - - DBG(5, "%s\n", __func__); - - s->retry_count = 0; - - while (1) { - status = e2_check_warm_up(s, &wup); - if (status != SANE_STATUS_GOOD) - return status; - - if (wup == SANE_FALSE) - break; - - s->retry_count++; - - if (s->retry_count > SANE_EPSON_MAX_RETRIES) { - DBG(1, "max retry count exceeded (%d)\n", - s->retry_count); - return SANE_STATUS_DEVICE_BUSY; - } - sleep(5); - } - - return SANE_STATUS_GOOD; -} - -static SANE_Status -e2_check_adf(Epson_Scanner * s) -{ - SANE_Status status; - - DBG(5, "%s\n", __func__); - - if (s->hw->use_extension == SANE_FALSE) - return SANE_STATUS_GOOD; - - if (s->hw->extended_commands) { - unsigned char buf[16]; - - status = esci_request_scanner_status(s, buf); - if (status != SANE_STATUS_GOOD) - return status; - - if (buf[1] & FSF_STATUS_ADF_PE) - return SANE_STATUS_NO_DOCS; - - if (buf[1] & FSF_STATUS_ADF_PJ) - return SANE_STATUS_JAMMED; - - } else { - unsigned char *buf, t; - - status = esci_request_extended_status(s, &buf, NULL); - if (status != SANE_STATUS_GOOD) - return status;; - - t = buf[1]; - - free(buf); - - if (t & EXT_STATUS_PE) - return SANE_STATUS_NO_DOCS; - - if (t & EXT_STATUS_PJ) - return SANE_STATUS_JAMMED; - } - - return SANE_STATUS_GOOD; -} - -static SANE_Status -e2_start_std_scan(Epson_Scanner * s) -{ - SANE_Status status; - unsigned char params[2]; + if (option < 0 || option >= NUM_OPTIONS) + return SANE_STATUS_INVAL; - DBG(5, "%s\n", __func__); + if (info != NULL) + *info = 0; + + switch (action) { + case SANE_ACTION_GET_VALUE: + return getvalue(handle, option, value); - /* ESC g */ - params[0] = ESC; - params[1] = s->hw->cmd->start_scanning; + case SANE_ACTION_SET_VALUE: + return setvalue(handle, option, value, info); - e2_send(s, params, 2, 6 + (s->lcount * s->params.bytes_per_line), - &status); + default: + return SANE_STATUS_INVAL; + } - return status; + return SANE_STATUS_INVAL; } -static SANE_Status -e2_start_ext_scan(Epson_Scanner * s) +SANE_Status +sane_get_parameters(SANE_Handle handle, SANE_Parameters *params) { - SANE_Status status; - unsigned char params[2]; - unsigned char buf[14]; + Epson_Scanner *s = (Epson_Scanner *) handle; DBG(5, "%s\n", __func__); - params[0] = FS; - params[1] = 'G'; - - status = e2_txrx(s, params, 2, buf, 14); - if (status != SANE_STATUS_GOOD) - return status; + if (params == NULL) + DBG(1, "%s: params is NULL\n", __func__); - if (buf[0] != STX) - return SANE_STATUS_INVAL; + /* + * If sane_start was already called, then just retrieve the parameters + * from the scanner data structure + */ - if (buf[1] & 0x80) { - DBG(1, "%s: fatal error\n", __func__); - return SANE_STATUS_IO_ERROR; + if (!s->eof && s->ptr != NULL) { + DBG(5, "scan in progress, returning saved params structure\n"); + } else { + /* otherwise initialize the params structure and gather the data */ + e2_init_parameters(s); } - s->ext_block_len = le32atoh(&buf[2]); - s->ext_blocks = le32atoh(&buf[6]); - s->ext_last_len = le32atoh(&buf[10]); - - s->ext_counter = 0; - - DBG(5, " status : 0x%02x\n", buf[1]); - DBG(5, " block size : %lu\n", (u_long) le32atoh(&buf[2])); - DBG(5, " block count : %lu\n", (u_long) le32atoh(&buf[6])); - DBG(5, " last block size: %lu\n", (u_long) le32atoh(&buf[10])); + if (params != NULL) + *params = s->params; - if (s->ext_last_len) { - s->ext_blocks++; - DBG(1, "adj block count: %d\n", s->ext_blocks); - } + print_params(s->params); - /* adjust block len if we have only one block to read */ - if (s->ext_block_len == 0 && s->ext_last_len) - s->ext_block_len = s->ext_last_len; + return SANE_STATUS_GOOD; +} - return status; +static void e2_load_cct_profile(struct Epson_Scanner *s, unsigned int index) +{ + s->cct_table[0] = SANE_FIX(s->hw->cct_profile->cct[index][0]); + s->cct_table[1] = SANE_FIX(s->hw->cct_profile->cct[index][1]); + s->cct_table[2] = SANE_FIX(s->hw->cct_profile->cct[index][2]); + s->cct_table[3] = SANE_FIX(s->hw->cct_profile->cct[index][3]); + s->cct_table[4] = SANE_FIX(s->hw->cct_profile->cct[index][4]); + s->cct_table[5] = SANE_FIX(s->hw->cct_profile->cct[index][5]); + s->cct_table[6] = SANE_FIX(s->hw->cct_profile->cct[index][6]); + s->cct_table[7] = SANE_FIX(s->hw->cct_profile->cct[index][7]); + s->cct_table[8] = SANE_FIX(s->hw->cct_profile->cct[index][8]); } /* @@ -3880,6 +2067,12 @@ if (status != SANE_STATUS_GOOD) return status; + print_params(s->params); + + /* enable infrared */ + if (s->val[OPT_MODE].w == MODE_INFRARED) + esci_enable_infrared(handle); + /* ESC , bay */ if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_BAY].cap)) { status = esci_set_bay(s, s->val[OPT_BAY].w); @@ -3888,9 +2081,9 @@ } /* set scanning parameters */ - if (dev->extended_commands) { + if (dev->extended_commands) status = e2_set_extended_scanning_parameters(s); - } else + else status = e2_set_scanning_parameters(s); if (status != SANE_STATUS_GOOD) @@ -3904,9 +2097,34 @@ return status; } + + if (s->val[OPT_COLOR_CORRECTION].w == CORR_AUTO) { /* Automatic */ + + DBG(1, "using built in CCT profile\n"); + + if (dev->model_id == 0) + DBG(1, " specific profile not available, using default\n"); + + + if (0) { /* XXX TPU */ + + /* XXX check this */ + if (s->val[OPT_FILM_TYPE].w == 0) + e2_load_cct_profile(s, CCTP_COLORPOS); + else + e2_load_cct_profile(s, CCTP_COLORNEG); + + } else { + e2_load_cct_profile(s, CCTP_REFLECTIVE); + } + } + /* ESC m, user defined color correction */ - if (s->val[OPT_COLOR_CORRECTION].w == 1) { - status = esci_set_color_correction_coefficients(s); + if (s->hw->cmd->set_color_correction_coefficients + && correction_userdefined[s->val[OPT_COLOR_CORRECTION].w]) { + + status = esci_set_color_correction_coefficients(s, + s->cct_table); if (status != SANE_STATUS_GOOD) return status; } @@ -3919,12 +2137,6 @@ if (status != SANE_STATUS_GOOD) return status; - -/* - status = sane_get_parameters(handle, NULL); - if (status != SANE_STATUS_GOOD) - return status; -*/ /* * If WAIT_FOR_BUTTON is active, then do just that: * Wait until the button is pressed. If the button was already @@ -3942,12 +2154,12 @@ /* set the retry count to 0 */ s->retry_count = 0; - /* allocate buffers for color shuffling */ if (dev->color_shuffle == SANE_TRUE) { int i; /* initialize the line buffers */ for (i = 0; i < s->line_distance * 2 + 1; i++) { + if (s->line_buffer[i] != NULL) free(s->line_buffer[i]); @@ -3990,13 +2202,14 @@ if (dev->extended_commands) { status = e2_start_ext_scan(s); - /* check if the scanner signaled a warming up */ - if (status == SANE_STATUS_IO_ERROR && s->hw->use_extension) { - status = e2_wait_warm_up(s); - if (status == SANE_STATUS_GOOD) - status = e2_start_ext_scan(s); - } - + /* sometimes the scanner gives an io error when + * it's warming up. + */ + if (status == SANE_STATUS_IO_ERROR) { + status = e2_wait_warm_up(s); + if (status == SANE_STATUS_GOOD) + status = e2_start_ext_scan(s); + } } else status = e2_start_std_scan(s); @@ -4011,83 +2224,11 @@ if (dev->connection == SANE_EPSON_NET) { sanei_epson_net_write(s, 0x2000, NULL, 0, s->ext_block_len + 1, &status); - } - - return status; -} - -/* XXX this routine is ugly and should be avoided */ -static SANE_Status -read_info_block(Epson_Scanner * s, EpsonDataRec * result) -{ - SANE_Status status; - unsigned char params[2]; - - retry: - e2_recv(s, result, s->block ? 6 : 4, &status); - if (status != SANE_STATUS_GOOD) - return status; - - if (result->code != STX) { - DBG(1, "error: got %02x, expected STX\n", result->code); - return SANE_STATUS_INVAL; - } - - /* XXX */ - if (result->status & STATUS_FER) { - unsigned char *ext_status; - - DBG(1, "fatal error, status = %02x\n", result->status); - - if (s->retry_count > SANE_EPSON_MAX_RETRIES) { - DBG(1, "max retry count exceeded (%d)\n", - s->retry_count); - return SANE_STATUS_INVAL; - } - - /* if the scanner is warming up, retry after a few secs */ - status = esci_request_extended_status(s, &ext_status, NULL); - if (status != SANE_STATUS_GOOD) - return status; - - if (ext_status[0] & EXT_STATUS_WU) { - free(ext_status); - - sleep(5); /* for the next attempt */ - - DBG(1, "retrying ESC G - %d\n", ++(s->retry_count)); - - params[0] = ESC; - params[1] = s->hw->cmd->start_scanning; - - e2_send(s, params, 2, 0, &status); - if (status != SANE_STATUS_GOOD) - return status; - - goto retry; - } else - free(ext_status); } return status; } -static void -e2_scan_finish(Epson_Scanner * s) -{ - DBG(5, "%s\n", __func__); - - free(s->buf); - s->buf = NULL; - - if (s->hw->ADF && s->hw->use_extension && s->val[OPT_AUTO_EJECT].w) - if (e2_check_adf(s) == SANE_STATUS_NO_DOCS) - esci_eject(s); - - /* XXX required? */ - esci_reset(s); -} - static inline int get_color(int status) { @@ -4103,301 +2244,42 @@ } } -static void -e2_copy_image_data(Epson_Scanner * s, SANE_Byte * data, SANE_Int max_length, - SANE_Int * length) -{ - if (!s->block && SANE_FRAME_RGB == s->params.format) { - - max_length /= 3; - - if (max_length > s->end - s->ptr) - max_length = s->end - s->ptr; - - *length = 3 * max_length; - - if (s->invert_image == SANE_TRUE) { - while (max_length-- != 0) { - /* invert the three values */ - *data++ = (unsigned char) ~(s->ptr[0]); - *data++ = - (unsigned char) ~(s-> - ptr[s->params. - pixels_per_line]); - *data++ = - (unsigned char) ~(s-> - ptr[2 * - s->params. - pixels_per_line]); - ++s->ptr; - } - } else { - while (max_length-- != 0) { - *data++ = s->ptr[0]; - *data++ = s->ptr[s->params.pixels_per_line]; - *data++ = - s->ptr[2 * s->params.pixels_per_line]; - ++s->ptr; - } - } - } else { - if (max_length > s->end - s->ptr) - max_length = s->end - s->ptr; - - *length = max_length; - - if (1 == s->params.depth) { - if (s->invert_image == SANE_TRUE) { - while (max_length-- != 0) - *data++ = *s->ptr++; - } else { - while (max_length-- != 0) - *data++ = ~*s->ptr++; - } - } else { - - if (s->invert_image == SANE_TRUE) { - int i; - - for (i = 0; i < max_length; i++) { - data[i] = - (unsigned char) ~(s->ptr[i]); - } - } else { - memcpy(data, s->ptr, max_length); - } - s->ptr += max_length; - } - } -} - -static SANE_Status -e2_ext_sane_read(SANE_Handle handle) -{ - Epson_Scanner *s = (Epson_Scanner *) handle; - SANE_Status status = SANE_STATUS_GOOD; - size_t buf_len = 0, read; - - /* did we passed everything we read to sane? */ - if (s->ptr == s->end) { - - if (s->eof) - return SANE_STATUS_EOF; - - s->ext_counter++; - - /* sane has already got the data, read some more, the final - * error byte must not be included in buf_len - */ - buf_len = s->ext_block_len; - - if (s->ext_counter == s->ext_blocks && s->ext_last_len) - buf_len = s->ext_last_len; - - DBG(18, "%s: block %d, size %lu\n", __func__, s->ext_counter, - (u_long) buf_len); - - /* receive image data + error code */ - read = e2_recv(s, s->buf, buf_len + 1, &status); - - DBG(18, "%s: read %lu bytes\n", __func__, (u_long) read); - - if (read != buf_len + 1) - return SANE_STATUS_IO_ERROR; - - /* XXX check error code in buf[buf_len] - if (s->buf[buf_len] & ... - */ - - /* ack every block except the last one */ - if (s->ext_counter < s->ext_blocks) { - size_t next_len = s->ext_block_len; - - if (s->ext_counter == (s->ext_blocks - 1)) - next_len = s->ext_last_len; - - status = e2_ack_next(s, next_len + 1); - } else - s->eof = SANE_TRUE; - - s->end = s->buf + buf_len; - s->ptr = s->buf; - } - - return status; -} - -static SANE_Status -e2_block_sane_read(SANE_Handle handle) -{ - Epson_Scanner *s = (Epson_Scanner *) handle; - SANE_Status status; - SANE_Bool reorder = SANE_FALSE; - SANE_Bool needStrangeReorder = SANE_FALSE; - - START_READ: - DBG(18, "%s: begin\n", __func__); - - if (s->ptr == s->end) { - EpsonDataRec result; - size_t buf_len; - - if (s->eof) { - if (s->hw->color_shuffle) { - DBG(1, - "written %d lines after color shuffle\n", - s->lines_written); - DBG(1, "lines requested: %d\n", - s->params.lines); - } - - return SANE_STATUS_EOF; - } - - status = read_info_block(s, &result); - if (status != SANE_STATUS_GOOD) { - return status; - } - - buf_len = result.buf[1] << 8 | result.buf[0]; - buf_len *= (result.buf[3] << 8 | result.buf[2]); - - DBG(18, "%s: buf len = %lu\n", __func__, (u_long) buf_len); - - { - /* do we have to reorder the data ? */ - if (get_color(result.status) == 0x01) - reorder = SANE_TRUE; - - e2_recv(s, s->buf, buf_len, &status); - if (status != SANE_STATUS_GOOD) { - return status; - } - } - - if (result.status & STATUS_AREA_END) { - DBG(1, "%s: EOF\n", __func__); - s->eof = SANE_TRUE; - } else { - if (s->canceling) { - status = e2_cmd_simple(s, S_CAN, 1); - return SANE_STATUS_CANCELLED; - } else { - status = e2_ack(s); - } - } - - s->end = s->buf + buf_len; - s->ptr = s->buf; - - /* - * if we have to re-order the color components (GRB->RGB) we - * are doing this here: - */ - - /* - * Some scanners (e.g. the Perfection 1640 and GT-2200) seem - * to have the R and G channels swapped. - * The GT-8700 is the Asian version of the Perfection 1640. - * If the scanner name is one of these and the scan mode is - * RGB then swap the colors. - */ - - needStrangeReorder = - (strstr(s->hw->model, "GT-2200") || - ((strstr(s->hw->model, "1640") - && strstr(s->hw->model, "Perfection")) - || strstr(s->hw->model, "GT-8700"))) - && s->params.format == SANE_FRAME_RGB; - - /* - * Certain Perfection 1650 also need this re-ordering of the two - * color channels. These scanners are identified by the problem - * with the half vertical scanning area. When we corrected this, - * we also set the variable s->hw->need_color_reorder - */ - if (s->hw->need_color_reorder) - reorder = SANE_FALSE; /* reordering once is enough */ - - if (reorder && s->params.format == SANE_FRAME_RGB) { - SANE_Byte *ptr; - - ptr = s->buf; - while (ptr < s->end) { - if (s->params.depth > 8) { - SANE_Byte tmp; - - /* R->G G->R */ - tmp = ptr[0]; - ptr[0] = ptr[2]; /* first Byte G */ - ptr[2] = tmp; /* first Byte R */ - - tmp = ptr[1]; - ptr[1] = ptr[3]; /* second Byte G */ - ptr[3] = tmp; /* second Byte R */ - - ptr += 6; /* go to next pixel */ - } else { - /* R->G G->R */ - SANE_Byte tmp; - - tmp = ptr[0]; - ptr[0] = ptr[1]; /* G */ - ptr[1] = tmp; /* R */ - /* B stays the same */ - ptr += 3; /* go to next pixel */ - } - } - } - - /* - * Do the color_shuffle if everything else is correct - at this time - * most of the stuff is hardcoded for the Perfection 610 - */ - - if (s->hw->color_shuffle) { - int new_length = 0; - - status = color_shuffle(s, &new_length); - - /* - * If no bytes are returned, check if the scanner is already done, if so, - * we'll probably just return, but if there is more data to process get - * the next batch. - */ - if (new_length == 0 && s->end != s->ptr) - goto START_READ; - - s->end = s->buf + new_length; - s->ptr = s->buf; - } - - DBG(18, "%s: begin scan2\n", __func__); - } - - DBG(18, "%s: end\n", __func__); - - return SANE_STATUS_GOOD; -} - +/* this moves data from our buffers to SANE */ SANE_Status -sane_read(SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, - SANE_Int * length) +sane_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length, + SANE_Int *length) { SANE_Status status; Epson_Scanner *s = (Epson_Scanner *) handle; + if (s->buf == NULL || s->canceling) + return SANE_STATUS_CANCELLED; + *length = 0; if (s->hw->extended_commands) - status = e2_ext_sane_read(handle); + status = e2_ext_read(s); else - status = e2_block_sane_read(handle); + status = e2_block_read(s); + + if (status == SANE_STATUS_CANCELLED) { + e2_scan_finish(s); + return status; + } + + /* XXX if FS G and STATUS_IOERR, use e2_check_extended_status */ + + DBG(18, "moving data %p %p, %d (%d lines)\n", + s->ptr, s->end, + max_length, max_length / s->params.bytes_per_line); - DBG(18, "moving data\n"); e2_copy_image_data(s, data, max_length, length); + DBG(18, "%d lines read, eof: %d, status: %d\n", + *length / s->params.bytes_per_line, + s->eof, status); + /* continue reading if appropriate */ if (status == SANE_STATUS_GOOD) return status; @@ -4407,180 +2289,6 @@ return status; } - -static SANE_Status -color_shuffle(SANE_Handle handle, int *new_length) -{ - Epson_Scanner *s = (Epson_Scanner *) handle; - SANE_Byte *buf = s->buf; - int length = s->end - s->buf; - - if (s->hw->color_shuffle == SANE_TRUE) { - SANE_Byte *data_ptr; /* ptr to data to process */ - SANE_Byte *data_end; /* ptr to end of processed data */ - SANE_Byte *out_data_ptr; /* ptr to memory when writing data */ - int i; /* loop counter */ - - /* - * It looks like we are dealing with a scanner that has an odd way - * of dealing with colors... The red and blue scan lines are shifted - * up or down by a certain number of lines relative to the green line. - */ - DBG(5, "%s\n", __func__); - - /* - * Initialize the variables we are going to use for the - * copying of the data. data_ptr is the pointer to - * the currently worked on scan line. data_end is the - * end of the data area as calculated from adding *length - * to the start of data. - * out_data_ptr is used when writing out the processed data - * and always points to the beginning of the next line to - * write. - */ - data_ptr = out_data_ptr = buf; - data_end = data_ptr + length; - - /* - * The image data is in *buf, we know that the buffer contains s->end - s->buf ( = length) - * bytes of data. The width of one line is in s->params.bytes_per_line - * - * The buffer area is supposed to have a number of full scan - * lines, let's test if this is the case. - */ - - if (length % s->params.bytes_per_line != 0) { - DBG(1, "error in buffer size: %d / %d\n", length, - s->params.bytes_per_line); - return SANE_STATUS_INVAL; - } - - while (data_ptr < data_end) { - SANE_Byte *source_ptr, *dest_ptr; - int loop; - - /* copy the green information into the current line */ - - source_ptr = data_ptr + 1; - dest_ptr = s->line_buffer[s->color_shuffle_line] + 1; - - for (i = 0; i < s->params.bytes_per_line / 3; i++) { - *dest_ptr = *source_ptr; - dest_ptr += 3; - source_ptr += 3; - } - - /* copy the red information n lines back */ - - if (s->color_shuffle_line >= s->line_distance) { - source_ptr = data_ptr + 2; - dest_ptr = - s->line_buffer[s->color_shuffle_line - - s->line_distance] + 2; - -/* while (source_ptr < s->line_buffer[s->color_shuffle_line] + s->params.bytes_per_line) */ - for (loop = 0; - loop < s->params.bytes_per_line / 3; - loop++) { - *dest_ptr = *source_ptr; - dest_ptr += 3; - source_ptr += 3; - } - } - - /* copy the blue information n lines forward */ - - source_ptr = data_ptr; - dest_ptr = - s->line_buffer[s->color_shuffle_line + - s->line_distance]; - -/* while (source_ptr < s->line_buffer[s->color_shuffle_line] + s->params.bytes_per_line) */ - for (loop = 0; loop < s->params.bytes_per_line / 3; - loop++) { - *dest_ptr = *source_ptr; - dest_ptr += 3; - source_ptr += 3; - } - - data_ptr += s->params.bytes_per_line; - - if (s->color_shuffle_line == s->line_distance) { - /* - * We just finished the line in line_buffer[0] - write it to the - * output buffer and continue. - * - * The ouput buffer ist still "buf", but because we are - * only overwriting from the beginning of the memory area - * we are not interfering with the "still to shuffle" data - * in the same area. - */ - - /* - * Strip the first and last n lines and limit to - */ - if ((s->current_output_line >= - s->line_distance) - && (s->current_output_line < - s->params.lines + s->line_distance)) { - memcpy(out_data_ptr, - s->line_buffer[0], - s->params.bytes_per_line); - out_data_ptr += - s->params.bytes_per_line; - - s->lines_written++; - } - - s->current_output_line++; - - /* - * Now remove the 0-entry and move all other - * lines up by one. There are 2*line_distance + 1 - * buffers, * therefore the loop has to run from 0 - * to * 2*line_distance, and because we want to - * copy every n+1st entry to n the loop runs - * from - to 2*line_distance-1! - */ - - free(s->line_buffer[0]); - - for (i = 0; i < s->line_distance * 2; i++) { - s->line_buffer[i] = - s->line_buffer[i + 1]; - } - - /* - * and create one new buffer at the end - */ - - s->line_buffer[s->line_distance * 2] = - malloc(s->params.bytes_per_line); - if (s->line_buffer[s->line_distance * 2] == - NULL) { - DBG(1, "out of memory (line %d)\n", - __LINE__); - return SANE_STATUS_NO_MEM; - } - } else { - s->color_shuffle_line++; /* increase the buffer number */ - } - } - - /* - * At this time we've used up all the new data from the scanner, some of - * it is still in the line_buffers, but we are ready to return some of it - * to the front end software. To do so we have to adjust the size of the - * data area and the *new_length variable. - */ - - *new_length = out_data_ptr - buf; - } - - return SANE_STATUS_GOOD; - -} - /* * void sane_cancel(SANE_Handle handle) * @@ -4592,95 +2300,10 @@ sane_cancel(SANE_Handle handle) { Epson_Scanner *s = (Epson_Scanner *) handle; - SANE_Status status = SANE_STATUS_GOOD; - - /* - * If the s->ptr pointer is not NULL, then a scan operation - * was started and if s->eof is FALSE, it was not finished. - */ - - if (s->buf) { - unsigned char *dummy; - int len; - - /* malloc one line */ - dummy = malloc(s->params.bytes_per_line); - if (dummy == NULL) { - DBG(1, "Out of memory\n"); - return; - } else { - - /* there is still data to read from the scanner */ - s->canceling = SANE_TRUE; - - /* XXX check this condition, we used to check - * for SANE_STATUS_CANCELLED */ - while (!s->eof && - (status == SANE_STATUS_GOOD - || status == SANE_STATUS_DEVICE_BUSY)) { - /* empty body, the while condition does the processing */ - status = sane_read(s, dummy, - s->params.bytes_per_line, - &len); - } - free(dummy); - } - } -} - -static void -filter_resolution_list(Epson_Scanner * s) -{ - /* re-create the list */ - - if (s->val[OPT_LIMIT_RESOLUTION].w == SANE_TRUE) { - /* copy the short list */ - - /* filter out all values that are not 300 or 400 dpi based */ - int i; - - int new_size = 0; - SANE_Bool is_correct_resolution = SANE_FALSE; - - for (i = 0; i < s->hw->res_list_size; i++) { - SANE_Word res; - res = s->hw->res_list[i]; - if ((res < 100) || res == 150 || (0 == (res % 300)) - || (0 == (res % 400))) { - /* add the value */ - new_size++; - - s->hw->resolution_list[new_size] = - s->hw->res_list[i]; - - /* check for a valid current resolution */ - if (res == s->val[OPT_RESOLUTION].w) - is_correct_resolution = SANE_TRUE; - } - } - s->hw->resolution_list[0] = new_size; - if (is_correct_resolution == SANE_FALSE) { - for (i = 1; i <= new_size; i++) { - if (s->val[OPT_RESOLUTION].w < - s->hw->resolution_list[i]) { - s->val[OPT_RESOLUTION].w = - s->hw->resolution_list[i]; - break; - } - } - } - - } else { - /* copy the full list */ - s->hw->resolution_list[0] = s->hw->res_list_size; - memcpy(&(s->hw->resolution_list[1]), s->hw->res_list, - s->hw->res_list_size * sizeof(SANE_Word)); - } + s->canceling = SANE_TRUE; } -/**********************************************************************************/ - /* * SANE_Status sane_set_io_mode() * @@ -4688,12 +2311,9 @@ */ SANE_Status -sane_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking) +sane_set_io_mode(SANE_Handle __sane_unused__ handle, + SANE_Bool __sane_unused__ non_blocking) { - /* get rid of compiler warning */ - handle = handle; - non_blocking = non_blocking; - return SANE_STATUS_UNSUPPORTED; } @@ -4704,11 +2324,8 @@ */ SANE_Status -sane_get_select_fd(SANE_Handle handle, SANE_Int * fd) +sane_get_select_fd(SANE_Handle __sane_unused__ handle, + SANE_Int __sane_unused__ *fd) { - /* get rid of compiler warnings */ - handle = handle; - fd = fd; - return SANE_STATUS_UNSUPPORTED; } diff -Nru sane-backends-1.0.20/backend/epson2-cct.c sane-backends-1.0.21/backend/epson2-cct.c --- sane-backends-1.0.20/backend/epson2-cct.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/epson2-cct.c 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,609 @@ +/* epson2 hardware colour correction coefficients + * Copyright (C) 2001-2009 SEIKO EPSON Corporation + * Copyright (C) 2009 Tower Technologies + * + * License: GPLv2 + * + * This file is part of the SANE epson2 backend and has been derived + * from the epkowa backend distributed with Image Scan! + * + */ + +/*! Hardware colour correction coefficients (CCC). + + Each entry starts with a unique identifier, followed by four CCC + profiles; the first is for reflective materials, the second for + colour negatives, the third for monochrome negatives, and the + fourth and last one is for colour positives. +*/ + +#define DEBUG_DECLARE_ONLY + +#include "epson2.h" + +const struct epson_profile epson_cct_profiles[] = { + {0x00, /* default */ + {{1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x05, /* ES-6000H */ + {{1.1419,-0.0596,-0.0825,-0.1234, 1.2812,-0.1413, 0.0703,-0.5720, 1.5016}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1419,-0.0596,-0.0825,-0.1234, 1.2812,-0.1413, 0.0703,-0.5720, 1.5016}}}, + {0x06, /* GT-6600 */ + {{1.1442,-0.0705,-0.0737,-0.0702, 1.1013,-0.0311,-0.0080,-0.3588, 1.3668}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x07, /* GT-7600 */ + {{1.1967,-0.1379,-0.0588,-0.0538, 1.0385, 0.0153, 0.0348,-0.4070, 1.3721}, + {1.0010,-0.0010, 0.0000,-0.1120, 1.1710,-0.0590, 0.0000,-0.0910, 1.0920}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1967,-0.1379,-0.0588,-0.0538, 1.0385, 0.0153, 0.0348,-0.4070, 1.3721}}}, + {0x0D, /* ES-2000 */ + {{1.1980,-0.1365,-0.0616,-0.1530, 1.1729,-0.0198,-0.0025,-0.2776, 1.2801}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1980,-0.1365,-0.0616,-0.1530, 1.1729,-0.0198,-0.0025,-0.2776, 1.2801}}}, + {0x0F, /* ES-8500 */ + {{1.0961,-0.0181,-0.0779,-0.1279, 1.1957,-0.0678, 0.0315,-0.3891, 1.3576}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0961,-0.0181,-0.0779,-0.1279, 1.1957,-0.0678, 0.0315,-0.3891, 1.3576}}}, + {0x15, /* GT-6700 */ + {{1.0999,-0.0425,-0.0574,-0.0806, 1.0835,-0.0028, 0.0057,-0.2924, 1.2866}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x16, /* GT-8700 */ + {{1.2020,-0.1518,-0.0502,-0.0847, 1.1385,-0.0538, 0.0059,-0.3255, 1.3196}, + {1.0030,-0.0030, 0.0000,-0.0980, 1.1500,-0.0520,-0.0030,-0.0840, 1.0880}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2456,-0.1617,-0.0839,-0.1160, 1.1862,-0.0702,-0.0036,-0.3438, 1.3473}}}, + {0x18, /* GT-7700 */ + {{1.1339,-0.0526,-0.0813,-0.1177, 1.1661,-0.0485,-0.0030,-0.3298, 1.3328}, + {1.0010,-0.0010, 0.0000,-0.1120, 1.1710,-0.0590, 0.0000,-0.0910, 1.0920}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2066,-0.0360,-0.1706,-0.1313, 1.2523,-0.1210,-0.0299,-0.3377, 1.3676}}}, + {0x1A, /* ES-9000H */ + {{1.0986, 0.0235,-0.1221,-0.1294, 1.0896, 0.0399, 0.0928,-0.6043, 1.5115}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x1B, /* ES-2200 */ + {{1.1855,-0.1372,-0.0483,-0.2060, 1.2468,-0.0407, 0.0358,-0.3059, 1.2701}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1976,-0.1182,-0.0794,-0.1578, 1.2720,-0.1142, 0.0122,-0.3467, 1.3345}}}, + {0x1D, /* GT-7200 */ + {{1.0675,-0.0586,-0.0088,-0.0332, 0.9716, 0.0616, 0.0175,-0.4054, 1.3879}, + {1.0090,-0.0090, 0.0000,-0.0390, 1.0750,-0.0360,-0.0070,-0.1060, 1.1130}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1394,-0.0829,-0.0564,-0.0003, 1.0008,-0.0004,-0.0059,-0.3674, 1.3733}}}, + {0x1F, /* GT-8200 */ + {{1.0800,-0.0607,-0.0193,-0.0787, 1.0846,-0.0059, 0.0135,-0.3334, 1.3199}, + {1.0040,-0.0040, 0.0000,-0.0780, 1.1360,-0.0570,-0.0020,-0.0810, 1.0830}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1334,-0.0929,-0.0405,-0.0418, 1.0689,-0.0271,-0.0521,-0.3262, 1.3783}}}, + {0x21, /* GT-9700 */ + {{1.0919,-0.0739,-0.0180,-0.0941, 1.1150,-0.0209, 0.0220,-0.3744, 1.3524}, + {1.0090,-0.0100, 0.0010,-0.0720, 1.1310,-0.0600, 0.0000,-0.1000, 1.1000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1374,-0.1396, 0.0021,-0.0489, 1.0655,-0.0166, 0.0081,-0.3492, 1.3411}}}, + {0x23, /* GT-7300 */ + {{1.0339,-0.0166,-0.0173,-0.0117, 0.9797, 0.0319, 0.0010,-0.3609, 1.3599}, + {1.0090,-0.0090, 0.0000,-0.0390, 1.0750,-0.0360,-0.0070,-0.1060, 1.1130}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1666,-0.0898,-0.0768,-0.0076, 1.0157,-0.0081, 0.0012,-0.3048, 1.3036}}}, + {0x25, /* GT-8300 */ + {{1.0800,-0.0607,-0.0193,-0.0787, 1.0846,-0.0059, 0.0135,-0.3334, 1.3199}, + {1.0040,-0.0040, 0.0000,-0.0780, 1.1360,-0.0570,-0.0020,-0.0810, 1.0830}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1334,-0.0929,-0.0405,-0.0418, 1.0689,-0.0271,-0.0521,-0.3262, 1.3783}}}, + {0x27, /* GT-9300 */ + {{1.0919,-0.0739,-0.0180,-0.0941, 1.1150,-0.0209, 0.0220,-0.3744, 1.3524}, + {1.0083,-0.0094, 0.0011,-0.0760, 1.1379,-0.0619,-0.0002,-0.0945, 1.0947}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1952,-0.1519,-0.0433,-0.0932, 1.1613,-0.0681,-0.0418,-0.3140, 1.3558}}}, + {0x29, /* GT-9800F */ + {{1.0369,-0.0210,-0.0160,-0.0820, 1.1160,-0.0341, 0.0150,-0.5035, 1.4885}, + {1.0122,-0.0151, 0.0029,-0.0861, 1.1402,-0.0542,-0.0061,-0.1607, 1.1669}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1764,-0.1749,-0.0014,-0.0590, 1.0983,-0.0393, 0.0208,-0.5194, 1.4986}}}, + {0x2B, /* ES-7000H */ + {{1.0305,-0.0116,-0.0189,-0.0936, 1.1245,-0.0309,-0.0072,-0.1413, 1.1485}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x32, /* GT-9400 */ + {{1.0932,-0.0529,-0.0403,-0.1077, 1.1416,-0.0338, 0.0079,-0.5525, 1.5446}, + {1.0259,-0.0356, 0.0097,-0.1085, 1.2225,-0.1140,-0.0046,-0.1848, 1.1894}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2720,-0.2665,-0.0054,-0.0672, 1.1301,-0.0629,-0.0048,-0.3917, 1.3965}}}, + {0x2D, /* CC-600PX */ + {{1.0436,-0.0078,-0.0359,-0.0169, 1.0114, 0.0056, 0.0308,-0.4425, 1.4117}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x3A, /* PM-A850 */ + {{1.1150,-0.0677,-0.0473,-0.1179, 1.1681,-0.0502, 0.0052,-0.4858, 1.4806}, + {1.0133,-0.0151, 0.0017,-0.1216, 1.2207,-0.0991,-0.0003,-0.1512, 1.1515}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2105,-0.1644,-0.0461,-0.1124, 1.1945,-0.0820,-0.0450,-0.3367, 1.3817}}}, + {0x36, /* CX5300/CX5400 */ + {{1.0848,-0.0153,-0.0695,-0.0902, 1.0611, 0.0291, 0.0344,-0.5002, 1.4658}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x34, /* GT-X700 */ + {{1.1032,-0.0590,-0.0442,-0.1915, 1.3371,-0.1456, 0.0387,-0.5804, 1.5417}, + {1.0232,-0.0258, 0.0026,-0.1296, 1.2882,-0.1587,-0.0011,-0.1928, 1.1940}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2662,-0.2664, 0.0002,-0.1050, 1.3168,-0.2118,-0.0058,-0.4370, 1.4428}}}, + {0x38, /* RX500/RX510 */ + {{1.1150,-0.0677,-0.0473,-0.1179, 1.1681,-0.0502, 0.0052,-0.4858, 1.4806}, + {1.0133,-0.0151, 0.0017,-0.1216, 1.2207,-0.0991,-0.0003,-0.1512, 1.1515}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2105,-0.1644,-0.0461,-0.1124, 1.1945,-0.0820,-0.0450,-0.3367, 1.3817}}}, + {0x37, /* CX6300/CX6400 */ + {{0.9640, 0.1455,-0.1095, 0.0108, 1.1933,-0.2041, 0.0071,-0.3487, 1.3416}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x3F, /* ES-10000G */ + {{1.1223,-0.0985,-0.0238,-0.0847, 1.1502,-0.0655, 0.0118,-0.5022, 1.4904}, + {1.0077,-0.0129, 0.0052,-0.0904, 1.1785,-0.0881, 0.0000,-0.1528, 1.1528}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1927,-0.1646,-0.0280,-0.0655, 1.1033,-0.0378, 0.0034,-0.4173, 1.4139}}}, + {0x41, /* GT-F500/F550 */ + {{1.0732,-0.0581,-0.0150,-0.0897, 1.1553,-0.0657,-0.0179,-0.6500, 1.6679}, + {1.0163,-0.0203, 0.0040,-0.1125, 1.1797,-0.0672,-0.0091,-0.2343, 1.2434}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2437,-0.2022,-0.0415,-0.0352, 1.0735,-0.0383,-0.0188,-0.5020, 1.5209}}}, + {0x43, /* GT-F600 */ + {{1.0782,-0.0697,-0.0085,-0.1605, 1.2862,-0.1257, 0.0148,-0.5854, 1.5706}, + {1.0136,-0.0151, 0.0016,-0.1836, 1.3422,-0.1586,-0.0014,-0.1851, 1.1865}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1491,-0.1456,-0.0035,-0.0990, 1.2657,-0.1666, 0.0015,-0.3868, 1.3853}}}, + {0x46, /* CX3500/CX3600/CX4500/CX4600 */ + {{0.9828, 0.0924,-0.0752, 0.0255, 1.1510,-0.1765, 0.0049,-0.3250, 1.3201}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x48, /* PM-A700/RX420/RX430 */ + {{0.9716, 0.0927,-0.0643, 0.0010, 1.1068,-0.1078, 0.0101,-0.3046, 1.2945}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x49, /* CX6500/CX6600 */ + {{0.9640, 0.1455,-0.1095, 0.0108, 1.1933,-0.2041, 0.0071,-0.3487, 1.3416}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x4B, /* PM-A870 */ + {{1.1150,-0.0677,-0.0473,-0.1179, 1.1681,-0.0502, 0.0052,-0.4858, 1.4806}, + {1.0133,-0.0151, 0.0017,-0.1216, 1.2207,-0.0991,-0.0003,-0.1512, 1.1515}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2105,-0.1644,-0.0461,-0.1124, 1.1945,-0.0820,-0.0450,-0.3367, 1.3817}}}, + {0x4D, /* PM-A900 */ + {{1.1011,-0.0824,-0.0186,-0.0970, 1.1991,-0.1021,-0.0161,-0.6247, 1.6408}, + {1.0259,-0.0356, 0.0097,-0.1085, 1.2225,-0.1140,-0.0046,-0.1848, 1.1894}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2150,-0.2074,-0.0076,-0.0521, 1.1430,-0.0909,-0.0204,-0.4156, 1.4360}}}, + {0x4F, /* GT-X800 */ + {{1.1052,-0.0850,-0.0202,-0.1050, 1.2294,-0.1245,-0.0486,-0.4160, 1.4646}, + {1.0255,-0.0272, 0.0017,-0.0919, 1.2098,-0.1180,-0.0021,-0.1296, 1.1317}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2950,-0.2619,-0.0332,-0.0562, 1.1587,-0.1025,-0.0397,-0.3100, 1.3497}}}, + {0x51, /* LP-A500 */ + {{1.0614,-0.0361,-0.0253,-0.1081, 1.1320,-0.0240,-0.0536,-0.2045, 1.2580}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x52, /* GT-F520/F570 */ + {{1.0978,-0.0806,-0.0173,-0.0802, 1.1515,-0.0713,-0.0476,-0.4656, 1.5132}, + {1.0192,-0.0192, 0.0000,-0.0974, 1.1846,-0.0872,-0.0031,-0.1797, 1.1828}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2490,-0.2030,-0.0460,-0.0469, 1.1046,-0.0577,-0.0361,-0.3857, 1.4217}}}, + {0x54, /* GT-X750 */ + {{1.0905,-0.0654,-0.0251,-0.1030, 1.1801,-0.0771,-0.0685,-0.4238, 1.4923}, + {1.0206,-0.0207, 0.0000,-0.0890, 1.1770,-0.0880,-0.0014,-0.1450, 1.1464}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.3041,-0.2907,-0.0134,-0.0383, 1.0908,-0.0525,-0.0327,-0.2947, 1.3275}}}, + {0x56, /* LP-M5500 */ + {{1.0784,-0.0560,-0.0224,-0.1793, 1.2234,-0.0441,-0.0041,-0.2636, 1.2677}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x57, /* Stylus CX3700/CX3800/DX3800 */ + {{0.9828, 0.0924,-0.0752, 0.0255, 1.1510,-0.1765, 0.0049,-0.3250, 1.3201}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x58, /* PX-A650/Stylus CX4700/CX4800/DX4800 */ + {{0.9716, 0.0927,-0.0643, 0.0010, 1.1068,-0.1078, 0.0101,-0.3046, 1.2945}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x59, /* Stylus CX4100/CX4200/DX4200 */ + {{0.9716, 0.0927,-0.0643, 0.0010, 1.1068,-0.1078, 0.0101,-0.3046, 1.2945}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x5B, /* Stylus CX7700/CX7800 */ + {{0.9764, 0.1095,-0.0859, 0.0149, 1.1154,-0.1303, 0.0051,-0.2851, 1.2800}, + {1.0024,-0.0149, 0.0124,-0.2569, 1.3432,-0.0864,-0.0043,-0.1306, 1.1349}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1003,-0.0493,-0.0510,-0.1607, 1.2748,-0.1142,-0.0059,-0.3161, 1.3220}}}, + {0x5D, /* Stylus Photo RX520/RX530 */ + {{0.9764, 0.1095,-0.0859, 0.0149, 1.1154,-0.1303, 0.0051,-0.2851, 1.2800}, + {1.0024,-0.0149, 0.0124,-0.2569, 1.3432,-0.0864,-0.0043,-0.1306, 1.1349}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.1003,-0.0493,-0.0510,-0.1607, 1.2748,-0.1142,-0.0059,-0.3161, 1.3220}}}, + {0x5F, /* Stylus Photo RX640/RX650 */ + {{1.0697,-0.0561,-0.0137,-0.0824, 1.1291,-0.0467,-0.0390,-0.5218, 1.5608}, + {1.0208,-0.0209, 0.0000,-0.0923, 1.2017,-0.1093,-0.0020,-0.1290, 1.1310}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2606,-0.2125,-0.0482,-0.0567, 1.1441,-0.0874,-0.0431,-0.3490, 1.3921}}}, + {0x61, /* PM-A950 */ + {{1.0921,-0.0722,-0.0199,-0.0831, 1.1550,-0.0718,-0.0452,-0.3721, 1.4173}, + {1.0168,-0.0168, 0.0000,-0.0953, 1.1928,-0.0975,-0.0012,-0.1235, 1.1247}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2603,-0.2763, 0.0155,-0.0398, 1.1033,-0.0635,-0.0249,-0.2675, 1.2924}}}, + {0x63, /* GT-X900 */ + {{1.0976,-0.0789,-0.0187,-0.0958, 1.1821,-0.0863,-0.0565,-0.4179, 1.4744}, + {1.0250,-0.0267, 0.0016,-0.0930, 1.2108,-0.1178,-0.0022,-0.1296, 1.1317}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.3111,-0.2979,-0.0132,-0.0441, 1.1148,-0.0707,-0.0348,-0.2971, 1.3319}}}, + {0x65, /* ES-H300 */ + {{1.0359,-0.0146,-0.0213,-0.0752, 1.0963,-0.0211,-0.0456,-0.3238, 1.3693}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x66, /* GT-S600/F650, Perfection V10/V100 */ + {{1.0878,-0.0667,-0.0211,-0.0892, 1.1513,-0.0622,-0.0654,-0.5175, 1.5829}, + {1.0208,-0.0209, 0.0000,-0.0923, 1.2017,-0.1093,-0.0020,-0.1290, 1.1310}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2688,-0.2522,-0.0166,-0.0559, 1.1291,-0.0733,-0.0377,-0.3519, 1.3896}}}, + {0x68, /* GT-F700, Perfection V350 */ + {{1.0950,-0.0646,-0.0305,-0.0792, 1.1398,-0.0606,-0.0123,-0.5175, 1.5298}, + {1.0258,-0.0306, 0.0048,-0.0995, 1.2173,-0.1178,-0.0054,-0.1242, 1.1296}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2697,-0.2501,-0.0195,-0.0351, 1.1236,-0.0885,-0.0131,-0.3268, 1.3400}}}, + {0x6A, /* Stylus CX2800/CX2900/ME200 */ + {{0.9828, 0.0924,-0.0752, 0.0255, 1.1510,-0.1765, 0.0049,-0.3250, 1.3201}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x6B, /* Stylus PX-A620, CX3900/DX4000 */ + {{0.9828, 0.0924,-0.0752, 0.0255, 1.1510,-0.1765, 0.0049,-0.3250, 1.3201}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x6C, /* Stylus CX5900/CX6000/DX6000 */ + {{0.9716, 0.0927,-0.0643, 0.0010, 1.1068,-0.1078, 0.0101,-0.3046, 1.2945}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x70, /* Stylus Photo RX560/RX580/RX590 */ + {{0.9533, 0.0885,-0.0418, 0.0033, 1.0627,-0.0660,-0.0137,-0.1904, 1.2041}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x71, /* PM-A920 */ + {{1.0697,-0.0561,-0.0137,-0.0824, 1.1291,-0.0467,-0.0390,-0.5218, 1.5608}, + {1.0208,-0.0209, 0.0000,-0.0923, 1.2017,-0.1093,-0.0020,-0.1290, 1.1310}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2606,-0.2125,-0.0482,-0.0567, 1.1441,-0.0874,-0.0431,-0.3490, 1.3921}}}, + {0x73, /* PM-A970 */ + {{1.0828,-0.0739,-0.0089,-0.0895, 1.1597,-0.0702,-0.0531,-0.4291, 1.4822}, + {1.0258,-0.0306, 0.0048,-0.0995, 1.2173,-0.1178,-0.0054,-0.1242, 1.1296}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2579,-0.2384,-0.0195,-0.0569, 1.1454,-0.0884,-0.0411,-0.3072, 1.3483}}}, + {0x75, /* PM-T990 */ + {{1.0828,-0.0739,-0.0089,-0.0895, 1.1597,-0.0702,-0.0531,-0.4291, 1.4822}, + {1.0258,-0.0306, 0.0048,-0.0995, 1.2173,-0.1178,-0.0054,-0.1242, 1.1296}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.2579,-0.2384,-0.0195,-0.0569, 1.1454,-0.0884,-0.0411,-0.3072, 1.3483}}}, + {0x77, /* Stylus CX4900/CX5000/DX5000 */ + {{0.9716, 0.0927,-0.0643, 0.0010, 1.1068,-0.1078, 0.0101,-0.3046, 1.2945}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x78, /* LP-M5600 */ + {{1.0784,-0.0560,-0.0224,-0.1793, 1.2234,-0.0441,-0.0041,-0.2636, 1.2677}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x79, /* AcuLaser CX21 */ + {{1.0614,-0.0361,-0.0253,-0.1081, 1.1320,-0.0240,-0.0536,-0.2045, 1.2580}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x7A, /* GT-F670, Perfection V200 */ + {{1.1754,-0.1173,-0.0580,-0.0687, 1.1307,-0.0620,-0.0255,-0.4699, 1.4954}, + {1.0150,-0.0173, 0.0022,-0.0853, 1.2238,-0.1384,-0.0073,-0.1490, 1.1562}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.4283,-0.4335, 0.0052,-0.0170, 1.1308,-0.1138,-0.0147,-0.2230, 1.2377}}}, + {0x7C, /* GT-X770, Perfection V500 */ + {{1.2470,-0.2041,-0.0429,-0.1920, 1.2918,-0.0998,-0.0100,-0.2503, 1.2603}, + {1.0050,-0.0076, 0.0026,-0.2532, 1.1289, 0.1243,-0.0733,-0.0960, 1.1693}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.4724,-0.4599,-0.0125,-0.0876, 1.1562,-0.0686,-0.0097,-0.2278, 1.2375}}}, + {0x7E, /* Stylus CX4300/CX4400/CX5500/CX5600/DX4400 */ + {{0.9828, 0.0924,-0.0752, 0.0255, 1.1510,-0.1765, 0.0049,-0.3250, 1.3201}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x7F, /* PX-A640, Stylus CX7300/CX7400/DX7400 */ + {{1.0936,-0.0142,-0.0795,-0.0001, 1.0951,-0.0949, 0.0308,-0.2967, 1.2659}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x80, /* PX-A740, Stylus CX8300/CX8400/DX8400 */ + {{1.0936,-0.0142,-0.0795,-0.0001, 1.0951,-0.0949, 0.0308,-0.2967, 1.2659}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x81, /* PX-FA700, Stylus CX9300F/CX9400Fax/DX9400F */ + {{1.1090,-0.0304,-0.0786, 0.0194, 1.1078,-0.1272,-0.0077,-0.1293, 1.1370}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x82, /* PM-T960 */ + {{1.1622,-0.1102,-0.0519,-0.0717, 1.1060,-0.0343,-0.0248,-0.4138, 1.4385}, + {0.9913, 0.0082, 0.0005,-0.1259, 1.0452, 0.0807,-0.0072,-0.0767, 1.0839}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.3900,-0.3008,-0.0892,-0.0254, 1.0890,-0.0636,-0.0300,-0.2501, 1.2801}}}, + {0x84, /* PM-A940, Stylus Photo RX680/RX685/RX690 */ + {{1.0934,-0.0042,-0.0892, 0.0052, 1.1019,-0.1071, 0.0259,-0.2651, 1.2392}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x85, /* PM-A840/A840S, Stylus Photo RX585/RX595/RX610 */ + {{1.0534, 0.0399,-0.0934, 0.0098, 1.0589,-0.0687, 0.0016,-0.1131, 1.1115}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x86, /* GT-D1000, GT-1500 */ + {{1.1945,-0.1413,-0.0532,-0.1929, 1.2525,-0.0596,-0.0235,-0.2761, 1.2996}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x87, /* GT-X970 */ + {{1.1978,-0.1417,-0.0561,-0.0852, 1.1610,-0.0758,-0.0395,-0.3212, 1.3607}, + {1.0000, 0.0009,-0.0009,-0.1268, 1.0523, 0.0745,-0.0075,-0.0873, 1.0948}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.4475,-0.3957,-0.0518,-0.0138, 1.0644,-0.0506,-0.0199,-0.2050, 1.2249}}}, + {0x97, /* LP-M5000 */ + {{1.1115,-0.0377,-0.0738,-0.0658, 1.0624, 0.0034, 0.0042,-0.2883, 1.2841}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x89, /* LP-M6000 */ + {{1.1115,-0.0377,-0.0738,-0.0658, 1.0624, 0.0034, 0.0042,-0.2883, 1.2841}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x8A, /* ES-H7200, GT-20000 */ + {{1.1221,-0.0396,-0.0825,-0.0718, 1.0822,-0.0104, 0.0112,-0.2995, 1.2883}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x8B, /* GT-F720/S620, Perfection V30/V300 */ + {{1.2402,-0.1891,-0.0511,-0.1535, 1.2008,-0.0473,-0.0316,-0.3293, 1.3609}, + {1.0027,-0.0048, 0.0021,-0.2067, 1.0878, 0.1189,-0.0408,-0.0767, 1.1175}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.4524,-0.4346,-0.0178,-0.0601, 1.1273,-0.0672,-0.0173,-0.1823, 1.1996}}}, + {0x8D, /* Stylus NX200/SX200/TX200 */ + {{1.0936,-0.0142,-0.0795,-0.0001, 1.0951,-0.0949, 0.0308,-0.2967, 1.2659}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x8E, /* PX-501A, Stylus NX400/SX400/TX400 */ + {{1.0936,-0.0142,-0.0795,-0.0001, 1.0951,-0.0949, 0.0308,-0.2967, 1.2659}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x8F, /* Stylus NX300 / Stylus Office BX300F/TX300F / ME Office 600F */ + {{1.1090,-0.0304,-0.0786, 0.0194, 1.1078,-0.1272,-0.0077,-0.1293, 1.1370}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x90, /* PX-601F, Stylus SX600FW/TX600FW / Stylus Office BX600FW / WorkForce 600 */ + {{1.0316, 0.0864,-0.1180, 0.0268, 1.1111,-0.1379, 0.0213,-0.2235, 1.2022}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x91, /* EP-901A/901F, Artisan 800 / Stylus Photo PX800FW/FX800FW */ + {{1.0777, 0.0152,-0.0929, 0.0244, 1.1221,-0.1465, 0.0103,-0.1544, 1.1441}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x92, /* EP-801A, Artisan 700 / Stylus Photo PX700W/TX700W */ + {{1.0777, 0.0152,-0.0929, 0.0244, 1.1221,-0.1465, 0.0103,-0.1544, 1.1441}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x93, /* PX-401A, Stylus NX100/SX100/TX100 / ME 300 */ + {{1.0934,-0.0042,-0.0892, 0.0052, 1.1019,-0.1071, 0.0259,-0.2651, 1.2392}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x96, /* WorkForce 500 */ + {{1.1090,-0.0304,-0.0786, 0.0194, 1.1078,-0.1272,-0.0077,-0.1293, 1.1370}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x98, + {{1.0936,-0.0142,-0.0795,-0.0001, 1.0951,-0.0949, 0.0308,-0.2967, 1.2659}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x99, + {{1.1090,-0.0304,-0.0786, 0.0194, 1.1078,-0.1272,-0.0077,-0.1293, 1.1370}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9A, + {{1.0779, 0.0132,-0.0911, 0.0214, 1.1003,-0.1217, 0.0109,-0.1487, 1.1378}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9B, + {{1.0779, 0.0132,-0.0911, 0.0214, 1.1003,-0.1217, 0.0109,-0.1487, 1.1378}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9C, + {{1.0316, 0.0864,-0.1180, 0.0268, 1.1111,-0.1379, 0.0213,-0.2235, 1.2022}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9D, + {{1.0316, 0.0864,-0.1180, 0.0268, 1.1111,-0.1379, 0.0213,-0.2235, 1.2022}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9E, + {{1.0534, 0.0399,-0.0934, 0.0098, 1.0589,-0.0687, 0.0016,-0.1131, 1.1115}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0x9F, + {{1.0777, 0.0152,-0.0929, 0.0244, 1.1221,-0.1465, 0.0103,-0.1544, 1.1441}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0xA0, + {{1.0777, 0.0152,-0.0929, 0.0244, 1.1221,-0.1465, 0.0103,-0.1544, 1.1441}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}}}, + {0xA1, + {{1.2578,-0.2140,-0.0438,-0.1939, 1.2856,-0.0917,-0.0258,-0.2642, 1.2900}, + {0.9989,-0.0018, 0.0029,-0.2608, 1.1305, 0.1303,-0.0802,-0.0807, 1.1609}, + {1.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, 1.0000}, + {1.4431,-0.4193,-0.0238,-0.0915, 1.1507,-0.0592,-0.0226,-0.1978, 1.2204}}}, + + { 0xFF, { } } /* terminator */ +}; + +/* cat hw-data.c | grep '{"' | cut -d ',' -f1,2 | awk '{ print $0 " },"}' */ + +const struct epson_profile_map epson_cct_models[] = { + {"GT-10000", 0x05 }, + {"ES-6000", 0x05 }, + {"Perfection610", 0x06 }, + {"GT-6600", 0x06 }, + {"Perfection1200", 0x07 }, + {"GT-7600", 0x07 }, + {"Expression1600", 0x0D }, + {"ES-2000", 0x0D }, + {"Expression1640XL", 0x0F }, + {"ES-8500", 0x0F }, + {"Perfection640", 0x15 }, + {"GT-6700", 0x15 }, + {"Perfection1640", 0x16 }, + {"GT-8700", 0x16 }, + {"Perfection1240", 0x18 }, + {"GT-7700", 0x18 }, + {"GT-30000", 0x1A }, + {"ES-9000H", 0x1A }, + {"Expression1680", 0x1B }, + {"ES-2200", 0x1B }, + {"GT-7200", 0x1D }, + {"GT-8200", 0x1F }, + {"GT-9700", 0x21 }, + {"GT-7300", 0x23 }, + {"GT-8300", 0x25 }, + {"GT-9300", 0x27 }, + {"GT-9800", 0x29 }, + {"ES-7000H", 0x2B }, + {"LP-A500", 0x51 }, + {"AL-CX11", 0x51 }, + {"GT-9400", 0x32 }, + {"CC-600PX", 0x2D }, + {"PM-A850", 0x3A }, + {"CX5400", 0x36 }, + {"GT-X700", 0x34 }, + {"RX500", 0x38 }, + {"PX-A650", 0x37 }, + {"ES-10000G", 0x3F }, + {"Expression10000", 0x3F }, + {"CX4600", 0x46 }, + {"CX6600", 0x49 }, + {"CX3600", 0x46 }, + {"RX420", 0x48 }, + {"PM-A700", 0x48 }, + {"PM-A870", 0x4B }, + {"GT-F500", 0x41 }, + {"GT-F600", 0x43 }, + {"PM-A900", 0x4D }, + {"GT-X800", 0x4F }, + {"GT-X750", 0x54 }, + {"LP-M5500", 0x56 }, + {"LP-M5600", 0x78 }, + {"GT-F520", 0x52 }, + {"CX3800", 0x57 }, + {"CX7800", 0x5B }, + {"PM-A750", 0x5D }, + {"CX4800", 0x58 }, + {"CX4200", 0x59 }, + {"PM-A950", 0x61 }, + {"PM-A890", 0x5F }, + {"GT-X900", 0x63 }, + {"CX4000", 0x6B }, + {"CX3000v", 0x6A }, + {"ES-H300", 0x65 }, + {"CX6000", 0x6C }, + {"PM-A820", 0x70 }, + {"PM-A920", 0x71 }, + {"PM-A970", 0x73 }, + {"PM-T990", 0x75 }, + {"CX5000", 0x77 }, + {"GT-S600", 0x66 }, + {"GT-F700", 0x68 }, + {"AL-CX21", 0x79 }, + {"GT-F670", 0x7A }, + {"GT-X770", 0x7C }, + {"CX4400", 0x7E }, + {"CX7400", 0x7F }, + {"CX8400", 0x80 }, + {"CX9400Fax", 0x81 }, + {"PM-T960", 0x82 }, + {"PM-A940", 0x84 }, + {"PM-A840", 0x85 }, + {"GT-D1000", 0x86 }, + {"GT-X970", 0x87 }, + {"LP-M5000", 0x97 }, + {"LP-M6000", 0x89 }, + {"ES-H7200", 0x8A }, + {"GT-20000", 0x8A }, + {"NX200", 0x8D }, + {"NX400", 0x8E }, + {"NX100", 0x93 }, + {"NX300", 0x8F }, + {"WorkForce 600", 0x90 }, + {"Artisan 800", 0x91 }, + {"Artisan 700", 0x92 }, + {"WorkForce 500", 0x96 }, + {"GT-F720", 0x8B }, + {"GT-S620", 0x8B }, + {"GT-S50", 0x00 }, + {"GT-S80", 0x00 }, + {"PID 0851", 0x98 }, + {"PID 084D", 0x99 }, + {"PID 084F", 0x9A }, + {"PID 0854", 0x9B }, + {"PID 0856", 0x9C }, + {"PID 0855", 0x9D }, + {"PID 0850", 0x9E }, + {"PID 0852", 0xA0 }, + {"PID 0853", 0x9F }, + {"GT-X820", 0xA1 }, + + { } /* terminator */ +}; diff -Nru sane-backends-1.0.20/backend/epson2-commands.c sane-backends-1.0.21/backend/epson2-commands.c --- sane-backends-1.0.20/backend/epson2-commands.c 2009-02-24 09:01:55.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2-commands.c 2010-04-05 23:18:04.000000000 +1000 @@ -17,13 +17,10 @@ #define DEBUG_DECLARE_ONLY -#include "../include/sane/config.h" - -#include -#include -#include +#include "sane/config.h" #include +#include #include "epson2.h" #include "epson2-io.h" @@ -129,17 +126,158 @@ return e2_cmd_simple(s, params, 8); } +static int +get_roundup_index(double frac[], int n) +{ + int i, index = -1; + double max_val = 0.0; + + for (i = 0; i < n; i++) { + + if (frac[i] < 0) + continue; + + if (max_val < frac[i]) { + index = i; + max_val = frac[i]; + } + } + + return index; +} + +static int +get_rounddown_index(double frac[], int n) +{ + int i, index = -1; + double min_val = 1.0; + + for (i = 0; i < n; i++) { + + if (frac[i] > 0) + continue; + + if (min_val > frac[i]) { + index = i; + min_val = frac[i]; + } + } + + return index; +} + +static unsigned char +int2cpt(int val) +{ + if (val >= 0) { + + if (val > 127) + val = 127; + + return (unsigned char) val; + + } else { + + val = -val; + + if (val > 127) + val = 127; + + return (unsigned char) (0x80 | val); + } +} + +static void +round_cct(double org_cct[], int rnd_cct[]) +{ + int loop = 0; + int i, j, sum[3]; + double mult_cct[9], frac[9]; + + for (i = 0; i < 9; i++) { + mult_cct[i] = org_cct[i] * 32; + rnd_cct[i] = (int) floor(mult_cct[i] + 0.5); + } + + do { + for (i = 0; i < 3; i++) { + + int k = i * 3; + + if ((rnd_cct[k] == 11) && + (rnd_cct[k] == rnd_cct[k + 1]) && + (rnd_cct[k] == rnd_cct[k + 2])) { + + rnd_cct[k + i]--; + mult_cct[k + i] = rnd_cct[k + i]; + } + } + + for (i = 0; i < 3; i++) { + + int k = i * 3; + + for (sum[i] = j = 0; j < 3; j++) + sum[i] += rnd_cct[k + j]; + } + + for (i = 0; i < 9; i++) + frac[i] = mult_cct[i] - rnd_cct[i]; + + for (i = 0; i < 3; i++) { + + int k = i * 3; + + if (sum[i] < 32) { + + int index = get_roundup_index(&frac[k], 3); + if (index != -1) { + rnd_cct[k + index]++; + mult_cct[k + index] = rnd_cct[k + index]; + sum[i]++; + } + + } else if (sum[i] > 32) { + + int index = get_rounddown_index(&frac[k], 3); + if (index != -1) { + rnd_cct[k + index]--; + mult_cct[k + index] = rnd_cct[k + index]; + sum[i]--; + } + } + } + } + + while ((++loop < 2) + && ((sum[0] != 32) || (sum[1] != 32) || (sum[2] != 32))); +} + +static void +profile_to_colorcoeff(double *profile, unsigned char *color_coeff) +{ + int cc_idx[] = { 4, 1, 7, 3, 0, 6, 5, 2, 8 }; + int i, color_table[9]; + + round_cct(profile, color_table); + + for (i = 0; i < 9; i++) + color_coeff[i] = int2cpt(color_table[cc_idx[i]]); +} + + /* * Sends the "set color correction coefficients" command with the * currently selected parameters to the scanner. */ SANE_Status -esci_set_color_correction_coefficients(Epson_Scanner * s) +esci_set_color_correction_coefficients(Epson_Scanner * s, SANE_Word *table) { SANE_Status status; unsigned char params[2]; - signed char cct[9]; + unsigned char data[9]; + double cct[9]; DBG(8, "%s\n", __func__); if (!s->hw->cmd->set_color_correction_coefficients) { @@ -154,21 +292,23 @@ if (status != SANE_STATUS_GOOD) return status; - cct[0] = s->val[OPT_CCT_1].w; - cct[1] = s->val[OPT_CCT_2].w; - cct[2] = s->val[OPT_CCT_3].w; - cct[3] = s->val[OPT_CCT_4].w; - cct[4] = s->val[OPT_CCT_5].w; - cct[5] = s->val[OPT_CCT_6].w; - cct[6] = s->val[OPT_CCT_7].w; - cct[7] = s->val[OPT_CCT_8].w; - cct[8] = s->val[OPT_CCT_9].w; + cct[0] = SANE_UNFIX(table[0]); + cct[1] = SANE_UNFIX(table[1]); + cct[2] = SANE_UNFIX(table[2]); + cct[3] = SANE_UNFIX(table[3]); + cct[4] = SANE_UNFIX(table[4]); + cct[5] = SANE_UNFIX(table[5]); + cct[6] = SANE_UNFIX(table[6]); + cct[7] = SANE_UNFIX(table[7]); + cct[8] = SANE_UNFIX(table[8]); + + profile_to_colorcoeff(cct, data); DBG(11, "%s: %d,%d,%d %d,%d,%d %d,%d,%d\n", __func__, - cct[0], cct[1], cct[2], cct[3], - cct[4], cct[5], cct[6], cct[7], cct[8]); + data[0] , data[1], data[2], data[3], + data[4], data[5], data[6], data[7], data[8]); - return e2_cmd_simple(s, params, 9); + return e2_cmd_simple(s, data, 9); } SANE_Status @@ -212,25 +352,11 @@ } } - /* - * When handling inverted images, we must also invert the user - * supplied gamma function. This is *not* just 255-gamma - - * this gives a negative image. - */ - for (table = 0; table < 3; table++) { gamma[0] = gamma_cmds[table]; - if (s->invert_image) { - for (n = 0; n < 256; ++n) { - gamma[n + 1] = - 255 - s->gamma_table[table][255 - n]; - } - } else { - for (n = 0; n < 256; ++n) { - gamma[n + 1] = s->gamma_table[table][n]; - } - } + for (n = 0; n < 256; ++n) + gamma[n + 1] = s->gamma_table[table][n]; status = e2_cmd_simple(s, params, 2); if (status != SANE_STATUS_GOOD) @@ -335,20 +461,21 @@ return status; DBG(1, " command level : %c%c\n", buf[0], buf[1]); - DBG(1, " basic resolution: %lu\n", (u_long) le32atoh(&buf[4])); - DBG(1, " min resolution : %lu\n", (u_long) le32atoh(&buf[8])); - DBG(1, " max resolution : %lu\n", (u_long) le32atoh(&buf[12])); - DBG(1, " max pixel num : %lu\n", (u_long) le32atoh(&buf[16])); + DBG(1, " basic resolution: %lu\n", (unsigned long) le32atoh(&buf[4])); + DBG(1, " min resolution : %lu\n", (unsigned long) le32atoh(&buf[8])); + DBG(1, " max resolution : %lu\n", (unsigned long) le32atoh(&buf[12])); + DBG(1, " max pixel num : %lu\n", (unsigned long) le32atoh(&buf[16])); DBG(1, " scan area : %lux%lu\n", - (u_long) le32atoh(&buf[20]), (u_long) le32atoh(&buf[24])); + (unsigned long) le32atoh(&buf[20]), (unsigned long) le32atoh(&buf[24])); DBG(1, " adf area : %lux%lu\n", - (u_long) le32atoh(&buf[28]), (u_long) le32atoh(&buf[32])); + (unsigned long) le32atoh(&buf[28]), (unsigned long) le32atoh(&buf[32])); DBG(1, " tpu area : %lux%lu\n", - (u_long) le32atoh(&buf[36]), (u_long) le32atoh(&buf[40])); + (unsigned long) le32atoh(&buf[36]), (unsigned long) le32atoh(&buf[40])); - DBG(1, " main status : 0x%02x\n", buf[44]); + DBG(1, " capabilities (1): 0x%02x\n", buf[44]); + DBG(1, " capabilities (2): 0x%02x\n", buf[45]); DBG(1, " input depth : %d\n", buf[66]); DBG(1, " max output depth: %d\n", buf[67]); DBG(1, " rom version : %c%c%c%c\n", @@ -366,32 +493,46 @@ if (le32atoh(&buf[36]) > 0) DBG(1, " TPU detected\n"); - DBG(1, "status:\n"); + if (buf[44]) + DBG(1, "capabilities (1):\n"); - if (buf[44] & EXT_IDTY_STATUS_DLF) + if (buf[44] & EXT_IDTY_CAP1_DLF) DBG(1, " main lamp change is supported\n"); - if (buf[44] & EXT_IDTY_STATUS_NOTFBF) + if (buf[44] & EXT_IDTY_CAP1_NOTFBF) DBG(1, " the device is NOT flatbed\n"); - if (buf[44] & EXT_IDTY_STATUS_ADFT) + if (buf[44] & EXT_IDTY_CAP1_ADFT) DBG(1, " page type ADF is installed\n"); - if (buf[44] & EXT_IDTY_STATUS_ADFS) + if (buf[44] & EXT_IDTY_CAP1_ADFS) DBG(1, " ADF is duplex capable\n"); - if (buf[44] & EXT_IDTY_STATUS_ADFO) + if (buf[44] & EXT_IDTY_CAP1_ADFO) DBG(1, " page type ADF loads from the first sheet\n"); - if (buf[44] & EXT_IDTY_STATUS_LID) + if (buf[44] & EXT_IDTY_CAP1_LID) DBG(1, " lid type option is installed\n"); - if (buf[44] & EXT_IDTY_STATUS_TPIR) + if (buf[44] & EXT_IDTY_CAP1_TPIR) DBG(1, " infrared scanning is supported\n"); - if (buf[44] & EXT_IDTY_STATUS_PB) + if (buf[44] & EXT_IDTY_CAP1_PB) DBG(1, " push button is supported\n"); + + if (buf[45]) + DBG(1, "capabilities (2):\n"); + + if (buf[45] & EXT_IDTY_CAP2_AFF) + DBG(1, " ADF has auto form feed\n"); + + if (buf[45] & EXT_IDTY_CAP2_DFD) + DBG(1, " ADF has double feed detection\n"); + + if (buf[45] & EXT_IDTY_CAP2_ADFAS) + DBG(1, " ADF has auto scan\n"); + return SANE_STATUS_GOOD; } @@ -429,6 +570,9 @@ if (buf[0] & FSF_STATUS_MAIN_WU) DBG(1, " scanner is warming up\n"); + if (buf[0] & FSF_STATUS_MAIN_CWU) + DBG(1, " warmup can be cancelled\n"); + DBG(1, "adf status : 0x%02x\n", buf[1]); @@ -507,12 +651,12 @@ params[0] = FS; params[1] = 'W'; - DBG(10, "resolution of main scan : %lu\n", (u_long) le32atoh(&buf[0])); - DBG(10, "resolution of sub scan : %lu\n", (u_long) le32atoh(&buf[4])); - DBG(10, "offset length of main scan : %lu\n", (u_long) le32atoh(&buf[8])); - DBG(10, "offset length of sub scan : %lu\n", (u_long) le32atoh(&buf[12])); - DBG(10, "scanning length of main scan: %lu\n", (u_long) le32atoh(&buf[16])); - DBG(10, "scanning length of sub scan : %lu\n", (u_long) le32atoh(&buf[20])); + DBG(10, "resolution of main scan : %lu\n", (unsigned long) le32atoh(&buf[0])); + DBG(10, "resolution of sub scan : %lu\n", (unsigned long) le32atoh(&buf[4])); + DBG(10, "offset length of main scan : %lu\n", (unsigned long) le32atoh(&buf[8])); + DBG(10, "offset length of sub scan : %lu\n", (unsigned long) le32atoh(&buf[12])); + DBG(10, "scanning length of main scan: %lu\n", (unsigned long) le32atoh(&buf[16])); + DBG(10, "scanning length of sub scan : %lu\n", (unsigned long) le32atoh(&buf[20])); DBG(10, "scanning color : %d\n", buf[24]); DBG(10, "data format : %d\n", buf[25]); DBG(10, "option control : %d\n", buf[26]); @@ -540,6 +684,100 @@ return SANE_STATUS_GOOD; } +/* FS S */ + +SANE_Status +esci_get_scanning_parameter(SANE_Handle handle, unsigned char *buf) +{ + Epson_Scanner *s = (Epson_Scanner *) handle; + SANE_Status status; + unsigned char params[2]; + + DBG(8, "%s\n", __func__); + + if (buf == NULL) + return SANE_STATUS_INVAL; + + params[0] = FS; + params[1] = 'S'; + + status = e2_txrx(s, params, 2, buf, 64); + if (status != SANE_STATUS_GOOD) + return status; + + DBG(10, "resolution of main scan : %lu\n", + (u_long) le32atoh(&buf[0])); + DBG(10, "resolution of sub scan : %lu\n", + (u_long) le32atoh(&buf[4])); + DBG(10, "offset length of main scan : %lu\n", + (u_long) le32atoh(&buf[8])); + DBG(10, "offset length of sub scan : %lu\n", + (u_long) le32atoh(&buf[12])); + DBG(10, "scanning length of main scan: %lu\n", + (u_long) le32atoh(&buf[16])); + DBG(10, "scanning length of sub scan : %lu\n", + (u_long) le32atoh(&buf[20])); + DBG(10, "scanning color : %d\n", buf[24]); + DBG(10, "data format : %d\n", buf[25]); + DBG(10, "option control : %d\n", buf[26]); + DBG(10, "scanning mode : %d\n", buf[27]); + DBG(10, "block line number : %d\n", buf[28]); + DBG(10, "gamma correction : %d\n", buf[29]); + DBG(10, "brightness : %d\n", buf[30]); + DBG(10, "color correction : %d\n", buf[31]); + DBG(10, "halftone processing : %d\n", buf[32]); + DBG(10, "threshold : %d\n", buf[33]); + DBG(10, "auto area segmentation : %d\n", buf[34]); + DBG(10, "sharpness control : %d\n", buf[35]); + DBG(10, "mirroring : %d\n", buf[36]); + DBG(10, "film type : %d\n", buf[37]); + DBG(10, "main lamp lighting mode : %d\n", buf[38]); + + return SANE_STATUS_GOOD; +} + +/* ESC # */ + +SANE_Status +esci_enable_infrared(SANE_Handle handle) +{ + Epson_Scanner *s = (Epson_Scanner *) handle; + SANE_Status status; + int i; + unsigned char params[2]; + unsigned char buf[64]; + + unsigned char seq[32] = { + 0xCA, 0xFB, 0x77, 0x71, 0x20, 0x16, 0xDA, 0x09, + 0x5F, 0x57, 0x09, 0x12, 0x04, 0x83, 0x76, 0x77, + 0x3C, 0x73, 0x9C, 0xBE, 0x7A, 0xE0, 0x52, 0xE2, + 0x90, 0x0D, 0xFF, 0x9A, 0xEF, 0x4C, 0x2C, 0x81 + }; + + DBG(8, "%s\n", __func__); + + status = esci_get_scanning_parameter(handle, buf); + if (status != SANE_STATUS_GOOD) + return status; + + for (i = 0; i < 32; i++) { + buf[i] = seq[i] ^ buf[i]; + } + + params[0] = ESC; + params[1] = '#'; + + status = e2_cmd_simple(s, params, 2); + if (status != SANE_STATUS_GOOD) + return status; + + status = e2_cmd_simple(s, buf, 32); + if (status != SANE_STATUS_GOOD) + return status; + + return SANE_STATUS_GOOD; +} + SANE_Status esci_request_command_parameter(SANE_Handle handle, unsigned char *buf) { @@ -804,7 +1042,7 @@ break; default: DBG(1, "%s: unknown reply length (%lu)\n", __func__, - (u_long) buf_len); + (unsigned long) buf_len); break; } diff -Nru sane-backends-1.0.20/backend/epson2-commands.h sane-backends-1.0.21/backend/epson2-commands.h --- sane-backends-1.0.20/backend/epson2-commands.h 2008-01-10 04:10:08.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2-commands.h 2010-04-05 23:18:04.000000000 +1000 @@ -39,7 +39,7 @@ SANE_Status esci_set_resolution(Epson_Scanner * s, int x, int y); SANE_Status esci_set_scan_area(Epson_Scanner * s, int x, int y, int width, int height); -SANE_Status esci_set_color_correction_coefficients(Epson_Scanner * s); +SANE_Status esci_set_color_correction_coefficients(Epson_Scanner * s, SANE_Word *table); SANE_Status esci_set_gamma_table(Epson_Scanner * s); SANE_Status esci_request_status(SANE_Handle handle, unsigned char *scanner_status); @@ -59,3 +59,4 @@ SANE_Status esci_eject(Epson_Scanner * s); SANE_Status esci_request_extended_status(SANE_Handle handle, unsigned char **data, size_t * data_len); +SANE_Status esci_enable_infrared(SANE_Handle handle); diff -Nru sane-backends-1.0.20/backend/epson2.h sane-backends-1.0.21/backend/epson2.h --- sane-backends-1.0.20/backend/epson2.h 2008-01-10 04:10:08.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2.h 2010-04-05 23:18:04.000000000 +1000 @@ -19,15 +19,29 @@ #define epson2_h #undef BACKEND_NAME -#define BACKEND_NAME epson2 +#define BACKEND_NAME epson2 #define DEBUG_NOT_STATIC #include + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H #include +#endif -#include -#include -#include +#include /* for memset and memcpy */ +#include + +#include "sane/sane.h" +#include "sane/sanei_backend.h" +#include "sane/sanei_debug.h" #ifdef __GNUC__ #define __func__ __FUNCTION__ @@ -36,10 +50,10 @@ /* I cast my vote for C99... :) */ #endif -#define EPSON2_CONFIG_FILE "epson2.conf" +#define EPSON2_CONFIG_FILE "epson2.conf" #ifndef PATH_MAX -#define PATH_MAX (1024) +#define PATH_MAX (1024) #endif #ifndef XtNumber @@ -52,12 +66,6 @@ #define DEVICE_NAME_LEN (16) /* length of device name in extended status */ -/* some string constants that are used in the config file */ - -#define SANE_EPSON_CONFIG_USB "usb" -#define SANE_EPSON_CONFIG_PIO "pio" -#define SANE_EPSON_CONFIG_NET "net" - /* string constants for GUI elements that are not defined SANE-wide */ #define SANE_NAME_GAMMA_CORRECTION "gamma-correction" @@ -71,14 +79,11 @@ #define SANE_EPSON_WAIT_FOR_BUTTON_TITLE SANE_I18N("Wait for Button") #define SANE_EPSON_WAIT_FOR_BUTTON_DESC SANE_I18N("After sending the scan command, wait until the button on the scanner is pressed to actually start the scan process."); +/* misc constants */ #define LINES_SHUFFLE_MAX 17 /* 2 x 8 lines plus 1 */ - -#define SANE_EPSON_MAX_RETRIES 120 /* how often do we retry during warmup ? */ - -#ifndef MM_PER_INCH -#define MM_PER_INCH 25.4 -#endif +#define SANE_EPSON_MAX_RETRIES 14 /* warmup max retry */ +#define CMD_SIZE_EXT_STATUS 42 /* NOTE: you can find these codes with "man ascii". */ #define STX 0x02 @@ -92,6 +97,8 @@ #define S_ACK "\006" #define S_CAN "\030" +/* status bits */ + #define STATUS_FER 0x80 /* fatal error */ #define STATUS_NOT_READY 0x40 /* scanner is in use on another interface */ #define STATUS_AREA_END 0x20 /* area end */ @@ -99,8 +106,6 @@ #define STATUS_EXT_COMMANDS 0x02 /* scanners supports extended commands */ #define STATUS_RESERVED 0x01 /* this should be always 0 */ -#define CMD_SIZE_EXT_STATUS 42 - #define EXT_STATUS_FER 0x80 /* fatal error */ #define EXT_STATUS_FBF 0x40 /* flat bed scanner */ #define EXT_STATUS_ADFT 0x20 /* page type ADF */ @@ -117,18 +122,24 @@ #define EXT_STATUS_PJ 0x04 /* paper jam */ #define EXT_STATUS_OPN 0x02 /* cover open */ -#define EXT_IDTY_STATUS_DLF 0x80 -#define EXT_IDTY_STATUS_NOTFBF 0x40 -#define EXT_IDTY_STATUS_ADFT 0x20 -#define EXT_IDTY_STATUS_ADFS 0x10 -#define EXT_IDTY_STATUS_ADFO 0x08 -#define EXT_IDTY_STATUS_LID 0x04 -#define EXT_IDTY_STATUS_TPIR 0x02 -#define EXT_IDTY_STATUS_PB 0x01 +#define EXT_IDTY_CAP1_DLF 0x80 +#define EXT_IDTY_CAP1_NOTFBF 0x40 /* not a flat bed scanner */ +#define EXT_IDTY_CAP1_ADFT 0x20 /* page type ADF ? */ +#define EXT_IDTY_CAP1_ADFS 0x10 /* ADF is duplex capable */ +#define EXT_IDTY_CAP1_ADFO 0x08 /* ADF loads from the first sheet (page type only) */ +#define EXT_IDTY_CAP1_LID 0x04 /* lid type option ? */ +#define EXT_IDTY_CAP1_TPIR 0x02 /* TPU with infrared */ +#define EXT_IDTY_CAP1_PB 0x01 /* scanner has a push button */ + +#define EXT_IDTY_CAP2_AFF 0x04 /* auto form feed */ +#define EXT_IDTY_CAP2_DFD 0x08 /* double feed detection */ +#define EXT_IDTY_CAP2_ADFAS 0x10 /* ADF with auto scan support */ #define FSF_STATUS_MAIN_FER 0x80 /* system error */ #define FSF_STATUS_MAIN_NR 0x40 /* not ready */ #define FSF_STATUS_MAIN_WU 0x02 /* warming up */ +#define FSF_STATUS_MAIN_CWU 0x01 /* warm up can be cancelled (?) */ + #define FSF_STATUS_ADF_IST 0x80 /* installed */ #define FSF_STATUS_ADF_EN 0x40 /* enabled */ #define FSF_STATUS_ADF_ERR 0x20 /* system error */ @@ -136,15 +147,21 @@ #define FSF_STATUS_ADF_PJ 0x04 /* paper jam */ #define FSF_STATUS_ADF_OPN 0x02 /* cover open */ #define FSF_STATUS_ADF_PAG 0x01 /* duplex */ + #define FSF_STATUS_TPU_IST 0x80 /* installed */ #define FSF_STATUS_TPU_EN 0x40 /* enabled */ #define FSF_STATUS_TPU_ERR 0x20 /* system error */ #define FSF_STATUS_TPU_OPN 0x02 /* cover open */ + #define FSF_STATUS_MAIN2_ERR 0x20 /* system error */ #define FSF_STATUS_MAIN2_PE 0x08 /* paper empty */ #define FSF_STATUS_MAIN2_PJ 0x04 /* paper jam */ #define FSF_STATUS_MAIN2_OPN 0x02 /* cover open */ +#define FSG_STATUS_FER 0x80 +#define FSG_STATUS_NOT_READY 0x40 /* in use via other interface */ +#define FSG_STATUS_CANCEL_REQ 0x10 /* cancel request from scanner */ + #define EPSON_LEVEL_A1 0 #define EPSON_LEVEL_A2 1 #define EPSON_LEVEL_B1 2 @@ -166,172 +183,239 @@ * scanner with SANE get in touch with me and we can work something out - khk */ -#define EPSON_LEVEL_DEFAULT EPSON_LEVEL_B3 +#define EPSON_LEVEL_DEFAULT EPSON_LEVEL_B3 -typedef struct +struct EpsonCmd { - char *level; + char *level; + + unsigned char request_identity; + unsigned char request_identity2; /* new request identity level Dx */ + 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 and later */ + unsigned char set_lcount; + unsigned char mirror_image; /* B5 and later */ + unsigned char set_gamma_table; /* B4 and later */ + unsigned char set_outline_emphasis; /* B4 and later */ + unsigned char set_dither; /* B4 and later */ + unsigned char set_color_correction_coefficients; /* B3 and later */ + unsigned char request_extended_status; /* get extended status from scanner */ + unsigned char control_an_extension; /* for extension control */ + unsigned char eject; /* for extension control */ + unsigned char feed; + unsigned char request_push_button_status; + unsigned char control_auto_area_segmentation; + unsigned char set_film_type; /* for extension control */ + unsigned char set_exposure_time; /* F5 only */ + unsigned char set_bay; /* F5 only */ + unsigned char set_threshold; + unsigned char set_focus_position; /* B8 only */ + unsigned char request_focus_position; /* B8 only */ + unsigned char request_extended_identity; + unsigned char request_scanner_status; +}; - unsigned char request_identity; - unsigned char request_identity2; /* new request identity command for Dx command level */ - 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 and later */ - unsigned char set_lcount; - unsigned char mirror_image; /* B5 and later */ - unsigned char set_gamma_table; /* B4 and later */ - unsigned char set_outline_emphasis; /* B4 and later */ - unsigned char set_dither; /* B4 and later */ - unsigned char set_color_correction_coefficients; /* B3 and later */ - unsigned char request_extended_status; /* get extended status from scanner */ - unsigned char control_an_extension; /* for extension control */ - unsigned char eject; /* for extension control */ - unsigned char feed; - unsigned char request_push_button_status; - unsigned char control_auto_area_segmentation; - unsigned char set_film_type; /* for extension control */ - unsigned char set_exposure_time; /* F5 only */ - unsigned char set_bay; /* F5 only */ - unsigned char set_threshold; - unsigned char set_focus_position; /* B8 only */ - unsigned char request_focus_position; /* B8 only */ - unsigned char request_extended_identity; - unsigned char request_scanner_status; -} EpsonCmdRec, *EpsonCmd; - -enum -{ OPT_NUM_OPTS = - 0, OPT_MODE_GROUP, OPT_MODE, OPT_BIT_DEPTH, OPT_HALFTONE, OPT_DROPOUT, - OPT_BRIGHTNESS, OPT_SHARPNESS, OPT_GAMMA_CORRECTION, OPT_COLOR_CORRECTION, - OPT_RESOLUTION, OPT_THRESHOLD, OPT_ADVANCED_GROUP, OPT_MIRROR, - OPT_AAS, OPT_LIMIT_RESOLUTION, /* OPT_GAMMA_VECTOR */ - OPT_GAMMA_VECTOR_R, OPT_GAMMA_VECTOR_G, OPT_GAMMA_VECTOR_B, - OPT_WAIT_FOR_BUTTON, 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_GEOMETRY_GROUP, - OPT_TL_X, OPT_TL_Y, OPT_BR_X, OPT_BR_Y, OPT_EQU_GROUP, - OPT_SOURCE, OPT_AUTO_EJECT, OPT_FILM_TYPE, OPT_FOCUS, OPT_BAY, - OPT_EJECT, OPT_ADF_MODE, NUM_OPTIONS +enum { + OPT_NUM_OPTS = 0, + OPT_MODE_GROUP, + OPT_MODE, + OPT_BIT_DEPTH, + OPT_HALFTONE, + OPT_DROPOUT, + OPT_BRIGHTNESS, + OPT_SHARPNESS, + OPT_GAMMA_CORRECTION, + OPT_COLOR_CORRECTION, + OPT_RESOLUTION, + OPT_THRESHOLD, + OPT_ADVANCED_GROUP, + OPT_MIRROR, + OPT_AAS, + OPT_GAMMA_VECTOR_R, + OPT_GAMMA_VECTOR_G, + OPT_GAMMA_VECTOR_B, + OPT_WAIT_FOR_BUTTON, + OPT_CCT_GROUP, + OPT_CCT_MODE, + OPT_CCT_PROFILE, + OPT_PREVIEW_GROUP, + OPT_PREVIEW, + OPT_GEOMETRY_GROUP, + OPT_TL_X, + OPT_TL_Y, + OPT_BR_X, + OPT_BR_Y, + OPT_EQU_GROUP, + OPT_SOURCE, + OPT_AUTO_EJECT, + OPT_FILM_TYPE, + OPT_FOCUS, + OPT_BAY, + OPT_EJECT, + OPT_ADF_MODE, + NUM_OPTIONS }; 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 */ - SANE_EPSON_NET /* network interface */ +{ /* 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 */ + SANE_EPSON_NET /* network interface */ } Epson_Connection_Type; +struct epson_profile +{ + unsigned int model; + double cct[4][9]; +}; + +enum { + CCTP_REFLECTIVE = 0, CCTP_COLORNEG, + CCTP_MONONEG, CCTP_COLORPOS +}; + +struct epson_profile_map +{ + char *name; + unsigned int id; +}; + +extern const struct epson_profile epson_cct_profiles[]; +extern const struct epson_profile_map epson_cct_models[]; + +/* hardware description */ + struct Epson_Device { - struct Epson_Device *next; + struct Epson_Device *next; - char *name; - char *model; + char *name; + char *model; + unsigned int model_id; - SANE_Device sane; - SANE_Int level; - SANE_Range dpi_range; + 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 *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 */ + 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 */ + Epson_Connection_Type connection; - 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_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_Word *resolution_list; /* for display purposes we store a second copy */ + SANE_Word *resolution_list; /* for display purposes we store a second copy */ - SANE_Bool extension; /* extension is installed */ - SANE_Int use_extension; /* use the installed extension */ - SANE_Bool TPU; /* TPU is installed */ - SANE_Bool TPU2; /* TPU2 is installed */ - SANE_Bool ADF; /* ADF is installed */ - SANE_Bool duplex; /* does the ADF handle duplex scanning */ - SANE_Bool focusSupport; /* does this scanner have support for "set focus position" ? */ - SANE_Bool color_shuffle; /* does this scanner need color shuffling */ - SANE_Int maxDepth; /* max. color depth */ + SANE_Bool extension; /* extension is installed */ + SANE_Int use_extension; /* use the installed extension */ + SANE_Bool TPU; /* TPU is installed */ + SANE_Bool TPU2; /* TPU2 is installed */ + SANE_Bool ADF; /* ADF is installed */ + SANE_Bool duplex; /* does the ADF handle duplex scanning */ + SANE_Bool focusSupport; /* does this scanner have support for "set focus position" ? */ + SANE_Bool color_shuffle; /* does this scanner need color shuffling */ - SANE_Int optical_res; /* optical resolution */ - SANE_Int max_line_distance; + SANE_Int maxDepth; /* max. color depth */ + SANE_Word *depth_list; - SANE_Bool need_double_vertical; - SANE_Bool need_color_reorder; - SANE_Bool need_reset_on_source_change; + SANE_Int optical_res; /* optical resolution */ + SANE_Int max_line_distance; - SANE_Bool wait_for_button; /* do we have to wait until the scanner button is pressed? */ + SANE_Bool need_double_vertical; + SANE_Bool need_color_reorder; + SANE_Bool need_reset_on_source_change; - SANE_Bool extended_commands; + SANE_Bool wait_for_button; /* do we have to wait until the scanner button is pressed? */ - EpsonCmd cmd; + SANE_Bool extended_commands; + + struct EpsonCmd *cmd; + const struct epson_profile *cct_profile; }; typedef struct Epson_Device Epson_Device; - +/* an instance of a scanner */ struct Epson_Scanner { - struct Epson_Scanner *next; - 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_Bool invert_image; - SANE_Bool focusOnGlass; - SANE_Byte currentFocusPosition; -/* SANE_Word gamma_table [ 4] [ 256]; */ - SANE_Word gamma_table[3][256]; - SANE_Int retry_count; - SANE_Byte *line_buffer[LINES_SHUFFLE_MAX]; - /* buffer lines for color shuffling */ - SANE_Int color_shuffle_line; /* current line number for color shuffling */ - SANE_Int line_distance; /* current line distance */ - SANE_Int current_output_line; /* line counter when color shuffling */ - SANE_Int lines_written; /* debug variable */ - SANE_Bool option_has_changed; /* did one of the options change it's value? */ - SANE_Int left, top, lcount; - unsigned char *netbuf, *netptr; - size_t netlen; - - - /* extended image data handshaking */ - SANE_Int ext_block_len; - SANE_Int ext_last_len; - SANE_Int ext_blocks; - SANE_Int ext_counter; + struct Epson_Scanner *next; + struct Epson_Device *hw; + + int fd; + + 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[3][256]; + SANE_Word cct_table[9]; + SANE_Int retry_count; + + /* buffer lines for color shuffling */ + SANE_Byte *line_buffer[LINES_SHUFFLE_MAX]; + SANE_Int color_shuffle_line; /* current line number for color shuffling */ + SANE_Int line_distance; /* current line distance */ + SANE_Int current_output_line; /* line counter when color shuffling */ + SANE_Int lines_written; /* debug variable */ + + SANE_Int left, top, lcount; + SANE_Bool focusOnGlass; + SANE_Byte currentFocusPosition; + + /* network buffers */ + unsigned char *netbuf, *netptr; + size_t netlen; + + /* extended image data handshaking */ + SANE_Int ext_block_len; + SANE_Int ext_last_len; + SANE_Int ext_blocks; + SANE_Int ext_counter; }; typedef struct Epson_Scanner Epson_Scanner; -#endif /* epson2_h */ +struct mode_param +{ + int color; + int flags; + int dropout_mask; + int depth; +}; + +enum { + MODE_BINARY, MODE_GRAY, MODE_COLOR, MODE_INFRARED +}; + +#endif diff -Nru sane-backends-1.0.20/backend/epson2-io.c sane-backends-1.0.21/backend/epson2-io.c --- sane-backends-1.0.20/backend/epson2-io.c 2009-02-24 09:02:23.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2-io.c 2010-04-05 23:18:04.000000000 +1000 @@ -17,26 +17,24 @@ #define DEBUG_DECLARE_ONLY -#include "../include/sane/config.h" +#include "sane/config.h" -#include -#include #include -#include - #include "epson2.h" #include "epson2-io.h" -#include -#include -#include -#include +#include "sane/sanei_scsi.h" +#include "sane/sanei_usb.h" +#include "sane/sanei_pio.h" +#include "sane/sanei_tcp.h" #include "epson2_scsi.h" #include "epson_usb.h" #include "epson2_net.h" +#include "byteorder.h" + /* flaming hack to get USB scanners * working without timeouts under linux * (cribbed from fujitsu.c) @@ -385,3 +383,10 @@ e2_send(s, S_ACK, 1, reply_len, &status); return status; } + +SANE_Status +e2_cancel(Epson_Scanner * s) +{ + DBG(1, "%s\n", __func__); + return e2_cmd_simple(s, S_CAN, 1); +} diff -Nru sane-backends-1.0.20/backend/epson2-io.h sane-backends-1.0.21/backend/epson2-io.h --- sane-backends-1.0.20/backend/epson2-io.h 2008-01-10 04:10:08.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2-io.h 2010-04-05 23:18:04.000000000 +1000 @@ -43,6 +43,7 @@ SANE_Status e2_ack(Epson_Scanner * s); SANE_Status e2_ack_next(Epson_Scanner * s, size_t reply_len); +SANE_Status e2_cancel(Epson_Scanner * s); SANE_Status e2_esc_cmd(Epson_Scanner * s, unsigned char cmd, unsigned char val); diff -Nru sane-backends-1.0.20/backend/epson2_net.c sane-backends-1.0.21/backend/epson2_net.c --- sane-backends-1.0.20/backend/epson2_net.c 2009-01-25 12:29:26.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2_net.c 2010-04-05 23:18:04.000000000 +1000 @@ -11,38 +11,22 @@ * published by the Free Software Foundation, version 2. */ -#include "../include/sane/config.h" +#define DEBUG_DECLARE_ONLY -#undef BACKEND_NAME -#define BACKEND_NAME epson2_net +#include "sane/config.h" -#include -#include -#include -#include -#include +#include "sane/sane.h" +#include "sane/saneopts.h" +#include "sane/sanei_tcp.h" +#include "sane/sanei_config.h" +#include "sane/sanei_backend.h" #include "epson2.h" #include "epson2_net.h" #include "byteorder.h" -#include - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef NEED_SYS_TYPES_H -#include -#endif - -#include /* for memset and memcpy */ -#include +#include "sane/sanei_debug.h" int sanei_epson_net_read_raw(Epson_Scanner *s, unsigned char *buf, size_t wanted, @@ -52,7 +36,6 @@ *status = SANE_STATUS_GOOD; - while (read < wanted) { size = sanei_tcp_read(s->fd, buf + read, wanted - read); @@ -72,12 +55,13 @@ sanei_epson_net_read(Epson_Scanner *s, unsigned char *buf, size_t wanted, SANE_Status * status) { - size_t size, read = 0; + size_t size; + ssize_t read = 0; unsigned char header[12]; /* read from buffer, if available */ if (s->netptr != s->netbuf) { - DBG(4, "reading %lu from buffer at %p, %lu available\n", + DBG(23, "reading %lu from buffer at %p, %lu available\n", (u_long) wanted, s->netptr, (u_long) s->netlen); memcpy(buf, s->netptr, wanted); @@ -86,7 +70,7 @@ s->netlen -= wanted; if (s->netlen == 0) { - DBG(4, "%s: freeing %p\n", __func__, s->netbuf); + DBG(23, "%s: freeing %p\n", __func__, s->netbuf); free(s->netbuf); s->netbuf = s->netptr = NULL; s->netlen = 0; @@ -96,22 +80,28 @@ } /* receive net header */ - sanei_tcp_read(s->fd, header, 12); + size = sanei_tcp_read(s->fd, header, 12); + if (size != 12) { + *status = SANE_STATUS_IO_ERROR; + return 0; + } if (header[0] != 'I' || header[1] != 'S') { DBG(1, "header mismatch: %02X %02x\n", header[0], header[1]); *status = SANE_STATUS_IO_ERROR; return 0; } + size = be32atoh(&header[6]); - DBG(4, "%s: wanted = %lu, available = %lu\n", __FUNCTION__, + DBG(23, "%s: wanted = %lu, available = %lu\n", __FUNCTION__, (u_long) wanted, (u_long) size); *status = SANE_STATUS_GOOD; if (size == wanted) { - DBG(4, "%s: full read\n", __func__); + + DBG(15, "%s: full read\n", __func__); read = sanei_tcp_read(s->fd, buf, size); if (s->netbuf) { @@ -119,17 +109,28 @@ s->netbuf = NULL; s->netlen = 0; } - } else if (wanted < size && s->netlen == size) { - DBG(4, "%s: partial read\n", __func__); - sanei_tcp_read(s->fd, s->netbuf, size); + if (read < 0) { + *status = SANE_STATUS_IO_ERROR; + return 0; + } + +/* } else if (wanted < size && s->netlen == size) { */ + } else { + DBG(23, "%s: partial read\n", __func__); + + read = sanei_tcp_read(s->fd, s->netbuf, size); + if (read != size) { + *status = SANE_STATUS_IO_ERROR; + return 0; + } s->netlen = size - wanted; s->netptr += wanted; read = wanted; - DBG(4, "0,4 %02x %02x\n", s->netbuf[0], s->netbuf[4]); - DBG(4, "storing %lu to buffer at %p, next read at %p, %lu bytes left\n", + DBG(23, "0,4 %02x %02x\n", s->netbuf[0], s->netbuf[4]); + DBG(23, "storing %lu to buffer at %p, next read at %p, %lu bytes left\n", (u_long) size, s->netbuf, s->netptr, (u_long) s->netlen); memcpy(buf, s->netbuf, wanted); @@ -155,11 +156,11 @@ if (reply_len) { s->netbuf = s->netptr = malloc(reply_len); s->netlen = reply_len; - DBG(8, "allocated %lu bytes at %p\n", + DBG(24, "allocated %lu bytes at %p\n", (u_long) reply_len, s->netbuf); } - DBG(2, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n", + DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n", __FUNCTION__, cmd, buf, (u_long) buf_size, (u_long) reply_len); memset(h1, 0x00, 12); @@ -174,7 +175,7 @@ h1[4] = 0x00; h1[5] = 0x0C; /* Don't know what's that */ - DBG(9, "H1[0]: %02x %02x %02x %02x\n", h1[0], h1[1], h1[2], h1[3]); + DBG(24, "H1[0]: %02x %02x %02x %02x\n", h1[0], h1[1], h1[2], h1[3]); if((cmd >> 8) == 0x20) { htobe32a(&h1[6], buf_size + 8); @@ -182,9 +183,9 @@ htobe32a(&h2[0], buf_size); htobe32a(&h2[4], reply_len); - DBG(9, "H1[6]: %02x %02x %02x %02x (%lu)\n", h1[6], h1[7], h1[8], h1[9], (u_long) (buf_size + 8)); - DBG(9, "H2[0]: %02x %02x %02x %02x (%lu)\n", h2[0], h2[1], h2[2], h2[3], (u_long) buf_size); - DBG(9, "H2[4]: %02x %02x %02x %02x (%lu)\n", h2[4], h2[5], h2[6], h2[7], (u_long) reply_len); + DBG(24, "H1[6]: %02x %02x %02x %02x (%lu)\n", h1[6], h1[7], h1[8], h1[9], (u_long) (buf_size + 8)); + DBG(24, "H2[0]: %02x %02x %02x %02x (%lu)\n", h2[0], h2[1], h2[2], h2[3], (u_long) buf_size); + DBG(24, "H2[4]: %02x %02x %02x %02x (%lu)\n", h2[4], h2[5], h2[6], h2[7], (u_long) reply_len); } if ((cmd >> 8) == 0x20 && (buf_size || reply_len)) { diff -Nru sane-backends-1.0.20/backend/epson2_net.h sane-backends-1.0.21/backend/epson2_net.h --- sane-backends-1.0.20/backend/epson2_net.h 2006-12-18 11:13:09.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2_net.h 2010-04-05 23:18:04.000000000 +1000 @@ -2,7 +2,7 @@ #define _EPSON2_NET_H_ #include -#include +#include "../include/sane/sane.h" extern int sanei_epson_net_read(struct Epson_Scanner *s, unsigned char *buf, size_t buf_size, SANE_Status *status); diff -Nru sane-backends-1.0.20/backend/epson2-ops.c sane-backends-1.0.21/backend/epson2-ops.c --- sane-backends-1.0.20/backend/epson2-ops.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/epson2-ops.c 2010-04-14 10:52:59.000000000 +1000 @@ -0,0 +1,2158 @@ +/* + * epson2.c - SANE library for Epson scanners. + * + * Based on Kazuhiro Sasayama previous + * Work on epson.[ch] file from the SANE package. + * Please see those files for additional copyrights. + * + * Copyright (C) 2006-09 Tower Technologies + * Author: Alessandro Zummo + * + * 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, version 2. + */ + +#define DEBUG_DECLARE_ONLY + +#include "sane/config.h" + +#include /* sleep */ + +#include + + +#include "byteorder.h" + +#include "epson2.h" +#include "epson2-ops.h" + +#include "epson2-io.h" +#include "epson2-commands.h" + +/* + * request identity + * | request identity2 + * | | request status + * | | | request condition + * | | | | set color mode + * | | | | | start scanning + * | | | | | | set data format + * | | | | | | | set resolution + * | | | | | | | | set zoom + * | | | | | | | | | set scan area + * | | | | | | | | | | set brightness + * | | | | | | | | | | | set gamma + * | | | | | | | | | | | | set halftoning + * | | | | | | | | | | | | | set color correction + * | | | | | | | | | | | | | | initialize scanner + * | | | | | | | | | | | | | | | set speed + * | | | | | | | | | | | | | | | | set lcount + * | | | | | | | | | | | | | | | | | mirror image + * | | | | | | | | | | | | | | | | | | set gamma table + * | | | | | | | | | | | | | | | | | | | set outline emphasis + * | | | | | | | | | | | | | | | | | | | | set dither + * | | | | | | | | | | | | | | | | | | | | | set color correction coefficients + * | | | | | | | | | | | | | | | | | | | | | | request extension status + * | | | | | | | | | | | | | | | | | | | | | | | control an extension + * | | | | | | | | | | | | | | | | | | | | | | | | forward feed / eject + * | | | | | | | | | | | | | | | | | | | | | | | | | feed + * | | | | | | | | | | | | | | | | | | | | | | | | | | request push button status + * | | | | | | | | | | | | | | | | | | | | | | | | | | | control auto area segmentation + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | set film type + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set exposure time + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set bay + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set threshold + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set focus position + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request extended identity + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request scanner status + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + */ + +static struct EpsonCmd epson_cmd[] = { + {"A1",'I', 0 ,'F','S', 0 ,'G', 0 ,'R', 0 ,'A', 0 ,{ 0, 0, 0}, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"A2",'I', 0 ,'F','S', 0 ,'G','D','R','H','A','L',{-3, 3, 0},'Z','B', 0 ,'@', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B1",'I', 0 ,'F','S','C','G','D','R', 0 ,'A', 0 ,{ 0, 0, 0}, 0 ,'B', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B2",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z','B', 0 ,'@', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B3",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z','B','M','@', 0 , 0 , 0 , 0 , 0 , 0 ,'m','f','e', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B4",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z','B','M','@','g','d', 0 ,'z','Q','b','m','f','e', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B5",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z','B','M','@','g','d','K','z','Q','b','m','f','e', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B6",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z','B','M','@','g','d','K','z','Q','b','m','f','e', 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"B7",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-4, 3, 0},'Z','B','M','@','g','d','K','z','Q','b','m','f','e','\f', 0 ,'!','s','N', 0 , 0 ,'t', 0 , 0 ,'I','F'}, + {"B8",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-4, 3, 0},'Z','B','M','@','g','d','K','z','Q','b','m','f','e','\f', 0x19,'!','s','N', 0 , 0 ,'t','p','q','I','F'}, +/* XXX 'f' probably not supported on F5 */ + {"F5",'I', 0 ,'F','S','C','G','D','R','H','A','L',{-3, 3, 0},'Z', 0 ,'M','@','g','d','K','z','Q', 0 ,'m','f','e','\f', 0 , 0 , 0 ,'N','T','P', 0 , 0 , 0 , 0 , 0 }, + {"D1",'I','i','F', 0 ,'C','G','D','R', 0 ,'A', 0 ,{ 0, 0, 0},'Z', 0 , 0 ,'@','g','d', 0 ,'z', 0 , 0 ,'m','f', 0 , 0 , 0 ,'!', 0 , 0 , 0 , 0 ,'t', 0 , 0 , 0 , 0 }, + {"D2",'I','i','F', 0 ,'C','G','D','R', 0 ,'A', 0 ,{ 0, 0, 0},'Z', 0 , 0 ,'@','g','d', 0 ,'z', 0 , 0 ,'m','f','e', 0 , 0 ,'!', 0 ,'N', 0 , 0 ,'t', 0 , 0 , 0 , 0 }, + {"D7",'I','i','F', 0 ,'C','G','D','R', 0 ,'A', 0 ,{ 0, 0, 0},'Z', 0 , 0 ,'@','g','d', 0 ,'z', 0 , 0 , 0 ,'f','e','\f', 0 ,'!', 0 ,'N', 0 , 0 ,'t', 0 , 0 , 0 , 0 }, + {"D8",'I','i','F', 0 ,'C','G','D','R', 0 ,'A', 0 ,{ 0, 0, 0},'Z', 0 , 0 ,'@','g','d', 0 ,'z', 0 , 0 , 0 ,'f','e','\f', 0 ,'!', 0 ,'N', 0 , 0 ,'t', 0 , 0 , 0 , 0 }, +}; + + + +extern struct mode_param mode_params[]; + +/* Define the different scan sources */ + +#define FBF_STR SANE_I18N("Flatbed") +#define TPU_STR SANE_I18N("Transparency Unit") +#define ADF_STR SANE_I18N("Automatic Document Feeder") + +/* + * source list need one dummy entry (save device settings is crashing). + * NOTE: no const - this list gets created while exploring the capabilities + * of the scanner. + */ + +extern SANE_String_Const source_list[]; + +static int film_params[] = { 0, 1, 2, 3 }; + +extern const int halftone_params[]; + +static const int dropout_params[] = { + 0x00, /* none */ + 0x10, /* red */ + 0x20, /* green */ + 0x30 /* blue */ +}; + +/* + * Color correction: + * One array for the actual parameters that get sent to the scanner (color_params[]), + * one array for the strings that get displayed in the user interface (correction_list[]) + * and one array to mark the user defined color correction (correction_userdefined[]). + */ +static const int correction_params[] = { + 0x00, /* None */ + 0x01, /* Auto */ + 0x01, /* User defined */ +}; + +void +e2_dev_init(Epson_Device *dev, const char *devname, int conntype) +{ + DBG(5, "%s\n", __func__); + + dev->name = NULL; + dev->model = NULL; + dev->connection = conntype; + + dev->model_id = 0; + + dev->sane.name = devname; + dev->sane.model = NULL; + + dev->sane.type = "flatbed scanner"; + dev->sane.vendor = "Epson"; + + dev->optical_res = 0; /* just to have it initialized */ + dev->color_shuffle = SANE_FALSE; + dev->extension = SANE_FALSE; + dev->use_extension = SANE_FALSE; + + dev->need_color_reorder = SANE_FALSE; + dev->need_double_vertical = SANE_FALSE; + + dev->cct_profile = &epson_cct_profiles[0]; /* default profile */ + + dev->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; + + /* Change default level when using a network connection */ + if (dev->connection == SANE_EPSON_NET) + dev->cmd = &epson_cmd[EPSON_LEVEL_B7]; + + dev->last_res = 0; + dev->last_res_preview = 0; /* set resolution to safe values */ + + dev->res_list_size = 0; + dev->res_list = NULL; +} + +SANE_Status +e2_dev_post_init(struct Epson_Device *dev) +{ + int i; + + DBG(5, "%s\n", __func__); + + /* find cct model id */ + for (i = 0; epson_cct_models[i].name != NULL; i++) { + if (strcmp(epson_cct_models[i].name, dev->model) == 0) { + dev->model_id = epson_cct_models[i].id; + break; + } + } + + /* find cct profile */ + for (i = 0; epson_cct_profiles[i].model != 0xFF; i++) { + if (epson_cct_profiles[i].model == dev->model_id) { + dev->cct_profile = &epson_cct_profiles[i]; + break; + } + } + + DBG(1, "CCT model id is 0x%02x, profile offset %d\n", dev->model_id, i); + + /* If we have been unable to obtain supported resolutions + * due to the fact we are on the network transport, + * add some convenient ones + */ + + if (dev->res_list_size == 0) { + + int val = (dev->dpi_range.min < 150) ? 150 : dev->dpi_range.min; + + DBG(1, "cannot obtain resolution list, faking (%d-%d)\n", + dev->dpi_range.min, dev->dpi_range.max); + + if (dev->dpi_range.min <= 25) + e2_add_resolution(dev, 25); + + if (dev->dpi_range.min <= 50) + e2_add_resolution(dev, 50); + + if (dev->dpi_range.min <= 75) + e2_add_resolution(dev, 75); + + if (dev->dpi_range.min <= 100) + e2_add_resolution(dev, 100); + + while (val <= dev->dpi_range.max) { + e2_add_resolution(dev, val); + val *= 2; + } + } + + /* the device is more capable, integrating resolution list */ + if (dev->dpi_range.max > dev->res_list[dev->res_list_size - 1]) { + + int val = dev->res_list[dev->res_list_size - 1] * 2; + + DBG(1, "integrating resolution list (%d-%d)\n", + val, dev->dpi_range.max); + + while (val <= dev->dpi_range.max) { + e2_add_resolution(dev, val); + val *= 2; + } + } + + + /* + * Copy the resolution list to the resolution_list array so that the frontend can + * display the correct values + */ + + dev->resolution_list = + malloc((dev->res_list_size + 1) * sizeof(SANE_Word)); + + if (dev->resolution_list == NULL) { + return SANE_STATUS_NO_MEM; + } + + *(dev->resolution_list) = dev->res_list_size; + memcpy(&(dev->resolution_list[1]), dev->res_list, + dev->res_list_size * sizeof(SANE_Word)); + + /* establish defaults */ + dev->need_reset_on_source_change = SANE_FALSE; + + if (e2_dev_model(dev, "ES-9000H") || e2_dev_model(dev, "GT-30000")) { + dev->cmd->set_focus_position = 0; + dev->cmd->feed = 0x19; + } + + if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650") + || e2_dev_model(dev, "Perfection1640") || e2_dev_model(dev, "GT-8700")) { + dev->cmd->feed = 0; + dev->cmd->set_focus_position = 0; + dev->need_reset_on_source_change = SANE_TRUE; + } + + return SANE_STATUS_GOOD; +} + + +SANE_Bool +e2_dev_model(Epson_Device *dev, const char *model) +{ + if (dev->model == NULL) + return SANE_FALSE; + + if (strncmp(dev->model, model, strlen(model)) == 0) + return SANE_TRUE; + + return SANE_FALSE; +} + +void +e2_set_cmd_level(SANE_Handle handle, unsigned char *level) +{ + Epson_Scanner *s = (Epson_Scanner *) handle; + Epson_Device *dev = s->hw; + + int n; + + DBG(1, "%s: %c%c\n", __func__, level[0], level[1]); + + /* set command type and level */ + for (n = 0; n < NELEMS(epson_cmd); n++) { + char type_level[3]; + sprintf(type_level, "%c%c", level[0], level[1]); + if (!strncmp(type_level, epson_cmd[n].level, 2)) + break; + } + + if (n < NELEMS(epson_cmd)) { + dev->cmd = &epson_cmd[n]; + } else { + dev->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; + DBG(1, " unknown type %c or level %c, using %s\n", + level[0], level[1], dev->cmd->level); + } + + s->hw->level = dev->cmd->level[1] - '0'; +} + +SANE_Status +e2_set_model(Epson_Scanner * s, unsigned char *model, size_t len) +{ + unsigned char *buf; + unsigned char *p; + struct Epson_Device *dev = s->hw; + + buf = malloc(len + 1); + if (buf == NULL) + return SANE_STATUS_NO_MEM; + + memcpy(buf, model, len); + buf[len] = '\0'; + + p = &buf[len - 1]; + + while (*p == ' ') { + *p = '\0'; + p--; + } + + if (dev->model) + free(dev->model); + + dev->model = strndup((const char *) buf, len); + dev->sane.model = dev->model; + + DBG(10, "%s: model is '%s'\n", __func__, dev->model); + + free(buf); + + return SANE_STATUS_GOOD; +} + +SANE_Status +e2_add_resolution(Epson_Device *dev, int r) +{ + dev->res_list_size++; + dev->res_list = (SANE_Int *) realloc(dev->res_list, + dev->res_list_size * + sizeof(SANE_Word)); + + DBG(10, "%s: add (dpi): %d\n", __func__, r); + + if (dev->res_list == NULL) + return SANE_STATUS_NO_MEM; + + dev->res_list[dev->res_list_size - 1] = (SANE_Int) r; + + return SANE_STATUS_GOOD; +} + +void +e2_set_fbf_area(Epson_Scanner * s, int x, int y, int unit) +{ + struct Epson_Device *dev = s->hw; + + if (x == 0 || y == 0) + return; + + dev->fbf_x_range.min = 0; + dev->fbf_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); + dev->fbf_x_range.quant = 0; + + dev->fbf_y_range.min = 0; + dev->fbf_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); + dev->fbf_y_range.quant = 0; + + DBG(5, "%s: %f,%f %f,%f %d [mm]\n", + __func__, + SANE_UNFIX(dev->fbf_x_range.min), + SANE_UNFIX(dev->fbf_y_range.min), + SANE_UNFIX(dev->fbf_x_range.max), + SANE_UNFIX(dev->fbf_y_range.max), unit); +} + +void +e2_set_adf_area(struct Epson_Scanner *s, int x, int y, int unit) +{ + struct Epson_Device *dev = s->hw; + + dev->adf_x_range.min = 0; + dev->adf_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); + dev->adf_x_range.quant = 0; + + dev->adf_y_range.min = 0; + dev->adf_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); + dev->adf_y_range.quant = 0; + + DBG(5, "%s: %f,%f %f,%f %d [mm]\n", + __func__, + SANE_UNFIX(dev->adf_x_range.min), + SANE_UNFIX(dev->adf_y_range.min), + SANE_UNFIX(dev->adf_x_range.max), + SANE_UNFIX(dev->adf_y_range.max), unit); +} + +void +e2_set_tpu_area(struct Epson_Scanner *s, int x, int y, int unit) +{ + struct Epson_Device *dev = s->hw; + + dev->tpu_x_range.min = 0; + dev->tpu_x_range.max = SANE_FIX(x * MM_PER_INCH / unit); + dev->tpu_x_range.quant = 0; + + dev->tpu_y_range.min = 0; + dev->tpu_y_range.max = SANE_FIX(y * MM_PER_INCH / unit); + dev->tpu_y_range.quant = 0; + + DBG(5, "%s: %f,%f %f,%f %d [mm]\n", + __func__, + SANE_UNFIX(dev->tpu_x_range.min), + SANE_UNFIX(dev->tpu_y_range.min), + SANE_UNFIX(dev->tpu_x_range.max), + SANE_UNFIX(dev->tpu_y_range.max), unit); +} + +void +e2_add_depth(Epson_Device * dev, SANE_Word depth) +{ + if (depth > dev->maxDepth) + dev->maxDepth = depth; + + dev->depth_list[0]++; + dev->depth_list[dev->depth_list[0]] = depth; +} + +/* A little helper function to correct the extended status reply + * gotten from scanners with known buggy firmware. + */ +static void +fix_up_extended_status_reply(Epson_Scanner * s, unsigned char *buf) +{ + if (e2_model(s, "ES-9000H") || e2_model(s, "GT-30000")) { + DBG(1, "fixing up buggy ADF max scan dimensions.\n"); + buf[2] = 0xB0; + buf[3] = 0x6D; + buf[4] = 0x60; + buf[5] = 0x9F; + } +} + + +SANE_Status +e2_discover_capabilities(Epson_Scanner *s) +{ + SANE_Status status; + + unsigned char scanner_status; + Epson_Device *dev = s->hw; + + SANE_String_Const *source_list_add = source_list; + + DBG(5, "%s\n", __func__); + + /* always add flatbed */ + *source_list_add++ = FBF_STR; + + /* ESC I, request identity + * this must be the first command on the FilmScan 200 + */ + if (dev->connection != SANE_EPSON_NET) { + unsigned int n, k, x = 0, y = 0; + unsigned char *buf, *area; + size_t len; + + status = esci_request_identity(s, &buf, &len); + if (status != SANE_STATUS_GOOD) + return status; + + e2_set_cmd_level(s, &buf[0]); + + /* Setting available resolutions and xy ranges for sane frontend. */ + /* cycle thru the resolutions, saving them in a list */ + for (n = 2, k = 0; n < len; n += k) { + + area = buf + n; + + switch (*area) { + case 'R': + { + int val = area[2] << 8 | area[1]; + + status = e2_add_resolution(s->hw, val); + k = 3; + continue; + } + case 'A': + { + x = area[2] << 8 | area[1]; + y = area[4] << 8 | area[3]; + + DBG(1, "maximum scan area: %dx%d\n", x, y); + k = 5; + continue; + } + default: + break; + } + } + + /* min and max dpi */ + dev->dpi_range.min = dev->res_list[0]; + dev->dpi_range.max = dev->res_list[dev->res_list_size - 1]; + dev->dpi_range.quant = 0; + + e2_set_fbf_area(s, x, y, dev->dpi_range.max); + + free(buf); + } + + /* ESC F, request status */ + status = esci_request_status(s, &scanner_status); + if (status != SANE_STATUS_GOOD) + return status;; + + /* set capabilities */ + if (scanner_status & STATUS_OPTION) + dev->extension = SANE_TRUE; + + if (scanner_status & STATUS_EXT_COMMANDS) + dev->extended_commands = 1; + + /* + * Extended status flag request (ESC f). + * this also requests the scanner device name from the the scanner. + * It seems unsupported on the network transport (CX11NF/LP-A500). + * so avoid it if the device support request_extended_identity. + */ + + if (dev->cmd->request_extended_status && !dev->cmd->request_extended_identity) { + + unsigned char *es; + size_t es_len; + + DBG(1, "detection with request_extended_status\n"); + + status = esci_request_extended_status(s, &es, &es_len); + if (status != SANE_STATUS_GOOD) + return status; + + /* + * Get the device name and copy it to dev->sane.model. + * The device name starts at es[0x1A] and is up to 16 bytes long + * We are overwriting whatever was set previously! + */ + if (es_len == CMD_SIZE_EXT_STATUS) /* 42 */ + e2_set_model(s, es + 0x1A, 16); + + if (es[0] & EXT_STATUS_LID) + DBG(1, "LID detected\n"); + + if (es[0] & EXT_STATUS_PB) + DBG(1, "push button detected\n"); + else + dev->cmd->request_push_button_status = 0; + + /* Flatbed */ + e2_set_fbf_area(s, es[13] << 8 | es[12], es[15] << 8 | es[14], + dev->dpi_range.max); + + /* ADF */ + if (dev->extension && (es[1] & EXT_STATUS_IST)) { + DBG(1, "ADF detected\n"); + + fix_up_extended_status_reply(s, es); + + dev->duplex = (es[0] & EXT_STATUS_ADFS) != 0; + if (dev->duplex) + DBG(1, "ADF supports duplex\n"); + + if (es[1] & EXT_STATUS_EN) { + DBG(1, "ADF is enabled\n"); + dev->x_range = &dev->adf_x_range; + dev->y_range = &dev->adf_y_range; + } + + e2_set_adf_area(s, es[3] << 8 | es[2], + es[5] << 8 | es[4], + dev->dpi_range.max); + *source_list_add++ = ADF_STR; + + dev->ADF = SANE_TRUE; + } + + /* TPU */ + if (dev->extension && (es[6] & EXT_STATUS_IST)) { + DBG(1, "TPU detected\n"); + + if (es[6] & EXT_STATUS_EN) { + DBG(1, "TPU is enabled\n"); + dev->x_range = &dev->tpu_x_range; + dev->y_range = &dev->tpu_y_range; + } + + e2_set_tpu_area(s, + (es[8] << 8 | es[7]), + (es[10] << 8 | es[9]), + dev->dpi_range.max); + + *source_list_add++ = TPU_STR; + dev->TPU = SANE_TRUE; + } + + free(es); + + *source_list_add = NULL; /* add end marker to source list */ + } + + /* FS I, request extended identity (B7/B8) */ + if (dev->extended_commands && dev->cmd->request_extended_identity) { + unsigned char buf[80]; + + DBG(1, "detection with request_extended_identity\n"); + + status = esci_request_extended_identity(s, buf); + if (status != SANE_STATUS_GOOD) + return status; + + e2_set_cmd_level(s, &buf[0]); + + dev->maxDepth = buf[67]; + + /* set model name. it will probably be + * different than the one reported by request_identity + * for the same unit (i.e. LP-A500 vs CX11) . + */ + e2_set_model(s, &buf[46], 16); + + dev->optical_res = le32atoh(&buf[4]); + + dev->dpi_range.min = le32atoh(&buf[8]); + dev->dpi_range.max = le32atoh(&buf[12]); + + /* Flatbed */ + e2_set_fbf_area(s, le32atoh(&buf[20]), + le32atoh(&buf[24]), dev->optical_res); + + /* ADF */ + if (le32atoh(&buf[28]) > 0) { + e2_set_adf_area(s, le32atoh(&buf[28]), + le32atoh(&buf[32]), dev->optical_res); + + if (!dev->ADF) { + *source_list_add++ = ADF_STR; + dev->ADF = SANE_TRUE; + } + } + + /* TPU */ + if (e2_model(s, "GT-X800")) { + if (le32atoh(&buf[68]) > 0 && !dev->TPU) { + e2_set_tpu_area(s, + le32atoh(&buf[68]), + le32atoh(&buf[72]), + dev->optical_res); + + *source_list_add++ = TPU_STR; + dev->TPU = SANE_TRUE; + dev->TPU2 = SANE_TRUE; + } + } + + if (le32atoh(&buf[36]) > 0 && !dev->TPU) { + e2_set_tpu_area(s, + le32atoh(&buf[36]), + le32atoh(&buf[40]), dev->optical_res); + + *source_list_add++ = TPU_STR; + dev->TPU = SANE_TRUE; + } + + *source_list_add = NULL; /* add end marker to source list */ + + } else { + DBG(1, "no command available to detect capabilities\n"); + } + + /* + * request identity 2 (ESC i), if available will + * get the information from the scanner and store it in dev + */ + + if (dev->cmd->request_identity2 && dev->connection != SANE_EPSON_NET) { + unsigned char *buf; + status = esci_request_identity2(s, &buf); + if (status != SANE_STATUS_GOOD) + return status; + + /* the first two bytes of the buffer contain the optical resolution */ + dev->optical_res = buf[1] << 8 | buf[0]; + + /* + * the 4th and 5th byte contain the line distance. Both values have to + * be identical, otherwise this software can not handle this scanner. + */ + if (buf[4] != buf[5]) { + status = SANE_STATUS_INVAL; + return status; + } + + dev->max_line_distance = buf[4]; + } + + /* + * Check for the max. supported color depth and assign + * the values to the bitDepthList. + */ + dev->depth_list = malloc(sizeof(SANE_Word) * 4); + if (dev->depth_list == NULL) { + DBG(1, "out of memory (line %d)\n", __LINE__); + return SANE_STATUS_NO_MEM; + } + + dev->depth_list[0] = 0; + + /* maximum depth discovery */ + DBG(3, "discovering max depth, NAKs are expected\n"); + + if (dev->maxDepth >= 16 || dev->maxDepth == 0) { + if (esci_set_data_format(s, 16) == SANE_STATUS_GOOD) + e2_add_depth(dev, 16); + } + + if (dev->maxDepth >= 14 || dev->maxDepth == 0) { + if (esci_set_data_format(s, 14) == SANE_STATUS_GOOD) + e2_add_depth(dev, 14); + } + + if (dev->maxDepth >= 12 || dev->maxDepth == 0) { + if (esci_set_data_format(s, 12) == SANE_STATUS_GOOD) + e2_add_depth(dev, 12); + } + + /* add default depth */ + e2_add_depth(dev, 8); + + DBG(1, "maximum supported color depth: %d\n", dev->maxDepth); + + /* + * Check for "request focus position" command. If this command is + * supported, then the scanner does also support the "set focus + * position" command. + * XXX ??? + */ + + if (esci_request_focus_position(s, &s->currentFocusPosition) == + SANE_STATUS_GOOD) { + DBG(1, "setting focus is supported\n"); + dev->focusSupport = SANE_TRUE; + s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE; + + /* reflect the current focus position in the GUI */ + if (s->currentFocusPosition < 0x4C) { + /* focus on glass */ + s->val[OPT_FOCUS].w = 0; + } else { + /* focus 2.5mm above glass */ + s->val[OPT_FOCUS].w = 1; + } + + } else { + DBG(1, "setting focus is not supported\n"); + dev->focusSupport = SANE_FALSE; + s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE; + s->val[OPT_FOCUS].w = 0; /* on glass - just in case */ + } + + /* Set defaults for no extension. */ + dev->x_range = &dev->fbf_x_range; + dev->y_range = &dev->fbf_y_range; + + /* + * Correct for a firmware bug in some Perfection 1650 scanners: + * Firmware version 1.08 reports only half the vertical scan area, we have + * to double the number. To find out if we have to do this, we just compare + * is the vertical range is smaller than the horizontal range. + */ + + if ((dev->x_range->max - dev->x_range->min) > + (dev->y_range->max - dev->y_range->min)) { + DBG(1, "found buggy scan area, doubling it.\n"); + dev->y_range->max += (dev->y_range->max - dev->y_range->min); + dev->need_double_vertical = SANE_TRUE; + dev->need_color_reorder = SANE_TRUE; + } + + /* FS F, request scanner status */ + if (dev->extended_commands) { + unsigned char buf[16]; + + status = esci_request_scanner_status(s, buf); + if (status != SANE_STATUS_GOOD) + return status; + } + + return status; +} + + +SANE_Status +e2_set_extended_scanning_parameters(Epson_Scanner * s) +{ + unsigned char buf[64]; + + const struct mode_param *mparam; + + DBG(1, "%s\n", __func__); + + mparam = &mode_params[s->val[OPT_MODE].w]; + + memset(buf, 0x00, sizeof(buf)); + + /* ESC R, resolution */ + htole32a(&buf[0], s->val[OPT_RESOLUTION].w); + htole32a(&buf[4], s->val[OPT_RESOLUTION].w); + + /* ESC A, scanning area */ + htole32a(&buf[8], s->left); + htole32a(&buf[12], s->top); + htole32a(&buf[16], s->params.pixels_per_line); + htole32a(&buf[20], s->params.lines); + + /* + * The byte sequence mode was introduced in B5, + *for B[34] we need line sequence mode + */ + + /* ESC C, set color */ + if ((s->hw->cmd->level[0] == 'D' + || (s->hw->cmd->level[0] == 'B' && s->hw->level >= 5)) + && mparam->flags == 0x02) { + buf[24] = 0x13; + } else { + buf[24] = mparam->flags | (mparam->dropout_mask + & dropout_params[s-> + val[OPT_DROPOUT]. + w]); + } + + /* ESC D, set data format */ + mparam = &mode_params[s->val[OPT_MODE].w]; + buf[25] = mparam->depth; + + /* ESC e, control option */ + if (s->hw->extension) { + + char extensionCtrl; + extensionCtrl = (s->hw->use_extension ? 1 : 0); + if (s->hw->use_extension && (s->val[OPT_ADF_MODE].w == 1)) + extensionCtrl = 2; + + /* Test for TPU2 + * Epson Perfection 4990 Command Specifications + * JZIS-0075 Rev. A, page 31 + */ + if (s->hw->use_extension && s->hw->TPU2) + extensionCtrl = 5; + + /* ESC e */ + buf[26] = extensionCtrl; + + /* XXX focus */ + } + + /* ESC g, scanning mode (normal or high speed) */ + if (s->val[OPT_PREVIEW].w) + buf[27] = 1; /* High speed */ + else + buf[27] = 0; + + /* ESC d, block line number */ + buf[28] = s->lcount; + + /* ESC Z, set gamma correction */ + buf[29] = 0x01; /* default */ + + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_GAMMA_CORRECTION].cap)) { + char val; + if (s->hw->cmd->level[0] == 'D') { + /* The D1 level has only the two user defined gamma + * settings. + */ + val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; + } else { + val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; + + /* + * If "Default" is selected then determine the actual value + * to send to the scanner: If bilevel mode, just send the + * value from the table (0x01), for grayscale or color mode + * add one and send 0x02. + */ + + if (s->val[OPT_GAMMA_CORRECTION].w == 0) { + val += mparam->depth == 1 ? 0 : 1; + } + } + + buf[29] = val; + } + + /* ESC L, set brightness */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_BRIGHTNESS].cap)) + buf[30] = s->val[OPT_BRIGHTNESS].w; + + /* ESC B, set halftoning mode / halftone processing */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_HALFTONE].cap)) + buf[32] = halftone_params[s->val[OPT_HALFTONE].w]; + + /* ESC s, auto area segmentation */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_AAS].cap)) + buf[34] = s->val[OPT_AAS].w; + + /* ESC Q, set sharpness / sharpness control */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_SHARPNESS].cap)) + buf[35] = s->val[OPT_SHARPNESS].w; + + /* ESC K, set data order / mirroring */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_MIRROR].cap)) + buf[36] = s->val[OPT_MIRROR].w; + + /* ESC N, film type */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_FILM_TYPE].cap)) + buf[37] = film_params[s->val[OPT_FILM_TYPE].w]; + + /* ESC M, color correction */ + buf[31] = correction_params[s->val[OPT_COLOR_CORRECTION].w]; + + /* ESC t, threshold */ + buf[33] = s->val[OPT_THRESHOLD].w; + + return esci_set_scanning_parameter(s, buf); +} + +SANE_Status +e2_set_scanning_parameters(Epson_Scanner * s) +{ + SANE_Status status; + struct mode_param *mparam = &mode_params[s->val[OPT_MODE].w]; + unsigned char color_mode; + + DBG(1, "%s\n", __func__); + + /* + * There is some undocumented special behavior with the TPU enable/disable. + * TPU power ESC e status + * on 0 NAK + * on 1 ACK + * off 0 ACK + * off 1 NAK + * + * It makes no sense to scan with TPU powered on and source flatbed, because + * light will come from both sides. + */ + + if (s->hw->extension) { + + int extensionCtrl; + extensionCtrl = (s->hw->use_extension ? 1 : 0); + if (s->hw->use_extension && (s->val[OPT_ADF_MODE].w == 1)) + extensionCtrl = 2; + + status = esci_control_extension(s, extensionCtrl); + if (status != SANE_STATUS_GOOD) { + DBG(1, "you may have to power %s your TPU\n", + s->hw->use_extension ? "on" : "off"); + DBG(1, + "and you may also have to restart the SANE frontend.\n"); + return status; + } + + /* XXX use request_extended_status and analyze + * buffer to set the scan area for + * ES-9000H and GT-30000 + */ + + /* + * set the focus position according to the extension used: + * if the TPU is selected, then focus 2.5mm above the glass, + * otherwise focus on the glass. Scanners that don't support + * this feature, will just ignore these calls. + */ + + if (s->hw->focusSupport == SANE_TRUE) { + if (s->val[OPT_FOCUS].w == 0) { + DBG(1, "setting focus to glass surface\n"); + esci_set_focus_position(s, 0x40); + } else { + DBG(1, + "setting focus to 2.5mm above glass\n"); + esci_set_focus_position(s, 0x59); + } + } + } + + /* ESC C, Set color */ + color_mode = mparam->flags | (mparam->dropout_mask + & dropout_params[s->val[OPT_DROPOUT]. + w]); + + /* + * The byte sequence mode was introduced in B5, for B[34] we need line sequence mode + * XXX Check what to do for the FilmScan 200 + */ + if ((s->hw->cmd->level[0] == 'D' + || (s->hw->cmd->level[0] == 'B' && s->hw->level >= 5)) + && mparam->flags == 0x02) + color_mode = 0x13; + + status = esci_set_color_mode(s, color_mode); + if (status != SANE_STATUS_GOOD) + return status; + + /* ESC D, set data format */ + DBG(1, "%s: setting data format to %d bits\n", __func__, + mparam->depth); + status = esci_set_data_format(s, mparam->depth); + if (status != SANE_STATUS_GOOD) + return status; + + /* ESC B, set halftoning mode */ + if (s->hw->cmd->set_halftoning + && SANE_OPTION_IS_ACTIVE(s->opt[OPT_HALFTONE].cap)) { + status = esci_set_halftoning(s, + halftone_params[s-> + val + [OPT_HALFTONE]. + w]); + if (status != SANE_STATUS_GOOD) + return status; + } + + /* ESC L, set brightness */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_BRIGHTNESS].cap)) { + status = esci_set_bright(s, s->val[OPT_BRIGHTNESS].w); + if (status != SANE_STATUS_GOOD) + return status; + } + + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_AAS].cap)) { + status = esci_set_auto_area_segmentation(s, + s->val[OPT_AAS].w); + if (status != SANE_STATUS_GOOD) + return status; + } + + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_FILM_TYPE].cap)) { + status = esci_set_film_type(s, + film_params[s->val[OPT_FILM_TYPE].w]); + + if (status != SANE_STATUS_GOOD) + return status; + } + + if (s->hw->cmd->set_gamma + && SANE_OPTION_IS_ACTIVE(s->opt[OPT_GAMMA_CORRECTION].cap)) { + int val; + if (s->hw->cmd->level[0] == 'D') { + /* + * The D1 level has only the two user defined gamma + * settings. + */ + val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; + } else { + val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; + + /* + * If "Default" is selected then determine the actual value + * to send to the scanner: If bilevel mode, just send the + * value from the table (0x01), for grayscale or color mode + * add one and send 0x02. + */ + +/* if( s->val[ OPT_GAMMA_CORRECTION].w <= 1) { */ + if (s->val[OPT_GAMMA_CORRECTION].w == 0) { + val += mparam->depth == 1 ? 0 : 1; + } + } + + status = esci_set_gamma(s, val); + if (status != SANE_STATUS_GOOD) + return status; + } + + if (s->hw->cmd->set_threshold != 0 + && SANE_OPTION_IS_ACTIVE(s->opt[OPT_THRESHOLD].cap)) { + status = esci_set_threshold(s, s->val[OPT_THRESHOLD].w); + if (status != SANE_STATUS_GOOD) + return status; + } + + /* XXX ESC Z here */ + + /* ESC M, set color correction */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_COLOR_CORRECTION].cap)) { + + status = esci_set_color_correction(s, + correction_params[s->val[OPT_COLOR_CORRECTION].w]); + + if (status != SANE_STATUS_GOOD) + return status; + } + + /* ESC Q, set sharpness */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_SHARPNESS].cap)) { + + status = esci_set_sharpness(s, s->val[OPT_SHARPNESS].w); + if (status != SANE_STATUS_GOOD) + return status; + } + + /* ESC g, set scanning mode */ + if (s->val[OPT_PREVIEW].w) + status = esci_set_speed(s, 1); + else + status = esci_set_speed(s, 0); + + if (status != SANE_STATUS_GOOD) + return status; + + /* ESC K, set data order */ + if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_MIRROR].cap)) { + status = esci_mirror_image(s, s->val[OPT_MIRROR].w); + if (status != SANE_STATUS_GOOD) + return status; + } + + /* ESC R */ + status = esci_set_resolution(s, s->val[OPT_RESOLUTION].w, + s->val[OPT_RESOLUTION].w); + if (status != SANE_STATUS_GOOD) + return status; + + /* ESC H, set zoom */ + /* not implemented */ + + /* ESC A, set scanning area */ + + /* + * Modify the scan area: If the scanner requires color shuffling, then we try to + * scan more lines to compensate for the lines that will be removed from the scan + * due to the color shuffling algorithm. + */ + + if (s->hw->color_shuffle == SANE_TRUE) { + + unsigned int lines = s->params.lines + (2 * s->line_distance); + int top = s->top - (1 * s->line_distance); + + if (top < 0) + top = 0; + + status = esci_set_scan_area(s, s->left, top, + s->params.pixels_per_line, + lines); + + } else { + + status = esci_set_scan_area(s, s->left, s->top, + s->params.pixels_per_line, + s->params.lines); + } + + if (status != SANE_STATUS_GOOD) + return status; + + /* ESC d, set block line number / set line counter */ + status = esci_set_lcount(s, s->lcount); + if (status != SANE_STATUS_GOOD) + return status; + + return SANE_STATUS_GOOD; +} + +void +e2_setup_block_mode(Epson_Scanner * s) +{ + int maxreq; + + DBG(5, "%s\n", __func__); + + s->block = SANE_TRUE; + + if (s->hw->connection == SANE_EPSON_SCSI) + maxreq = sanei_scsi_max_request_size; + else if (s->hw->connection == SANE_EPSON_USB) + maxreq = 128 * 1024; + else + maxreq = 32 * 1024; + + /* XXX verify if this can b extended to other models */ + if (s->hw->connection == SANE_EPSON_NET && e2_model(s, "LP-A500")) + maxreq = 64 * 1024; + + s->lcount = maxreq / s->params.bytes_per_line; + + DBG(1, "max req size: %d, line count: %d\n", maxreq, s->lcount); + + /* XXX investigate this */ + if (s->lcount < 3 && e2_model(s, "GT-X800")) { + s->lcount = 21; + DBG(17, + "%s: set lcount = %i bigger than sanei_scsi_max_request_size\n", + __func__, s->lcount); + } + + if (s->lcount >= 255) + s->lcount = 255; + + /* XXX why this? */ + if (s->hw->TPU && s->hw->use_extension && s->lcount > 32) + s->lcount = 32; + + /* + * The D1 series of scanners only allow an even line number + * for bi-level scanning. If a bit depth of 1 is selected, then + * make sure the next lower even number is selected. + */ + + /* XXX check bith depth? */ + if (s->hw->cmd->level[0] == 'D' && s->lcount > 3 && s->lcount % 2) + s->lcount -= 1; + + DBG(1, "final line count is %d\n", s->lcount); +} + +SANE_Status +e2_init_parameters(Epson_Scanner * s) +{ + int dpi, bytes_per_pixel; + struct mode_param *mparam; + + DBG(5, "%s\n", __func__); + + memset(&s->params, 0, sizeof(SANE_Parameters)); + + dpi = s->val[OPT_RESOLUTION].w; + + mparam = &mode_params[s->val[OPT_MODE].w]; + + if (SANE_UNFIX(s->val[OPT_BR_Y].w) == 0 || + SANE_UNFIX(s->val[OPT_BR_X].w) == 0) + return SANE_STATUS_INVAL; + + s->left = ((SANE_UNFIX(s->val[OPT_TL_X].w) / MM_PER_INCH) * + s->val[OPT_RESOLUTION].w) + 0.5; + + s->top = ((SANE_UNFIX(s->val[OPT_TL_Y].w) / MM_PER_INCH) * + s->val[OPT_RESOLUTION].w) + 0.5; + + s->params.pixels_per_line = + ((SANE_UNFIX(s->val[OPT_BR_X].w - + s->val[OPT_TL_X].w) / MM_PER_INCH) * dpi) + 0.5; + s->params.lines = + ((SANE_UNFIX(s->val[OPT_BR_Y].w - + s->val[OPT_TL_Y].w) / MM_PER_INCH) * dpi) + 0.5; + + + DBG(1, "%s: resolution = %d, preview = %d\n", + __func__, s->val[OPT_RESOLUTION].w, s->val[OPT_PREVIEW].w); + + DBG(1, "%s: %p %p tlx %f tly %f brx %f bry %f [mm]\n", + __func__, (void *) s, (void *) s->val, + SANE_UNFIX(s->val[OPT_TL_X].w), SANE_UNFIX(s->val[OPT_TL_Y].w), + SANE_UNFIX(s->val[OPT_BR_X].w), SANE_UNFIX(s->val[OPT_BR_Y].w)); + + /* + * Calculate bytes_per_pixel and bytes_per_line for + * any color depths. + * + * The default color depth is stored in mode_params.depth: + */ + + if (mode_params[s->val[OPT_MODE].w].depth == 1) + s->params.depth = 1; + else + s->params.depth = s->val[OPT_BIT_DEPTH].w; + + if (s->params.depth > 8) { + s->params.depth = 16; /* + * The frontends can only handle 8 or 16 bits + * for gray or color - so if it's more than 8, + * it gets automatically set to 16. This works + * as long as EPSON does not come out with a + * scanner that can handle more than 16 bits + * per color channel. + */ + } + + /* this works because it can only be set to 1, 8 or 16 */ + bytes_per_pixel = s->params.depth / 8; + if (s->params.depth % 8) { /* just in case ... */ + bytes_per_pixel++; + } + + /* pixels_per_line is rounded to the next 8bit boundary */ + s->params.pixels_per_line = s->params.pixels_per_line & ~7; + + s->params.last_frame = SANE_TRUE; + + switch (s->val[OPT_MODE].w) { + case MODE_BINARY: + case MODE_GRAY: + s->params.format = SANE_FRAME_GRAY; + s->params.bytes_per_line = + s->params.pixels_per_line * s->params.depth / 8; + break; + case MODE_COLOR: + s->params.format = SANE_FRAME_RGB; + s->params.bytes_per_line = + 3 * s->params.pixels_per_line * bytes_per_pixel; + break; +#ifdef SANE_FRAME_IR + case MODE_INFRARED: + s->params.format = SANE_FRAME_IR; + s->params.bytes_per_line = + s->params.pixels_per_line * s->params.depth / 8; + break; +#endif + } + + /* + * Calculate correction for line_distance in D1 scanner: + * Start line_distance lines earlier and add line_distance lines at the end + * + * Because the actual line_distance is not yet calculated we have to do this + * first. + */ + + s->hw->color_shuffle = SANE_FALSE; + + s->lines_written = 0; + s->color_shuffle_line = 0; + s->current_output_line = 0; + + if ((s->hw->optical_res != 0) && (mparam->depth == 8) + && (mparam->flags != 0)) { + + s->line_distance = + s->hw->max_line_distance * dpi / s->hw->optical_res; + + if (s->line_distance != 0) { + + s->hw->color_shuffle = SANE_TRUE; + + DBG(1, "%s: color shuffling required\n", __func__); + } + } + + /* + * If (s->top + s->params.lines) is larger than the max scan area, reset + * the number of scan lines: + * XXX: precalculate the maximum scanning area elsewhere (use dev max_y) + */ + + if (SANE_UNFIX(s->val[OPT_BR_Y].w) / MM_PER_INCH * dpi < + (s->params.lines + s->top)) { + s->params.lines = + ((int) SANE_UNFIX(s->val[OPT_BR_Y].w) / MM_PER_INCH * + dpi + 0.5) - s->top; + } + + s->block = SANE_FALSE; + s->lcount = 1; + + /* + * The set line count commands needs to be sent for certain scanners in + * color mode. The D1 level requires it, we are however only testing for + * 'D' and not for the actual numeric level. + */ + + if ((s->hw->cmd->level[0] == 'B') && (s->hw->level >= 5)) /* >= B5 */ + e2_setup_block_mode(s); + + else if ((s->hw->cmd->level[0] == 'B') && (s->hw->level == 4) /* B4 !color */ + && (!mode_params[s->val[OPT_MODE].w].color)) + e2_setup_block_mode(s); + + else if (s->hw->cmd->level[0] == 'D') /* Dx */ + e2_setup_block_mode(s); + + return (s->params.lines > 0) ? SANE_STATUS_GOOD : SANE_STATUS_INVAL; +} + +void +e2_wait_button(Epson_Scanner * s) +{ + DBG(5, "%s\n", __func__); + + s->hw->wait_for_button = SANE_TRUE; + + while (s->hw->wait_for_button == SANE_TRUE) { + unsigned char button_status = 0; + + if (s->canceling == SANE_TRUE) + s->hw->wait_for_button = SANE_FALSE; + + /* get the button status from the scanner */ + else if (esci_request_push_button_status(s, &button_status) == + SANE_STATUS_GOOD) { + if (button_status) + s->hw->wait_for_button = SANE_FALSE; + else + sleep(1); + } else { + /* we run into an error condition, just continue */ + s->hw->wait_for_button = SANE_FALSE; + } + } +} + +/* +SANE_Status +e2_check_extended_status(Epson_Scanner *s) +{ + + SANE_Status status = esci_request_scanner_status(s, buf); + if (status != SANE_STATUS_GOOD) + return status; + + if (buf[0] & FSF_STATUS_MAIN_WU) + + main -> 0 + fbf -> 3 + adf -> 1, 10 + tpu -> 2 +} +*/ + +SANE_Status +e2_check_warm_up(Epson_Scanner * s, SANE_Bool * wup) +{ + SANE_Status status; + + DBG(5, "%s\n", __func__); + + *wup = SANE_FALSE; + + if (s->hw->extended_commands) { + unsigned char buf[16]; + + status = esci_request_scanner_status(s, buf); + if (status != SANE_STATUS_GOOD) + return status; + + if (buf[0] & FSF_STATUS_MAIN_WU) + *wup = SANE_TRUE; + + } else { + unsigned char *es; + + /* this command is not available on some scanners */ + if (!s->hw->cmd->request_extended_status) + return SANE_STATUS_GOOD; + + status = esci_request_extended_status(s, &es, NULL); + if (status != SANE_STATUS_GOOD) + return status; + + if (es[0] & EXT_STATUS_WU) + *wup = SANE_TRUE; + + free(es); + } + + return status; +} + +SANE_Status +e2_wait_warm_up(Epson_Scanner * s) +{ + SANE_Status status; + SANE_Bool wup; + + DBG(5, "%s\n", __func__); + + s->retry_count = 0; + + while (1) { + + if (s->canceling) + return SANE_STATUS_CANCELLED; + + status = e2_check_warm_up(s, &wup); + if (status != SANE_STATUS_GOOD) + return status; + + if (wup == SANE_FALSE) + break; + + s->retry_count++; + + if (s->retry_count > SANE_EPSON_MAX_RETRIES) { + DBG(1, "max retry count exceeded (%d)\n", + s->retry_count); + return SANE_STATUS_DEVICE_BUSY; + } + sleep(5); + } + + return SANE_STATUS_GOOD; +} + +SANE_Status +e2_check_adf(Epson_Scanner * s) +{ + SANE_Status status; + + DBG(5, "%s\n", __func__); + + if (s->hw->use_extension == SANE_FALSE) + return SANE_STATUS_GOOD; + + if (s->hw->extended_commands) { + unsigned char buf[16]; + + status = esci_request_scanner_status(s, buf); + if (status != SANE_STATUS_GOOD) + return status; + + if (buf[1] & FSF_STATUS_ADF_PE) + return SANE_STATUS_NO_DOCS; + + if (buf[1] & FSF_STATUS_ADF_PJ) + return SANE_STATUS_JAMMED; + + } else { + unsigned char *buf, t; + + status = esci_request_extended_status(s, &buf, NULL); + if (status != SANE_STATUS_GOOD) + return status;; + + t = buf[1]; + + free(buf); + + if (t & EXT_STATUS_PE) + return SANE_STATUS_NO_DOCS; + + if (t & EXT_STATUS_PJ) + return SANE_STATUS_JAMMED; + } + + return SANE_STATUS_GOOD; +} + +SANE_Status +e2_start_std_scan(Epson_Scanner * s) +{ + SANE_Status status; + unsigned char params[2]; + + DBG(5, "%s\n", __func__); + + /* ESC g */ + params[0] = ESC; + params[1] = s->hw->cmd->start_scanning; + + e2_send(s, params, 2, 6 + (s->lcount * s->params.bytes_per_line), + &status); + + return status; +} + +SANE_Status +e2_start_ext_scan(Epson_Scanner * s) +{ + SANE_Status status; + unsigned char params[2]; + unsigned char buf[14]; + + DBG(5, "%s\n", __func__); + + params[0] = FS; + params[1] = 'G'; + + status = e2_txrx(s, params, 2, buf, 14); + if (status != SANE_STATUS_GOOD) + return status; + + if (buf[0] != STX) + return SANE_STATUS_INVAL; + + if (buf[1] & 0x80) { + DBG(1, "%s: fatal error\n", __func__); + return SANE_STATUS_IO_ERROR; + } + + s->ext_block_len = le32atoh(&buf[2]); + s->ext_blocks = le32atoh(&buf[6]); + s->ext_last_len = le32atoh(&buf[10]); + + s->ext_counter = 0; + + DBG(5, " status : 0x%02x\n", buf[1]); + DBG(5, " block size : %u\n", (unsigned int) le32atoh(&buf[2])); + DBG(5, " block count : %u\n", (unsigned int) le32atoh(&buf[6])); + DBG(5, " last block size: %u\n", (unsigned int) le32atoh(&buf[10])); + + if (s->ext_last_len) { + s->ext_blocks++; + DBG(1, "adjusted block count: %d\n", s->ext_blocks); + } + + /* adjust block len if we have only one block to read */ + if (s->ext_block_len == 0 && s->ext_last_len) + s->ext_block_len = s->ext_last_len; + + return status; +} + +void +e2_scan_finish(Epson_Scanner * s) +{ + DBG(5, "%s\n", __func__); + + free(s->buf); + s->buf = NULL; + + if (s->hw->ADF && s->hw->use_extension && s->val[OPT_AUTO_EJECT].w) + if (e2_check_adf(s) == SANE_STATUS_NO_DOCS) + esci_eject(s); + + /* XXX required? */ + esci_reset(s); +} + +void +e2_copy_image_data(Epson_Scanner * s, SANE_Byte * data, SANE_Int max_length, + SANE_Int * length) +{ + if (!s->block && s->params.format == SANE_FRAME_RGB) { + + max_length /= 3; + + if (max_length > s->end - s->ptr) + max_length = s->end - s->ptr; + + *length = 3 * max_length; + + while (max_length-- != 0) { + *data++ = s->ptr[0]; + *data++ = s->ptr[s->params.pixels_per_line]; + *data++ = s->ptr[2 * s->params.pixels_per_line]; + ++s->ptr; + } + + } else { + if (max_length > s->end - s->ptr) + max_length = s->end - s->ptr; + + *length = max_length; + + if (s->params.depth == 1) { + while (max_length-- != 0) + *data++ = ~*s->ptr++; + } else { + memcpy(data, s->ptr, max_length); + s->ptr += max_length; + } + } +} + +SANE_Status +e2_ext_read(struct Epson_Scanner *s) +{ + SANE_Status status = SANE_STATUS_GOOD; + ssize_t buf_len = 0, read; + + /* did we passed everything we read to sane? */ + if (s->ptr == s->end) { + + if (s->eof) + return SANE_STATUS_EOF; + + s->ext_counter++; + + /* sane has already got the data, read some more, the final + * error byte must not be included in buf_len + */ + buf_len = s->ext_block_len; + + if (s->ext_counter == s->ext_blocks && s->ext_last_len) + buf_len = s->ext_last_len; + + DBG(18, "%s: block %d/%d, size %lu\n", __func__, + s->ext_counter, s->ext_blocks, + (unsigned long) buf_len); + + /* receive image data + error code */ + read = e2_recv(s, s->buf, buf_len + 1, &status); + + DBG(18, "%s: read %lu bytes\n", __func__, (unsigned long) read); + + if (read != buf_len + 1) + return SANE_STATUS_IO_ERROR; + + if (s->buf[buf_len] & FSG_STATUS_CANCEL_REQ) { + DBG(0, "%s: cancel request received\n", __func__); + return SANE_STATUS_CANCELLED; + } + + if (s->buf[buf_len] & (FSG_STATUS_FER | FSG_STATUS_NOT_READY)) + return SANE_STATUS_IO_ERROR; + + /* ack every block except the last one */ + if (s->ext_counter < s->ext_blocks) { + size_t next_len = s->ext_block_len; + + if (s->ext_counter == (s->ext_blocks - 1)) + next_len = s->ext_last_len; + + if (s->canceling) { + e2_cancel(s); + return SANE_STATUS_CANCELLED; + } + + status = e2_ack_next(s, next_len + 1); + } else + s->eof = SANE_TRUE; + + s->end = s->buf + buf_len; + s->ptr = s->buf; + } + + return status; +} + +/* XXXX use routine from sane-evolution */ + +typedef struct +{ + unsigned char code; + unsigned char status; + + unsigned char buf[4]; + +} EpsonDataRec; + + +/* XXX this routine is ugly and should be avoided */ +static SANE_Status +read_info_block(Epson_Scanner * s, EpsonDataRec * result) +{ + SANE_Status status; + unsigned char params[2]; + + retry: + e2_recv(s, result, s->block ? 6 : 4, &status); + if (status != SANE_STATUS_GOOD) + return status; + + if (result->code != STX) { + DBG(1, "error: got %02x, expected STX\n", result->code); + return SANE_STATUS_INVAL; + } + + /* XXX */ + if (result->status & STATUS_FER) { + unsigned char *ext_status; + + DBG(1, "fatal error, status = %02x\n", result->status); + + if (s->retry_count > SANE_EPSON_MAX_RETRIES) { + DBG(1, "max retry count exceeded (%d)\n", + s->retry_count); + return SANE_STATUS_INVAL; + } + + /* if the scanner is warming up, retry after a few secs */ + status = esci_request_extended_status(s, &ext_status, NULL); + if (status != SANE_STATUS_GOOD) + return status; + + if (ext_status[0] & EXT_STATUS_WU) { + free(ext_status); + + sleep(5); /* for the next attempt */ + + DBG(1, "retrying ESC G - %d\n", ++(s->retry_count)); + + params[0] = ESC; + params[1] = s->hw->cmd->start_scanning; + + e2_send(s, params, 2, 0, &status); + if (status != SANE_STATUS_GOOD) + return status; + + goto retry; + } else + free(ext_status); + } + + return status; +} + +static SANE_Status +color_shuffle(SANE_Handle handle, int *new_length) +{ + Epson_Scanner *s = (Epson_Scanner *) handle; + SANE_Byte *buf = s->buf; + int length = s->end - s->buf; + + SANE_Byte *data_ptr; /* ptr to data to process */ + SANE_Byte *data_end; /* ptr to end of processed data */ + SANE_Byte *out_data_ptr; /* ptr to memory when writing data */ + int i; /* loop counter */ + + /* + * It looks like we are dealing with a scanner that has an odd way + * of dealing with colors... The red and blue scan lines are shifted + * up or down by a certain number of lines relative to the green line. + */ + DBG(5, "%s\n", __func__); + + /* + * Initialize the variables we are going to use for the + * copying of the data. data_ptr is the pointer to + * the currently worked on scan line. data_end is the + * end of the data area as calculated from adding *length + * to the start of data. + * out_data_ptr is used when writing out the processed data + * and always points to the beginning of the next line to + * write. + */ + data_ptr = out_data_ptr = buf; + data_end = data_ptr + length; + + /* + * The image data is in *buf, we know that the buffer contains s->end - s->buf ( = length) + * bytes of data. The width of one line is in s->params.bytes_per_line + * + * The buffer area is supposed to have a number of full scan + * lines, let's test if this is the case. + */ + + if (length % s->params.bytes_per_line != 0) { + DBG(1, "error in buffer size: %d / %d\n", length, + s->params.bytes_per_line); + return SANE_STATUS_INVAL; + } + + while (data_ptr < data_end) { + SANE_Byte *source_ptr, *dest_ptr; + int loop; + + /* copy the green information into the current line */ + + source_ptr = data_ptr + 1; + dest_ptr = s->line_buffer[s->color_shuffle_line] + 1; + + for (i = 0; i < s->params.bytes_per_line / 3; i++) { + *dest_ptr = *source_ptr; + dest_ptr += 3; + source_ptr += 3; + } + + /* copy the red information n lines back */ + + if (s->color_shuffle_line >= s->line_distance) { + source_ptr = data_ptr + 2; + dest_ptr = + s->line_buffer[s->color_shuffle_line - + s->line_distance] + 2; + +/* while (source_ptr < s->line_buffer[s->color_shuffle_line] + s->params.bytes_per_line) */ + for (loop = 0; + loop < s->params.bytes_per_line / 3; + loop++) { + *dest_ptr = *source_ptr; + dest_ptr += 3; + source_ptr += 3; + } + } + + /* copy the blue information n lines forward */ + + source_ptr = data_ptr; + dest_ptr = + s->line_buffer[s->color_shuffle_line + + s->line_distance]; + +/* while (source_ptr < s->line_buffer[s->color_shuffle_line] + s->params.bytes_per_line) */ + for (loop = 0; loop < s->params.bytes_per_line / 3; + loop++) { + *dest_ptr = *source_ptr; + dest_ptr += 3; + source_ptr += 3; + } + + data_ptr += s->params.bytes_per_line; + + if (s->color_shuffle_line == s->line_distance) { + /* + * We just finished the line in line_buffer[0] - write it to the + * output buffer and continue. + * + * The ouput buffer ist still "buf", but because we are + * only overwriting from the beginning of the memory area + * we are not interfering with the "still to shuffle" data + * in the same area. + */ + + /* + * Strip the first and last n lines and limit to + */ + if ((s->current_output_line >= + s->line_distance) + && (s->current_output_line < + s->params.lines + s->line_distance)) { + memcpy(out_data_ptr, + s->line_buffer[0], + s->params.bytes_per_line); + out_data_ptr += + s->params.bytes_per_line; + + s->lines_written++; + } + + s->current_output_line++; + + /* + * Now remove the 0-entry and move all other + * lines up by one. There are 2*line_distance + 1 + * buffers, * therefore the loop has to run from 0 + * to * 2*line_distance, and because we want to + * copy every n+1st entry to n the loop runs + * from - to 2*line_distance-1! + */ + + free(s->line_buffer[0]); + + for (i = 0; i < s->line_distance * 2; i++) { + s->line_buffer[i] = + s->line_buffer[i + 1]; + } + + /* + * and create one new buffer at the end + */ + + s->line_buffer[s->line_distance * 2] = + malloc(s->params.bytes_per_line); + if (s->line_buffer[s->line_distance * 2] == + NULL) { + DBG(1, "out of memory (line %d)\n", + __LINE__); + return SANE_STATUS_NO_MEM; + } + } else { + s->color_shuffle_line++; /* increase the buffer number */ + } + } + + /* + * At this time we've used up all the new data from the scanner, some of + * it is still in the line_buffers, but we are ready to return some of it + * to the front end software. To do so we have to adjust the size of the + * data area and the *new_length variable. + */ + + *new_length = out_data_ptr - buf; + + return SANE_STATUS_GOOD; +} + +static inline int +get_color(int status) +{ + switch ((status >> 2) & 0x03) { + case 1: + return 1; + case 2: + return 0; + case 3: + return 2; + default: + return 0; /* required to make the compiler happy */ + } +} + + +SANE_Status +e2_block_read(struct Epson_Scanner *s) +{ + SANE_Status status; + SANE_Bool reorder = SANE_FALSE; + SANE_Bool needStrangeReorder = SANE_FALSE; + + START_READ: + DBG(18, "%s: begin\n", __func__); + + if (s->ptr == s->end) { + EpsonDataRec result; + unsigned int buf_len; + + if (s->eof) { + if (s->hw->color_shuffle) { + DBG(1, + "written %d lines after color shuffle\n", + s->lines_written); + DBG(1, "lines requested: %d\n", + s->params.lines); + } + + return SANE_STATUS_EOF; + } + + status = read_info_block(s, &result); + if (status != SANE_STATUS_GOOD) { + return status; + } + + buf_len = result.buf[1] << 8 | result.buf[0]; + buf_len *= (result.buf[3] << 8 | result.buf[2]); + + DBG(18, "%s: buf len = %u\n", __func__, buf_len); + + { + /* do we have to reorder the data ? */ + if (get_color(result.status) == 0x01) + reorder = SANE_TRUE; + + e2_recv(s, s->buf, buf_len, &status); + if (status != SANE_STATUS_GOOD) { + return status; + } + } + + if (result.status & STATUS_AREA_END) { + DBG(1, "%s: EOF\n", __func__); + s->eof = SANE_TRUE; + } else { + if (s->canceling) { + e2_cancel(s); + return SANE_STATUS_CANCELLED; + } else { + status = e2_ack(s); + } + } + + s->end = s->buf + buf_len; + s->ptr = s->buf; + + /* + * if we have to re-order the color components (GRB->RGB) we + * are doing this here: + */ + + /* + * Some scanners (e.g. the Perfection 1640 and GT-2200) seem + * to have the R and G channels swapped. + * The GT-8700 is the Asian version of the Perfection 1640. + * If the scanner name is one of these and the scan mode is + * RGB then swap the colors. + */ + + needStrangeReorder = + (strstr(s->hw->model, "GT-2200") || + ((strstr(s->hw->model, "1640") + && strstr(s->hw->model, "Perfection")) + || strstr(s->hw->model, "GT-8700"))) + && s->params.format == SANE_FRAME_RGB; + + /* + * Certain Perfection 1650 also need this re-ordering of the two + * color channels. These scanners are identified by the problem + * with the half vertical scanning area. When we corrected this, + * we also set the variable s->hw->need_color_reorder + */ + if (s->hw->need_color_reorder) + reorder = SANE_FALSE; /* reordering once is enough */ + + if (reorder && s->params.format == SANE_FRAME_RGB) { + SANE_Byte *ptr; + + ptr = s->buf; + while (ptr < s->end) { + if (s->params.depth > 8) { + SANE_Byte tmp; + + /* R->G G->R */ + tmp = ptr[0]; + ptr[0] = ptr[2]; /* first Byte G */ + ptr[2] = tmp; /* first Byte R */ + + tmp = ptr[1]; + ptr[1] = ptr[3]; /* second Byte G */ + ptr[3] = tmp; /* second Byte R */ + + ptr += 6; /* go to next pixel */ + } else { + /* R->G G->R */ + SANE_Byte tmp; + + tmp = ptr[0]; + ptr[0] = ptr[1]; /* G */ + ptr[1] = tmp; /* R */ + /* B stays the same */ + ptr += 3; /* go to next pixel */ + } + } + } + + /* + * Do the color_shuffle if everything else is correct - at this time + * most of the stuff is hardcoded for the Perfection 610 + */ + + if (s->hw->color_shuffle) { + int new_length = 0; + + status = color_shuffle(s, &new_length); + /* XXX check status here */ + + /* + * If no bytes are returned, check if the scanner is already done, if so, + * we'll probably just return, but if there is more data to process get + * the next batch. + */ + if (new_length == 0 && s->end != s->ptr) + goto START_READ; + + s->end = s->buf + new_length; + s->ptr = s->buf; + } + + DBG(18, "%s: begin scan2\n", __func__); + } + + DBG(18, "%s: end\n", __func__); + + return SANE_STATUS_GOOD; +} diff -Nru sane-backends-1.0.20/backend/epson2-ops.h sane-backends-1.0.21/backend/epson2-ops.h --- sane-backends-1.0.20/backend/epson2-ops.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/epson2-ops.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,52 @@ +/* + * epson2.c - SANE library for Epson scanners. + * + * Based on Kazuhiro Sasayama previous + * Work on epson.[ch] file from the SANE package. + * Please see those files for additional copyrights. + * + * Copyright (C) 2006-07 Tower Technologies + * Author: Alessandro Zummo + * + * 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, version 2. + */ + +/* some defines to make handling the TPU easier */ +#define FILM_TYPE_NEGATIVE (1L << 0) +#define FILM_TYPE_SLIDE (1L << 1) + +#define e2_model(s,m) e2_dev_model((s)->hw,(m)) + +extern int sanei_scsi_max_request_size; +extern int *gamma_params; + +extern void e2_dev_init(Epson_Device *dev, const char *devname, int conntype); +extern SANE_Status e2_dev_post_init(struct Epson_Device *dev); +extern SANE_Bool e2_dev_model(Epson_Device *dev, const char *model); +extern void e2_set_cmd_level(SANE_Handle handle, unsigned char *level); +extern SANE_Status e2_set_model(Epson_Scanner *s, unsigned char *model, size_t len); +extern SANE_Status e2_add_resolution(Epson_Device *dev, int r); +extern void e2_set_fbf_area(Epson_Scanner *s, int x, int y, int unit); +extern void e2_set_adf_area(struct Epson_Scanner *s, int x, int y, int unit); +extern void e2_set_tpu_area(struct Epson_Scanner *s, int x, int y, int unit); +extern void e2_add_depth(Epson_Device *dev, SANE_Word depth); +extern SANE_Status e2_discover_capabilities(Epson_Scanner *s); +extern SANE_Status e2_set_extended_scanning_parameters(Epson_Scanner *s); +extern SANE_Status e2_set_scanning_parameters(Epson_Scanner *s); +extern void e2_setup_block_mode(Epson_Scanner *s); +extern SANE_Status e2_init_parameters(Epson_Scanner *s); +extern void e2_wait_button(Epson_Scanner *s); +extern SANE_Status e2_check_warm_up(Epson_Scanner *s, SANE_Bool *wup); +extern SANE_Status e2_wait_warm_up(Epson_Scanner *s); +extern SANE_Status e2_check_adf(Epson_Scanner *s); +extern SANE_Status e2_start_std_scan(Epson_Scanner *s); +extern SANE_Status e2_start_ext_scan(Epson_Scanner *s); +extern void e2_scan_finish(Epson_Scanner *s); +extern void e2_copy_image_data(Epson_Scanner *s, SANE_Byte *data, SANE_Int max_length, + SANE_Int *length); +extern SANE_Status e2_ext_read(struct Epson_Scanner *s); +extern SANE_Status e2_block_read(struct Epson_Scanner *s); diff -Nru sane-backends-1.0.20/backend/epson2_scsi.c sane-backends-1.0.21/backend/epson2_scsi.c --- sane-backends-1.0.20/backend/epson2_scsi.c 2009-02-24 09:04:01.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2_scsi.c 2010-04-05 23:18:04.000000000 +1000 @@ -2,8 +2,8 @@ #define BACKEND_NAME epson2_scsi #include "../include/sane/config.h" -#include -#include +#include "../include/sane/sanei_debug.h" +#include "../include/sane/sanei_scsi.h" #include "epson2_scsi.h" #ifdef HAVE_STDDEF_H diff -Nru sane-backends-1.0.20/backend/epson2_scsi.h sane-backends-1.0.21/backend/epson2_scsi.h --- sane-backends-1.0.20/backend/epson2_scsi.h 2006-12-03 01:47:21.000000000 +1100 +++ sane-backends-1.0.21/backend/epson2_scsi.h 2010-04-05 23:18:04.000000000 +1000 @@ -2,7 +2,7 @@ #define _EPSON2_SCSI_H_ #include -#include +#include "../include/sane/sane.h" #define TEST_UNIT_READY_COMMAND (0x00) #define READ_6_COMMAND (0x08) diff -Nru sane-backends-1.0.20/backend/epson.c sane-backends-1.0.21/backend/epson.c --- sane-backends-1.0.20/backend/epson.c 2009-01-25 12:29:26.000000000 +1100 +++ sane-backends-1.0.21/backend/epson.c 2010-04-05 23:18:04.000000000 +1000 @@ -305,7 +305,7 @@ #define SANE_I18N(text) (text) #endif -#include "sane/config.h" +#include "../include/sane/config.h" #include @@ -318,18 +318,18 @@ #include #include -#include "sane/sane.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" -#include "sane/sanei_usb.h" +#include "../include/sane/sanei_usb.h" -#include +#include "../include/sane/sanei_pio.h" #define BACKEND_NAME epson -#include +#include "../include/sane/sanei_backend.h" -#include +#include "../include/sane/sanei_config.h" #include "epson.h" #include "epson_scsi.h" @@ -341,10 +341,6 @@ #define PATH_MAX (1024) #endif -#ifndef MM_PER_INCH -#define MM_PER_INCH 25.4 -#endif - #define walloc(x) (x *)malloc(sizeof(x)) #define walloca(x) (x *)alloca(sizeof(x)) @@ -485,9 +481,9 @@ }; static const SANE_String_Const mode_list[] = { - SANE_I18N ("Binary"), - SANE_I18N ("Gray"), - SANE_I18N ("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, NULL }; diff -Nru sane-backends-1.0.20/backend/epson_scsi.c sane-backends-1.0.21/backend/epson_scsi.c --- sane-backends-1.0.20/backend/epson_scsi.c 2009-01-25 12:29:26.000000000 +1100 +++ sane-backends-1.0.21/backend/epson_scsi.c 2010-04-05 23:18:04.000000000 +1000 @@ -4,8 +4,8 @@ #undef BACKEND_NAME #define BACKEND_NAME epson_scsi #include "../include/sane/config.h" -#include -#include +#include "../include/sane/sanei_debug.h" +#include "../include/sane/sanei_scsi.h" #include "epson_scsi.h" #include "../include/lalloca.h" diff -Nru sane-backends-1.0.20/backend/epson_scsi.h sane-backends-1.0.21/backend/epson_scsi.h --- sane-backends-1.0.20/backend/epson_scsi.h 2004-02-09 05:32:33.000000000 +1100 +++ sane-backends-1.0.21/backend/epson_scsi.h 2010-04-05 23:18:04.000000000 +1000 @@ -2,7 +2,7 @@ #define _EPSON_SCSI_H_ #include -#include +#include "../include/sane/sane.h" #define TEST_UNIT_READY_COMMAND (0x00) #define READ_6_COMMAND (0x08) diff -Nru sane-backends-1.0.20/backend/epson_usb.c sane-backends-1.0.21/backend/epson_usb.c --- sane-backends-1.0.20/backend/epson_usb.c 2007-08-18 22:06:36.000000000 +1000 +++ sane-backends-1.0.21/backend/epson_usb.c 2010-04-05 23:18:04.000000000 +1000 @@ -1,55 +1,84 @@ #include -#include +#include "../include/sane/sanei_usb.h" #include "epson_usb.h" SANE_Word sanei_epson_usb_product_ids[] = { - 0x101, /* GT-7000 / Perfection 636 */ - 0x103, /* GT-6600 / Perfection 610 */ - 0x10c, /* GT-6700 / Perfection 640 */ - 0x104, /* GT-7600 / Perfection 1200 */ - 0x10b, /* GT-7700 / Perfection 1240 */ - 0x106, /* Stylus Scan 2500 */ - 0x109, /* ES-8500 / Expression 1640 XL */ - 0x10a, /* GT-8700 / Perfection 1640 */ - 0x107, /* ES-2000 / Expression 1600 */ - 0x10e, /* ES-2200 / Expression 1680 */ - 0x110, /* GT-8200 / Perfection 1650 */ - 0x112, /* GT-9700 / Perfection 2450 */ - 0x116, /* GT-9400 / Perfection 3170 */ - 0x11b, /* GT-9300 / Perfection 2400 */ - 0x11c, /* GT-9800 / Perfection 3200 */ - 0x11e, /* GT-8300 / Perfection 1660 */ - 0x126, /* ES-7000 / GT-15000 */ - 0x128, /* GT-X700 / Perfection 4870 */ - 0x129, /* ES-10000 / Expression 10000XL */ - 0x12a, /* GT-X800 / Perfection 4990 */ - 0x12c, /* V700, V750 */ - 0x801, /* CC-600 / Stylus CX5100/CX5200/CX5300/CX5400 */ - 0x802, /* CC-570 / Stylus CX3100/CX3200 */ - 0x805, /* / Stylus CX6300/CX6400/CX6500/CX6600 */ - 0x806, /* PM-A850 / Stylus Photo RX600/RX610 */ - 0x807, /* / Stylus Photo RX500/RX510 */ - 0x808, /* / Stylus CX5400 */ - 0x80d, /* / Stylus CX4500/CX4600 */ - 0x80e, /* PX-A550 / Stylus CX3500/CX3600/CX3650 */ - 0x80f, /* / Stylus Photo RX420/RX425/RX430 */ - 0x810, /* PM-A900 / Stylus Photo RX700 */ - 0x811, /* PM-A870 / Stylus Photo RX620/RX630 */ - 0x813, /* Stylus CX6600 */ - 0x814, /* PM-A700 */ - 0x815, /* LP-A500 / AcuLaser CX11 */ - 0x818, /* CX3800/3810 */ - 0x819, /* CX4800 */ - 0x820, /* CX4200 */ - 0x82b, /* Stylus CX5000/DX5000/DX5050 */ - 0x82f, /* Stylus DX4050 */ + 0x101, /* GT-7000U, Perfection 636U */ + 0x103, /* GT-6600U, Perfection 610 */ + 0x104, /* GT-7600U, GT-7600UF, Perfection 1200U, Perfection 1200U PHOTO */ + 0x105, /* Stylus Scan 2000 */ + 0x106, /* Stylus Scan 2500 */ + 0x107, /* ES-2000, Expression 1600 */ + 0x109, /* ES-8500, Expression 1640XL */ + 0x10a, /* GT-8700, GT-8700F, Perfection 1640SU, Perfection 1640SU PHOTO */ + 0x10b, /* GT-7700U, Perfection 1240U */ + 0x10c, /* GT-6700U, Perfection 640U */ + 0x10e, /* ES-2200, Expression 1680 */ + 0x110, /* GT-8200U, GT-8200UF, Perfection 1650, Perfection 1650 PHOTO */ + 0x112, /* GT-9700F, Perfection 2450 PHOTO */ + 0x11b, /* GT-9300UF, Perfection 2400 PHOTO */ + 0x11c, /* GT-9800F, Perfection 3200 PHOTO */ + 0x11e, /* GT-8300UF, Perfection 1660 PHOTO */ + 0x126, /* ES-7000H, GT-15000 */ + 0x128, /* GT-X700, Perfection 4870 PHOTO */ + 0x129, /* ES-10000G, Expression 10000XL */ + 0x12a, /* GT-X800, Perfection 4990 PHOTO */ + 0x12b, /* ES-H300, GT-2500 */ + 0x12c, /* GT-X900, Perfection V700 Photo, Perfection V750 Photo */ + 0x135, /* GT-X970 */ + 0x801, /* CC-600PX, Stylus CX5100, Stylus CX5200 */ + 0x802, /* CC-570L, Stylus CX3100, Stylus CX3200 */ + 0x805, /* Stylus CX6300, Stylus CX6400 */ + 0x806, /* PM-A850, Stylus Photo RX600 */ + 0x807, /* Stylus Photo RX500, Stylus Photo RX510 */ + 0x808, /* Stylus CX5300, Stylus CX5400 */ + 0x80d, /* Stylus CX4500, Stylus CX4600 */ + 0x80e, /* PX-A550, Stylus CX3500, Stylus CX3600, Stylus CX3650 */ + 0x80f, /* Stylus Photo RX420, Stylus Photo RX425, Stylus Photo RX430 */ + 0x810, /* PM-A900, Stylus Photo RX700 */ + 0x811, /* PM-A870, Stylus Photo RX620, Stylus Photo RX630 */ + 0x813, /* Stylus CX6500, Stylus CX6600 */ + 0x814, /* PM-A700 */ + 0x815, /* AcuLaser CX11, AcuLaser CX11NF, LP-A500 */ + 0x817, /* LP-M5500, LP-M5500F */ + 0x818, /* Stylus CX3700, Stylus CX3800, Stylus DX3800 */ + 0x819, /* PX-A650, Stylus CX4700, Stylus CX4800, Stylus DX4800, Stylus DX4850 */ + 0x81a, /* PM-A750, Stylus Photo RX520, Stylus Photo RX530 */ + 0x81c, /* PM-A890, Stylus Photo RX640, Stylus Photo RX650 */ + 0x81d, /* PM-A950 */ + 0x81f, /* Stylus CX7700, Stylus CX7800 */ + 0x820, /* Stylus CX4100, Stylus CX4200, Stylus DX4200 */ + 0x827, /* PM-A820, Stylus Photo RX560, Stylus Photo RX580, Stylus Photo RX590 */ + 0x828, /* PM-A970 */ + 0x829, /* PM-T990 */ + 0x82a, /* PM-A920 */ + 0x82b, /* Stylus CX4900, Stylus CX5000, Stylus DX5000 */ + 0x82e, /* PX-A720, Stylus CX5900, Stylus CX6000, Stylus DX6000 */ + 0x82f, /* PX-A620, Stylus CX3900, Stylus DX4000 */ + 0x830, /* ME 200, Stylus CX2800, Stylus CX2900 */ + 0x833, /* LP-M5600 */ + 0x834, /* LP-M6000 */ + 0x835, /* AcuLaser CX21 */ + 0x836, /* PM-T960 */ + 0x837, /* PM-A940, Stylus Photo RX680, Stylus Photo RX685, Stylus Photo RX690 */ + 0x838, /* PX-A640, Stylus CX7300, Stylus CX7400, Stylus DX7400 */ + 0x839, /* PX-A740, Stylus CX8300, Stylus CX8400, Stylus DX8400 */ + 0x83a, /* PX-FA700, Stylus CX9300F, Stylus CX9400Fax, Stylus DX9400F */ + 0x83c, /* PM-A840, PM-A840S, Stylus Photo RX585, Stylus Photo RX595, Stylus Photo RX610 */ + 0x841, /* ME 300, PX-401A, Stylus NX100, Stylus SX100, Stylus TX100 */ + 0x843, /* LP-M5000 */ + 0x844, /* Artisan 800, EP-901A, EP-901F, Stylus Photo PX800FW, Stylus Photo TX800FW */ + 0x846, /* Artisan 700, EP-801A, Stylus Photo PX700W, Stylus Photo TX700W */ + 0x847, /* ME Office 700FW, PX-601F, Stylus Office BX600FW, Stylus Office TX600FW, Stylus SX600FW, WorkForce 600 */ + 0x848, /* ME Office 600F, Stylus Office BX300F, Stylus Office TX300F, Stylus NX300 */ + 0x849, /* Stylus NX200, Stylus SX200, Stylus SX205, Stylus TX200, Stylus TX203, Stylus TX209 */ + 0x84a, /* PX-501A, Stylus NX400, Stylus SX400, Stylus SX405, Stylus TX400 */ + 0x84c, /* WorkForce 500 */ 0 /* last entry - this is used for devices that are specified in the config file as "usb " */ }; - - int sanei_epson_getNumberOfUSBProductIds (void) { diff -Nru sane-backends-1.0.20/backend/fujitsu.c sane-backends-1.0.21/backend/fujitsu.c --- sane-backends-1.0.20/backend/fujitsu.c 2009-05-01 23:38:37.000000000 +1000 +++ sane-backends-1.0.21/backend/fujitsu.c 2010-04-05 23:18:04.000000000 +1000 @@ -6,10 +6,11 @@ Copyright (C) 2000 Randolph Bentson Copyright (C) 2001 Frederik Ramm Copyright (C) 2001-2004 Oliver Schirrmeister - Copyright (C) 2003-2009 m. allan noah + Copyright (C) 2003-2010 m. allan noah JPEG output support funded by Archivista GmbH, www.archivista.ch Endorser support funded by O A S Oilfield Accounting Service Ltd, www.oas.ca + Automatic length detection support funded by Martin G. Miller -------------------------------------------------------------------------- @@ -54,12 +55,13 @@ The source code is divided in sections which you can easily find by searching for the tag "@@". - Section 1 - Init & static stuff - Section 2 - sane_init, _get_devices, _open & friends - Section 3 - sane_*_option functions - Section 4 - sane_start, _get_param, _read & friends - Section 5 - sane_close functions - Section 6 - misc functions + Section 1 - Boilerplate: Init & static stuff + Section 2 - Init: sane_init, _get_devices, _open ... + Section 3 - Options: sane_*_option functions + Section 4 - Scanning: sane_start, _get_param, _read ... + Section 5 - Cleanup: sane_cancel, ... + Section 6 - Misc: sense_handler, hexdump, ... + Section 7 - Image processing: deskew, crop, despeck Changes: v1, 2002-05-05, OS @@ -430,6 +432,26 @@ - ignore errors in scanner_control(), M3091 has not worked since sane 1.0.19, due to this. - copy_buffer needs to count lines, or M309[12] cannot duplex + v94 2009-05-22, MAN + - add side option to show which duplex image is being transferred + - convert front and simplex buffers to use much less ram + - add lowmemory option which makes duplex back buffer small too + - refactor image handling code to track eof's instead of lengths + - do color deinterlacing after reading from scanner, before buffering + v95 2009-06-02, MAN + - scanner_control_ric should return a subset of the possible errors + v96 2009-08-07, MAN + - split sane_get_parameters into two functions + - remove unused code from get_pixelsize + - support hardware based auto length detection + v97 2009-09-14, MAN + - use sanei_magic to provide software deskew, autocrop and despeckle + v98 2010-02-09, MAN + - clean up #include lines and copyright + - add SANE_I18N to static strings + - don't fail if scsi buffer is too small + - disable bg_color for S1500 + - enable flatbed for M3092 SANE FLOW DIAGRAM @@ -458,39 +480,28 @@ */ /* - * @@ Section 1 - Init + * @@ Section 1 - Boilerplate */ -#include "sane/config.h" +#include "../include/sane/config.h" -#include -#include -#include -#include -#include -#include -#include -#include -/*#include */ -#include - -#include -#include -#ifdef HAVE_LIBC_H -# include /* NeXTStep/OpenStep */ -#endif - -#include "sane/sanei_backend.h" -#include "sane/sanei_scsi.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" -#include "sane/sanei_config.h" +#include /*memcpy...*/ +#include /*isspace*/ +#include /*tan*/ +#include /*usleep*/ + +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_magic.h" #include "fujitsu-scsi.h" #include "fujitsu.h" #define DEBUG 1 -#define BUILD 93 +#define BUILD 98 /* values for SANE_DEBUG_FUJITSU env var: - errors 5 @@ -503,53 +514,53 @@ */ /* ------------------------------------------------------------------------- */ -static const char string_Flatbed[] = "Flatbed"; -static const char string_ADFFront[] = "ADF Front"; -static const char string_ADFBack[] = "ADF Back"; -static const char string_ADFDuplex[] = "ADF Duplex"; - -static const char string_Lineart[] = "Lineart"; -static const char string_Halftone[] = "Halftone"; -static const char string_Grayscale[] = "Gray"; -static const char string_Color[] = "Color"; - -static const char string_Default[] = "Default"; -static const char string_On[] = "On"; -static const char string_Off[] = "Off"; - -static const char string_DTC[] = "DTC"; -static const char string_SDTC[] = "SDTC"; - -static const char string_Dither[] = "Dither"; -static const char string_Diffusion[] = "Diffusion"; - -static const char string_Red[] = "Red"; -static const char string_Green[] = "Green"; -static const char string_Blue[] = "Blue"; -static const char string_White[] = "White"; -static const char string_Black[] = "Black"; - -static const char string_None[] = "None"; -static const char string_JPEG[] = "JPEG"; - -static const char string_Continue[] = "Continue"; -static const char string_Stop[] = "Stop"; - -static const char string_10mm[] = "10mm"; -static const char string_15mm[] = "15mm"; -static const char string_20mm[] = "20mm"; - -static const char string_Horizontal[] = "Horizontal"; -static const char string_HorizontalBold[] = "Horizontal bold"; -static const char string_HorizontalNarrow[] = "Horizontal narrow"; -static const char string_Vertical[] = "Vertical"; -static const char string_VerticalBold[] = "Vertical bold"; +#define STRING_FLATBED SANE_I18N("Flatbed") +#define STRING_ADFFRONT SANE_I18N("ADF Front") +#define STRING_ADFBACK SANE_I18N("ADF Back") +#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex") + +#define STRING_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define STRING_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE +#define STRING_GRAYSCALE SANE_VALUE_SCAN_MODE_GRAY +#define STRING_COLOR SANE_VALUE_SCAN_MODE_COLOR + +#define STRING_DEFAULT SANE_I18N("Default") +#define STRING_ON SANE_I18N("On") +#define STRING_OFF SANE_I18N("Off") + +#define STRING_DTC SANE_I18N("DTC") +#define STRING_SDTC SANE_I18N("SDTC") + +#define STRING_DITHER SANE_I18N("Dither") +#define STRING_DIFFUSION SANE_I18N("Diffusion") + +#define STRING_RED SANE_I18N("Red") +#define STRING_GREEN SANE_I18N("Green") +#define STRING_BLUE SANE_I18N("Blue") +#define STRING_WHITE SANE_I18N("White") +#define STRING_BLACK SANE_I18N("Black") + +#define STRING_NONE SANE_I18N("None") +#define STRING_JPEG SANE_I18N("JPEG") + +#define STRING_CONTINUE SANE_I18N("Continue") +#define STRING_STOP SANE_I18N("Stop") + +#define STRING_10MM SANE_I18N("10mm") +#define STRING_15MM SANE_I18N("15mm") +#define STRING_20MM SANE_I18N("20mm") + +#define STRING_HORIZONTAL SANE_I18N("Horizontal") +#define STRING_HORIZONTALBOLD SANE_I18N("Horizontal bold") +#define STRING_HORIZONTALNARROW SANE_I18N("Horizontal narrow") +#define STRING_VERTICAL SANE_I18N("Vertical") +#define STRING_VERTICALBOLD SANE_I18N("Vertical bold") -static const char string_TopToBottom[] = "Top to bottom"; -static const char string_BottomToTop[] = "Bottom to top"; +#define STRING_TOPTOBOTTOM SANE_I18N("Top to bottom") +#define STRING_BOTTOMTOTOP SANE_I18N("Bottom to top") -static const char string_Front[] = "Front"; -static const char string_Back[] = "Back"; +#define STRING_FRONT SANE_I18N("Front") +#define STRING_BACK SANE_I18N("Back") /* Also set via config file. */ static int global_buffer_size = 64 * 1024; @@ -593,6 +604,8 @@ DBG (5, "sane_init: fujitsu backend %d.%d.%d, from %s\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING); + sanei_magic_init(); + DBG (10, "sane_init: finish\n"); return SANE_STATUS_GOOD; @@ -1030,10 +1043,11 @@ } else { DBG (15, "connect_fd: opening SCSI device\n"); - ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handler, s, &s->buffer_size); - if(ret == SANE_STATUS_GOOD && buffer_size != s->buffer_size){ - DBG (5, "connect_fd: cannot get requested buffer size (%d/%d)\n", buffer_size, s->buffer_size); - ret = SANE_STATUS_NO_MEM; + ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handler, s, + &s->buffer_size); + if(!ret && buffer_size != s->buffer_size){ + DBG (5, "connect_fd: cannot get requested buffer size (%d/%d)\n", + buffer_size, s->buffer_size); } } @@ -1901,6 +1915,8 @@ s->has_rif = 1; s->has_back = 0; s->adbits = 8; + if (strstr (s->model_name, "M3092")) + s->has_flatbed = 1; /* weirdness */ s->has_vuid_3091 = 1; @@ -2019,6 +2035,11 @@ s->max_y_fb = 14173; } + else if (strstr (s->model_name,"S1500")){ + /*lies*/ + s->has_MS_bg=0; + } + DBG (10, "init_model: finish\n"); return SANE_STATUS_GOOD; @@ -2158,9 +2179,9 @@ s->mode=MODE_COLOR; /* load our own private copy of scan params */ - ret = sane_get_parameters ((SANE_Handle) s, &s->params); + ret = update_params(s); if (ret != SANE_STATUS_GOOD) { - DBG (5, "init_interlace: ERROR: cannot get params\n"); + DBG (5, "init_interlace: ERROR: cannot update params\n"); return ret; } @@ -2375,16 +2396,16 @@ if(option==OPT_SOURCE){ i=0; if(s->has_flatbed){ - s->source_list[i++]=string_Flatbed; + s->source_list[i++]=STRING_FLATBED; } if(s->has_adf){ - s->source_list[i++]=string_ADFFront; + s->source_list[i++]=STRING_ADFFRONT; if(s->has_back){ - s->source_list[i++]=string_ADFBack; + s->source_list[i++]=STRING_ADFBACK; } if(s->has_duplex){ - s->source_list[i++]=string_ADFDuplex; + s->source_list[i++]=STRING_ADFDUPLEX; } } s->source_list[i]=NULL; @@ -2403,16 +2424,16 @@ if(option==OPT_MODE){ i=0; if(s->can_monochrome){ - s->mode_list[i++]=string_Lineart; + s->mode_list[i++]=STRING_LINEART; } if(s->can_halftone){ - s->mode_list[i++]=string_Halftone; + s->mode_list[i++]=STRING_HALFTONE; } if(s->can_grayscale){ - s->mode_list[i++]=string_Grayscale; + s->mode_list[i++]=STRING_GRAYSCALE; } if(s->can_color_grayscale){ - s->mode_list[i++]=string_Color; + s->mode_list[i++]=STRING_COLOR; } s->mode_list[i]=NULL; @@ -2829,9 +2850,9 @@ if(option==OPT_HT_TYPE){ i=0; - s->ht_type_list[i++]=string_Default; - s->ht_type_list[i++]=string_Dither; - s->ht_type_list[i++]=string_Diffusion; + s->ht_type_list[i++]=STRING_DEFAULT; + s->ht_type_list[i++]=STRING_DITHER; + s->ht_type_list[i++]=STRING_DIFFUSION; s->ht_type_list[i]=NULL; opt->name = "ht-type"; @@ -2934,9 +2955,9 @@ if(option==OPT_WL_FOLLOW){ i=0; - s->wl_follow_list[i++]=string_Default; - s->wl_follow_list[i++]=string_On; - s->wl_follow_list[i++]=string_Off; + s->wl_follow_list[i++]=STRING_DEFAULT; + s->wl_follow_list[i++]=STRING_ON; + s->wl_follow_list[i++]=STRING_OFF; s->wl_follow_list[i]=NULL; opt->name = "wl-follow"; @@ -2957,12 +2978,12 @@ if(option==OPT_IPC_MODE){ i=0; - s->ipc_mode_list[i++]=string_Default; + s->ipc_mode_list[i++]=STRING_DEFAULT; if(s->has_dtc){ - s->ipc_mode_list[i++]=string_DTC; + s->ipc_mode_list[i++]=STRING_DTC; } if(s->has_sdtc){ - s->ipc_mode_list[i++]=string_SDTC; + s->ipc_mode_list[i++]=STRING_SDTC; } s->ipc_mode_list[i]=NULL; @@ -3220,13 +3241,30 @@ opt->constraint_type = SANE_CONSTRAINT_NONE; } + /*automatic length detection */ + if(option==OPT_ALD){ + + opt->name = "ald"; + opt->title = "Auto length detection"; + opt->desc = "Scanner detects paper lower edge. May confuse some frontends."; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_NONE; + + if (s->has_MS_auto){ + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + } + else + opt->cap = SANE_CAP_INACTIVE; + } + /*image compression*/ if(option==OPT_COMPRESS){ i=0; - s->compress_list[i++]=string_None; + s->compress_list[i++]=STRING_NONE; if(s->has_comp_JPG1){ - s->compress_list[i++]=string_JPEG; + s->compress_list[i++]=STRING_JPEG; } s->compress_list[i]=NULL; @@ -3276,9 +3314,9 @@ /*double feed detection*/ if(option==OPT_DF_ACTION){ - s->df_action_list[0] = string_Default; - s->df_action_list[1] = string_Continue; - s->df_action_list[2] = string_Stop; + s->df_action_list[0] = STRING_DEFAULT; + s->df_action_list[1] = STRING_CONTINUE; + s->df_action_list[2] = STRING_STOP; s->df_action_list[3] = NULL; opt->name = "df-action"; @@ -3354,10 +3392,10 @@ /*double feed length difference*/ if(option==OPT_DF_DIFF){ - s->df_diff_list[0] = string_Default; - s->df_diff_list[1] = string_10mm; - s->df_diff_list[2] = string_15mm; - s->df_diff_list[3] = string_20mm; + s->df_diff_list[0] = STRING_DEFAULT; + s->df_diff_list[1] = STRING_10MM; + s->df_diff_list[2] = STRING_15MM; + s->df_diff_list[3] = STRING_20MM; s->df_diff_list[4] = NULL; opt->name = "df-diff"; @@ -3379,9 +3417,9 @@ /*background color*/ if(option==OPT_BG_COLOR){ - s->bg_color_list[0] = string_Default; - s->bg_color_list[1] = string_White; - s->bg_color_list[2] = string_Black; + s->bg_color_list[0] = STRING_DEFAULT; + s->bg_color_list[1] = STRING_WHITE; + s->bg_color_list[2] = STRING_BLACK; s->bg_color_list[3] = NULL; opt->name = "bgcolor"; @@ -3399,10 +3437,10 @@ /*dropout color*/ if(option==OPT_DROPOUT_COLOR){ - s->do_color_list[0] = string_Default; - s->do_color_list[1] = string_Red; - s->do_color_list[2] = string_Green; - s->do_color_list[3] = string_Blue; + s->do_color_list[0] = STRING_DEFAULT; + s->do_color_list[1] = STRING_RED; + s->do_color_list[2] = STRING_GREEN; + s->do_color_list[3] = STRING_BLUE; s->do_color_list[4] = NULL; opt->name = "dropoutcolor"; @@ -3424,9 +3462,9 @@ /*buffer mode*/ if(option==OPT_BUFF_MODE){ - s->buff_mode_list[0] = string_Default; - s->buff_mode_list[1] = string_Off; - s->buff_mode_list[2] = string_On; + s->buff_mode_list[0] = STRING_DEFAULT; + s->buff_mode_list[1] = STRING_OFF; + s->buff_mode_list[2] = STRING_ON; s->buff_mode_list[3] = NULL; opt->name = "buffermode"; @@ -3444,9 +3482,9 @@ /*prepick*/ if(option==OPT_PREPICK){ - s->prepick_list[0] = string_Default; - s->prepick_list[1] = string_Off; - s->prepick_list[2] = string_On; + s->prepick_list[0] = STRING_DEFAULT; + s->prepick_list[1] = STRING_OFF; + s->prepick_list[2] = STRING_ON; s->prepick_list[3] = NULL; opt->name = "prepick"; @@ -3464,9 +3502,9 @@ /*overscan*/ if(option==OPT_OVERSCAN){ - s->overscan_list[0] = string_Default; - s->overscan_list[1] = string_Off; - s->overscan_list[2] = string_On; + s->overscan_list[0] = STRING_DEFAULT; + s->overscan_list[1] = STRING_OFF; + s->overscan_list[2] = STRING_ON; s->overscan_list[3] = NULL; opt->name = "overscan"; @@ -3556,6 +3594,78 @@ opt->cap = SANE_CAP_INACTIVE; } + if(option==OPT_LOW_MEM){ + opt->name = "lowmemory"; + opt->title = "Low Memory"; + opt->desc = "Limit driver memory usage for use in embedded systems. Causes some duplex transfers to alternate sides on each call to sane_read. Value of option 'side' can be used to determine correct image. This option should only be used with custom front-end software."; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + opt->size = sizeof(SANE_Word); + + if (1) + opt->cap= SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + else + opt->cap = SANE_CAP_INACTIVE; + + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + + if(option==OPT_SIDE){ + opt->name = "side"; + opt->title = "Duplex side"; + opt->desc = "Tells which side (0=front, 1=back) of a duplex scan the next call to sane_read will return."; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + opt->size = sizeof(SANE_Word); + opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + + /*deskew by software*/ + if(option==OPT_SWDESKEW){ + opt->name = "swdeskew"; + opt->title = "Software deskew"; + opt->desc = "Request driver to rotate skewed pages digitally"; + opt->type = SANE_TYPE_BOOL; + if (1) + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + else + opt->cap = SANE_CAP_INACTIVE; + } + + /*software despeckle radius*/ + if(option==OPT_SWDESPECK){ + + opt->name = "swdespeck"; + opt->title = "Software despeckle diameter"; + opt->desc = "Maximum diameter of lone dots to remove from scan"; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->swdespeck_range; + s->swdespeck_range.quant=1; + + if(1){ + s->swdespeck_range.min=0; + s->swdespeck_range.max=9; + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + else + opt->cap = SANE_CAP_INACTIVE; + } + + /*crop by software*/ + if(option==OPT_SWCROP){ + opt->name = "swcrop"; + opt->title = "Software crop"; + opt->desc = "Request driver to remove border from pages digitally"; + opt->type = SANE_TYPE_BOOL; + if (1) + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; + else + opt->cap = SANE_CAP_INACTIVE; + } + /* "Endorser" group ------------------------------------------------------ */ if(option==OPT_ENDORSER_GROUP){ opt->name = "endorser-options"; @@ -3705,11 +3815,11 @@ opt->constraint_type = SANE_CONSTRAINT_STRING_LIST; opt->constraint.string_list = s->endorser_font_list; - s->endorser_font_list[0] = string_Horizontal; - s->endorser_font_list[1] = string_HorizontalBold; - s->endorser_font_list[2] = string_HorizontalNarrow; - s->endorser_font_list[3] = string_Vertical; - s->endorser_font_list[4] = string_VerticalBold; + s->endorser_font_list[0] = STRING_HORIZONTAL; + s->endorser_font_list[1] = STRING_HORIZONTALBOLD; + s->endorser_font_list[2] = STRING_HORIZONTALNARROW; + s->endorser_font_list[3] = STRING_VERTICAL; + s->endorser_font_list[4] = STRING_VERTICALBOLD; s->endorser_font_list[5] = NULL; opt->size = maxStringSize (opt->constraint.string_list); @@ -3733,8 +3843,8 @@ opt->constraint_type = SANE_CONSTRAINT_STRING_LIST; opt->constraint.string_list = s->endorser_dir_list; - s->endorser_dir_list[0] = string_TopToBottom; - s->endorser_dir_list[1] = string_BottomToTop; + s->endorser_dir_list[0] = STRING_TOPTOBOTTOM; + s->endorser_dir_list[1] = STRING_BOTTOMTOTOP; s->endorser_dir_list[2] = NULL; opt->size = maxStringSize (opt->constraint.string_list); @@ -3759,8 +3869,8 @@ opt->constraint_type = SANE_CONSTRAINT_STRING_LIST; opt->constraint.string_list = s->endorser_side_list; - s->endorser_side_list[0] = string_Front; - s->endorser_side_list[1] = string_Back; + s->endorser_side_list[0] = STRING_FRONT; + s->endorser_side_list[1] = STRING_BACK; s->endorser_side_list[2] = NULL; opt->size = maxStringSize (opt->constraint.string_list); @@ -4102,31 +4212,31 @@ case OPT_SOURCE: if(s->source == SOURCE_FLATBED){ - strcpy (val, string_Flatbed); + strcpy (val, STRING_FLATBED); } else if(s->source == SOURCE_ADF_FRONT){ - strcpy (val, string_ADFFront); + strcpy (val, STRING_ADFFRONT); } else if(s->source == SOURCE_ADF_BACK){ - strcpy (val, string_ADFBack); + strcpy (val, STRING_ADFBACK); } else if(s->source == SOURCE_ADF_DUPLEX){ - strcpy (val, string_ADFDuplex); + strcpy (val, STRING_ADFDUPLEX); } return SANE_STATUS_GOOD; case OPT_MODE: if(s->mode == MODE_LINEART){ - strcpy (val, string_Lineart); + strcpy (val, STRING_LINEART); } else if(s->mode == MODE_HALFTONE){ - strcpy (val, string_Halftone); + strcpy (val, STRING_HALFTONE); } else if(s->mode == MODE_GRAYSCALE){ - strcpy (val, string_Grayscale); + strcpy (val, STRING_GRAYSCALE); } else if(s->mode == MODE_COLOR){ - strcpy (val, string_Color); + strcpy (val, STRING_COLOR); } return SANE_STATUS_GOOD; @@ -4186,13 +4296,13 @@ case OPT_HT_TYPE: switch (s->ht_type) { case WD_ht_type_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case WD_ht_type_DITHER: - strcpy (val, string_Dither); + strcpy (val, STRING_DITHER); break; case WD_ht_type_DIFFUSION: - strcpy (val, string_Diffusion); + strcpy (val, STRING_DIFFUSION); break; } return SANE_STATUS_GOOD; @@ -4220,26 +4330,26 @@ case OPT_WL_FOLLOW: switch (s->wl_follow) { case WD_wl_follow_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case WD_wl_follow_ON: - strcpy (val, string_On); + strcpy (val, STRING_ON); break; case WD_wl_follow_OFF: - strcpy (val, string_Off); + strcpy (val, STRING_OFF); break; } return SANE_STATUS_GOOD; case OPT_IPC_MODE: if(s->ipc_mode == WD_ipc_DEFAULT){ - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); } else if(s->ipc_mode == WD_ipc_DTC){ - strcpy (val, string_DTC); + strcpy (val, STRING_DTC); } else if(s->ipc_mode == WD_ipc_SDTC){ - strcpy (val, string_SDTC); + strcpy (val, STRING_SDTC); } return SANE_STATUS_GOOD; @@ -4288,12 +4398,16 @@ return SANE_STATUS_GOOD; /* Advanced Group */ + case OPT_ALD: + *val_p = s->ald; + return SANE_STATUS_GOOD; + case OPT_COMPRESS: if(s->compress == COMP_JPEG){ - strcpy (val, string_JPEG); + strcpy (val, STRING_JPEG); } else{ - strcpy (val, string_None); + strcpy (val, STRING_NONE); } return SANE_STATUS_GOOD; @@ -4304,13 +4418,13 @@ case OPT_DF_ACTION: switch (s->df_action) { case DF_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case DF_CONTINUE: - strcpy (val, string_Continue); + strcpy (val, STRING_CONTINUE); break; case DF_STOP: - strcpy (val, string_Stop); + strcpy (val, STRING_STOP); break; } return SANE_STATUS_GOOD; @@ -4330,16 +4444,16 @@ case OPT_DF_DIFF: switch (s->df_diff) { case MSEL_df_diff_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case MSEL_df_diff_10MM: - strcpy (val, string_10mm); + strcpy (val, STRING_10MM); break; case MSEL_df_diff_15MM: - strcpy (val, string_15mm); + strcpy (val, STRING_15MM); break; case MSEL_df_diff_20MM: - strcpy (val, string_20mm); + strcpy (val, STRING_20MM); break; } return SANE_STATUS_GOOD; @@ -4347,13 +4461,13 @@ case OPT_BG_COLOR: switch (s->bg_color) { case COLOR_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case COLOR_WHITE: - strcpy (val, string_White); + strcpy (val, STRING_WHITE); break; case COLOR_BLACK: - strcpy (val, string_Black); + strcpy (val, STRING_BLACK); break; } return SANE_STATUS_GOOD; @@ -4361,16 +4475,16 @@ case OPT_DROPOUT_COLOR: switch (s->dropout_color) { case COLOR_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case COLOR_RED: - strcpy (val, string_Red); + strcpy (val, STRING_RED); break; case COLOR_GREEN: - strcpy (val, string_Green); + strcpy (val, STRING_GREEN); break; case COLOR_BLUE: - strcpy (val, string_Blue); + strcpy (val, STRING_BLUE); break; } return SANE_STATUS_GOOD; @@ -4378,13 +4492,13 @@ case OPT_BUFF_MODE: switch (s->buff_mode) { case MSEL_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case MSEL_ON: - strcpy (val, string_On); + strcpy (val, STRING_ON); break; case MSEL_OFF: - strcpy (val, string_Off); + strcpy (val, STRING_OFF); break; } return SANE_STATUS_GOOD; @@ -4392,13 +4506,13 @@ case OPT_PREPICK: switch (s->prepick) { case MSEL_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case MSEL_ON: - strcpy (val, string_On); + strcpy (val, STRING_ON); break; case MSEL_OFF: - strcpy (val, string_Off); + strcpy (val, STRING_OFF); break; } return SANE_STATUS_GOOD; @@ -4406,13 +4520,13 @@ case OPT_OVERSCAN: switch (s->overscan) { case MSEL_DEFAULT: - strcpy (val, string_Default); + strcpy (val, STRING_DEFAULT); break; case MSEL_ON: - strcpy (val, string_On); + strcpy (val, STRING_ON); break; case MSEL_OFF: - strcpy (val, string_Off); + strcpy (val, STRING_OFF); break; } return SANE_STATUS_GOOD; @@ -4433,6 +4547,26 @@ *val_p = s->blue_offset; return SANE_STATUS_GOOD; + case OPT_LOW_MEM: + *val_p = s->low_mem; + return SANE_STATUS_GOOD; + + case OPT_SIDE: + *val_p = s->side; + return SANE_STATUS_GOOD; + + case OPT_SWDESKEW: + *val_p = s->swdeskew; + return SANE_STATUS_GOOD; + + case OPT_SWDESPECK: + *val_p = s->swdespeck; + return SANE_STATUS_GOOD; + + case OPT_SWCROP: + *val_p = s->swcrop; + return SANE_STATUS_GOOD; + /* Endorser Group */ case OPT_ENDORSER: *val_p = s->u_endorser; @@ -4457,19 +4591,19 @@ case OPT_ENDORSER_FONT: switch (s->u_endorser_font) { case FONT_H: - strcpy (val, string_Horizontal); + strcpy (val, STRING_HORIZONTAL); break; case FONT_HB: - strcpy (val, string_HorizontalBold); + strcpy (val, STRING_HORIZONTALBOLD); break; case FONT_HN: - strcpy (val, string_HorizontalNarrow); + strcpy (val, STRING_HORIZONTALNARROW); break; case FONT_V: - strcpy (val, string_Vertical); + strcpy (val, STRING_VERTICAL); break; case FONT_VB: - strcpy (val, string_VerticalBold); + strcpy (val, STRING_VERTICALBOLD); break; } return SANE_STATUS_GOOD; @@ -4477,10 +4611,10 @@ case OPT_ENDORSER_DIR: switch (s->u_endorser_dir) { case DIR_TTB: - strcpy (val, string_TopToBottom); + strcpy (val, STRING_TOPTOBOTTOM); break; case DIR_BTT: - strcpy (val, string_BottomToTop); + strcpy (val, STRING_BOTTOMTOTOP); break; } return SANE_STATUS_GOOD; @@ -4488,10 +4622,10 @@ case OPT_ENDORSER_SIDE: switch (s->u_endorser_side) { case ED_front: - strcpy (val, string_Front); + strcpy (val, STRING_FRONT); break; case ED_back: - strcpy (val, string_Back); + strcpy (val, STRING_BACK); break; } return SANE_STATUS_GOOD; @@ -4644,13 +4778,13 @@ /* Mode Group */ case OPT_SOURCE: - if (!strcmp (val, string_ADFFront)) { + if (!strcmp (val, STRING_ADFFRONT)) { tmp = SOURCE_ADF_FRONT; } - else if (!strcmp (val, string_ADFBack)) { + else if (!strcmp (val, STRING_ADFBACK)) { tmp = SOURCE_ADF_BACK; } - else if (!strcmp (val, string_ADFDuplex)) { + else if (!strcmp (val, STRING_ADFDUPLEX)) { tmp = SOURCE_ADF_DUPLEX; } else{ @@ -4665,13 +4799,13 @@ return SANE_STATUS_GOOD; case OPT_MODE: - if (!strcmp (val, string_Lineart)) { + if (!strcmp (val, STRING_LINEART)) { tmp = MODE_LINEART; } - else if (!strcmp (val, string_Halftone)) { + else if (!strcmp (val, STRING_HALFTONE)) { tmp = MODE_HALFTONE; } - else if (!strcmp (val, string_Grayscale)) { + else if (!strcmp (val, STRING_GRAYSCALE)) { tmp = MODE_GRAYSCALE; } else{ @@ -4799,11 +4933,11 @@ return SANE_STATUS_GOOD; case OPT_HT_TYPE: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->ht_type = WD_ht_type_DEFAULT; - else if (!strcmp(val, string_Dither)) + else if (!strcmp(val, STRING_DITHER)) s->ht_type = WD_ht_type_DITHER; - else if (!strcmp(val, string_Diffusion)) + else if (!strcmp(val, STRING_DIFFUSION)) s->ht_type = WD_ht_type_DIFFUSION; return SANE_STATUS_GOOD; @@ -4828,19 +4962,19 @@ return SANE_STATUS_GOOD; case OPT_WL_FOLLOW: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->wl_follow = WD_wl_follow_DEFAULT; - else if (!strcmp(val, string_On)) + else if (!strcmp(val, STRING_ON)) s->wl_follow = WD_wl_follow_ON; - else if (!strcmp(val, string_Off)) + else if (!strcmp(val, STRING_OFF)) s->wl_follow = WD_wl_follow_OFF; return SANE_STATUS_GOOD; case OPT_IPC_MODE: - if (!strcmp (val, string_Default)) { + if (!strcmp (val, STRING_DEFAULT)) { tmp = WD_ipc_DEFAULT; } - else if (!strcmp (val, string_DTC)) { + else if (!strcmp (val, STRING_DTC)) { tmp = WD_ipc_DTC; } else { @@ -4901,8 +5035,13 @@ return SANE_STATUS_GOOD; /* Advanced Group */ + case OPT_ALD: + s->ald = val_c; + *info |= SANE_INFO_RELOAD_OPTIONS; + return mode_select_auto(s); + case OPT_COMPRESS: - if (!strcmp (val, string_JPEG)) { + if (!strcmp (val, STRING_JPEG)) { tmp = COMP_JPEG; } else{ @@ -4920,11 +5059,11 @@ return SANE_STATUS_GOOD; case OPT_DF_ACTION: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->df_action = DF_DEFAULT; - else if (!strcmp(val, string_Continue)) + else if (!strcmp(val, STRING_CONTINUE)) s->df_action = DF_CONTINUE; - else if (!strcmp(val, string_Stop)) + else if (!strcmp(val, STRING_STOP)) s->df_action = DF_STOP; *info |= SANE_INFO_RELOAD_OPTIONS; return mode_select_df(s); @@ -4942,33 +5081,33 @@ return mode_select_df(s); case OPT_DF_DIFF: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->df_diff = MSEL_df_diff_DEFAULT; - else if (!strcmp(val, string_10mm)) + else if (!strcmp(val, STRING_10MM)) s->df_diff = MSEL_df_diff_10MM; - else if (!strcmp(val, string_15mm)) + else if (!strcmp(val, STRING_15MM)) s->df_diff = MSEL_df_diff_15MM; - else if (!strcmp(val, string_20mm)) + else if (!strcmp(val, STRING_20MM)) s->df_diff = MSEL_df_diff_20MM; return mode_select_df(s); case OPT_BG_COLOR: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->bg_color = COLOR_DEFAULT; - else if (!strcmp(val, string_White)) + else if (!strcmp(val, STRING_WHITE)) s->bg_color = COLOR_WHITE; - else if (!strcmp(val, string_Black)) + else if (!strcmp(val, STRING_BLACK)) s->bg_color = COLOR_BLACK; return mode_select_bg(s); case OPT_DROPOUT_COLOR: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->dropout_color = COLOR_DEFAULT; - else if (!strcmp(val, string_Red)) + else if (!strcmp(val, STRING_RED)) s->dropout_color = COLOR_RED; - else if (!strcmp(val, string_Green)) + else if (!strcmp(val, STRING_GREEN)) s->dropout_color = COLOR_GREEN; - else if (!strcmp(val, string_Blue)) + else if (!strcmp(val, STRING_BLUE)) s->dropout_color = COLOR_BLUE; if (s->has_MS_dropout) return mode_select_dropout(s); @@ -4976,20 +5115,20 @@ return SANE_STATUS_GOOD; case OPT_BUFF_MODE: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->buff_mode = MSEL_DEFAULT; - else if (!strcmp(val, string_On)) + else if (!strcmp(val, STRING_ON)) s->buff_mode= MSEL_ON; - else if (!strcmp(val, string_Off)) + else if (!strcmp(val, STRING_OFF)) s->buff_mode= MSEL_OFF; return mode_select_buff(s); case OPT_PREPICK: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->prepick = MSEL_DEFAULT; - else if (!strcmp(val, string_On)) + else if (!strcmp(val, STRING_ON)) s->prepick = MSEL_ON; - else if (!strcmp(val, string_Off)) + else if (!strcmp(val, STRING_OFF)) s->prepick = MSEL_OFF; if (s->has_MS_prepick) return mode_select_prepick(s); @@ -4997,18 +5136,15 @@ return SANE_STATUS_GOOD; case OPT_OVERSCAN: - if (!strcmp(val, string_Default)) + if (!strcmp(val, STRING_DEFAULT)) s->overscan = MSEL_DEFAULT; - else if (!strcmp(val, string_On)) + else if (!strcmp(val, STRING_ON)) s->overscan = MSEL_ON; - else if (!strcmp(val, string_Off)) + else if (!strcmp(val, STRING_OFF)) s->overscan = MSEL_OFF; - if (s->has_MS_auto){ - *info |= SANE_INFO_RELOAD_OPTIONS; - return mode_select_overscan(s); - } - else - return SANE_STATUS_GOOD; + + *info |= SANE_INFO_RELOAD_OPTIONS; + return mode_select_auto(s); case OPT_SLEEP_TIME: s->sleep_time = val_c; @@ -5026,6 +5162,22 @@ s->blue_offset = val_c; return SANE_STATUS_GOOD; + case OPT_LOW_MEM: + s->low_mem = val_c; + return SANE_STATUS_GOOD; + + case OPT_SWDESKEW: + s->swdeskew = val_c; + return SANE_STATUS_GOOD; + + case OPT_SWDESPECK: + s->swdespeck = val_c; + return SANE_STATUS_GOOD; + + case OPT_SWCROP: + s->swcrop = val_c; + return SANE_STATUS_GOOD; + /* Endorser Group */ case OPT_ENDORSER: s->u_endorser = val_c; @@ -5051,38 +5203,38 @@ case OPT_ENDORSER_FONT: - if (!strcmp (val, string_Horizontal)){ + if (!strcmp (val, STRING_HORIZONTAL)){ s->u_endorser_font = FONT_H; } - else if (!strcmp (val, string_HorizontalBold)){ + else if (!strcmp (val, STRING_HORIZONTALBOLD)){ s->u_endorser_font = FONT_HB; } - else if (!strcmp (val, string_HorizontalNarrow)){ + else if (!strcmp (val, STRING_HORIZONTALNARROW)){ s->u_endorser_font = FONT_HN; } - else if (!strcmp (val, string_Vertical)){ + else if (!strcmp (val, STRING_VERTICAL)){ s->u_endorser_font = FONT_V; } - else if (!strcmp (val, string_VerticalBold)){ + else if (!strcmp (val, STRING_VERTICALBOLD)){ s->u_endorser_font = FONT_VB; } return send_endorser(s); case OPT_ENDORSER_DIR: - if (!strcmp (val, string_TopToBottom)){ + if (!strcmp (val, STRING_TOPTOBOTTOM)){ s->u_endorser_dir = DIR_TTB; } - else if (!strcmp (val, string_BottomToTop)){ + else if (!strcmp (val, STRING_BOTTOMTOTOP)){ s->u_endorser_dir = DIR_BTT; } return send_endorser(s); /*this val not used in send_endorser*/ case OPT_ENDORSER_SIDE: - if (!strcmp (val, string_Front)){ + if (!strcmp (val, STRING_FRONT)){ s->u_endorser_side = ED_front; } - else if (!strcmp (val, string_Back)){ + else if (!strcmp (val, STRING_BACK)){ s->u_endorser_side = ED_back; } return SANE_STATUS_GOOD; @@ -5680,7 +5832,7 @@ } static SANE_Status -mode_select_overscan (struct fujitsu *s) +mode_select_auto (struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -5691,7 +5843,7 @@ size_t outLen = MSEL_header_len + MSEL_data_min_len; unsigned char * page = out+MSEL_header_len; - DBG (10, "mode_select_overscan: start\n"); + DBG (10, "mode_select_auto: start\n"); memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, MODE_SELECT_code); @@ -5703,6 +5855,7 @@ set_MSEL_page_len(page, MSEL_data_min_len-2); set_MSEL_overscan(page, s->overscan); + set_MSEL_ald(page, s->ald); ret = do_cmd ( s, 1, 0, @@ -5711,7 +5864,7 @@ NULL, NULL ); - DBG (10, "mode_select_overscan: finish\n"); + DBG (10, "mode_select_auto: finish\n"); return ret; } @@ -5741,106 +5894,120 @@ SANE_Status sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) { - SANE_Status ret = SANE_STATUS_GOOD; - struct fujitsu *s = (struct fujitsu *) handle; + SANE_Status ret = SANE_STATUS_GOOD; + struct fujitsu *s = (struct fujitsu *) handle; - DBG (10, "sane_get_parameters: start\n"); + DBG (10, "sane_get_parameters: start\n"); - /* started? get param data from struct */ - if(s->started){ - DBG (15, "sane_get_parameters: started, copying to caller\n"); - params->format = s->params.format; - params->last_frame = s->params.last_frame; - params->lines = s->params.lines; - params->depth = s->params.depth; - params->pixels_per_line = s->params.pixels_per_line; - params->bytes_per_line = s->params.bytes_per_line; - } + /* not started? update param data from user settings */ + if(!s->started){ + ret = update_params(s); + if(ret) + return ret; + } - /* not started? get param data from user settings */ - else { - DBG (15, "sane_get_parameters: not started, updating\n"); + params->format = s->params.format; + params->last_frame = s->params.last_frame; + params->lines = s->params.lines; + params->depth = s->params.depth; + params->pixels_per_line = s->params.pixels_per_line; + params->bytes_per_line = s->params.bytes_per_line; - /* this backend only sends single frame images */ - params->last_frame = 1; + if(s->ald){ + params->lines = -1; + } - /* initial ppl from user settings */ - params->pixels_per_line = s->resolution_x * (s->br_x - s->tl_x) / 1200; + DBG (10, "sane_get_parameters: finish\n"); + return ret; +} - /* some scanners require even number of bytes in each transfer block, - * so we round to even # of total lines, to ensure last block is even */ - params->lines = s->resolution_y * (s->br_y - s->tl_y) / 1200; - params->lines -= params->lines % 2; +/* get param data from user settings, store in private copy */ +SANE_Status +update_params (struct fujitsu * s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + SANE_Parameters * params = &(s->params); + + DBG (15, "update_params: start\n"); + + /* this backend only sends single frame images */ + params->last_frame = 1; + + /* initial ppl from user settings */ + params->pixels_per_line = s->resolution_x * (s->br_x - s->tl_x) / 1200; + + /* some scanners require even number of bytes in each transfer block, + * so we round to even # of total lines, to ensure last block is even */ + params->lines = s->resolution_y * (s->br_y - s->tl_y) / 1200; + params->lines -= params->lines % 2; - if (s->mode == MODE_COLOR) { - params->depth = 8; + if (s->mode == MODE_COLOR) { + params->depth = 8; #ifdef SANE_FRAME_JPEG - /* jpeg requires 8x8 squares */ - if(s->compress == COMP_JPEG){ - params->format = SANE_FRAME_JPEG; - params->pixels_per_line -= params->pixels_per_line % 8; - params->lines -= params->lines % 8; - } - else{ + /* jpeg requires 8x8 squares */ + if(s->compress == COMP_JPEG){ + params->format = SANE_FRAME_JPEG; + params->pixels_per_line -= params->pixels_per_line % 8; + params->lines -= params->lines % 8; + } + else{ #endif - params->format = SANE_FRAME_RGB; - params->pixels_per_line - -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; + params->format = SANE_FRAME_RGB; + params->pixels_per_line + -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; #ifdef SANE_FRAME_JPEG - } + } #endif - params->bytes_per_line = params->pixels_per_line * 3; - } - else if (s->mode == MODE_GRAYSCALE) { - params->depth = 8; + params->bytes_per_line = params->pixels_per_line * 3; + } + else if (s->mode == MODE_GRAYSCALE) { + params->depth = 8; #ifdef SANE_FRAME_JPEG - /* jpeg requires 8x8 squares */ - if(s->compress == COMP_JPEG){ - params->format = SANE_FRAME_JPEG; - params->pixels_per_line -= params->pixels_per_line % 8; - params->lines -= params->lines % 8; - } - else{ + /* jpeg requires 8x8 squares */ + if(s->compress == COMP_JPEG){ + params->format = SANE_FRAME_JPEG; + params->pixels_per_line -= params->pixels_per_line % 8; + params->lines -= params->lines % 8; + } + else{ #endif - params->format = SANE_FRAME_GRAY; - params->pixels_per_line - -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; + params->format = SANE_FRAME_GRAY; + params->pixels_per_line + -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; #ifdef SANE_FRAME_JPEG - } + } #endif - params->bytes_per_line = params->pixels_per_line; - } - else { - params->depth = 1; - params->format = SANE_FRAME_GRAY; - params->pixels_per_line - -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; - params->bytes_per_line = params->pixels_per_line / 8; - } - } + params->bytes_per_line = params->pixels_per_line; + } + else { + params->depth = 1; + params->format = SANE_FRAME_GRAY; + params->pixels_per_line + -= params->pixels_per_line % s->ppl_mod_by_mode[s->mode]; + params->bytes_per_line = params->pixels_per_line / 8; + } - DBG(15,"sane_get_parameters: x: max=%d, page=%d, gpw=%d, res=%d\n", - s->max_x, s->page_width, get_page_width(s), s->resolution_x); + DBG(15,"update_params: x: max=%d, page=%d, gpw=%d, res=%d\n", + s->max_x, s->page_width, get_page_width(s), s->resolution_x); - DBG(15,"sane_get_parameters: y: max=%d, page=%d, gph=%d, res=%d\n", - s->max_y, s->page_height, get_page_height(s), s->resolution_y); + DBG(15,"update_params: y: max=%d, page=%d, gph=%d, res=%d\n", + s->max_y, s->page_height, get_page_height(s), s->resolution_y); - DBG(15,"sane_get_parameters: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", - s->tl_x, s->br_x, s->tl_y, s->br_y); + DBG(15,"update_params: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", + s->tl_x, s->br_x, s->tl_y, s->br_y); - DBG (15, "sane_get_parameters: params: ppl=%d, Bpl=%d, lines=%d\n", - params->pixels_per_line, params->bytes_per_line, params->lines); + DBG (15, "update_params: params: ppl=%d, Bpl=%d, lines=%d\n", + params->pixels_per_line, params->bytes_per_line, params->lines); - DBG (15, "sane_get_parameters: params: format=%d, depth=%d, last=%d\n", - params->format, params->depth, params->last_frame); + DBG (15, "update_params: params: format=%d, depth=%d, last=%d\n", + params->format, params->depth, params->last_frame); - DBG (10, "sane_get_parameters: finish\n"); - - return ret; + DBG (10, "update_params: finish\n"); + return ret; } /* @@ -5868,11 +6035,18 @@ s->reading=1; /* not finished with current side, error */ - if (s->started && s->bytes_tx[s->side] != s->bytes_tot[s->side]) { + if (s->started && !s->eof_tx[s->side]) { DBG(5,"sane_start: previous transfer not finished?"); return SANE_STATUS_INVAL; } + /* low mem mode messes up the side marker, reset it */ + if(s->source == SOURCE_ADF_DUPLEX && s->low_mem + && s->eof_tx[SIDE_FRONT] && s->eof_tx[SIDE_BACK] + ){ + s->side = SIDE_BACK; + } + /* batch start? inititalize struct and scanner */ if(!s->started){ @@ -5885,9 +6059,9 @@ } /* load our own private copy of scan params */ - ret = sane_get_parameters ((SANE_Handle) s, &s->params); + ret = update_params(s); if (ret != SANE_STATUS_GOOD) { - DBG (5, "sane_start: ERROR: cannot get params\n"); + DBG (5, "sane_start: ERROR: cannot update params\n"); return ret; } @@ -5905,6 +6079,13 @@ } } + /* enable overscan/auto detection */ + ret = mode_select_auto(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot mode_select_auto\n"); + return ret; + } + /* set window command */ ret = set_window(s); if (ret != SANE_STATUS_GOOD) { @@ -5948,9 +6129,18 @@ s->bytes_rx[1]=0; s->lines_rx[0]=0; s->lines_rx[1]=0; + s->eof_rx[0]=0; + s->eof_rx[1]=0; s->bytes_tx[0]=0; s->bytes_tx[1]=0; + s->eof_tx[0]=0; + s->eof_tx[1]=0; + + s->buff_rx[0]=0; + s->buff_rx[1]=0; + s->buff_tx[0]=0; + s->buff_tx[1]=0; /* reset jpeg just in case... */ s->jpeg_stage = JPEG_STAGE_HEAD; @@ -5961,17 +6151,39 @@ /* store the number of front bytes */ if ( s->source != SOURCE_ADF_BACK ){ s->bytes_tot[SIDE_FRONT] = s->params.bytes_per_line * s->params.lines; + s->buff_tot[SIDE_FRONT] = s->buffer_size; + + /* the front buffer is normally very small, but some scanners or + * option combinations can't handle it, so we make a big one */ + if( + (s->mode == MODE_COLOR && s->color_interlace == COLOR_INTERLACE_3091) + || (s->swcrop || s->swdeskew || s->swdespeck +#ifdef SANE_FRAME_JPEG + && s->s.format != SANE_FRAME_JPEG +#endif + ) + ) + s->buff_tot[SIDE_FRONT] = s->bytes_tot[SIDE_FRONT]; } else{ s->bytes_tot[SIDE_FRONT] = 0; + s->buff_tot[SIDE_FRONT] = 0; } /* store the number of back bytes */ if ( s->source == SOURCE_ADF_DUPLEX || s->source == SOURCE_ADF_BACK ){ s->bytes_tot[SIDE_BACK] = s->params.bytes_per_line * s->params.lines; + s->buff_tot[SIDE_BACK] = s->bytes_tot[SIDE_BACK]; + + /* the back buffer is normally very large, but some scanners or + * option combinations dont need it, so we make a small one */ + if(s->low_mem || s->source == SOURCE_ADF_BACK + || s->duplex_interlace == DUPLEX_INTERLACE_NONE) + s->buff_tot[SIDE_BACK] = s->buffer_size; } else{ s->bytes_tot[SIDE_BACK] = 0; + s->buff_tot[SIDE_BACK] = 0; } /* first page of batch */ @@ -6004,6 +6216,44 @@ DBG (15, "started=%d, side=%d, source=%d\n", s->started, s->side, s->source); + /* certain options require the entire image to + * be collected from the scanner before we can + * tell the user the size of the image. the sane + * API has no way to inform the frontend of this, + * so we block and buffer. yuck */ + if( (s->swdeskew || s->swdespeck || s->swcrop) +#ifdef SANE_FRAME_JPEG + && s->s.format != SANE_FRAME_JPEG +#endif + ){ + + /* get image */ + while(!s->eof_rx[s->side] && !ret){ + SANE_Int len = 0; + ret = sane_read((SANE_Handle)s, NULL, 0, &len); + } + + /* check for errors */ + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot buffer image\n"); + goto errors; + } + + DBG (5, "sane_start: OK: done buffering\n"); + + /* finished buffering, adjust image as required */ + if(s->swdeskew){ + buffer_deskew(s,s->side); + } + if(s->swcrop){ + buffer_crop(s,s->side); + } + if(s->swdespeck){ + buffer_despeck(s,s->side); + } + + } + /* check if user cancelled during this start */ ret = check_for_cancel(s); @@ -6011,8 +6261,14 @@ s->reading=0; DBG (10, "sane_start: finish %d\n", ret); - return ret; + + errors: + DBG (10, "sane_start: error %d\n", ret); + s->started = 0; + s->cancelled = 0; + s->reading = 0; + return ret; } static SANE_Status @@ -6174,8 +6430,15 @@ if(ret == SANE_STATUS_GOOD){ DBG (15, "scanner_control_ric: success, tries %d, ret %d\n",tries,ret); } + /* some errors pass thru unchanged */ + else if(ret == SANE_STATUS_CANCELLED || ret == SANE_STATUS_JAMMED + || ret == SANE_STATUS_NO_DOCS || ret == SANE_STATUS_COVER_OPEN + ){ + DBG (5, "scanner_control_ric: error, tries %d, ret %d\n",tries,ret); + } + /* other errors are ignored, since scanner may not support RIC */ else{ - DBG (5, "scanner_control_ric: error %d, ret %d\n",tries,ret); + DBG (5, "scanner_control_ric: ignoring, tries %d, ret %d\n",tries,ret); ret = SANE_STATUS_GOOD; } } @@ -6205,8 +6468,9 @@ s->buffers[side] = NULL; } - if(s->bytes_tot[side]){ - s->buffers[side] = calloc (1,s->bytes_tot[side]); + if(s->buff_tot[side]){ + s->buffers[side] = calloc (1,s->buff_tot[side]); + if (!s->buffers[side]) { DBG (5, "setup_buffers: Error, no buffer %d.\n",side); return SANE_STATUS_NO_MEM; @@ -6513,7 +6777,7 @@ s->params.pixels_per_line = get_PSIZE_num_x(in); s->params.lines = get_PSIZE_num_y(in); - + /* bytes per line differs by mode */ if (s->mode == MODE_COLOR) { s->params.bytes_per_line = s->params.pixels_per_line * 3; @@ -6530,61 +6794,6 @@ } -#if 0 - /* if READ pixelsize fails, we attempt to guess */ - else { - int dir = 1; - - /* adjust x data in a loop */ - while(1){ - - /* binary and jpeg must have width in multiple of 8 pixels */ - /* plus, some larger scanners require even bytes per line */ - /* so change the scan width and try again */ - if( - ((params->depth == 1 || params->format == SANE_FRAME_JPEG) - && params->pixels_per_line % 8) - || (s->even_scan_line && params->bytes_per_line % 8) - ){ - /* dont round up larger than current max width */ - if(s->br_x >= pw){ - dir = -1; - } - s->br_x += dir; - } - else{ - break; - } - } - - DBG(15,"sane_get_parameters: adj: tlx=%d, brx=%d, pixx=%d\n", - s->tl_x, s->br_x, (s->resolution_x * (s->br_x - s->tl_x) / 1200)); - - dir = 1; - - /* adjust y data in a loop */ - while(1){ - - /* jpeg must have length in multiple of 8 pixels */ - /* so change the user's scan length and try again */ - if( params->format == SANE_FRAME_JPEG && params->lines % 8 ){ - - /* dont round up larger than current max length */ - if(s->br_y >= ph){ - dir = -1; - } - s->br_y += dir; - } - else{ - break; - } - } - - DBG(15,"sane_get_parameters: adj: tly=%d, bry=%d, pixy=%d\n", - s->tl_y, s->br_y, (s->resolution_y * (s->br_y - s->tl_y) / 1200)); - } -#endif - DBG (10, "get_pixelsize: finish\n"); return ret; @@ -6739,92 +6948,89 @@ /* maybe cancelled? */ if(!s->started){ - DBG (5, "sane_read: not started, call sane_start\n"); - return SANE_STATUS_CANCELLED; + DBG (5, "sane_read: not started, call sane_start\n"); + return SANE_STATUS_CANCELLED; } /* sane_start required between sides */ - if(s->bytes_tx[s->side] == s->bytes_tot[s->side]){ - DBG (15, "sane_read: returning eof\n"); - return SANE_STATUS_EOF; + if(s->eof_rx[s->side] && s->bytes_tx[s->side] == s->bytes_rx[s->side]){ + DBG (15, "sane_read: returning eof\n"); + s->eof_tx[s->side] = 1; + + /* swap sides if user asked for low-mem mode, we are duplexing, + * and there is data waiting on the other side */ + if(s->low_mem && s->source == SOURCE_ADF_DUPLEX + && (s->bytes_rx[!s->side] > s->bytes_tx[!s->side] + || (s->eof_rx[!s->side] && !s->eof_tx[!s->side]) + ) + ){ + s->side = !s->side; + } + + return SANE_STATUS_EOF; } /* protect this block from sane_cancel */ s->reading = 1; - /* 3091/2 are on crack, get their own duplex reader function */ - if(s->source == SOURCE_ADF_DUPLEX - && s->duplex_interlace == DUPLEX_INTERLACE_3091){ - - if(s->bytes_tot[SIDE_FRONT] > s->bytes_rx[SIDE_FRONT] - || s->bytes_tot[SIDE_BACK] > s->bytes_rx[SIDE_BACK] - ){ - ret = read_from_3091duplex(s); - if(ret){ - DBG(5,"sane_read: 3091 returning %d\n",ret); - return ret; - } - } + /* no eof from scanner yet, try to get some bytes */ + if(!s->eof_rx[s->side]){ - } /* end 3091 */ + /* 3091/2 are on crack, get their own duplex reader function */ + if(s->source == SOURCE_ADF_DUPLEX + && s->duplex_interlace == DUPLEX_INTERLACE_3091 + ){ + ret = read_from_3091duplex(s); + if(ret){ + DBG(5,"sane_read: 3091 returning %d\n",ret); + return ret; + } + } /* end 3091 */ #ifdef SANE_FRAME_JPEG - /* alternating jpeg duplex interlacing */ - else if(s->source == SOURCE_ADF_DUPLEX - && s->params.format == SANE_FRAME_JPEG - && s->jpeg_interlace == JPEG_INTERLACE_ALT){ - - /* read from front side if either side has remaining */ - if ( s->bytes_tot[SIDE_FRONT] > s->bytes_rx[SIDE_FRONT] - || s->bytes_tot[SIDE_BACK] > s->bytes_rx[SIDE_BACK] - ){ - ret = read_from_JPEGduplex(s); - if(ret){ - DBG(5,"sane_read: jpeg duplex returning %d\n",ret); - return ret; - } + /* alternating jpeg duplex interlacing */ + else if(s->source == SOURCE_ADF_DUPLEX + && s->params.format == SANE_FRAME_JPEG + && s->jpeg_interlace == JPEG_INTERLACE_ALT + ){ + ret = read_from_JPEGduplex(s); + if(ret){ + DBG(5,"sane_read: jpeg duplex returning %d\n",ret); + return ret; } - - } /* end alt jpeg */ + } /* end alt jpeg */ #endif - /* alternating pnm duplex interlacing */ - else if(s->source == SOURCE_ADF_DUPLEX - && s->params.format <= SANE_FRAME_RGB - && s->duplex_interlace == DUPLEX_INTERLACE_ALT){ + /* alternating pnm duplex interlacing */ + else if(s->source == SOURCE_ADF_DUPLEX + && s->params.format <= SANE_FRAME_RGB + && s->duplex_interlace == DUPLEX_INTERLACE_ALT + ){ /* buffer front side */ - if(s->bytes_tot[SIDE_FRONT] > s->bytes_rx[SIDE_FRONT]){ - ret = read_from_scanner(s, SIDE_FRONT); - if(ret){ - DBG(5,"sane_read: front returning %d\n",ret); - return ret; - } + ret = read_from_scanner(s, SIDE_FRONT); + if(ret){ + DBG(5,"sane_read: front returning %d\n",ret); + return ret; } /* buffer back side */ - if(s->bytes_tot[SIDE_BACK] > s->bytes_rx[SIDE_BACK] ){ - ret = read_from_scanner(s, SIDE_BACK); - if(ret){ - DBG(5,"sane_read: back returning %d\n",ret); - return ret; - } + ret = read_from_scanner(s, SIDE_BACK); + if(ret){ + DBG(5,"sane_read: back returning %d\n",ret); + return ret; } + } /* end alt pnm */ - } /* end alt pnm */ - - /* simplex or non-alternating duplex */ - else{ - - if(s->bytes_tot[s->side] > s->bytes_rx[s->side] ){ + /* simplex or non-alternating duplex */ + else{ ret = read_from_scanner(s, s->side); if(ret){ DBG(5,"sane_read: side %d returning %d\n",s->side,ret); return ret; } - } - - } + } /*end simplex*/ + } /*end get more from scanner*/ /* copy a block from buffer to frontend */ ret = read_from_buffer(s,buf,max_len,len,s->side); @@ -6832,6 +7038,16 @@ /* check if user cancelled during this read */ ret = check_for_cancel(s); + /* swap sides if user asked for low-mem mode, we are duplexing, + * and there is data waiting on the other side */ + if(s->low_mem && s->source == SOURCE_ADF_DUPLEX + && (s->bytes_rx[!s->side] > s->bytes_tx[!s->side] + || (s->eof_rx[!s->side] && !s->eof_tx[!s->side]) + ) + ){ + s->side = !s->side; + } + /* unprotect this block from sane_cancel */ s->reading = 0; @@ -6839,6 +7055,7 @@ return ret; } +#ifdef SANE_FRAME_JPEG static SANE_Status read_from_JPEGduplex(struct fujitsu *s) { @@ -7008,9 +7225,11 @@ /* clear what is already in the back */ s->bytes_rx[SIDE_BACK]=0; + s->lines_rx[SIDE_BACK]=0; + s->buff_rx[SIDE_BACK]=0; /* and put the high-order width byte into front unchanged */ - s->buffers[SIDE_FRONT][ s->bytes_rx[SIDE_FRONT] ] = s->jpeg_x_byte; + s->buffers[SIDE_FRONT][s->buff_rx[SIDE_FRONT]++] = s->jpeg_x_byte; s->bytes_rx[SIDE_FRONT]++; } @@ -7020,13 +7239,11 @@ s->params.pixels_per_line,width); /* put the high-order width byte into front side, shifted down */ - s->buffers[SIDE_FRONT][ s->bytes_rx[SIDE_FRONT] ] - = width >> 9; + s->buffers[SIDE_FRONT][s->buff_rx[SIDE_FRONT]++] = width >> 9; s->bytes_rx[SIDE_FRONT]++; /* put the high-order width byte into back side, shifted down */ - s->buffers[SIDE_BACK][ s->bytes_rx[SIDE_BACK] ] - = width >> 9; + s->buffers[SIDE_BACK][s->buff_rx[SIDE_BACK]++] = width >> 9; s->bytes_rx[SIDE_BACK]++; /* shift down low order byte */ @@ -7043,10 +7260,10 @@ ){ /* first byte after ff, send the ff first */ if(s->jpeg_ff_offset == 1){ - s->buffers[SIDE_FRONT][ s->bytes_rx[SIDE_FRONT] ] = 0xff; + s->buffers[SIDE_FRONT][s->buff_rx[SIDE_FRONT]++] = 0xff; s->bytes_rx[SIDE_FRONT]++; } - s->buffers[SIDE_FRONT][ s->bytes_rx[SIDE_FRONT] ] = in[i]; + s->buffers[SIDE_FRONT][s->buff_rx[SIDE_FRONT]++] = in[i]; s->bytes_rx[SIDE_FRONT]++; } @@ -7061,10 +7278,10 @@ ){ /* first byte after ff, send the ff first */ if(s->jpeg_ff_offset == 1){ - s->buffers[SIDE_BACK][ s->bytes_rx[SIDE_BACK] ] = 0xff; + s->buffers[SIDE_BACK][s->buff_rx[SIDE_BACK]++] = 0xff; s->bytes_rx[SIDE_BACK]++; } - s->buffers[SIDE_BACK][ s->bytes_rx[SIDE_BACK] ] = in[i]; + s->buffers[SIDE_BACK][s->buff_rx[SIDE_BACK]++] = in[i]; s->bytes_rx[SIDE_BACK]++; } @@ -7075,8 +7292,8 @@ /* last byte of file, update totals, bail out */ if(s->jpeg_stage == JPEG_STAGE_EOI){ - s->bytes_tot[SIDE_FRONT] = s->bytes_rx[SIDE_FRONT]; - s->bytes_tot[SIDE_BACK] = s->bytes_rx[SIDE_BACK]; + s->eof_rx[SIDE_FRONT] = 1; + s->eof_rx[SIDE_BACK] = 1; } } @@ -7086,6 +7303,7 @@ return ret; } +#endif static SANE_Status read_from_3091duplex(struct fujitsu *s) @@ -7155,7 +7373,6 @@ if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { DBG(15, "read_from_3091duplex: got GOOD/EOF, returning GOOD\n"); - ret = SANE_STATUS_GOOD; } else if (ret == SANE_STATUS_DEVICE_BUSY) { DBG(5, "read_from_3091duplex: got BUSY, returning GOOD\n"); @@ -7176,7 +7393,7 @@ } /* end is back */ - else if(s->bytes_rx[SIDE_FRONT] == s->bytes_tot[SIDE_FRONT]){ + else if(s->eof_rx[SIDE_FRONT]){ side=SIDE_BACK; } @@ -7198,6 +7415,12 @@ } } + if(ret == SANE_STATUS_EOF){ + s->eof_rx[SIDE_FRONT] = 1; + s->eof_rx[SIDE_BACK] = 1; + ret = SANE_STATUS_GOOD; + } + free(in); DBG (10, "read_from_3091duplex: finish\n"); @@ -7218,6 +7441,7 @@ int bytes = s->buffer_size; int remain = s->bytes_tot[side] - s->bytes_rx[side]; + int space = s->buff_tot[side] - s->buff_rx[side]; DBG (10, "read_from_scanner: start\n"); @@ -7225,6 +7449,9 @@ if(bytes > remain){ bytes = remain; } + if(bytes > space){ + bytes = space; + } /* all requests must end on line boundary */ bytes -= (bytes % s->params.bytes_per_line); @@ -7234,17 +7461,19 @@ bytes -= s->params.bytes_per_line; } - /* this should never happen */ - if(bytes < 1){ - DBG(5, "read_from_scanner: ERROR: no bytes this pass\n"); - ret = SANE_STATUS_INVAL; - } - - DBG(15, "read_from_scanner: si:%d to:%d rx:%d re:%d bu:%d pa:%d\n", side, - s->bytes_tot[side], s->bytes_rx[side], remain, s->buffer_size, bytes); + DBG(15, "read_from_scanner: si:%d re:%d bs:%d by:%d\n", + side, remain, s->buffer_size, bytes); + + DBG(15, "read_from_scanner: img to:%d rx:%d tx:%d\n", + s->bytes_tot[side], s->bytes_rx[side], s->bytes_tx[side]); + + DBG(15, "read_from_scanner: buf to:%d rx:%d tx:%d\n", + s->buff_tot[side], s->buff_rx[side], s->buff_tx[side]); - if(ret){ - return ret; + /* this will happen if buffer is not drained yet */ + if(bytes < 1){ + DBG(5, "read_from_scanner: no bytes this pass\n"); + return ret; } /* fi-6770A gets mad if you 'read' too soon on usb, see if it is ready */ @@ -7312,7 +7541,7 @@ free(in); if(ret == SANE_STATUS_EOF){ - s->bytes_tot[side] = s->bytes_rx[side]; + s->eof_rx[side] = 1; ret = SANE_STATUS_GOOD; } @@ -7325,7 +7554,7 @@ copy_3091(struct fujitsu *s, unsigned char * buf, int len, int side) { SANE_Status ret=SANE_STATUS_GOOD; - int i, dest, boff, goff; + int i, j, dest, boff, goff; DBG (10, "copy_3091: start\n"); @@ -7341,30 +7570,33 @@ boff = (s->color_raster_offset+s->blue_offset) * s->resolution_y/300; /* loop thru all lines in read buffer */ - for(i=0;iparams.bytes_per_line;i++){ + for(i=0;iparams.bytes_per_line;i+=s->params.bytes_per_line){ /* red at start of line */ dest = s->lines_rx[side] * s->params.bytes_per_line; + if(dest >= 0 && dest < s->bytes_tot[side]){ - memcpy(s->buffers[side] + dest, - buf + i*s->params.bytes_per_line, - s->params.pixels_per_line); + for (j=0; jparams.pixels_per_line; j++){ + s->buffers[side][dest+j*3] = buf[i+j]; + } } /* green is in middle of line */ - dest = (s->lines_rx[side] - goff) * s->params.bytes_per_line + s->params.pixels_per_line; + dest = (s->lines_rx[side] - goff) * s->params.bytes_per_line; + if(dest >= 0 && dest < s->bytes_tot[side]){ - memcpy(s->buffers[side] + dest, - buf + i*s->params.bytes_per_line + s->params.pixels_per_line, - s->params.pixels_per_line); + for (j=0; jparams.pixels_per_line; j++){ + s->buffers[side][dest+j*3+1] = buf[i+s->params.pixels_per_line+j]; + } } /* blue is at end of line */ - dest = (s->lines_rx[side] - boff) * s->params.bytes_per_line + s->params.pixels_per_line*2; + dest = (s->lines_rx[side] - boff) * s->params.bytes_per_line; + if(dest >= 0 && dest < s->bytes_tot[side]){ - memcpy(s->buffers[side] + dest, - buf + i*s->params.bytes_per_line + s->params.pixels_per_line*2, - s->params.pixels_per_line); + for (j=0; jparams.pixels_per_line; j++){ + s->buffers[side][dest+j*3+2] = buf[i+2*s->params.pixels_per_line+j]; + } } s->lines_rx[side]++; @@ -7377,6 +7609,11 @@ i = 0; } s->bytes_rx[side] = i; + s->buff_rx[side] = i; + + if(s->bytes_rx[side] == s->bytes_tot[side]){ + s->eof_rx[side] = 1; + } DBG (10, "copy_3091: finish\n"); @@ -7387,13 +7624,67 @@ copy_buffer(struct fujitsu *s, unsigned char * buf, int len, int side) { SANE_Status ret=SANE_STATUS_GOOD; - + int i, j; + int bwidth = s->params.bytes_per_line; + int pwidth = s->params.pixels_per_line; + DBG (10, "copy_buffer: start\n"); - memcpy(s->buffers[side]+s->bytes_rx[side],buf,len); + /* invert image if scanner needs it for this mode */ + /* jpeg data does not use inverting */ + if(s->params.format <= SANE_FRAME_RGB && s->reverse_by_mode[s->mode]){ + for(i=0; iparams.format == SANE_FRAME_RGB){ + + switch (s->color_interlace) { + + /* scanner returns pixel data as bgrbgr... */ + case COLOR_INTERLACE_BGR: + for(i=0; ibuffers[side][s->buff_rx[side]++] = buf[i+j*3+2]; + s->buffers[side][s->buff_rx[side]++] = buf[i+j*3+1]; + s->buffers[side][s->buff_rx[side]++] = buf[i+j*3]; + } + } + break; + + /* one line has the following format: rrr...rrrggg...gggbbb...bbb */ + case COLOR_INTERLACE_RRGGBB: + for(i=0; ibuffers[side][s->buff_rx[side]++] = buf[i+j]; + s->buffers[side][s->buff_rx[side]++] = buf[i+pwidth+j]; + s->buffers[side][s->buff_rx[side]++] = buf[i+2*pwidth+j]; + } + } + break; + + default: + memcpy(s->buffers[side]+s->buff_rx[side],buf,len); + s->buff_rx[side] += len; + break; + } + } + + /* jpeg/gray/ht/binary */ + else{ + memcpy(s->buffers[side]+s->buff_rx[side],buf,len); + s->buff_rx[side] += len; + } + s->bytes_rx[side] += len; s->lines_rx[side] += len/s->params.bytes_per_line; + if(s->bytes_rx[side] == s->bytes_tot[side]){ + s->eof_rx[side] = 1; + } + DBG (10, "copy_buffer: finish\n"); return ret; @@ -7404,8 +7695,8 @@ SANE_Int max_len, SANE_Int * len, int side) { SANE_Status ret=SANE_STATUS_GOOD; - int bytes = max_len, i=0; - int remain = s->bytes_rx[side] - s->bytes_tx[side]; + int bytes = max_len; + int remain = s->buff_rx[side] - s->buff_tx[side]; DBG (10, "read_from_buffer: start\n"); @@ -7416,8 +7707,14 @@ *len = bytes; - DBG(15, "read_from_buffer: si:%d to:%d tx:%d re:%d bu:%d pa:%d\n", side, - s->bytes_tot[side], s->bytes_tx[side], remain, max_len, bytes); + DBG(15, "read_from_buffer: si:%d re:%d ml:%d by:%d\n", + side, remain, max_len, bytes); + + DBG(15, "read_from_buffer: img to:%d rx:%d tx:%d\n", + s->bytes_tot[side], s->bytes_rx[side], s->bytes_tx[side]); + + DBG(15, "read_from_buffer: buf to:%d rx:%d tx:%d\n", + s->buff_tot[side], s->buff_rx[side], s->buff_tx[side]); /*FIXME this needs to timeout eventually */ if(!bytes){ @@ -7425,69 +7722,19 @@ return SANE_STATUS_GOOD; } -#ifdef SANE_FRAME_JPEG - /* jpeg data does not use typical interlacing or inverting, just copy */ - if(s->params.format == SANE_FRAME_JPEG){ - memcpy(buf,s->buffers[side]+s->bytes_tx[side],bytes); + memcpy(buf,s->buffers[side]+s->buff_tx[side],bytes); + s->buff_tx[side] += bytes; + s->bytes_tx[side] += bytes; + + /*finished sending small buffer, reset it*/ + if(s->buff_tx[side] == s->buff_rx[side] + && s->buff_tot[side] < s->bytes_tot[side] + ){ + DBG (15, "read_from_buffer: reset\n"); + s->buff_rx[side] = 0; + s->buff_tx[side] = 0; } - - /* not using jpeg, colors maybe interlaced, pixels maybe inverted */ - else { -#endif - /* scanners interlace colors in many different ways */ - /* use separate code to convert to regular rgb */ - if(s->mode == MODE_COLOR){ - int byteOff, lineOff; - - switch (s->color_interlace) { - - /* scanner returns pixel data as bgrbgr... */ - case COLOR_INTERLACE_BGR: - for (i=0; i < bytes; i++){ - byteOff = s->bytes_tx[side] + i; - buf[i] = s->buffers[side][ byteOff-((byteOff%3)-1)*2 ]; - } - break; - - /* one line has the following format: - * rrr...rrrggg...gggbbb...bbb */ - case COLOR_INTERLACE_3091: - case COLOR_INTERLACE_RRGGBB: - for (i=0; i < bytes; i++){ - byteOff = s->bytes_tx[side] + i; - lineOff = byteOff % s->params.bytes_per_line; - - buf[i] = s->buffers[side][ - byteOff - lineOff /* line */ - + (lineOff%3)*s->params.pixels_per_line /* color */ - + (lineOff/3) /* pixel */ - ]; - } - break; - - default: - memcpy(buf,s->buffers[side]+s->bytes_tx[side],bytes); - break; - } - } - /* gray/ht/binary */ - else{ - memcpy(buf,s->buffers[side]+s->bytes_tx[side],bytes); - } - - /* invert image if scanner needs it for this mode */ - if (s->reverse_by_mode[s->mode]){ - for ( i = 0; i < *len; i++ ) { - buf[i] ^= 0xff; - } - } -#ifdef SANE_FRAME_JPEG - } -#endif - - s->bytes_tx[side] += *len; - DBG (10, "read_from_buffer: finish\n"); return ret; @@ -7495,7 +7742,7 @@ /* - * @@ Section 4 - SANE cleanup functions + * @@ Section 5 - SANE cleanup functions */ /* * Cancels a scan. @@ -7628,9 +7875,8 @@ DBG (10, "sane_exit: finish\n"); } - /* - * @@ Section 5 - misc helper functions + * @@ Section 6 - misc helper functions */ /* * Called by the SANE SCSI core and our usb code on device errors @@ -8369,3 +8615,120 @@ DBG (15, "%p %d\n", h, *fdp); return SANE_STATUS_UNSUPPORTED; } + +/* + * @@ Section 7 - Image processing functions + */ + +/* Look in image for likely upper and left paper edges, then rotate + * image so that upper left corner of paper is upper left of image. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_deskew(struct fujitsu *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + int x = 0, y = 0; + double slope = 0; + int bg_color = 0xdd; + + DBG (10, "buffer_deskew: start\n"); + + ret = sanei_magic_findSkew(&s->params,s->buffers[side], + s->resolution_x,s->resolution_y,&x,&y,&slope); + if(ret){ + DBG (5, "buffer_despeck: bad findSkew, bailing\n"); + ret = SANE_STATUS_GOOD; + goto cleanup; + } + + /* tweak the bg color based on scanner settings */ + if(s->mode == MODE_HALFTONE || s->mode == MODE_GRAYSCALE){ + if(s->bg_color == COLOR_BLACK) + bg_color = 0xff; + else + bg_color = 0; + } + else if(s->bg_color == COLOR_BLACK) + bg_color = 0; + + ret = sanei_magic_rotate(&s->params,s->buffers[side], x, y, slope, bg_color); + if(ret){ + DBG(5,"buffer_deskew: rotate error: %d",ret); + ret = SANE_STATUS_GOOD; + goto cleanup; + } + + cleanup: + DBG (10, "buffer_deskew: finish\n"); + return ret; +} + +/* Look in image for likely left/right/bottom paper edges, then crop image. + * Does not attempt to rotate the image, that should be done first. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_crop(struct fujitsu *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + int top = 0; + int bot = 0; + int left = 0; + int right = 0; + + DBG (10, "buffer_crop: start\n"); + + ret = sanei_magic_findEdges(&s->params,s->buffers[side], + s->resolution_x,s->resolution_y,&top,&bot,&left,&right); + if(ret){ + DBG (5, "buffer_crop: bad edges, bailing\n"); + ret = SANE_STATUS_GOOD; + goto cleanup; + } + + DBG (15, "buffer_crop: t:%d b:%d l:%d r:%d\n",top,bot,left,right); + + /* we dont listen to the 'top' value, since fujitsu does not pad the top */ + top = 0; + + /* now crop the image */ + /*FIXME: crop duplex backside at same time?*/ + ret = sanei_magic_crop(&s->params,s->buffers[side],top,bot,left,right); + if(ret){ + DBG (5, "buffer_crop: bad crop, bailing\n"); + ret = SANE_STATUS_GOOD; + goto cleanup; + } + + /* update image size counter to new, smaller size */ + s->bytes_rx[side] = s->params.lines * s->params.bytes_per_line; + s->buff_rx[side] = s->bytes_rx[side]; + + cleanup: + DBG (10, "buffer_crop: finish\n"); + return ret; +} + +/* Look in image for disconnected 'spots' of the requested size. + * Replace the spots with the average color of the surrounding pixels. + * FIXME: should we do this before we binarize instead of after? */ +static SANE_Status +buffer_despeck(struct fujitsu *s, int side) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + DBG (10, "buffer_despeck: start\n"); + + ret = sanei_magic_despeck(&s->params,s->buffers[side],s->swdespeck); + if(ret){ + DBG (5, "buffer_despeck: bad despeck, bailing\n"); + ret = SANE_STATUS_GOOD; + goto cleanup; + } + + cleanup: + DBG (10, "buffer_despeck: finish\n"); + return ret; +} + diff -Nru sane-backends-1.0.20/backend/fujitsu.conf.in sane-backends-1.0.21/backend/fujitsu.conf.in --- sane-backends-1.0.20/backend/fujitsu.conf.in 2009-04-20 06:16:15.000000000 +1000 +++ sane-backends-1.0.21/backend/fujitsu.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -107,5 +107,5 @@ #fi-6750S usb 0x04c5 0x1178 -#S1500 +#S1500 & S1500M usb 0x04c5 0x11a2 diff -Nru sane-backends-1.0.20/backend/fujitsu.h sane-backends-1.0.21/backend/fujitsu.h --- sane-backends-1.0.20/backend/fujitsu.h 2009-03-21 07:59:43.000000000 +1100 +++ sane-backends-1.0.21/backend/fujitsu.h 2010-04-05 23:18:04.000000000 +1000 @@ -62,6 +62,7 @@ OPT_VARIANCE, OPT_ADVANCED_GROUP, + OPT_ALD, OPT_COMPRESS, OPT_COMPRESS_ARG, OPT_DF_ACTION, @@ -78,6 +79,11 @@ OPT_DUPLEX_OFFSET, OPT_GREEN_OFFSET, OPT_BLUE_OFFSET, + OPT_LOW_MEM, + OPT_SIDE, + OPT_SWDESKEW, + OPT_SWDESPECK, + OPT_SWCROP, OPT_ENDORSER_GROUP, OPT_ENDORSER, @@ -386,6 +392,7 @@ SANE_Range duplex_offset_range; SANE_Range green_offset_range; SANE_Range blue_offset_range; + SANE_Range swdespeck_range; /*endorser group*/ SANE_Range endorser_bits_range; @@ -447,6 +454,7 @@ int variance; /*advanced group*/ + int ald; int compress; int compress_arg; int df_action; @@ -464,7 +472,10 @@ int duplex_offset; int green_offset; int blue_offset; - int use_temp_file; + int low_mem; + int swdeskew; + int swdespeck; + int swcrop; /*endorser group*/ int u_endorser; @@ -504,9 +515,16 @@ /* how far we have read */ int bytes_rx[2]; int lines_rx[2]; /*only used by 3091*/ + int eof_rx[2]; /* how far we have written */ int bytes_tx[2]; + int eof_tx[2]; + + /*size of buffers (can be smaller than above*/ + int buff_tot[2]; + int buff_rx[2]; + int buff_tx[2]; unsigned char * buffers[2]; @@ -631,7 +649,6 @@ /* ------------------------------------------------------------------------- */ -#define MM_PER_INCH 25.4 #define MM_PER_UNIT_UNFIX SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0)) #define MM_PER_UNIT_FIX SANE_FIX(SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))) @@ -744,7 +761,7 @@ static SANE_Status mode_select_prepick (struct fujitsu *s); -static SANE_Status mode_select_overscan (struct fujitsu *s); +static SANE_Status mode_select_auto (struct fujitsu *s); static SANE_Status set_sleep_mode(struct fujitsu *s); @@ -757,11 +774,14 @@ static SANE_Status set_window (struct fujitsu *s); static SANE_Status get_pixelsize(struct fujitsu *s); +static SANE_Status update_params (struct fujitsu *s); static SANE_Status start_scan (struct fujitsu *s); static SANE_Status check_for_cancel(struct fujitsu *s); +#ifdef SANE_FRAME_JPEG static SANE_Status read_from_JPEGduplex(struct fujitsu *s); +#endif static SANE_Status read_from_3091duplex(struct fujitsu *s); static SANE_Status read_from_scanner(struct fujitsu *s, int side); @@ -774,6 +794,10 @@ static SANE_Status get_hardware_status (struct fujitsu *s, SANE_Int option); +static SANE_Status buffer_deskew(struct fujitsu *s, int side); +static SANE_Status buffer_crop(struct fujitsu *s, int side); +static SANE_Status buffer_despeck(struct fujitsu *s, int side); + static void hexdump (int level, char *comment, unsigned char *p, int l); static size_t maxStringSize (const SANE_String_Const strings[]); diff -Nru sane-backends-1.0.20/backend/fujitsu-scsi.h sane-backends-1.0.21/backend/fujitsu-scsi.h --- sane-backends-1.0.20/backend/fujitsu-scsi.h 2009-04-02 03:28:02.000000000 +1100 +++ sane-backends-1.0.21/backend/fujitsu-scsi.h 2010-04-05 23:18:04.000000000 +1000 @@ -396,6 +396,8 @@ #define set_MSEL_prepick(sb, val) setbitfield(sb + 0x02, 0x03, 6, val) /*more automatic stuff with this one...*/ +#define set_MSEL_awd(sb, val) setbitfield(sb + 0x02, 0x01, 7, val) +#define set_MSEL_ald(sb, val) setbitfield(sb + 0x03, 0x01, 7, val) #define set_MSEL_overscan(sb, val) setbitfield(sb + 0x05, 0x03, 6, val) /*buffer, prepick, overscan use these*/ diff -Nru sane-backends-1.0.20/backend/genesys.c sane-backends-1.0.21/backend/genesys.c --- sane-backends-1.0.20/backend/genesys.c 2009-04-30 23:15:19.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys.c 2010-04-05 23:18:04.000000000 +1000 @@ -2,11 +2,14 @@ Copyright (C) 2003, 2004 Henning Meier-Geinitz Copyright (C) 2004, 2005 Gerhard Jaeger - Copyright (C) 2004-2009 Stéphane Voltz + Copyright (C) 2004-2010 Stéphane Voltz Copyright (C) 2005-2009 Pierre Willenbrock Copyright (C) 2006 Laurent Charpentier Copyright (C) 2007 Luke + Dynamic rasterization code was taken from the epjistsu backend by + m. allan noah + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -52,7 +55,7 @@ #include "../include/sane/config.h" -#define BUILD 11 +#define BUILD 13 #include #include @@ -69,7 +72,7 @@ #include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_config.h" -#include "_stdint.h" +#include "../include/_stdint.h" #include "genesys.h" #include "genesys_devices.c" @@ -102,22 +105,18 @@ 0 }; -static SANE_String_Const source_list[] = { - SANE_I18N ("Flatbed"), - SANE_I18N ("Transparency Adapter"), +static SANE_String_Const cis_color_filter_list[] = { + SANE_I18N ("Red"), + SANE_I18N ("Green"), + SANE_I18N ("Blue"), + SANE_I18N ("None"), 0 }; -static SANE_Range x_range = { - SANE_FIX (0.0), /* minimum */ - SANE_FIX (216.0), /* maximum */ - SANE_FIX (0.0) /* quantization */ -}; - -static SANE_Range y_range = { - SANE_FIX (0.0), /* minimum */ - SANE_FIX (299.0), /* maximum */ - SANE_FIX (0.0) /* quantization */ +static SANE_String_Const source_list[] = { + SANE_I18N (FLATBED), + SANE_I18N (TRANSPARENCY_ADAPTER), + 0 }; static SANE_Range time_range = { @@ -156,6 +155,12 @@ SANE_FIX (1) /* quantization */ }; +static const SANE_Range threshold_curve_range = { + 0, /* minimum */ + 127, /* maximum */ + 1 /* quantization */ +}; + /* ------------------------------------------------------------------------ */ /* functions calling ASIC specific functions */ /* ------------------------------------------------------------------------ */ @@ -221,7 +226,7 @@ { if (depth == 8) { - fputc (*(data+count), out); + fputc (*(data + count), out); } else { @@ -282,8 +287,7 @@ /* Write to one register */ SANE_Status -sanei_genesys_write_register (Genesys_Device * dev, uint8_t reg, - uint8_t val) +sanei_genesys_write_register (Genesys_Device * dev, uint8_t reg, uint8_t val) { SANE_Status status; @@ -318,8 +322,7 @@ /* Read from one register */ SANE_Status -sanei_genesys_read_register (Genesys_Device * dev, uint8_t reg, - uint8_t * val) +sanei_genesys_read_register (Genesys_Device * dev, uint8_t reg, uint8_t * val) { SANE_Status status; @@ -428,7 +431,8 @@ { DBG (DBG_error0, "sanei_genesys_init_structs: bad description(s) for ccd/gpo/motor=%d/%d/%d\n", - dev->model->ccd_type, dev->model->gpo_type, dev->model->motor_type); + dev->model->ccd_type, dev->model->gpo_type, + dev->model->motor_type); } } @@ -437,6 +441,7 @@ { unsigned int i; + DBG (DBG_proc, "sanei_genesys_init_fe: start\n"); for (i = 0; i < sizeof (Wolfson) / sizeof (Genesys_Frontend); i++) { if (dev->model->dac_type == Wolfson[i].fe_id) @@ -448,7 +453,51 @@ DBG (DBG_error0, "sanei_genesys_init_fe: failed to find description for dac_type %d\n", dev->model->dac_type); - DBG (DBG_info, "sanei_genesys_init_fe: dac_type %d set up\n", dev->model->dac_type); + DBG (DBG_info, "sanei_genesys_init_fe: dac_type %d set up\n", + dev->model->dac_type); + DBG (DBG_proc, "sanei_genesys_init_fe: end\n"); +} + +/** read data for analog frontend + * @param dev device owning the AFE + * @param addr register address to read + * @param data placeholder for the result + * @return SANE_STATUS_GOOD is OK, else the error code + */ +SANE_Status +sanei_genesys_fe_read_data (Genesys_Device * dev, uint8_t addr, + uint16_t *data) +{ + SANE_Status status; + uint8_t value; + Genesys_Register_Set reg[1]; + + + DBG (DBG_proc, "sanei_genesys_fe_read_data: start\n"); + + reg[0].address = 0x50; + reg[0].value = addr; + + /* set up read address */ + status = dev->model->cmd_set->bulk_write_register (dev, reg, 1); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "sanei_genesys_fe_read_data: failed while bulk writing registers: %s\n", + sane_strstatus (status)); + return status; + } + + /* read data */ + RIE (sanei_genesys_read_register (dev, 0x46, &value)); + *data=256*value; + RIE (sanei_genesys_read_register (dev, 0x47, &value)); + *data+=value; + + DBG (DBG_io, "sanei_genesys_fe_read_data (0x%02x, 0x%04x)\n", addr, *data); + DBG (DBG_proc, "sanei_genesys_fe_read_data: completed\n"); + + return status; } /* Write data for analog frontend */ @@ -472,7 +521,7 @@ if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "sanei_genesys_fe_write_data: Failed while bulk writing registers: %s\n", + "sanei_genesys_fe_write_data: failed while bulk writing registers: %s\n", sane_strstatus (status)); return status; } @@ -553,6 +602,31 @@ return SANE_STATUS_GOOD; } +/** read the number of lines scanned + * ie registers 4b-4c-4d + */ +SANE_Status +sanei_genesys_read_scancnt (Genesys_Device * dev, unsigned int *words) +{ + SANE_Status status; + uint8_t value; + + DBG (DBG_proc, "sanei_genesys_read_scancnt: start\n"); + + RIE (sanei_genesys_read_register (dev, 0x4d, &value)); + *words = value; + RIE (sanei_genesys_read_register (dev, 0x4c, &value)); + *words += (value * 256); + RIE (sanei_genesys_read_register (dev, 0x4b, &value)); + if (dev->model->asic_type == GENESYS_GL646) + *words += ((value & 0x03) * 256 * 256); + else + *words += ((value & 0x0f) * 256 * 256); + + DBG (DBG_proc, "sanei_genesys_read_scancnt: %d lines\n", *words); + return SANE_STATUS_GOOD; +} + Genesys_Register_Set * sanei_genesys_get_address (Genesys_Register_Set * regs, SANE_Byte addr) { @@ -734,12 +808,10 @@ vtarget, vstart, vend, - dev->motor. - slopes[power_mode] - [step_type]. - minimum_steps << step_type, - dev->motor. - slopes[power_mode] + dev->motor.slopes[power_mode] + [step_type].minimum_steps << + step_type, + dev->motor.slopes[power_mode] [step_type].g, used_steps, &vfinal); @@ -797,12 +869,10 @@ vtarget, vstart, vend, - dev->motor. - slopes[power_mode] - [step_type]. - minimum_steps << step_type, - dev->motor. - slopes[power_mode] + dev->motor.slopes[power_mode] + [step_type].minimum_steps << + step_type, + dev->motor.slopes[power_mode] [step_type].g, NULL, NULL); DBG (DBG_proc, @@ -977,8 +1047,7 @@ divider = 1 << step_type; time_period = - (uint32_t) (yres * exposure_time / - dev->motor.base_ydpi /*MOTOR_GEAR */ ); + (uint32_t) (yres * exposure_time / dev->motor.base_ydpi /*MOTOR_GEAR */ ); if ((time_period < 2000) && (same_speed)) same_speed = SANE_FALSE; @@ -1064,7 +1133,7 @@ { time_period = (uint32_t) (yres * exposure_time / - dev->motor.base_ydpi /*MOTOR_GEAR */ ); + dev->motor.base_ydpi /*MOTOR_GEAR */ ); time_period = time_period / divider; if (time_period > 65535) @@ -1095,8 +1164,8 @@ time_period = /* time required for full steps */ (uint32_t) (yres * exposure_time / - dev->motor.base_ydpi /*MOTOR_GEAR */ * - (start_speed + (1 - start_speed) * t)); + dev->motor.base_ydpi /*MOTOR_GEAR */ * + (start_speed + (1 - start_speed) * t)); time_period = time_period / divider; if (time_period > 65535) @@ -1295,7 +1364,10 @@ The data needs to be of size "size", and in little endian byte order. */ -static SANE_Status +#ifndef UNIT_TESTING +static +#endif + SANE_Status genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data, int size) { @@ -1307,7 +1379,17 @@ dpihw = sanei_genesys_read_reg_from_set (dev->reg, 0x05) >> 6; - if (dev->settings.scan_mode < 2 && dev->model->ccd_type != CCD_HP2300 && dev->model->ccd_type != CCD_HP2400 && dev->model->ccd_type != CCD_HP3670 && dev->model->ccd_type != CCD_5345) /* lineart, halftone */ + /* many scanners send coefficient for lineart/gray like in color mode */ + if (dev->settings.scan_mode < 2 + && dev->model->ccd_type != CCD_DSMOBILE600 + && dev->model->ccd_type != CCD_XP300 + && dev->model->ccd_type != CCD_DP665 + && dev->model->ccd_type != CCD_DP685 + && dev->model->ccd_type != CCD_ROADWARRIOR + && dev->model->ccd_type != CCD_HP2300 + && dev->model->ccd_type != CCD_HP2400 + && dev->model->ccd_type != CCD_HP3670 + && dev->model->ccd_type != CCD_5345) /* lineart, halftone */ { if (dpihw == 0) /* 600 dpi */ start_address = 0x02a00; @@ -1507,7 +1589,7 @@ } /* laplace filter to denoise picture */ - memcpy (image, data, size); /* to initialize unprocessed part of the image buffer */ + memcpy (image, data, size); /* to initialize unprocessed part of the image buffer */ for (y = 1; y < height - 1; y++) for (x = 1; x < width - 1; x++) { @@ -1576,7 +1658,7 @@ dev->sensor.CCD_start_xoffset = start_pixel + (left * dev->sensor.optical_res) / dpi; - /* find top edge by detecting black stripe */ + /* find top edge by detecting black strip */ /* apply Y direction sobel filter -1 -2 -1 0 0 0 @@ -1639,7 +1721,9 @@ if ((dev->model->ccd_type == CCD_HP2300 && dev->model->motor_type == MOTOR_HP2300) || (dev->model->ccd_type == CCD_HP2400 - && dev->model->motor_type == MOTOR_HP2400)) + && dev->model->motor_type == MOTOR_HP2400) + || (dev->model->ccd_type == CCD_HP3670 + && dev->model->motor_type == MOTOR_HP3670)) { top = 0; count = 0; @@ -1740,8 +1824,7 @@ uint32_t steps_sum, uint16_t last_speed, uint32_t feedl, uint8_t fastfed, uint8_t scanfed, uint8_t fwdstep, - uint8_t tgtime, uint32_t * z1, - uint32_t * z2) + uint8_t tgtime, uint32_t * z1, uint32_t * z2) { uint8_t exposure_factor; @@ -2164,21 +2247,21 @@ default: dev->dark[0] = (uint16_t) (1.6925 * dark[i * 3 + 0] + - (1.1895 - 1.0) * 256); + (1.1895 - 1.0) * 256); dev->dark[1] = dev->dark[2] = dev->dark[0]; break; case 1: dev->dark[1] = (uint16_t) (1.4013 * dark[i * 3 + 1] + - (1.3147 - 1.0) * 256); + (1.3147 - 1.0) * 256); dev->dark[0] = dev->dark[2] = dev->dark[1]; break; case 2: dev->dark[2] = (uint16_t) (1.2931 * dark[i * 3 + 2] + - (1.1558 - 1.0) * 256); + (1.1558 - 1.0) * 256); dev->dark[0] = dev->dark[1] = dev->dark[2]; break; } @@ -2257,24 +2340,33 @@ } /* size is size in bytes for scanarea: bytes_per_line * lines */ - size = channels * 2 * pixels_per_line * (dev->model->shading_lines+1); + size = channels * 2 * pixels_per_line * (dev->model->shading_lines + 1); calibration_data = malloc (size); if (!calibration_data) { - DBG (DBG_error, "genesys_dark_shading_calibration: " - "failed to allocate calibration data memory\n"); + DBG (DBG_error, + "genesys_dark_shading_calibration: failed to allocate calibration data memory\n"); return SANE_STATUS_NO_MEM; } - /* turn off motor and lamp power */ - dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_FALSE); - dev->model->cmd_set->set_motor_power (dev->calib_reg, SANE_FALSE); + /* turn off motor and lamp power for flatbed scanners, but not for sheetfed scanners + * because they have a calibration sheet with a sufficent black strip */ + if (dev->model->is_sheetfed == SANE_FALSE) + { + dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_FALSE); + dev->model->cmd_set->set_motor_power (dev->calib_reg, SANE_FALSE); + } + else + { + dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_TRUE); + dev->model->cmd_set->set_motor_power (dev->calib_reg, SANE_TRUE); + } status = dev->model->cmd_set->bulk_write_register (dev, dev->calib_reg, - dev->model->cmd_set-> - bulk_full_size ()); + dev->model-> + cmd_set->bulk_full_size ()); if (status != SANE_STATUS_GOOD) { free (calibration_data); @@ -2321,13 +2413,14 @@ pixels_per_line * channels); if (DBG_LEVEL >= DBG_data) - { - sanei_genesys_write_pnm_file ("black_shading.pnm", calibration_data, 16, - channels, pixels_per_line, - dev->model->shading_lines); - sanei_genesys_write_pnm_file ("black_average.pnm", dev->dark_average_data, - 16, channels, pixels_per_line, 1); - } + { + sanei_genesys_write_pnm_file ("black_shading.pnm", calibration_data, 16, + channels, pixels_per_line, + dev->model->shading_lines); + sanei_genesys_write_pnm_file ("black_average.pnm", + dev->dark_average_data, 16, channels, + pixels_per_line, 1); + } free (calibration_data); @@ -2479,8 +2572,8 @@ status = dev->model->cmd_set->bulk_write_register (dev, dev->calib_reg, - dev->model->cmd_set-> - bulk_full_size ()); + dev->model-> + cmd_set->bulk_full_size ()); if (status != SANE_STATUS_GOOD) { free (calibration_data); @@ -2558,7 +2651,7 @@ } /* This calibration uses a scan over the calibration target, comprising a - * black and a white stripe. (So the motor must be on.) + * black and a white strip. (So the motor must be on.) */ static SANE_Status genesys_dark_white_shading_calibration (Genesys_Device * dev) @@ -2620,8 +2713,8 @@ status = dev->model->cmd_set->bulk_write_register (dev, dev->calib_reg, - dev->model->cmd_set-> - bulk_full_size ()); + dev->model-> + cmd_set->bulk_full_size ()); if (status != SANE_STATUS_GOOD) { free (calibration_data); @@ -2747,168 +2840,189 @@ return SANE_STATUS_GOOD; } +/* computes one coefficient given bright-dark value + * @param coeff factor giving 1.00 gain + * @param target desired target code + * @param value brght-dark value + * */ static unsigned int -compute_coefficient (unsigned int coeff, - unsigned int target_code, unsigned int val) +compute_coefficient (unsigned int coeff, unsigned int target, unsigned int value) { - if (val <= 0) - return 0; + int result; - val = (coeff * target_code) / val; - - if (val > 65535) - val = 65535; - return val; + if (value > 0) + { + result = (coeff * target) / value; + if (result >= 65535) + { + result = 65535; + } + } + else + { + result = coeff; + } + return result; } /** * Computes shading coefficient using formula in data sheet. 16bit data values - * manipulated here are little endian. + * manipulated here are little endian. For now we assume deletion scanning type + * and that there is always 3 channels. * @param dev scanner's device * @shading_data memory area where to store the computed shading coefficients * @param pixels_per_line number of pixels per line * @param channels number of color channels (actually 1 or 3) - * @param avgpixels number of pixels to average * @param offset shading coefficients left offset * @param coeff 4000h or 2000h depending on fast scan mode or not + * @param target value of the target code */ -static void +#ifndef UNIT_TESTING +static +#endif +void compute_coefficients (Genesys_Device * dev, uint8_t * shading_data, unsigned int pixels_per_line, unsigned int channels, - unsigned int avgpixels, - unsigned int offset, - unsigned int coeff, unsigned int target_code) -{ - uint8_t *ptr; /*contain 16bit words in little endian */ - unsigned int x, j; - unsigned int val, dk; + int cmat[3], + int offset, + unsigned int coeff, + unsigned int target) +{ + uint8_t *ptr; /* contain 16bit words in little endian */ + unsigned int x, c; + unsigned int val, br, dk; + unsigned int start, end; - for (x = 0; x < pixels_per_line - offset - avgpixels - 1; x += avgpixels) - { - /* dark data */ - ptr = shading_data + (x + offset) * 2 * 2 * 3; - dk = 0; - for (j = 0; j < avgpixels; j++) - { - dk += dev->dark_average_data[(x + j) * 2 * channels]; - dk += 256 * dev->dark_average_data[(x + j) * 2 * channels + 1]; - } - dk /= j; - if (dk > 65535) - dk = 65535; - for (j = 0; j < avgpixels; j++) - { - ptr[0 + j * 2 * 2 * 3] = dk & 255; - ptr[1 + j * 2 * 2 * 3] = dk / 256; + DBG (DBG_io, + "compute_coefficients: pixels_per_line=%d, coeff=0x%04x\n", pixels_per_line, coeff); + + /* compute start & end values depending of the offset */ + if (offset < 0) + { + start = -1 * offset; + end = pixels_per_line; + } + else + { + start = 0; + end = pixels_per_line - offset; + } + + for (c = 0; c < channels; c++) + { + for (x = start; x < end; x++) + { + /* TODO if channels=1 , use filter to know the base addr */ + ptr = shading_data + 4 * ((x + offset) * channels + cmat[c]); + + /* dark data */ + dk = dev->dark_average_data[x * 2 * channels + c * 2]; + dk += 256 * dev->dark_average_data[x * 2 * channels + c * 2 + 1]; + + /* white data */ + br = dev->white_average_data[x * 2 * channels + c * 2]; + br += 256 * dev->white_average_data[x * 2 * channels + c * 2 + 1]; + + /* compute coeff */ + val=compute_coefficient(coeff,target,br-dk); + + /* assign it */ + ptr[0] = dk & 255; + ptr[1] = dk / 256; + ptr[2] = val & 0xff; + ptr[3] = val / 256; } - if (channels > 1) - { - dk = 0; - for (j = 0; j < avgpixels; j++) - { - dk += dev->dark_average_data[(x + j) * 2 * channels + 2]; - dk += 256 * dev->dark_average_data[(x + j) * 2 * channels + 3]; - } - dk /= j; - if (dk > 65535) - dk = 65535; - for (j = 0; j < avgpixels; j++) - { - ptr[4 + j * 2 * 2 * 3] = dk & 255; - ptr[5 + j * 2 * 2 * 3] = dk / 256; - } + } +} + +/** + * Computes shading coefficient using formula in data sheet. 16bit data values + * manipulated here are little endian. Data is in planar form, ie grouped by + * lines of the same color component. + * @param dev scanner's device + * @shading_data memory area where to store the computed shading coefficients + * @factor averaging factor when the calibration scan is done at a higher resolution + * than the final scan + * @param pixels_per_line number of pixels per line + * @param channels number of color channels (actually 1 or 3) + * @param cmat transcoding matrix for color channel order + * @param offset shading coefficients left offset + * @param coeff 4000h or 2000h depending on fast scan mode or not + * @param target white target value + */ +#ifndef UNIT_TESTING +static +#endif +void +compute_planar_coefficients (Genesys_Device * dev, + uint8_t * shading_data, + unsigned int factor, + unsigned int pixels_per_line, + unsigned int words_per_color, + unsigned int channels, + int cmat[3], + unsigned int offset, + unsigned int coeff, + unsigned int target) +{ + uint8_t *ptr; /* contains 16bit words in little endian */ + unsigned int x, c, i; + unsigned int val, dk, br; + + DBG (DBG_io, + "compute_planar_coefficients: factor=%d, pixels_per_line=%d, words=0x%X, coeff=0x%04x\n", factor, + pixels_per_line, words_per_color, coeff); + for (c = 0; c < channels; c++) + { + /* shading data is larger than pixels_per_line so offset can be neglected */ + for (x = 0; x < pixels_per_line; x+=factor) + { + /* x2 because of 16 bit values, and x2 since one coeff for dark + * and another for white */ + ptr = + shading_data + words_per_color * cmat[c] * 2 + (x + offset) * 4; + dk = 0; - for (j = 0; j < avgpixels; j++) - { - dk += dev->dark_average_data[(x + j) * 2 * channels + 4]; - dk += 256 * dev->dark_average_data[(x + j) * 2 * channels + 5]; - } - dk /= j; - if (dk > 65535) - dk = 65535; - for (j = 0; j < avgpixels; j++) - { - ptr[8 + j * 2 * 2 * 3] = dk & 255; - ptr[9 + j * 2 * 2 * 3] = dk / 256; - } - } - else - { - for (j = 0; j < avgpixels; j++) - { - ptr[4 + j * 2 * 2 * 3] = ptr[0]; - ptr[5 + j * 2 * 2 * 3] = ptr[1]; - ptr[8 + j * 2 * 2 * 3] = ptr[0]; - ptr[9 + j * 2 * 2 * 3] = ptr[1]; - } - } + br = 0; - /* white data */ - /* red channel */ - val = 0; - for (j = 0; j < avgpixels; j++) - { - val += 256 * dev->white_average_data[(x + j) * 2 * channels + 1]; - val += dev->white_average_data[(x + j) * 2 * channels]; - } - val /= j; - val -= (256 * ptr[1] + ptr[0]); - val = compute_coefficient (coeff, target_code, val); - for (j = 0; j < avgpixels; j++) - { - ptr[2 + j * 2 * 2 * 3] = val & 0xff; - ptr[3 + j * 2 * 2 * 3] = val / 256; - } + /* average case */ + for(i=0;idark_average_data[((x+i) + pixels_per_line * c) * 2 + 1]; + dk += dev->dark_average_data[((x+i) + pixels_per_line * c) * 2]; + br += + 256 * dev->white_average_data[((x+i) + pixels_per_line * c) * 2 + 1]; + br += dev->white_average_data[((x+i) + pixels_per_line * c) * 2]; + } + dk /= factor; + br /= factor; - if (channels > 1) - { - /* green */ - val = 0; - for (j = 0; j < avgpixels; j++) - { - val += - 256 * dev->white_average_data[(x + j) * 2 * channels + 3]; - val += dev->white_average_data[(x + j) * 2 * channels + 2]; - } - val /= j; - val -= (256 * ptr[5] + ptr[4]); - val = compute_coefficient (coeff, target_code, val); - for (j = 0; j < avgpixels; j++) - { - ptr[6 + j * 2 * 2 * 3] = val & 0xff; - ptr[7 + j * 2 * 2 * 3] = val / 256; - } - - /* blue */ - val = 0; - for (j = 0; j < avgpixels; j++) - { - val += - 256 * dev->white_average_data[(x + j) * 2 * channels + 5]; - val += dev->white_average_data[(x + j) * 2 * channels + 4]; - } - val /= j; - val -= (256 * ptr[9] + ptr[8]); - val = compute_coefficient (coeff, target_code, val); - for (j = 0; j < avgpixels; j++) - { - ptr[10 + j * 2 * 2 * 3] = val & 255; - ptr[11 + j * 2 * 2 * 3] = val / 256; - } - } - else - { - for (j = 0; j < avgpixels; j++) + val = compute_coefficient (coeff, target, br - dk); + + /* we duplicate the information to have calibration data at optical resolution */ + for (i = 0; i < factor; i++) { - ptr[6 + j * 2 * 2 * 3] = val & 255; - ptr[7 + j * 2 * 2 * 3] = val / 256; - ptr[10 + j * 2 * 2 * 3] = val & 255; - ptr[11 + j * 2 * 2 * 3] = val / 256; + ptr[0 + 4 * i] = dk & 255; + ptr[1 + 4 * i] = dk / 256; + ptr[2 + 4 * i] = val & 0xff; + ptr[3 + 4 * i] = val / 256; } } } + /* in case of gray level scan, we duplicate shading information on all + * three color channels */ + if(channels==1) + { + memcpy(shading_data+cmat[1]*2*words_per_color, + shading_data+cmat[0]*2*words_per_color, + words_per_color*2); + memcpy(shading_data+cmat[2]*2*words_per_color, + shading_data+cmat[0]*2*words_per_color, + words_per_color*2); + } } static SANE_Status @@ -2916,10 +3030,13 @@ { SANE_Status status; uint16_t pixels_per_line; - uint8_t *shading_data; /*contains 16bit words in little endian */ + uint8_t *shading_data; /**> contains 16bit words in little endian */ uint8_t channels; - unsigned int x, j, o; - unsigned int i, res; + unsigned int x, j; + int o; + unsigned int length; /**> number of shading calibration data words */ + unsigned int i, res, factor; + int cmat[3]; /**> matrix of color channels */ unsigned int coeff, target_code, val, avgpixels, dk, words_per_color = 0; unsigned int target_dark, target_bright, br; @@ -2929,32 +3046,37 @@ pixels_per_line = dev->calib_pixels; channels = dev->calib_channels; - /* we always build data for three channels, even for gray */ - if (dev->model->is_cis) - { - switch (sanei_genesys_read_reg_from_set (dev->reg, 0x05) >> 6) - { - case 0: - words_per_color = 0x5500; - break; - case 1: - words_per_color = 0xaa00; - break; - case 2: - words_per_color = 0x15400; - break; - } - shading_data = malloc (words_per_color * 3); /* 16 bit black, 16 bit white */ - memset (shading_data, 0, words_per_color * 3); + /* we always build data for three channels, even for gray + * we make the shading data such that each color channel data line is contiguous + * to the next one, which allow to write the 3 channels in 1 write + * during genesys_send_shading_coefficient, some values are words, other bytes + * hence the x2 factor */ + switch (sanei_genesys_read_reg_from_set (dev->reg, 0x05) >> 6) + { + /* 600 dpi */ + case 0: + words_per_color = 0x2a00; + break; + /* 1200 dpi */ + case 1: + words_per_color = 0x5500; + break; + /* 2400 dpi */ + case 2: + words_per_color = 0xa800; + break; } - else - shading_data = malloc (pixels_per_line * 4 * 3); /* 16 bit black, 16 bit white */ + + length = words_per_color * 3 * 2; + /* allocate computed size */ + shading_data = malloc (length); if (!shading_data) { DBG (DBG_error, "genesys_send_shading_coefficient: failed to allocate memory\n"); return SANE_STATUS_NO_MEM; } + memset (shading_data, 0, length); /* TARGET/(Wn-Dn) = white gain -> ~1.xxx then it is multiplied by 0x2000 or 0x4000 to give an integer @@ -2966,35 +3088,135 @@ else coeff = 0x2000; + /* compute avg factor */ + if(dev->settings.xres>dev->sensor.optical_res) + { + factor=1; + } + else + { + factor=dev->sensor.optical_res/dev->settings.xres; + } + + /* for GL646, shading data is planar if REG01_FASTMOD is set and + * chunky if not. For now we rely on the fact that we know that + * each sensor is used only in one mode. Currently only the CIS_XP200 + * sets REG01_FASTMOD. + */ + + /* at some point me may thought of a setup struct in genesys_devices that + * will handle these settings instead of having this switch growing up */ switch (dev->model->ccd_type) { + case CCD_XP300: + case CCD_ROADWARRIOR: + case CCD_DP665: + case CCD_DP685: + case CCD_DSMOBILE600: + target_code = 0xdc00; + o = 4; + cmat[0] = 0; + cmat[1] = 1; + cmat[2] = 2; + compute_planar_coefficients (dev, + shading_data, + factor, + pixels_per_line, + words_per_color, + channels, + cmat, + o, + coeff, + target_code); + break; + case CIS_XP200: + target_code = 0xdc00; + o = 2; + cmat[0] = 2; /* red is last */ + cmat[1] = 0; /* green is first */ + cmat[2] = 1; /* blue is second */ + compute_planar_coefficients (dev, + shading_data, + 1, + pixels_per_line, + words_per_color, + channels, + cmat, + o, + coeff, + target_code); + break; + case CCD_HP2300: + target_code = 0xdc00; + o = 2; + if(dev->settings.xres<=dev->sensor.optical_res/2) + { + o = o - dev->sensor.dummy_pixel / 2; + } + cmat[0] = 0; + cmat[1] = 1; + cmat[2] = 2; + compute_coefficients (dev, + shading_data, + pixels_per_line, + 3, + cmat, + o, + coeff, + target_code); + break; case CCD_5345: - target_code = 0xfa00; - memset (shading_data, 0x00, pixels_per_line * 4 * channels); + target_code = 0xe000; o = 4; - avgpixels = 1; + if(dev->settings.xres<=dev->sensor.optical_res/2) + { + o = o - dev->sensor.dummy_pixel; + } + cmat[0] = 0; + cmat[1] = 1; + cmat[2] = 2; compute_coefficients (dev, shading_data, pixels_per_line, - channels, avgpixels, o, coeff, target_code); + 3, + cmat, + o, + coeff, + target_code); break; - case CCD_HP2300: - case CCD_HP2400: case CCD_HP3670: - target_code = 0xfa00; - memset (shading_data, 0x00, pixels_per_line * 4 * channels); - o = 2; - avgpixels = 1; + case CCD_HP2400: + target_code = 0xe000; + /* offset is cksel dependent, but we can't use this in common code */ + if(dev->settings.xres<=300) + { + o = -10; /* OK for <=300 */ + } + else if(dev->settings.xres<=600) + { + o = -6; /* ok at 600 */ + } + else + { + o = +2; + } + cmat[0] = 0; + cmat[1] = 1; + cmat[2] = 2; compute_coefficients (dev, shading_data, pixels_per_line, - channels, avgpixels, o, coeff, target_code); + 3, + cmat, + o, + coeff, + target_code); break; case CCD_CANONLIDE35: target_bright = 0xfa00; target_dark = 0xa00; o = 4; /*first four pixels are ignored */ - memset (shading_data, 0xff, words_per_color * 3); + memset (shading_data, 0xff, length); /* strangely i can write 0x20000 bytes beginning at 0x00000 without overwriting @@ -3054,7 +3276,7 @@ for (x = 0; x <= pixels_per_line - avgpixels; x += avgpixels) { - if ((x + o) * 2 * 2 + 3 > words_per_color) + if ((x + o) * 2 * 2 + 3 > words_per_color * 2) break; for (j = 0; j < channels; j++) @@ -3098,9 +3320,9 @@ for (i = 0; i < avgpixels; i++) { shading_data[(x + o + i) * 2 * 2 + - words_per_color * j] = val & 0xff; + words_per_color * 2 * j] = val & 0xff; shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 1] = val >> 8; + words_per_color * 2 * j + 1] = val >> 8; } val = br - dk; @@ -3114,9 +3336,9 @@ for (i = 0; i < avgpixels; i++) { shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 2] = val & 0xff; + words_per_color * 2 * j + 2] = val & 0xff; shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 3] = val >> 8; + words_per_color * 2 * j + 3] = val >> 8; } } @@ -3126,20 +3348,20 @@ for (i = 0; i < avgpixels; i++) { shading_data[(x + o + i) * 2 * 2 + - words_per_color * j] = + words_per_color * 2 * j] = shading_data[(x + o + i) * 2 * 2 + words_per_color * 0]; shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 1] = + words_per_color * 2 * j + 1] = shading_data[(x + o + i) * 2 * 2 + - words_per_color * 0 + 1]; + words_per_color * 2 * 0 + 1]; shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 2] = + words_per_color * 2 * j + 2] = shading_data[(x + o + i) * 2 * 2 + - words_per_color * 0 + 2]; + words_per_color * 2 * 0 + 2]; shading_data[(x + o + i) * 2 * 2 + - words_per_color * j + 3] = + words_per_color * 2 * j + 3] = shading_data[(x + o + i) * 2 * 2 + - words_per_color * 0 + 3]; + words_per_color * 2 * 0 + 3]; } } @@ -3148,10 +3370,10 @@ /* creates a black line in image for ( x = 65; x < 66; x++) { for ( j = 0; j < 3; j++) { - shading_data[(x+o) * 2 * 2 + words_per_color * j + 0] = 0; - shading_data[(x+o) * 2 * 2 + words_per_color * j + 1] = 0; - shading_data[(x+o) * 2 * 2 + words_per_color * j + 2] = 0; - shading_data[(x+o) * 2 * 2 + words_per_color * j + 3] = 0; + shading_data[(x+o) * 2 * 2 + words_per_color * 2 * j + 0] = 0; + shading_data[(x+o) * 2 * 2 + words_per_color * 2 * j + 1] = 0; + shading_data[(x+o) * 2 * 2 + words_per_color * 2 * j + 2] = 0; + shading_data[(x+o) * 2 * 2 + words_per_color * 2 * j + 3] = 0; } } */ @@ -3164,14 +3386,8 @@ break; } - - if (dev->model->is_cis) - status = genesys_send_offset_and_shading (dev, shading_data, 0x1fe00); - else - status = - genesys_send_offset_and_shading (dev, shading_data, - pixels_per_line * 4 * 3); - + /* do the actual write of shading calibration data to the scanner */ + status = genesys_send_offset_and_shading (dev, shading_data, length); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "genesys_send_shading_coefficient: failed to send shading data: %s\n", @@ -3196,64 +3412,65 @@ { SANE_Status status; Genesys_Calibration_Cache *cache; - + DBG (DBG_proc, "genesys_restore_calibration\n"); /* if no cache or no function to evaluate cache entry ther can be no match */ - if (!dev->model->cmd_set->is_compatible_calibration || dev->calibration_cache==NULL) + if (!dev->model->cmd_set->is_compatible_calibration + || dev->calibration_cache == NULL) return SANE_STATUS_UNSUPPORTED; /* we walk the link list of calibration cache in search for a * matching one */ - for(cache = dev->calibration_cache; cache; cache = cache->next) + for (cache = dev->calibration_cache; cache; cache = cache->next) { - status = dev->model->cmd_set->is_compatible_calibration(dev, cache, - SANE_FALSE); + status = dev->model->cmd_set->is_compatible_calibration (dev, cache, + SANE_FALSE); /* SANE_STATUS_GOOD, a matching cache has been found * so we use it to populate calibration data */ - if(status==SANE_STATUS_GOOD) - { - memcpy(&dev->frontend, &cache->frontend, sizeof(dev->frontend)); - /* don't restore the gamma fields */ - memcpy(&dev->sensor, &cache->sensor, - offsetof(Genesys_Sensor,red_gamma)); - - free(dev->dark_average_data); - free(dev->white_average_data); - - dev->average_size = cache->average_size; - dev->calib_pixels = cache->calib_pixels; - dev->calib_channels = cache->calib_channels; - - dev->dark_average_data = (uint8_t*)malloc(cache->average_size); - dev->white_average_data = (uint8_t*)malloc(cache->average_size); - - if (!dev->dark_average_data || !dev->white_average_data) - return SANE_STATUS_NO_MEM; + if (status == SANE_STATUS_GOOD) + { + memcpy (&dev->frontend, &cache->frontend, sizeof (dev->frontend)); + /* don't restore the gamma fields */ + memcpy (&dev->sensor, &cache->sensor, + offsetof (Genesys_Sensor, red_gamma)); - memcpy(dev->dark_average_data, - cache->dark_average_data, dev->average_size); - memcpy(dev->white_average_data, - cache->white_average_data, dev->average_size); + free (dev->dark_average_data); + free (dev->white_average_data); - status = genesys_send_shading_coefficient (dev); + dev->average_size = cache->average_size; + dev->calib_pixels = cache->calib_pixels; + dev->calib_channels = cache->calib_channels; - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "genesys_restore_calibration: failed to send shading data: %s\n", - sane_strstatus (status)); - return status; - } + dev->dark_average_data = (uint8_t *) malloc (cache->average_size); + dev->white_average_data = (uint8_t *) malloc (cache->average_size); - DBG (DBG_proc, "genesys_restore_calibration: restored\n"); - return SANE_STATUS_GOOD; - } + if (!dev->dark_average_data || !dev->white_average_data) + return SANE_STATUS_NO_MEM; + + memcpy (dev->dark_average_data, + cache->dark_average_data, dev->average_size); + memcpy (dev->white_average_data, + cache->white_average_data, dev->average_size); + + status = genesys_send_shading_coefficient (dev); + + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_restore_calibration: failed to send shading data: %s\n", + sane_strstatus (status)); + return status; + } + + DBG (DBG_proc, "genesys_restore_calibration: restored\n"); + return SANE_STATUS_GOOD; + } - /* here status is either SANE_STATUS_UNSUPPORTED which mean tested cache - * entry doesn't match, or an fatal error */ - if (status != SANE_STATUS_UNSUPPORTED) + /* here status is either SANE_STATUS_UNSUPPORTED which mean tested cache + * entry doesn't match, or an fatal error */ + if (status != SANE_STATUS_UNSUPPORTED) { DBG (DBG_error, "genesys_restore_calibration: fail while checking compatibility: %s\n", @@ -3272,6 +3489,9 @@ SANE_Status status = SANE_STATUS_UNSUPPORTED; Genesys_Calibration_Cache *cache = NULL; uint8_t *tmp; +#ifdef HAVE_SYS_TIME_H + struct timeval time; +#endif DBG (DBG_proc, "genesys_save_calibration\n"); @@ -3351,11 +3571,23 @@ cache->average_size); memcpy (cache->white_average_data, dev->white_average_data, cache->average_size); +#ifdef HAVE_SYS_TIME_H + gettimeofday(&time,NULL); + cache->last_calibration = time.tv_sec; +#endif DBG (DBG_proc, "genesys_save_calibration: completed\n"); return SANE_STATUS_GOOD; } +/** + * does the calibration process for a flatbed scanner + * - offset calibration + * - gain calibration + * - shading calibration + * @param dev device to calibrate + * @return SANE_STATUS_GOOD if everything when all right, else the error code. + */ static SANE_Status genesys_flatbed_calibration (Genesys_Device * dev) { @@ -3369,25 +3601,6 @@ if (dev->settings.yres <= dev->sensor.optical_res / 2) yres /= 2; - /* send custom or generic gamma tables depending on flag */ - if (dev->model->flags & GENESYS_FLAG_CUSTOM_GAMMA) - { - /* use custom gamma table */ - status = dev->model->cmd_set->send_gamma_table (dev, 0); - } - else - { - /* send default gamma table if no custom gamma */ - status = dev->model->cmd_set->send_gamma_table (dev, 1); - } - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "genesys_flatbed_calibration: failed to init gamma table: %s\n", - sane_strstatus (status)); - return status; - } - /* do offset calibration if needed */ if (dev->model->flags & GENESYS_FLAG_OFFSET_CALIBRATION) { @@ -3437,7 +3650,7 @@ if (dev->model->is_cis) { -/*the afe now sends valid data for doing led calibration*/ + /* the afe now sends valid data for doing led calibration */ status = dev->model->cmd_set->led_calibration (dev); if (status != SANE_STATUS_GOOD) { @@ -3447,7 +3660,7 @@ return status; } -/*calibrate afe again to match new exposure*/ + /* calibrate afe again to match new exposure */ if (dev->model->flags & GENESYS_FLAG_OFFSET_CALIBRATION) { status = dev->model->cmd_set->offset_calibration (dev); @@ -3469,7 +3682,6 @@ sane_strstatus (status)); return status; } - } else /* since we have 2 gain calibration proc, skip second if first one was @@ -3493,13 +3705,11 @@ sane_strstatus (status)); return status; } - } } - - pixels_per_line = (SANE_UNFIX(dev->model->x_size) * dev->settings.xres) / - MM_PER_INCH; + pixels_per_line = (SANE_UNFIX (dev->model->x_size) * dev->settings.xres) / + MM_PER_INCH; /* send default shading data */ status = sanei_genesys_init_shading_data (dev, pixels_per_line); @@ -3564,37 +3774,270 @@ return status; } - /* send specific gamma tables if needed */ - status = dev->model->cmd_set->send_gamma_table (dev, 0); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "genesys_flatbed_calibration: failed to send specific gamma tables: %s\n", - sane_strstatus (status)); - return status; - } - DBG (DBG_info, "genesys_flatbed_calibration: completed\n"); return SANE_STATUS_GOOD; } -/* unused function kept in case it may be usefull in the futur */ -#if 0 +/** + * Does the calibration process for a sheetfed scanner + * - offset calibration + * - gain calibration + * - shading calibration + * During calibration a predefined calibration sheet with specific black and white + * areas is used. + * @param dev device to calibrate + * @return SANE_STATUS_GOOD if everything when all right, else the error code. + */ static SANE_Status -genesys_wait_not_moving (Genesys_Device * dev, int mseconds) +genesys_sheetfed_calibration (Genesys_Device * dev) { - uint8_t value; - SANE_Status status; + SANE_Status status = SANE_STATUS_GOOD; + SANE_Bool forward = SANE_TRUE; + int xres; - DBG (DBG_proc, - "genesys_wait_not_moving: waiting %d mseconds for motor to stop\n", - mseconds); - while (mseconds > 0) + DBG (DBG_proc, "genesys_sheetfed_calibration: start\n"); + if (dev->model->cmd_set->search_strip == NULL) { - RIE (sanei_genesys_get_status (dev, &value)); - - if (dev->model->cmd_set->test_motor_flag_bit (value)) + DBG (DBG_error, + "genesys_sheetfed_calibration: no strip searching function available\n"); + return SANE_STATUS_UNSUPPORTED; + } + + /* first step, load document */ + status = dev->model->cmd_set->load_document (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to load document: %s\n", + sane_strstatus (status)); + return status; + } + + + DBG (DBG_info, "genesys_sheetfed_calibration\n"); + + /* led, offset and gain calibration are influenced by scan + * settings. So we set it to sensor resolution */ + xres = dev->sensor.optical_res; + dev->settings.xres = dev->sensor.optical_res; + /* XP200 needs to calibrate a full and half sensor's resolution */ + if (dev->model->ccd_type == CIS_XP200 + && dev->settings.xres <= dev->sensor.optical_res / 2) + dev->settings.xres /= 2; + + /* the afe needs to sends valid data even before calibration */ + + /* go to a white area */ + status = dev->model->cmd_set->search_strip (dev, forward, SANE_FALSE); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to find white strip: %s\n", + sane_strstatus (status)); + dev->model->cmd_set->eject_document (dev); + return status; + } + + if (dev->model->is_cis) + { + status = dev->model->cmd_set->led_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: led calibration failed: %s\n", + sane_strstatus (status)); + return status; + } + } + + /* calibrate afe */ + if (dev->model->flags & GENESYS_FLAG_OFFSET_CALIBRATION) + { + status = dev->model->cmd_set->offset_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: offset calibration failed: %s\n", + sane_strstatus (status)); + return status; + } + + /* since all the registers are set up correctly, just use them */ + + status = dev->model->cmd_set->coarse_gain_calibration (dev, xres); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: coarse gain calibration: %s\n", + sane_strstatus (status)); + return status; + } + } + else + /* since we have 2 gain calibration proc, skip second if first one was + used. */ + { + status = + dev->model->cmd_set->init_regs_for_coarse_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to send calibration registers: %s\n", + sane_strstatus (status)); + return status; + } + + status = genesys_coarse_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to do static calibration: %s\n", + sane_strstatus (status)); + return status; + } + } + + /* search for a full width black strip and then do a 16 bit scan to + * gather black shading data */ + if (dev->model->flags & GENESYS_FLAG_DARK_CALIBRATION) + { + /* seek black/white reverse/forward */ + status = dev->model->cmd_set->search_strip (dev, forward, SANE_TRUE); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to find black strip: %s\n", + sane_strstatus (status)); + dev->model->cmd_set->eject_document (dev); + return status; + } + + status = dev->model->cmd_set->init_regs_for_shading (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to do set up registers for shading calibration: %s\n", + sane_strstatus (status)); + return status; + } + status = genesys_dark_shading_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + dev->model->cmd_set->eject_document (dev); + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to do dark shading calibration: %s\n", + sane_strstatus (status)); + return status; + } + forward = SANE_FALSE; + } + + + /* go to a white area */ + status = dev->model->cmd_set->search_strip (dev, forward, SANE_FALSE); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to find white strip: %s\n", + sane_strstatus (status)); + dev->model->cmd_set->eject_document (dev); + return status; + } + + status = dev->model->cmd_set->init_regs_for_shading (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to do set up registers for shading calibration: %s\n", + sane_strstatus (status)); + return status; + } + status = genesys_white_shading_calibration (dev); + if (status != SANE_STATUS_GOOD) + { + dev->model->cmd_set->eject_document (dev); + DBG (DBG_error, + "genesys_sheetfed_calibration: failed eject target: %s\n", + sane_strstatus (status)); + return status; + } + + /* in case we haven't black shading data, build it from black pixels + * of white calibration */ + if (!(dev->model->flags & GENESYS_FLAG_DARK_CALIBRATION)) + { + FREE_IFNOT_NULL (dev->dark_average_data); + dev->dark_average_data = malloc (dev->average_size); + memset (dev->dark_average_data, 0x0f, dev->average_size); + /* XXX STEF XXX + * with black point in white shading, build an average black + * pixel and use it to fill the dark_average + * dev->calib_pixels + (dev->sensor.sensor_pixels * dev->settings.xres) / dev->sensor.optical_res, + dev->model->shading_lines, + */ + } + + /* send the shading coefficient */ + status = genesys_send_shading_coefficient (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to send shading calibration coefficients: %s\n", + sane_strstatus (status)); + return status; + } + + /* save the calibration data */ + genesys_save_calibration (dev); + + /* and finally eject calibration sheet */ + status = dev->model->cmd_set->eject_document (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_sheetfed_calibration: failed to eject document: %s\n", + sane_strstatus (status)); + return status; + } + + /* resotre settings */ + dev->settings.xres = xres; + DBG (DBG_proc, "genesys_sheetfed_calibration: end\n"); + return SANE_STATUS_GOOD; +} + +/** + * does the calibration process for a device + * @param dev device to calibrate + */ +static SANE_Status +genesys_scanner_calibration (Genesys_Device * dev) +{ + if (dev->model->is_sheetfed == SANE_FALSE) + { + return genesys_flatbed_calibration (dev); + } + return genesys_sheetfed_calibration (dev); +} + +/* unused function kept in case it may be usefull in the futur */ +#if 0 +static SANE_Status +genesys_wait_not_moving (Genesys_Device * dev, int mseconds) +{ + uint8_t value; + SANE_Status status; + + DBG (DBG_proc, + "genesys_wait_not_moving: waiting %d mseconds for motor to stop\n", + mseconds); + while (mseconds > 0) + { + RIE (sanei_genesys_get_status (dev, &value)); + + if (dev->model->cmd_set->test_motor_flag_bit (value)) { usleep (100 * 1000); mseconds -= 100; @@ -3616,6 +4059,89 @@ } #endif +/* Function to build a lookup table (LUT), often + used by scanners to implement brightness/contrast/gamma + or by backends to speed binarization/thresholding + + offset and slope inputs are -127 to +127 + + slope rotates line around central input/output val, + 0 makes horizontal line + + pos zero neg + . x . . x + . x . . x + out . x .xxxxxxxxxxx . x + . x . . x + ....x....... ............ .......x.... + in in in + + offset moves line vertically, and clamps to output range + 0 keeps the line crossing the center of the table + + high low + . xxxxxxxx . + . x . + out x . x + . . x + ............ xxxxxxxx.... + in in + + out_min/max provide bounds on output values, + useful when building thresholding lut. + 0 and 255 are good defaults otherwise. + */ +static SANE_Status +load_lut (unsigned char * lut, + int in_bits, int out_bits, + int out_min, int out_max, + int slope, int offset) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i, j; + double shift, rise; + int max_in_val = (1 << in_bits) - 1; + int max_out_val = (1 << out_bits) - 1; + unsigned char * lut_p = lut; + + DBG (DBG_proc, "load_lut: start\n"); + + /* slope is converted to rise per unit run: + * first [-127,127] to [-1,1] + * then multiply by PI/2 to convert to radians + * then take the tangent (T.O.A) + * then multiply by the normal linear slope + * because the table may not be square, i.e. 1024x256*/ + rise = tan((double)slope/127 * M_PI/2) * max_out_val / max_in_val; + + /* line must stay vertically centered, so figure + * out vertical offset at central input value */ + shift = (double)max_out_val/2 - (rise*max_in_val/2); + + /* convert the user offset setting to scale of output + * first [-127,127] to [-1,1] + * then to [-max_out_val/2,max_out_val/2]*/ + shift += (double)offset / 127 * max_out_val / 2; + + for(i=0;i<=max_in_val;i++){ + j = rise*i + shift; + + if(jout_max){ + j=out_max; + } + + *lut_p=j; + lut_p++; + } + + DBG (DBG_proc, "load_lut: finish\n"); + return ret; +} + + /* ------------------------------------------------------------------------ */ /* High level (exported) functions */ /* ------------------------------------------------------------------------ */ @@ -3769,6 +4295,7 @@ { SANE_Status status; unsigned int steps, expected; + SANE_Bool empty; DBG (DBG_proc, "genesys_start_scan\n"); @@ -3782,8 +4309,10 @@ return status; } - /* wait for lamp warmup */ - if (!(dev->model->flags & GENESYS_FLAG_SKIP_WARMUP)) + /* wait for lamp warmup : until a warmup for TRANSPARENCY is designed, skip + * it when scanning from XPA */ + if (!(dev->model->flags & GENESYS_FLAG_SKIP_WARMUP) + && (dev->settings.scan_method == SCAN_METHOD_FLATBED)) { RIE (genesys_warmup_lamp (dev)); } @@ -3831,6 +4360,20 @@ } } + /* move to calibration area for transparency adapter */ + if ((dev->settings.scan_method == SCAN_METHOD_TRANSPARENCY) + && dev->model->cmd_set->move_to_ta != NULL) + { + status=dev->model->cmd_set->move_to_ta(dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_start_scan: failed to move to start of transparency adapter: %s\n", + sane_strstatus (status)); + return status; + } + } + /* load document if needed (for sheetfed scanner for instance) */ if (dev->model->is_sheetfed == SANE_TRUE && dev->model->cmd_set->load_document != NULL) @@ -3845,54 +4388,51 @@ } } - /* TODO: STEF we should move gamma table handling out of calibration, when cache - * is active, custom gamma tables don't seem to be sent */ + /* send custom or generic gamma tables depending on flag */ + if (dev->model->flags & GENESYS_FLAG_CUSTOM_GAMMA) + { + /* use custom gamma table */ + status = dev->model->cmd_set->send_gamma_table (dev, 0); + } + else + { + /* send default gamma table if no custom gamma */ + status = dev->model->cmd_set->send_gamma_table (dev, 1); + } + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "genesys_start_scan: failed to init gamma table: %s\n", + sane_strstatus (status)); + return status; + } + + /* try to use cached calibration first */ status = genesys_restore_calibration (dev); - if(status == SANE_STATUS_UNSUPPORTED) + if (status == SANE_STATUS_UNSUPPORTED) { /* calibration : sheetfed scanners can't calibrate before each scan */ - /* so we use a NO_CALIBRATION flags for those scanners */ - if (dev->model->flags & GENESYS_FLAG_NO_CALIBRATION) + /* and also those who have the NO_CALIBRATION flag */ + if (!(dev->model->flags & GENESYS_FLAG_NO_CALIBRATION) + &&dev->model->is_sheetfed == SANE_FALSE) { - /* TODO send predefined calibration values from default - * values or built from a calibration scan */ - /* send custom or generic gamma tables depending on flag */ - if (dev->model->flags & GENESYS_FLAG_CUSTOM_GAMMA) - { - /* use custom gamma table */ - status = dev->model->cmd_set->send_gamma_table (dev, 0); - } - else - { - /* send default gamma table if no custom gamma */ - status = dev->model->cmd_set->send_gamma_table (dev, 1); - } + status = genesys_scanner_calibration (dev); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "genesys_start_scan: failed to init gamma table: %s\n", + "genesys_start_scan: failed to do scanner calibration: %s\n", sane_strstatus (status)); return status; } - /* head hasn't moved */ - dev->scanhead_position_in_steps = 0; + genesys_save_calibration (dev); } else { - status = genesys_flatbed_calibration (dev); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "genesys_start_scan: failed to do flatbed calibration: %s\n", - sane_strstatus (status)); - return status; - } - - genesys_save_calibration(dev); - } + DBG (DBG_warn, "genesys_start_scan: no calibration done\n"); + } } - else if(status != SANE_STATUS_GOOD) + else if (status != SANE_STATUS_GOOD) { DBG (DBG_error, "genesys_start_scan: failed to restore calibration: %s\n", @@ -3900,6 +4440,19 @@ return status; } + /* build look up table for dynamic lineart */ + if(dev->settings.dynamic_lineart==SANE_TRUE) + { + status = load_lut(dev->lineart_lut, 8, 8, 50, 205, + dev->settings.threshold_curve, + dev->settings.threshold-127); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "genesys_start_scan: failed to build lut\n"); + return status; + } + } + status = dev->model->cmd_set->init_regs_for_scan (dev); if (status != SANE_STATUS_GOOD) { @@ -3911,12 +4464,12 @@ status = dev->model->cmd_set->bulk_write_register (dev, dev->reg, - dev->model->cmd_set-> - bulk_full_size ()); + dev->model-> + cmd_set->bulk_full_size ()); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "genesys_start_scan: Failed to bulk write registers, status = %d\n", + "genesys_start_scan: failed to bulk write registers, status = %d\n", status); return status; } @@ -3953,6 +4506,13 @@ } } while (steps < expected); + + /* wait for buffers to be filled */ + do + { + RIE (sanei_genesys_test_buffer_empty (dev, &empty)); + } + while (empty); /* when doing one or two-table movement, let the motor settle to scanning speed */ /* and scanning start before reading data */ @@ -3974,7 +4534,7 @@ if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "genesys_start_scan: Failed to read valid words: %s\n", + "genesys_start_scan: failed to read valid words: %s\n", sane_strstatus (status)); return status; } @@ -4246,8 +4806,11 @@ "genesys_read_ordered_data: nothing more to scan: EOF\n"); *len = 0; #ifdef SANE_DEBUG_LOG_RAW_DATA - fclose (rawfile); - rawfile = NULL; + if (rawfile != NULL) + { + fclose (rawfile); + rawfile = NULL; + } #endif return SANE_STATUS_EOF; } @@ -4640,14 +5203,16 @@ bytes = dst_lines * dev->settings.pixels * channels; - status = genesys_gray_lineart (work_buffer_src, destination, + status = genesys_gray_lineart (dev, + work_buffer_src, + destination, dev->settings.pixels, - channels, - dst_lines, dev->settings.threshold); + dst_lines, + dev->settings.threshold); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "genesys_read_ordered_data: failed to reverse bits(%s)\n", + "genesys_read_ordered_data: failed to convert bits(%s)\n", sane_strstatus (status)); return SANE_STATUS_IO_ERROR; } @@ -4729,7 +5294,6 @@ s->params.depth = depth; s->dev->settings.depth = depth; - /* interpolation */ s->dev->settings.disable_interpolation = s->val[OPT_DISABLE_INTERPOLATION].w == SANE_TRUE; @@ -4774,7 +5338,7 @@ s->dev->settings.scan_mode = SCAN_MODE_LINEART; /* todo: change and check */ - if (strcmp (source, "Flatbed") == 0) + if (strcmp (source, FLATBED) == 0) s->dev->settings.scan_method = SCAN_METHOD_FLATBED; else /* transparency */ s->dev->settings.scan_method = SCAN_METHOD_TRANSPARENCY; @@ -4790,10 +5354,28 @@ /* color filter */ if (strcmp (color_filter, "Red") == 0) s->dev->settings.color_filter = 0; + else if (strcmp (color_filter, "Green") == 0) + s->dev->settings.color_filter = 1; else if (strcmp (color_filter, "Blue") == 0) s->dev->settings.color_filter = 2; else - s->dev->settings.color_filter = 1; + s->dev->settings.color_filter = 3; + + /* true gray */ + if (strcmp (color_filter, "None") == 0) + s->dev->settings.true_gray = 1; + else + s->dev->settings.true_gray = 0; + + /* dynamic lineart */ + s->dev->settings.dynamic_lineart = + s->val[OPT_DISABLE_DYNAMIC_LINEART].w == SANE_FALSE; + + /* threshold curve for dynamic ratserization */ + if(s->dev->settings.dynamic_lineart==SANE_TRUE) + s->dev->settings.threshold_curve=s->val[OPT_THRESHOLD_CURVE].w; + else + s->dev->settings.threshold_curve=0; return status; } @@ -4841,7 +5423,7 @@ } } else - { /* GL841 case */ + { /* GL841 case 16 bits gamma table */ scanner->opt[option].size = 256 * sizeof (SANE_Word); scanner->opt[option].constraint.range = &u16_range; } @@ -4849,6 +5431,26 @@ scanner->val[option].wa = NULL; } +/** + * allocate a geometry range + * @param size maximum size of the range + * @return a poiter to a valid range or NULL + */ +static create_range(SANE_Fixed size) +{ +SANE_Range *range=NULL; + + range=(SANE_Range *)malloc(sizeof(SANE_Range)); + if(range!=NULL) + { + range->min = SANE_FIX (0.0); + range->max = size; + range->quant = SANE_FIX (0.0); + } + return range; +} + + static SANE_Status init_options (Genesys_Scanner * s) { @@ -4857,6 +5459,7 @@ SANE_Word *dpi_list; Genesys_Model *model = s->dev->model; SANE_Bool has_ta; + SANE_Range *x_range, *y_range; DBG (DBG_proc, "init_options: start\n"); @@ -4904,7 +5507,7 @@ s->opt[OPT_SOURCE].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_SOURCE].size = max_string_size (source_list); s->opt[OPT_SOURCE].constraint.string_list = source_list; - s->val[OPT_SOURCE].s = strdup ("Flatbed"); + s->val[OPT_SOURCE].s = strdup (FLATBED); DISABLE (OPT_SOURCE); /* preview */ @@ -4955,8 +5558,17 @@ s->opt[OPT_GEOMETRY_GROUP].size = 0; s->opt[OPT_GEOMETRY_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - x_range.max = model->x_size; - y_range.max = model->y_size; + x_range=create_range(model->x_size); + if(x_range==NULL) + { + return SANE_STATUS_NO_MEM; + } + + y_range=create_range(model->y_size); + if(y_range==NULL) + { + return SANE_STATUS_NO_MEM; + } /* top-left x */ s->opt[OPT_TL_X].name = SANE_NAME_SCAN_TL_X; @@ -4965,7 +5577,7 @@ s->opt[OPT_TL_X].type = SANE_TYPE_FIXED; s->opt[OPT_TL_X].unit = SANE_UNIT_MM; s->opt[OPT_TL_X].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_TL_X].constraint.range = &x_range; + s->opt[OPT_TL_X].constraint.range = x_range; s->val[OPT_TL_X].w = 0; /* top-left y */ @@ -4975,7 +5587,7 @@ s->opt[OPT_TL_Y].type = SANE_TYPE_FIXED; s->opt[OPT_TL_Y].unit = SANE_UNIT_MM; s->opt[OPT_TL_Y].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_TL_Y].constraint.range = &y_range; + s->opt[OPT_TL_Y].constraint.range = y_range; s->val[OPT_TL_Y].w = 0; /* bottom-right x */ @@ -4985,8 +5597,8 @@ s->opt[OPT_BR_X].type = SANE_TYPE_FIXED; s->opt[OPT_BR_X].unit = SANE_UNIT_MM; s->opt[OPT_BR_X].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_BR_X].constraint.range = &x_range; - s->val[OPT_BR_X].w = x_range.max; + s->opt[OPT_BR_X].constraint.range = x_range; + s->val[OPT_BR_X].w = x_range->max; /* bottom-right y */ s->opt[OPT_BR_Y].name = SANE_NAME_SCAN_BR_Y; @@ -4995,8 +5607,8 @@ s->opt[OPT_BR_Y].type = SANE_TYPE_FIXED; s->opt[OPT_BR_Y].unit = SANE_UNIT_MM; s->opt[OPT_BR_Y].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_BR_Y].constraint.range = &y_range; - s->val[OPT_BR_Y].w = y_range.max; + s->opt[OPT_BR_Y].constraint.range = y_range; + s->val[OPT_BR_Y].w = y_range->max; /* "Enhancement" group: */ s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N ("Enhancement"); @@ -5062,10 +5674,36 @@ s->opt[OPT_THRESHOLD].desc = SANE_DESC_THRESHOLD; s->opt[OPT_THRESHOLD].type = SANE_TYPE_FIXED; s->opt[OPT_THRESHOLD].unit = SANE_UNIT_PERCENT; - s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; s->opt[OPT_THRESHOLD].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_THRESHOLD].constraint.range = &threshold_percentage_range; s->val[OPT_THRESHOLD].w = SANE_FIX (50); + + /* BW threshold curve */ + s->opt[OPT_THRESHOLD_CURVE].name = "threshold-curve"; + s->opt[OPT_THRESHOLD_CURVE].title = SANE_I18N ("Threshold curve"); + s->opt[OPT_THRESHOLD_CURVE].desc = SANE_I18N ("Dynamic threshold curve, from light to dark, normally 50-65"); + s->opt[OPT_THRESHOLD_CURVE].type = SANE_TYPE_INT; + s->opt[OPT_THRESHOLD_CURVE].unit = SANE_UNIT_NONE; + s->opt[OPT_THRESHOLD_CURVE].constraint_type = SANE_CONSTRAINT_RANGE; + s->opt[OPT_THRESHOLD_CURVE].constraint.range = &threshold_curve_range; + s->val[OPT_THRESHOLD_CURVE].w = 50; + + /* dynamic linart */ + s->opt[OPT_DISABLE_DYNAMIC_LINEART].name = "disable-dynamic-lineart"; + s->opt[OPT_DISABLE_DYNAMIC_LINEART].title = SANE_I18N ("Disable dynamic lineart"); + s->opt[OPT_DISABLE_DYNAMIC_LINEART].desc = + SANE_I18N + ("Disabel use of a software adaptative algorithm to generate lineart instead of" + " relying on hardware lineart"); + s->opt[OPT_DISABLE_DYNAMIC_LINEART].type = SANE_TYPE_BOOL; + s->opt[OPT_DISABLE_DYNAMIC_LINEART].unit = SANE_UNIT_NONE; + s->opt[OPT_DISABLE_DYNAMIC_LINEART].constraint_type = SANE_CONSTRAINT_NONE; + s->val[OPT_DISABLE_DYNAMIC_LINEART].w = SANE_FALSE; + /* not working for GL646 scanners yet */ + if (s->dev->model->asic_type == GENESYS_GL646) + { + s->opt[OPT_DISABLE_DYNAMIC_LINEART].cap |= SANE_CAP_INACTIVE; + } /* disable_interpolation */ s->opt[OPT_DISABLE_INTERPOLATION].name = "disable-interpolation"; @@ -5088,9 +5726,25 @@ ("When using gray or lineart this option selects the used color."); s->opt[OPT_COLOR_FILTER].type = SANE_TYPE_STRING; s->opt[OPT_COLOR_FILTER].constraint_type = SANE_CONSTRAINT_STRING_LIST; - s->opt[OPT_COLOR_FILTER].size = max_string_size (color_filter_list); - s->opt[OPT_COLOR_FILTER].constraint.string_list = color_filter_list; - s->val[OPT_COLOR_FILTER].s = strdup ("Green"); + if(!model->is_cis) + { + s->opt[OPT_COLOR_FILTER].size = max_string_size (color_filter_list); + s->opt[OPT_COLOR_FILTER].constraint.string_list = color_filter_list; + s->val[OPT_COLOR_FILTER].s = strdup (s->opt[OPT_COLOR_FILTER].constraint.string_list[1]); + } + else + { + s->opt[OPT_COLOR_FILTER].size = max_string_size (cis_color_filter_list); + s->opt[OPT_COLOR_FILTER].constraint.string_list = cis_color_filter_list; + /* default to "None" ie true gray */ + s->val[OPT_COLOR_FILTER].s = strdup (s->opt[OPT_COLOR_FILTER].constraint.string_list[3]); + } + + /* no support for color filter for cis+gl646 scanners */ + if (model->asic_type == GENESYS_GL646 && model->is_cis) + { + DISABLE (OPT_COLOR_FILTER); + } /* Powersave time (turn lamp off) */ s->opt[OPT_LAMP_OFF_TIME].name = "lamp-off-time"; @@ -5116,8 +5770,9 @@ s->opt[OPT_SCAN_SW].desc = SANE_DESC_SCAN; s->opt[OPT_SCAN_SW].type = SANE_TYPE_BOOL; s->opt[OPT_SCAN_SW].unit = SANE_UNIT_NONE; - if (model->buttons & GENESYS_HAS_SCAN_SW) - s->opt[OPT_SCAN_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + if (model->buttons & GENESYS_HAS_SCAN_SW) + s->opt[OPT_SCAN_SW].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; else s->opt[OPT_SCAN_SW].cap = SANE_CAP_INACTIVE; s->val[OPT_SCAN_SW].b = 0; @@ -5125,11 +5780,11 @@ /* SANE_NAME_FILE is not for buttons */ s->opt[OPT_FILE_SW].name = "file"; - s->opt[OPT_FILE_SW].title = SANE_I18N("File button"); - s->opt[OPT_FILE_SW].desc = SANE_I18N("File button"); + s->opt[OPT_FILE_SW].title = SANE_I18N ("File button"); + s->opt[OPT_FILE_SW].desc = SANE_I18N ("File button"); s->opt[OPT_FILE_SW].type = SANE_TYPE_BOOL; s->opt[OPT_FILE_SW].unit = SANE_UNIT_NONE; - if (model->buttons & GENESYS_HAS_FILE_SW) + if (model->buttons & GENESYS_HAS_FILE_SW) s->opt[OPT_FILE_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; else @@ -5178,8 +5833,8 @@ /* OCR button */ s->opt[OPT_OCR_SW].name = "ocr"; - s->opt[OPT_OCR_SW].title = SANE_I18N("OCR button"); - s->opt[OPT_OCR_SW].desc = SANE_I18N("OCR button"); + s->opt[OPT_OCR_SW].title = SANE_I18N ("OCR button"); + s->opt[OPT_OCR_SW].desc = SANE_I18N ("OCR button"); s->opt[OPT_OCR_SW].type = SANE_TYPE_BOOL; s->opt[OPT_OCR_SW].unit = SANE_UNIT_NONE; if (model->buttons & GENESYS_HAS_OCR_SW) @@ -5192,8 +5847,8 @@ /* power button */ s->opt[OPT_POWER_SW].name = "power"; - s->opt[OPT_POWER_SW].title = SANE_I18N("Power button"); - s->opt[OPT_POWER_SW].desc = SANE_I18N("Power button"); + s->opt[OPT_POWER_SW].title = SANE_I18N ("Power button"); + s->opt[OPT_POWER_SW].desc = SANE_I18N ("Power button"); s->opt[OPT_POWER_SW].type = SANE_TYPE_BOOL; s->opt[OPT_POWER_SW].unit = SANE_UNIT_NONE; if (model->buttons & GENESYS_HAS_POWER_SW) @@ -5204,33 +5859,52 @@ s->val[OPT_POWER_SW].b = 0; s->last_val[OPT_POWER_SW].b = 0; + /* calibration needed */ + s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration"; + s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Need calibration"); + s->opt[OPT_NEED_CALIBRATION_SW].desc = SANE_I18N ("The scanner needs calibration for the current settings"); + s->opt[OPT_NEED_CALIBRATION_SW].type = SANE_TYPE_BOOL; + s->opt[OPT_NEED_CALIBRATION_SW].unit = SANE_UNIT_NONE; + if (model->buttons & GENESYS_HAS_CALIBRATE) + s->opt[OPT_NEED_CALIBRATION_SW].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + else + s->opt[OPT_NEED_CALIBRATION_SW].cap = SANE_CAP_INACTIVE; + s->val[OPT_NEED_CALIBRATION_SW].b = 0; + s->last_val[OPT_NEED_CALIBRATION_SW].b = 0; + /* button group */ s->opt[OPT_BUTTON_GROUP].name = "Buttons"; - s->opt[OPT_BUTTON_GROUP].title = SANE_I18N("Buttons"); - s->opt[OPT_BUTTON_GROUP].desc = SANE_I18N("Buttons"); + s->opt[OPT_BUTTON_GROUP].title = SANE_I18N ("Buttons"); + s->opt[OPT_BUTTON_GROUP].desc = ""; s->opt[OPT_BUTTON_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_BUTTON_GROUP].constraint_type = SANE_CONSTRAINT_NONE; /* calibrate button */ s->opt[OPT_CALIBRATE].name = "calibrate"; - s->opt[OPT_CALIBRATE].title = SANE_I18N("Calibrate"); - s->opt[OPT_CALIBRATE].desc = SANE_I18N("Start calibration using special sheet"); + s->opt[OPT_CALIBRATE].title = SANE_I18N ("Calibrate"); + s->opt[OPT_CALIBRATE].desc = + SANE_I18N ("Start calibration using special sheet"); s->opt[OPT_CALIBRATE].type = SANE_TYPE_BUTTON; s->opt[OPT_CALIBRATE].unit = SANE_UNIT_NONE; if (model->buttons & GENESYS_HAS_CALIBRATE) - s->opt[OPT_CALIBRATE].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | SANE_CAP_AUTOMATIC; + s->opt[OPT_CALIBRATE].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; else s->opt[OPT_CALIBRATE].cap = SANE_CAP_INACTIVE; s->val[OPT_CALIBRATE].b = 0; s->last_val[OPT_CALIBRATE].b = 0; /* clear calibration cache button */ - s->opt[OPT_CLEAR_CALIBRATION].name = "clear"; - s->opt[OPT_CLEAR_CALIBRATION].title = SANE_I18N("Clear calibration"); - s->opt[OPT_CLEAR_CALIBRATION].desc = SANE_I18N("Clear calibration cache"); + s->opt[OPT_CLEAR_CALIBRATION].name = "clear-calibration"; + s->opt[OPT_CLEAR_CALIBRATION].title = SANE_I18N ("Clear calibration"); + s->opt[OPT_CLEAR_CALIBRATION].desc = SANE_I18N ("Clear calibration cache"); s->opt[OPT_CLEAR_CALIBRATION].type = SANE_TYPE_BUTTON; s->opt[OPT_CLEAR_CALIBRATION].unit = SANE_UNIT_NONE; - s->opt[OPT_CLEAR_CALIBRATION].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | SANE_CAP_AUTOMATIC; + s->opt[OPT_CLEAR_CALIBRATION].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; s->val[OPT_CLEAR_CALIBRATION].b = 0; s->last_val[OPT_CLEAR_CALIBRATION].b = 0; @@ -5421,7 +6095,7 @@ #define CALIBRATION_VERSION 1 static void -read_calibration(Genesys_Device * dev) +read_calibration (Genesys_Device * dev) { FILE *fp; uint8_t vers = 0; @@ -5429,43 +6103,45 @@ struct Genesys_Calibration_Cache *cache; DBG (DBG_proc, "read_calibration: enter\n"); - fp = fopen(dev->calib_file,"rb"); - if (!fp) + fp = fopen (dev->calib_file, "rb"); + if (!fp) { - DBG ( DBG_info, "Calibration: Cannot open %s\n", dev->calib_file ); + DBG (DBG_info, "Calibration: Cannot open %s\n", dev->calib_file); DBG (DBG_proc, "read_calibration: exit\n"); return; } /* these two checks ensure that most bad things cannot happen */ - fread(&vers,1,1,fp); + fread (&vers, 1, 1, fp); if (vers != CALIBRATION_VERSION) { - DBG ( DBG_info, "Calibration: Bad version\n" ); - fclose(fp); + DBG (DBG_info, "Calibration: Bad version\n"); + fclose (fp); DBG (DBG_proc, "read_calibration: exit\n"); return; } - fread(&size,4,1,fp); - if (size != sizeof(struct Genesys_Calibration_Cache)) + fread (&size, 4, 1, fp); + if (size != sizeof (struct Genesys_Calibration_Cache)) { - DBG ( DBG_info, "Calibration: Size of calibration cache struct differs\n" ); - fclose(fp); + DBG (DBG_info, + "Calibration: Size of calibration cache struct differs\n"); + fclose (fp); DBG (DBG_proc, "read_calibration: exit\n"); return; } - while(!feof(fp)) + while (!feof (fp)) { DBG (DBG_info, "read_calibration: reading one record\n"); - cache = (struct Genesys_Calibration_Cache *)malloc(sizeof(*cache)); + cache = (struct Genesys_Calibration_Cache *) malloc (sizeof (*cache)); - if (!cache) + if (!cache) { - DBG (DBG_error, "read_calibration: could not allocate cache struct\n"); + DBG (DBG_error, + "read_calibration: could not allocate cache struct\n"); break; } - + #define BILT1( x ) \ do \ { \ @@ -5476,104 +6152,112 @@ break; \ } \ } while(0) - - if (fread(&cache->used_setup,sizeof(cache->used_setup),1,fp) < 1) - { /* eof is only detected here */ - free(cache); - break; + + if (fread (&cache->used_setup, sizeof (cache->used_setup), 1, fp) < 1) + { /* eof is only detected here */ + free (cache); + break; } - BILT1(fread(&cache->last_calibration,sizeof(cache->last_calibration),1,fp)); - BILT1(fread(&cache->frontend,sizeof(cache->frontend),1,fp)); + BILT1 (fread + (&cache->last_calibration, sizeof (cache->last_calibration), 1, + fp)); + BILT1 (fread (&cache->frontend, sizeof (cache->frontend), 1, fp)); /* the gamma (and later) fields are not stored */ - BILT1(fread(&cache->sensor,offsetof(Genesys_Sensor,red_gamma),1,fp)); - BILT1(fread(&cache->calib_pixels,sizeof(cache->calib_pixels),1,fp)); - BILT1(fread(&cache->calib_channels,sizeof(cache->calib_channels),1,fp)); - BILT1(fread(&cache->average_size,sizeof(cache->average_size),1,fp)); + BILT1 (fread + (&cache->sensor, offsetof (Genesys_Sensor, red_gamma), 1, fp)); + BILT1 (fread + (&cache->calib_pixels, sizeof (cache->calib_pixels), 1, fp)); + BILT1 (fread + (&cache->calib_channels, sizeof (cache->calib_channels), 1, fp)); + BILT1 (fread + (&cache->average_size, sizeof (cache->average_size), 1, fp)); /* Make sure we don't do bad things if someone feeds us a forged/ - sufficiently corrupted calibration file. - gl843 can do up to 0x5800 pixels. add some slack for the - dummy/blank pixel mess */ - if (cache->average_size > 0x5800*2*3*2+0x100) + sufficiently corrupted calibration file. + gl843 can do up to 0x5800 pixels. add some slack for the + dummy/blank pixel mess */ + if (cache->average_size > 0x5800 * 2 * 3 * 2 + 0x100) { DBG (DBG_error, "read_calibration: bad size of calibration data\n"); - free(cache); + free (cache); break; } - cache->white_average_data = (uint8_t*)malloc(cache->average_size); - cache->dark_average_data = (uint8_t*)malloc(cache->average_size); + cache->white_average_data = (uint8_t *) malloc (cache->average_size); + cache->dark_average_data = (uint8_t *) malloc (cache->average_size); - if (!cache->white_average_data || !cache->dark_average_data) + if (!cache->white_average_data || !cache->dark_average_data) { - FREE_IFNOT_NULL(cache->white_average_data); - FREE_IFNOT_NULL(cache->dark_average_data); - free(cache); - DBG (DBG_error, "read_calibration: could not allocate space for average data\n"); + FREE_IFNOT_NULL (cache->white_average_data); + FREE_IFNOT_NULL (cache->dark_average_data); + free (cache); + DBG (DBG_error, + "read_calibration: could not allocate space for average data\n"); break; } - if (fread(cache->white_average_data,cache->average_size,1,fp) < 1) + if (fread (cache->white_average_data, cache->average_size, 1, fp) < 1) { DBG (DBG_warn, "read_calibration: partial calibration record\n"); - free(cache->white_average_data); - free(cache->dark_average_data); - free(cache); + free (cache->white_average_data); + free (cache->dark_average_data); + free (cache); break; } - if (fread(cache->dark_average_data,cache->average_size,1,fp) < 1) + if (fread (cache->dark_average_data, cache->average_size, 1, fp) < 1) { DBG (DBG_warn, "read_calibration: partial calibration record\n"); - free(cache->white_average_data); - free(cache->dark_average_data); - free(cache); + free (cache->white_average_data); + free (cache->dark_average_data); + free (cache); break; } -#undef BILT1 +#undef BILT1 DBG (DBG_info, "read_calibration: adding record to list\n"); cache->next = dev->calibration_cache; dev->calibration_cache = cache; } - fclose(fp); + fclose (fp); DBG (DBG_proc, "read_calibration: exit\n"); } static void -write_calibration(Genesys_Device * dev) +write_calibration (Genesys_Device * dev) { FILE *fp; uint8_t vers = 0; uint32_t size = 0; struct Genesys_Calibration_Cache *cache; - fp = fopen(dev->calib_file,"wb"); - if (!fp) + fp = fopen (dev->calib_file, "wb"); + if (!fp) { - DBG ( DBG_info, "Calibration: Cannot open %s\n", dev->calib_file ); + DBG (DBG_info, "Calibration: Cannot open %s\n", dev->calib_file); return; } vers = CALIBRATION_VERSION; - fwrite(&vers,1,1,fp); - size = sizeof(struct Genesys_Calibration_Cache); - fwrite(&size,4,1,fp); - - for(cache = dev->calibration_cache; cache; cache = cache->next) - { - fwrite(&cache->used_setup,sizeof(cache->used_setup),1,fp); - fwrite(&cache->last_calibration,sizeof(cache->last_calibration),1,fp); - fwrite(&cache->frontend,sizeof(cache->frontend),1,fp); + fwrite (&vers, 1, 1, fp); + size = sizeof (struct Genesys_Calibration_Cache); + fwrite (&size, 4, 1, fp); + + for (cache = dev->calibration_cache; cache; cache = cache->next) + { + fwrite (&cache->used_setup, sizeof (cache->used_setup), 1, fp); + fwrite (&cache->last_calibration, sizeof (cache->last_calibration), 1, + fp); + fwrite (&cache->frontend, sizeof (cache->frontend), 1, fp); /* the gamma (and later) fields are not stored */ - fwrite(&cache->sensor,offsetof(Genesys_Sensor,red_gamma),1,fp); - fwrite(&cache->calib_pixels,sizeof(cache->calib_pixels),1,fp); - fwrite(&cache->calib_channels,sizeof(cache->calib_channels),1,fp); - fwrite(&cache->average_size,sizeof(cache->average_size),1,fp); - fwrite(cache->white_average_data,cache->average_size,1,fp); - fwrite(cache->dark_average_data,cache->average_size,1,fp); + fwrite (&cache->sensor, offsetof (Genesys_Sensor, red_gamma), 1, fp); + fwrite (&cache->calib_pixels, sizeof (cache->calib_pixels), 1, fp); + fwrite (&cache->calib_channels, sizeof (cache->calib_channels), 1, fp); + fwrite (&cache->average_size, sizeof (cache->average_size), 1, fp); + fwrite (cache->white_average_data, cache->average_size, 1, fp); + fwrite (cache->dark_average_data, cache->average_size, 1, fp); } - fclose(fp); + fclose (fp); } /* -------------------------- SANE API functions ------------------------- */ @@ -5765,7 +6449,7 @@ s->dev->read_active = SANE_FALSE; s->dev->white_average_data = NULL; s->dev->dark_average_data = NULL; - s->dev->calibration_cache = NULL; + s->dev->calibration_cache = NULL; /* insert newly opened handle into list of open handles: */ s->next = first_handle; @@ -5795,20 +6479,23 @@ knowledge, there is no such thing in these scanners. (At least the usb serial is always "0".) */ - + ptr = getenv ("HOME"); - if( NULL == ptr ) { - sprintf( tmp_str, "/tmp/%s.cal", s->dev->model->name ); - } else { - sprintf( tmp_str, "%s/.sane/%s.cal", ptr, s->dev->model->name ); - } - s->dev->calib_file = strdup( tmp_str ); - DBG( DBG_info, "Calibration filename set to:\n" ); - DBG( DBG_info, ">%s<\n", s->dev->calib_file ); + if (NULL == ptr) + { + sprintf (tmp_str, "/tmp/%s.cal", s->dev->model->name); + } + else + { + sprintf (tmp_str, "%s/.sane/%s.cal", ptr, s->dev->model->name); + } + s->dev->calib_file = strdup (tmp_str); + DBG (DBG_info, "Calibration filename set to:\n"); + DBG (DBG_info, ">%s<\n", s->dev->calib_file); /* now open file, fetch calibration records */ - read_calibration(s->dev); + read_calibration (s->dev); DBG (DBG_proc, "sane_open: exit\n"); return SANE_STATUS_GOOD; @@ -5836,17 +6523,23 @@ return; /* oops, not a handle we know about */ } + /* eject document for shhetfed scanners */ + if (s->dev->model->is_sheetfed == SANE_TRUE) + { + s->dev->model->cmd_set->eject_document (s->dev); + } + /* here is the place to store calibration cache */ - write_calibration(s->dev); + write_calibration (s->dev); - for(cache = s->dev->calibration_cache; cache; cache = next_cache) + for (cache = s->dev->calibration_cache; cache; cache = next_cache) { next_cache = cache->next; - free(cache->dark_average_data); - free(cache->white_average_data); - free(cache); + free (cache->dark_average_data); + free (cache->white_average_data); + free (cache); } - + sanei_genesys_buffer_free (&(s->dev->read_buffer)); sanei_genesys_buffer_free (&(s->dev->lines_buffer)); sanei_genesys_buffer_free (&(s->dev->shrink_buffer)); @@ -5864,6 +6557,8 @@ free (s->val[OPT_SOURCE].s); free (s->val[OPT_MODE].s); free (s->val[OPT_COLOR_FILTER].s); + FREE_IFNOT_NULL (s->opt[OPT_TL_X].constraint.range); + FREE_IFNOT_NULL (s->opt[OPT_TL_Y].constraint.range); if (prev) prev->next = s->next; @@ -5895,24 +6590,45 @@ get_option_value (Genesys_Scanner * s, int option, void *val) { unsigned int i; - SANE_Word *table; + SANE_Word *table ,tmp; uint16_t *gamma; SANE_Status status = SANE_STATUS_GOOD; + Genesys_Calibration_Cache *cache; switch (option) { + /* geometry */ + case OPT_TL_X: + case OPT_TL_Y: + case OPT_BR_X: + case OPT_BR_Y: + *(SANE_Word *) val = s->val[option].w; + /* switch coordinate tokeep them coherent */ + if (s->val[OPT_TL_X].w >= s->val[OPT_BR_X].w) + { + tmp=s->val[OPT_BR_X].w; + s->val[OPT_BR_X].w=s->val[OPT_TL_X].w; + s->val[OPT_TL_X].w=tmp; + } + if (s->val[OPT_TL_Y].w >= s->val[OPT_BR_Y].w) + { + tmp=s->val[OPT_BR_Y].w; + s->val[OPT_BR_Y].w=s->val[OPT_TL_Y].w; + s->val[OPT_TL_Y].w=tmp; + } + break; /* word options: */ case OPT_NUM_OPTS: case OPT_RESOLUTION: case OPT_BIT_DEPTH: case OPT_PREVIEW: - case OPT_TL_X: - case OPT_TL_Y: - case OPT_BR_X: - case OPT_BR_Y: case OPT_THRESHOLD: + case OPT_THRESHOLD_CURVE: + case OPT_DISABLE_DYNAMIC_LINEART: case OPT_DISABLE_INTERPOLATION: case OPT_LAMP_OFF_TIME: + *(SANE_Word *) val = s->val[option].w; + break; case OPT_CUSTOM_GAMMA: *(SANE_Word *) val = s->val[option].w; break; @@ -5975,7 +6691,21 @@ *(SANE_Bool *) val = s->val[option].b; s->last_val[option].b = *(SANE_Bool *) val; break; - /* button */ + case OPT_NEED_CALIBRATION_SW: + /* scanner needs calibration for current mode unless a matching + * calibration cache is found */ + *(SANE_Bool *) val = SANE_TRUE; + for (cache = s->dev->calibration_cache; cache; cache = cache->next) + { + if (s->dev->model-> + cmd_set->is_compatible_calibration (s->dev, cache, + SANE_FALSE) == + SANE_STATUS_GOOD) + { + *(SANE_Bool *) val = SANE_FALSE; + } + } + break; default: DBG (DBG_warn, "get_option_value: can't get unknown option %d\n", option); @@ -5988,9 +6718,10 @@ set_option_value (Genesys_Scanner * s, int option, void *val, SANE_Int * myinfo) { - SANE_Status status; + SANE_Status status = SANE_STATUS_GOOD; SANE_Word *table; unsigned int i; + SANE_Range *x_range, *y_range; Genesys_Calibration_Cache *cache, *next_cache; switch (option) @@ -6006,6 +6737,8 @@ case OPT_RESOLUTION: case OPT_BIT_DEPTH: case OPT_THRESHOLD: + case OPT_THRESHOLD_CURVE: + case OPT_DISABLE_DYNAMIC_LINEART: case OPT_DISABLE_INTERPOLATION: case OPT_PREVIEW: s->val[option].w = *(SANE_Word *) val; @@ -6018,6 +6751,36 @@ if (s->val[option].s) free (s->val[option].s); s->val[option].s = strdup (val); + + /* change geometry constraint to the new source value */ + if (strcmp (s->val[option].s, FLATBED) == 0) + { + x_range=create_range(s->dev->model->x_size); + y_range=create_range(s->dev->model->y_size); + } + else + { + x_range=create_range(s->dev->model->x_size_ta); + y_range=create_range(s->dev->model->y_size_ta); + } + if(x_range==NULL || y_range==NULL) + { + return SANE_STATUS_NO_MEM; + } + + /* assign new values */ + free(s->opt[OPT_TL_X].constraint.range); + free(s->opt[OPT_TL_Y].constraint.range); + s->opt[OPT_TL_X].constraint.range = x_range; + s->val[OPT_TL_X].w = 0; + s->opt[OPT_TL_Y].constraint.range = y_range; + s->val[OPT_TL_Y].w = 0; + s->opt[OPT_BR_X].constraint.range = x_range; + s->val[OPT_BR_Y].w = y_range->max; + s->opt[OPT_BR_Y].constraint.range = y_range; + s->val[OPT_BR_X].w = x_range->max; + + /* signals reload */ *myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; } break; @@ -6028,15 +6791,25 @@ if (strcmp (s->val[option].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) { ENABLE (OPT_THRESHOLD); + ENABLE (OPT_THRESHOLD_CURVE); DISABLE (OPT_BIT_DEPTH); - ENABLE (OPT_COLOR_FILTER); + if (s->dev->model->asic_type != GENESYS_GL646 || !s->dev->model->is_cis) + { + ENABLE (OPT_COLOR_FILTER); + } + ENABLE (OPT_DISABLE_DYNAMIC_LINEART); } else { DISABLE (OPT_THRESHOLD); + DISABLE (OPT_THRESHOLD_CURVE); + DISABLE (OPT_DISABLE_DYNAMIC_LINEART); if (strcmp (s->val[option].s, SANE_VALUE_SCAN_MODE_GRAY) == 0) { - ENABLE (OPT_COLOR_FILTER); + if (s->dev->model->asic_type != GENESYS_GL646 || !s->dev->model->is_cis) + { + ENABLE (OPT_COLOR_FILTER); + } create_bpp_list (s, s->dev->model->bpp_gray_values); } else @@ -6082,8 +6855,8 @@ if (*(SANE_Word *) val != s->val[option].w) { s->val[option].w = *(SANE_Word *) val; - RIE (s->dev->model-> - cmd_set->set_powersaving (s->dev, s->val[option].w)); + RIE (s->dev->model->cmd_set-> + set_powersaving (s->dev, s->val[option].w)); } break; @@ -6120,38 +6893,27 @@ sanei_genesys_create_gamma_table (s->dev->sensor.red_gamma_table, s->opt[OPT_GAMMA_VECTOR_R].size / sizeof (SANE_Word), - s-> - opt - [OPT_GAMMA_VECTOR_R].constraint. - range->max, - s-> - opt - [OPT_GAMMA_VECTOR_R].constraint. - range->max, + s->opt + [OPT_GAMMA_VECTOR_R]. + constraint.range->max, + s->opt[OPT_GAMMA_VECTOR_R]. + constraint.range->max, s->dev->sensor.red_gamma); sanei_genesys_create_gamma_table (s->dev->sensor.green_gamma_table, s->opt[OPT_GAMMA_VECTOR_G].size / sizeof (SANE_Word), - s-> - opt - [OPT_GAMMA_VECTOR_G].constraint. - range->max, - s-> - opt - [OPT_GAMMA_VECTOR_G].constraint. - range->max, + s->opt[OPT_GAMMA_VECTOR_G]. + constraint.range->max, + s->opt[OPT_GAMMA_VECTOR_G]. + constraint.range->max, s->dev->sensor.red_gamma); sanei_genesys_create_gamma_table (s->dev->sensor.blue_gamma_table, s->opt[OPT_GAMMA_VECTOR_B].size / sizeof (SANE_Word), - s-> - opt - [OPT_GAMMA_VECTOR_B].constraint. - range->max, - s-> - opt - [OPT_GAMMA_VECTOR_B].constraint. - range->max, + s->opt[OPT_GAMMA_VECTOR_B]. + constraint.range->max, + s->opt[OPT_GAMMA_VECTOR_B]. + constraint.range->max, s->dev->sensor.red_gamma); } break; @@ -6187,30 +6949,44 @@ } break; case OPT_CALIBRATE: - /* TODO call for calibration using special sheet here */ + status = s->dev->model->cmd_set->save_power (s->dev, SANE_FALSE); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "%s: failed to disable power saving mode: %s\n", + __FUNCTION__, sane_strstatus (status)); + } + else + status = genesys_scanner_calibration (s->dev); + /* not critical if this fails*/ + s->dev->model->cmd_set->save_power (s->dev, SANE_TRUE); + /* signals that sensors will have to be read again */ + *myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; break; case OPT_CLEAR_CALIBRATION: /* clear calibration cache */ - if(s->dev->calibration_cache!=NULL) - { - for (cache = s->dev->calibration_cache; cache; cache = next_cache) + if (s->dev->calibration_cache != NULL) { - next_cache = cache->next; - free (cache->dark_average_data); - free (cache->white_average_data); - free (cache); + for (cache = s->dev->calibration_cache; cache; cache = next_cache) + { + next_cache = cache->next; + free (cache->dark_average_data); + free (cache->white_average_data); + free (cache); + } } - } - s->dev->calibration_cache=NULL; + s->dev->calibration_cache = NULL; /* remove file */ unlink (s->dev->calib_file); + /* signals that sensors will have to be read again */ + *myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; break; default: DBG (DBG_warn, "set_option_value: can't set unknown option %d\n", option); } - return SANE_STATUS_GOOD; + return status; } @@ -6315,7 +7091,19 @@ RIE (calc_parameters (s)); if (params) - *params = s->params; + { + *params = s->params; + + /* in the case of a sheetfed scanner, when full height is specified + * we override the computed line number with -1 to signal that we + * don't know the real document height. + */ + if (s->dev->model->is_sheetfed == SANE_TRUE + && s->val[OPT_BR_Y].w == s->opt[OPT_BR_Y].constraint.range->max) + { + params->lines = -1; + } + } DBG (DBG_proc, "sane_get_parameters: exit\n"); @@ -6390,7 +7178,7 @@ return SANE_STATUS_CANCELLED; } - DBG (DBG_proc, "sane_read: start\n"); + DBG (DBG_proc, "sane_read: start, %d maximum bytes required\n", max_len); local_len = max_len; status = genesys_read_ordered_data (s->dev, buf, &local_len); @@ -6488,3 +7276,5 @@ } return SANE_STATUS_UNSUPPORTED; } + +/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/genesys.conf.in sane-backends-1.0.21/backend/genesys.conf.in --- sane-backends-1.0.20/backend/genesys.conf.in 2009-03-21 01:45:56.000000000 +1100 +++ sane-backends-1.0.21/backend/genesys.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -50,3 +50,24 @@ # Visioneer XP100 rev 3 usb 0x04a7 0x049b + +#Pentax DSmobile 600 +usb 0x0a17 0x3210 + +# Syscan DocketPort 467 +usb 0x1dcc 0x4812 + +# Syscan DocketPort 485 +usb 0x0a82 0x4800 + +# DCT DocketPort 487 +usb 0x1dcc 0x4810 + +# Syscan/Ambir DocketPort 685 +usb 0x0a82 0x480c + +# Visioneer OneTouch 7100 +usb 0x04a7 0x0229 + +# Xerox Travel Scanner 100 +usb 0x04a7 0x04ac diff -Nru sane-backends-1.0.20/backend/genesys_conv.c sane-backends-1.0.21/backend/genesys_conv.c --- sane-backends-1.0.20/backend/genesys_conv.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/genesys_conv.c 2010-04-05 23:18:04.000000000 +1000 @@ -89,30 +89,119 @@ return SANE_STATUS_GOOD; } +/** + * uses the threshold/threshold_curve to control software binarization + * This code was taken from the epjistsu backend by m. allan noah + * @param dev device set up for the scan + * @param src pointer to raw data + * @param dst pointer where to store result + * @param width width of the processed line + * */ +static SANE_Status +binarize_line(Genesys_Device * dev, uint8_t *src, uint8_t *dst, int width) +{ + int j, windowX, sum = 0; + int thresh; + int offset, addCol, dropCol; + unsigned char mask; + + size_t x; + uint8_t min, max; + + /* normalize line */ + min = 255; + max = 0; + for (x = 0; x < width; x++) + { + if (src[x] > max) + { + max = src[x]; + } + if (src[x] < min) + { + min = src[x]; + } + } + + /* safeguard against dark or white areas */ + if(min>80) + min=0; + if(max<80) + max=255; + for (x = 0; x < width; x++) + { + src[x] = ((src[x] - min) * 255) / (max - min); + } + + /* ~1mm works best, but the window needs to have odd # of pixels */ + windowX = (6 * dev->settings.xres) / 150; + if (!(windowX % 2)) + windowX++; + + /* second, prefill the sliding sum */ + for (j = 0; j < windowX; j++) + sum += src[j]; + + /* third, walk the input buffer, update the sliding sum, */ + /* determine threshold, output bits */ + for (j = 0; j < width; j++) + { + /* output image location */ + offset = j % 8; + mask = 0x80 >> offset; + thresh = dev->settings.threshold; + + /* move sum/update threshold only if there is a curve */ + if (dev->settings.threshold_curve) + { + addCol = j + windowX / 2; + dropCol = addCol - windowX; + + if (dropCol >= 0 && addCol < width) + { + sum -= src[dropCol]; + sum += src[addCol]; + } + thresh = dev->lineart_lut[sum / windowX]; + } + + /* use average to lookup threshold */ + if (src[j] > thresh) + *dst &= ~mask; /* white */ + else + *dst |= mask; /* black */ + + if (offset == 7) + dst++; + } + + return SANE_STATUS_GOOD; +} + +/** + * software lineart using data from a 8 bit gray scan. We assume true gray + * or monochrome scan as input. + */ static SANE_Status genesys_gray_lineart( + Genesys_Device *dev, uint8_t *src_data, uint8_t *dst_data, size_t pixels, - size_t channels, size_t lines, uint8_t threshold) { - size_t x,y,c,b; - for(y = 0; y < lines; y++) { - for(x = 0; x < pixels; x+=8) { - for(c = 0; c < channels; c++) - *(dst_data + c) = 0; - for(b = 0; b < 8 && x+b < pixels; b++) { - for(c = 0; c < channels; c++) { - if (*src_data++ < threshold) - *(dst_data + c) |= (0x80 >> b); - } - } - dst_data += channels; - } + size_t y; + + DBG (DBG_io2, "genesys_gray_lineart: converting %d lines of %d pixels\n", + lines, pixels); + + for (y = 0; y < lines; y++) + { + binarize_line (dev, src_data + y * pixels, dst_data, pixels); + dst_data += pixels / 8; } - return SANE_STATUS_GOOD; + return SANE_STATUS_GOOD; } static SANE_Status diff -Nru sane-backends-1.0.20/backend/genesys_devices.c sane-backends-1.0.21/backend/genesys_devices.c --- sane-backends-1.0.20/backend/genesys_devices.c 2009-04-30 23:15:19.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys_devices.c 2010-04-05 23:18:04.000000000 +1000 @@ -3,9 +3,12 @@ Copyright (C) 2003 Oliver Rauch Copyright (C) 2003-2005 Henning Meier-Geinitz Copyright (C) 2004, 2005 Gerhard Jaeger - Copyright (C) 2004-2009 Stéphane Voltz + Copyright (C) 2004-2010 Stéphane Voltz Copyright (C) 2005-2009 Pierre Willenbrock Copyright (C) 2007 Luke + Copyright (C) 2010 Jack McGill + Copyright (C) 2010 Andrey Loginov , + xerox travelscan device entry This file is part of the SANE package. @@ -81,14 +84,16 @@ , {0x00, 0x00, 0x00} } , /* 3: MD6228/MD6471 */ - {DAC_WOLFSON_HP2400,{0x00, 0x03, 0x05, 0x02} + {DAC_WOLFSON_HP2400, + {0x00, 0x03, 0x05, 0x02} , {0x00, 0x00, 0x00} - , {0xc0, 0xc0, 0xc0} - , {0x07, 0x07, 0x07} + , {0xb4, 0xb6, 0xbc} + , {0x06, 0x09, 0x08} , {0x00, 0x00, 0x00} } , /* 4: HP2400c */ - {DAC_WOLFSON_HP2300,{0x00, 0x03, 0x04, 0x02} + {DAC_WOLFSON_HP2300, + {0x00, 0x03, 0x04, 0x02} , {0x00, 0x00, 0x00} , {0xbe, 0xbe, 0xbe} , {0x04, 0x04, 0x04} @@ -102,10 +107,11 @@ , {0x00, 0x19, 0x06} } , /* 6: CANONLIDE35 */ - {DAC_AD_XP200,{0x58, 0x00, 0x00, 0x00} /* TODO create an AnalogDevice struct */ + {DAC_AD_XP200, + {0x58, 0x80, 0x00, 0x00} /* reg1=0x80 ? */ , {0x00, 0x00, 0x00} - , {0x0a, 0x00, 0x00} /* offset */ - , {0x20, 0x00, 0x00} /* gain */ + , {0x09, 0x09, 0x09} + , {0x09, 0x09, 0x09} , {0x00, 0x00, 0x00} } , @@ -115,15 +121,23 @@ , {0x93, 0x93, 0x93} , {0x07, 0x00, 0x00} } - , /* 8: XP300 */ - {DAC_WOLFSON_HP3670, /* uses one write for offset or gain like hp2300/2400 */ - {0x00, 0x03, 0x04, 0x02} - , {0x00, 0x00, 0x00} - , {0xb4, 0xb4, 0xb4} - , {0x08, 0x08, 0x08} + , /* 8: HP3670 */ + {DAC_WOLFSON_HP3670, + /* reg0 reg1 reg2 reg3 */ + {0x00, 0x03, 0x05, 0x32} /* reg3=0x32 for 100-300 dpi, 0x12 at 1200 */ + , {0x00, 0x00, 0x00} /* sign */ + , {0xba, 0xb8, 0xb8} /* offset */ + , {0x06, 0x05, 0x04} /* gain 4,3,2 at 1200 ?*/ , {0x00, 0x00, 0x00} } , + {DAC_WOLFSON_DSM600,{0x00, 0x35, 0x20, 0x14} /* 9: DSMOBILE600 */ + , {0x00, 0x00, 0x00} + , {0x85, 0x85, 0x85} + , {0xa0, 0xa0, 0xa0} + , {0x07, 0x00, 0x00} + } + , }; @@ -200,13 +214,13 @@ {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x0e, 0x00, 0x00} , - 1.0, 1.0, 1.0, + 2.1, 2.1, 2.1, NULL, NULL, NULL} , /* 5: HP2300c */ {CCD_HP2300,600, 48, - 20, 0, 5454, 180, 180, + 20, 0, 5368, 180, 180, /* 5376 */ {0x16, 0x00, 0x01, 0x03} , {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a, @@ -243,11 +257,11 @@ , /* 7: Strobe XP200 */ {CIS_XP200, 600, - 48, - 38, 0, 5454, 210, 200, + 5, + 38, 0, 5200, 200, 200, /* 5125 */ {0x16, 0x00, 0x01, 0x03} , - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a, + {0x14, 0x50, 0x0c, 0x80, 0x0a, 0x28, 0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a, 0x00, 0x05} , {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x06, 0x0b, 0x10, @@ -261,22 +275,22 @@ 16, 0, 10872, 210, 200, {0x00, 0x0a, 0x0b, 0x0d} , - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x07, 0x20, 0x2a, 0x00, 0x00, 0xc0, 0x43} , + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x07, 0x20, 0x2a, 0x00, 0x00, 0xc0, 0x43} , {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0x15, 0x05, 0x0a, 0x0f, 0x00}, - 2.38, 2.35, 2.34, + 1.00, 1.00, 1.00, NULL, NULL, NULL} , - /* 8: Strobe XP300 */ - {CCD_XP300, 600, + /* Syscan DP 665 */ + {CCD_DP665, 600, /*TODO: find a good reason for keeping all three following variables*/ - 87, /*(black) */ - 87, /* (dummy) */ + 27, /*(black) */ + 27, /* (dummy) */ 0, /* (startxoffset) */ - 10240, /*sensor_pixels */ + 2496, /*sensor_pixels */ 210, 200, {0x00, 0x00, 0x00, 0x00}, - {0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x04, 0x50, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, 0x10, 0x00, 0x20, 0x02 }, {0x04, 0x05, @@ -289,17 +303,17 @@ 1.0, 1.0, 1.0, NULL, NULL, NULL} , - /* Syscan DP 665 */ - {CCD_DP665, 600, + /* Visioneer Roadwarrior */ + {CCD_ROADWARRIOR, 600, /*TODO: find a good reason for keeping all three following variables*/ - 28, /*(black) */ - 28, /* (dummy) */ + 27, /*(black) */ + 27, /* (dummy) */ 0, /* (startxoffset) */ - 2496, /*sensor_pixels */ + 5200, /*sensor_pixels */ 210, 200, {0x00, 0x00, 0x00, 0x00}, - {0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x04, 0x50, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, 0x10, 0x00, 0x20, 0x02 }, {0x04, 0x05, @@ -311,9 +325,9 @@ , 1.0, 1.0, 1.0, NULL, NULL, NULL} - , - /* Visioneer Roadwarrior */ - {CCD_ROADWARRIOR, 600, +, + /* Pentax DS Mobile 600 */ + {CCD_DSMOBILE600, 600, /*TODO: find a good reason for keeping all three following variables*/ 28, /*(black) */ 28, /* (dummy) */ @@ -322,7 +336,7 @@ 210, 200, {0x00, 0x00, 0x00, 0x00}, - {0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x04, 0x50, + {0x15, 0x44, 0x15, 0x44, 0x15, 0x44, 0x00, 0x02, 0x04, 0x50, 0x10, 0x00, 0x20, 0x02 }, {0x04, 0x05, @@ -334,6 +348,52 @@ , 1.0, 1.0, 1.0, NULL, NULL, NULL} +, + /* 13: Strobe XP300 */ + {CCD_XP300, 600, + 27, /*(black) */ + 27, /* (dummy) */ + 0, /* (startxoffset) */ + 10240, /*sensor_pixels */ + 210, + 200, + {0x00, 0x00, 0x00, 0x00}, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, + 0x10, 0x00, 0x20, 0x02 + }, + {0x04, 0x05, + 0x00, 0x00, 0x00, 0x00, /*[GB](HI|LOW) not needed for cis */ + 0x54, 0x03, + 0x00, /*TODO: bit7 */ + 0x00, 0x00, 0x00, 0x01 /*TODO (these do no harm, but may be neccessery for CCD) */ + } + , + 1.0, 1.0, 1.0, + NULL, NULL, NULL} + , + /* 13: Strobe XP300 */ + {CCD_DP685, 600, + 27, /*(black) */ + 27, /* (dummy) */ + 0, /* (startxoffset) */ + 5020, /*sensor_pixels */ + 210, + 200, + {0x00, 0x00, 0x00, 0x00}, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, + 0x10, 0x00, 0x20, 0x02 + }, + {0x04, 0x05, + 0x00, 0x00, 0x00, 0x00, /*[GB](HI|LOW) not needed for cis */ + 0x54, 0x03, + 0x00, /*TODO: bit7 */ + 0x00, 0x00, 0x00, 0x01 /*TODO (these do no harm, but may be neccessery for CCD) */ + } + , + 1.0, 1.0, 1.0, + NULL, NULL, NULL} + , + }; /** for General Purpose Output specific settings: @@ -405,11 +465,11 @@ {0xb0, 0x00} , }, - /* HP2400C */ + /* HP3670 */ {GPO_HP3670, - {0x20, 0x00} + {0x00, 0x00} , - {0x70, 0x00} + {0x00, 0x00} } , /* 8: XP300 */ @@ -423,7 +483,15 @@ GPO_DP665, {0x18, 0x00},/*0x19,0x00*/ {0xbb, 0x00}, - } + } + , + /* Syscan DP 685 */ + { + GPO_DP685, + {0x3f, 0x46}, /* 6c, 6d */ + {0xfb, 0x00}, /* 6e, 6f */ + } + , }; static Genesys_Motor Motor[] = { @@ -626,6 +694,24 @@ 0.8, },},}, }, + {MOTOR_DSMOBILE_600, /* Pentax DSmobile 600 */ + 750, + 1500, + 1, + 1, + {{{ + 6666, + 3700, + 8, + 0.8, + }, + { + 11000, + 11000, + 2, + 0.8, + },},}, + }, }; /* here we have the various device settings... @@ -725,6 +811,7 @@ GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION | + GENESYS_FLAG_CUSTOM_GAMMA | GENESYS_FLAG_HALF_CCD_MODE, GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | @@ -780,6 +867,7 @@ | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA | GENESYS_FLAG_HALF_CCD_MODE, GENESYS_HAS_NO_BUTTONS, /* no buttons supported */ @@ -837,7 +925,7 @@ | GENESYS_FLAG_HALF_CCD_MODE | GENESYS_FLAG_CUSTOM_GAMMA, GENESYS_HAS_SCAN_SW | GENESYS_HAS_COPY_SW, - 18, + 40, 132 }; @@ -849,8 +937,8 @@ GENESYS_GL646, NULL, - {1200, 600, 300, 150, 75, 50, 0}, /* possible x-resolutions */ - {1200, 600, 300, 150, 75, 50, 0}, /* possible y-resolutions */ + {1200, 600, 300, 150, 100, 75, 50, 0}, /* possible x-resolutions */ + {1200, 600, 300, 150, 100, 75, 50, 0}, /* possible y-resolutions */ {16, 8, 0}, /* possible depths in gray mode */ {16, 8, 0}, /* possible depths in color mode */ @@ -874,7 +962,7 @@ SANE_FIX (0.0), /* Amount of feeding needed to eject document after finishing scanning in mm */ - 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + 0, 24, 48, /* RGB CCD Line-distance correction in pixel */ COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */ @@ -887,12 +975,13 @@ GENESYS_FLAG_UNTESTED /* not fully working yet */ | GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_14BIT_GAMMA + | GENESYS_FLAG_XPA | GENESYS_FLAG_DARK_CALIBRATION | GENESYS_FLAG_OFFSET_CALIBRATION - | GENESYS_FLAG_CUSTOM_GAMMA | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_NO_BUTTONS, /* no buttons supported */ + | GENESYS_FLAG_STAGGERED_LINE + | GENESYS_FLAG_CUSTOM_GAMMA, + GENESYS_HAS_COPY_SW | GENESYS_HAS_EMAIL_SW | GENESYS_HAS_SCAN_SW, 20, 132 }; @@ -911,7 +1000,7 @@ {16, 8, 0}, /* possible depths in color mode */ SANE_FIX (0.5), /* Start of scan area in mm (x) */ - SANE_FIX (10.5), /* Start of scan area in mm (y) */ + SANE_FIX (16.0), /* Start of scan area in mm (y) */ SANE_FIX (215.9), /* Size of scan area in mm (x) */ SANE_FIX (297.2), /* Size of scan area in mm (y) */ @@ -941,11 +1030,13 @@ GPO_XP200, MOTOR_XP200, GENESYS_FLAG_14BIT_GAMMA + | GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_CUSTOM_GAMMA | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, /* | GENESYS_HAS_CALIBRATE, */ - 20, + | GENESYS_FLAG_DARK_CALIBRATION + | GENESYS_FLAG_OFFSET_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 120, 132 }; @@ -956,34 +1047,34 @@ GENESYS_GL646, NULL, - {1200, 600, 300, 150, 100, 50, 0}, /* possible x-resolutions */ - {1200, 600, 300, 150, 100, 50, 0}, /* possible y-resolutions */ + {1200, 600, 300, 150, 100, 75, 0}, /* possible x-resolutions */ + {1200, 600, 300, 150, 100, 75, 0}, /* possible y-resolutions */ {16, 8, 0}, /* possible depths in gray mode */ {16, 8, 0}, /* possible depths in color mode */ - SANE_FIX (3.5), /* Start of scan area in mm (x) */ - SANE_FIX (7.5), /* Start of scan area in mm (y) */ + SANE_FIX (8.5), /* Start of scan area in mm (x) */ + SANE_FIX (11.0), /* Start of scan area in mm (y) */ SANE_FIX (215.9), /* Size of scan area in mm (x) */ - SANE_FIX (297.2), /* Size of scan area in mm (y) */ + SANE_FIX (300.0), /* Size of scan area in mm (y) */ SANE_FIX (0.0), /* Start of white strip in mm (y) */ SANE_FIX (1.0), /* Start of black mark in mm (x) */ - SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ - SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ - SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ - SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + SANE_FIX (104.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (55.6), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (25.6), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (78.0), /* Size of scan area in TA mode in mm (y) */ - SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + SANE_FIX (76.0), /* Start of white strip in TA mode in mm (y) */ SANE_FIX (0.0), /* Size of scan area after paper sensor stops sensing document in mm */ SANE_FIX (0.0), /* Amount of feeding needed to eject document after finishing scanning in mm */ - 0, 8, 16, /* RGB CCD Line-distance correction in pixel */ + 0, 24, 48, /* RGB CCD Line-distance correction in pixel */ - COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */ + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ SANE_FALSE, /* Is this a CIS scanner? */ SANE_FALSE, /* Is this a sheetfed scanner? */ @@ -991,13 +1082,14 @@ DAC_WOLFSON_HP3670, GPO_HP3670, MOTOR_HP3670, - GENESYS_FLAG_14BIT_GAMMA - | GENESYS_FLAG_SEARCH_START - | GENESYS_FLAG_SKIP_WARMUP + GENESYS_FLAG_LAZY_INIT + | GENESYS_FLAG_14BIT_GAMMA + | GENESYS_FLAG_XPA | GENESYS_FLAG_DARK_CALIBRATION | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_STAGGERED_LINE | GENESYS_FLAG_CUSTOM_GAMMA, - GENESYS_HAS_NO_BUTTONS, /* no buttons supported */ + GENESYS_HAS_COPY_SW | GENESYS_HAS_EMAIL_SW | GENESYS_HAS_SCAN_SW, 20, 200 }; @@ -1095,7 +1187,9 @@ GENESYS_FLAG_UNTESTED | GENESYS_FLAG_14BIT_GAMMA | GENESYS_FLAG_LAZY_INIT - | GENESYS_FLAG_SEARCH_START | GENESYS_FLAG_OFFSET_CALIBRATION, + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_SEARCH_START + | GENESYS_FLAG_OFFSET_CALIBRATION, GENESYS_HAS_NO_BUTTONS, /* no buttons supported */ 20, 200 @@ -1134,7 +1228,6 @@ after finishing scanning in mm */ 48, 24, 0, /* RGB CCD Line-distance correction in pixel */ -/* 48, 24, 0, */ COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ SANE_FALSE, /* Is this a CIS scanner? */ @@ -1152,7 +1245,7 @@ | GENESYS_FLAG_HALF_CCD_MODE | GENESYS_FLAG_CUSTOM_GAMMA, GENESYS_HAS_COPY_SW | GENESYS_HAS_EMAIL_SW | GENESYS_HAS_POWER_SW | GENESYS_HAS_OCR_SW | GENESYS_HAS_SCAN_SW, - 32, + 40, 200 }; @@ -1201,9 +1294,11 @@ MOTOR_XP300, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_DARK_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; @@ -1251,9 +1346,11 @@ MOTOR_DP665, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_DARK_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; @@ -1301,9 +1398,11 @@ MOTOR_ROADWARRIOR, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; @@ -1352,6 +1451,7 @@ GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_NO_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA | GENESYS_FLAG_UNTESTED, GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, 300, @@ -1402,27 +1502,409 @@ MOTOR_ROADWARRIOR, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + +static Genesys_Model pentax_dsmobile_600_model = { + "pentax-dsmobile-600", /* Name */ + "Pentax", /* Device vendor string */ + "DSmobile 600", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in mm (y) */ + SANE_FIX (220.0), /* Size of scan area in mm (x) */ + SANE_FIX (511), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (16.0), /* Size of scan area after paper sensor stops + sensing document in mm */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_DSMOBILE600, + DAC_WOLFSON_DSM600, + GPO_DP665, + MOTOR_DSMOBILE_600, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; +static Genesys_Model syscan_docketport_467_model = { + "syscan-docketport-467", /* Name */ + "Syscan", /* Device vendor string */ + "DocketPORT 467", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in mm (y) */ + SANE_FIX (220.0), /* Size of scan area in mm (x) */ + SANE_FIX (511), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (16.0), /* Size of scan area after paper sensor stops + sensing document in mm */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_DSMOBILE600, + DAC_WOLFSON_DSM600, + GPO_DP665, + MOTOR_DSMOBILE_600, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + +static Genesys_Model syscan_docketport_685_model = { + "syscan-docketport-685", /* Name */ + "Syscan/Ambir", /* Device vendor string */ + "DocketPORT 685", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.0), /* Start of scan area in mm (y) */ + SANE_FIX (212.0), /* Size of scan area in mm (x) */ + SANE_FIX (500), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (26.5), /* Size of scan area after paper sensor stops + sensing document in mm */ + /* this is larger than needed -- accounts for second sensor head, which is a + calibration item */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_DP685, + DAC_WOLFSON_DSM600, + GPO_DP685, + MOTOR_XP300, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + +static Genesys_Model syscan_docketport_485_model = { + "syscan-docketport-485", /* Name */ + "Syscan/Ambir", /* Device vendor string */ + "DocketPORT 485", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.0), /* Start of scan area in mm (y) */ + SANE_FIX (435.0), /* Size of scan area in mm (x) */ + SANE_FIX (511), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (26.5), /* Size of scan area after paper sensor stops + sensing document in mm */ + /* this is larger than needed -- accounts for second sensor head, which is a + calibration item */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_XP300, + DAC_WOLFSON_XP300, + GPO_XP300, + MOTOR_XP300, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + +static Genesys_Model dct_docketport_487_model = { + "dct-docketport-487", /* Name */ + "DCT", /* Device vendor string */ + "DocketPORT 487", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.0), /* Start of scan area in mm (y) */ + SANE_FIX (435.0), /* Size of scan area in mm (x) */ + SANE_FIX (511), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (26.5), /* Size of scan area after paper sensor stops + sensing document in mm */ + /* this is larger than needed -- accounts for second sensor head, which is a + calibration item */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_XP300, + DAC_WOLFSON_XP300, + GPO_XP300, + MOTOR_XP300, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_DARK_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_UNTESTED, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + +static Genesys_Model visioneer_7100_model = { + "visioneer-7100-model", /* Name */ + "Visioneer", /* Device vendor string */ + "OneTouch 7100", /* Device model name */ + GENESYS_GL646, + NULL, + + {1200, 600, 400, 300, 200, 150, 100, 75, 50, 0}, /* possible x-resolutions */ + {2400, 1200, 600, 400, 300, 200, 150, 100, 75, 50, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX ( 4.00), /* Start of scan area in mm (x) */ + SANE_FIX ( 0.80), /* 2.79 < Start of scan area in mm (y) */ + SANE_FIX (215.9), /* Size of scan area in mm (x) */ + SANE_FIX (296.4), /* Size of scan area in mm (y) */ + + SANE_FIX (0.00), /* Start of white strip in mm (y) */ + SANE_FIX (0.00), /* Start of black mark in mm (x) */ + + SANE_FIX (0.00), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.00), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (0.00), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (0.00), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.00), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Size of scan area after paper sensor stops + sensing document in mm */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + + 48, 24, 0, /* RGB CCD Line-distance correction in pixel */ +/* 48, 24, 0, */ + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_FALSE, /* Is this a CIS scanner? */ + SANE_FALSE, /* Is this a sheetfed scanner? */ + CCD_5345, + DAC_WOLFSON_5345, + GPO_5345, + MOTOR_5345, + GENESYS_FLAG_14BIT_GAMMA + | GENESYS_FLAG_LAZY_INIT + | GENESYS_FLAG_SEARCH_START + | GENESYS_FLAG_STAGGERED_LINE + | GENESYS_FLAG_DARK_CALIBRATION + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_HALF_CCD_MODE + | GENESYS_FLAG_CUSTOM_GAMMA, + GENESYS_HAS_COPY_SW | GENESYS_HAS_EMAIL_SW | GENESYS_HAS_POWER_SW | GENESYS_HAS_OCR_SW | GENESYS_HAS_SCAN_SW, + 40, + 200 +}; + +static Genesys_Model xerox_travelscanner_model = { + "xerox-travelscanner", /* Name */ + "Xerox", /* Device vendor string */ + "Travelscanner 100", /* Device model name */ + GENESYS_GL841, + NULL, + + {600, 300, 150, 75, 0}, /* possible x-resolutions */ + {1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (4.0), /* Start of scan area in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in mm (y) */ + SANE_FIX (220.0), /* Size of scan area in mm (x) */ + SANE_FIX (511), /* Size of scan area in mm (y) */ + + SANE_FIX (3.0), /* Start of white strip in mm (y) */ + SANE_FIX (0.0), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + SANE_FIX (16.0), /* Size of scan area after paper sensor stops + sensing document in mm */ + SANE_FIX (0.0), /* Amount of feeding needed to eject document + after finishing scanning in mm */ + + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + + COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */ + + SANE_TRUE, /* Is this a CIS scanner? */ + SANE_TRUE, /* Is this a sheetfed scanner? */ + CCD_ROADWARRIOR, + DAC_WOLFSON_XP300, + GPO_DP665, + MOTOR_ROADWARRIOR, + GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ + | GENESYS_FLAG_SKIP_WARMUP + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_CUSTOM_GAMMA + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, + 400 +}; + + + static Genesys_USB_Device_Entry genesys_usb_device_list[] = { - {0x0638, 0x0a10, &umax_astra_4500_model}, - {0x04a9, 0x2213, &canon_lide_50_model}, - {0x04a9, 0x221c, &canon_lide_60_model}, {0x03f0, 0x0901, &hp2300c_model}, {0x03f0, 0x0a01, &hp2400c_model}, {0x03f0, 0x1405, &hp3670c_model}, - {0x07b3, 0x0600, &plustek_st12_model}, - {0x07b3, 0x0601, &plustek_st24_model}, {0x0461, 0x0377, &medion_md5345_model}, + {0x04a7, 0x0229, &visioneer_7100_model}, {0x04a7, 0x0426, &visioneer_xp200_model}, {0x04a7, 0x0474, &visioneer_xp300_model}, - {0x0a82, 0x4803, &syscan_docketport_665_model}, {0x04a7, 0x0494, &visioneer_roadwarrior_model}, - {0x0a82, 0x4802, &syscan_docketport_465_model}, {0x04a7, 0x049b, &visioneer_xp100_r3_model}, + {0x04a7, 0x04ac, &xerox_travelscanner_model}, + {0x04a9, 0x2213, &canon_lide_50_model}, + {0x04a9, 0x221c, &canon_lide_60_model}, + {0x0638, 0x0a10, &umax_astra_4500_model}, + {0x07b3, 0x0600, &plustek_st12_model}, + {0x07b3, 0x0601, &plustek_st24_model}, + {0x0a17, 0x3210, &pentax_dsmobile_600_model}, + {0x0a82, 0x4800, &syscan_docketport_485_model}, + {0x0a82, 0x4802, &syscan_docketport_465_model}, + {0x0a82, 0x4803, &syscan_docketport_665_model}, + {0x0a82, 0x480c, &syscan_docketport_685_model}, + {0x1dcc, 0x4810, &dct_docketport_487_model}, + {0x1dcc, 0x4812, &syscan_docketport_467_model}, {0, 0, NULL} }; diff -Nru sane-backends-1.0.20/backend/genesys_gl646.c sane-backends-1.0.21/backend/genesys_gl646.c --- sane-backends-1.0.20/backend/genesys_gl646.c 2009-04-30 23:15:19.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys_gl646.c 2010-04-14 10:52:59.000000000 +1000 @@ -46,296 +46,7 @@ If you do not wish that, delete this exception notice. */ -#include "../include/sane/config.h" - -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#include "../include/sane/sane.h" -#include "../include/sane/sanei.h" -#include "../include/sane/saneopts.h" - -#undef BACKEND_NAME -#define BACKEND_NAME genesys_gl646 - -#include "../include/sane/sanei_backend.h" -#include "../include/sane/sanei_config.h" -#include "../include/sane/sanei_usb.h" - -#include "_stdint.h" -#include "genesys.h" - -/* Individual bits */ -#define REG01_CISSET 0x80 -#define REG01_DOGENB 0x40 -#define REG01_DVDSET 0x20 -#define REG01_FASTMOD 0x10 -#define REG01_COMPENB 0x08 -#define REG01_DRAMSEL 0x04 -#define REG01_SHDAREA 0x02 -#define REG01_SCAN 0x01 - -#define REG02_NOTHOME 0x80 -#define REG02_ACDCDIS 0x40 -#define REG02_AGOHOME 0x20 -#define REG02_MTRPWR 0x10 -#define REG02_FASTFED 0x08 -#define REG02_MTRREV 0x04 -#define REG02_STEPSEL 0x03 - -#define REG02_FULLSTEP 0x00 -#define REG02_HALFSTEP 0x01 -#define REG02_QUATERSTEP 0x02 - -#define REG03_TG3 0x80 -#define REG03_AVEENB 0x40 -#define REG03_XPASEL 0x20 -#define REG03_LAMPPWR 0x10 -#define REG03_LAMPDOG 0x08 -#define REG03_LAMPTIM 0x07 - -#define REG04_LINEART 0x80 -#define REG04_BITSET 0x40 -#define REG04_ADTYPE 0x30 -#define REG04_FILTER 0x0c -#define REG04_FESET 0x03 - -#define REG05_DPIHW 0xc0 -#define REG05_DPIHW_600 0x00 -#define REG05_DPIHW_1200 0x40 -#define REG05_DPIHW_2400 0x80 -#define REG05_GMMTYPE 0x30 -#define REG05_GMM14BIT 0x10 -#define REG05_GMMENB 0x08 -#define REG05_LEDADD 0x04 -#define REG05_BASESEL 0x03 - -#define REG06_PWRBIT 0x10 -#define REG06_GAIN4 0x08 -#define REG06_OPTEST 0x07 - -#define REG07_DMASEL 0x02 -#define REG07_DMARDWR 0x01 - -#define REG16_CTRLHI 0x80 -#define REG16_SELINV 0x40 -#define REG16_TGINV 0x20 -#define REG16_CK1INV 0x10 -#define REG16_CK2INV 0x08 -#define REG16_CTRLINV 0x04 -#define REG16_CKDIS 0x02 -#define REG16_CTRLDIS 0x01 - -#define REG17_TGMODE 0xc0 -#define REG17_TGMODE_NO_DUMMY 0x00 -#define REG17_TGMODE_REF 0x40 -#define REG17_TGMODE_XPA 0x80 -#define REG17_TGW 0x3f - -#define REG18_CNSET 0x80 -#define REG18_DCKSEL 0x60 -#define REG18_CKTOGGLE 0x10 -#define REG18_CKDELAY 0x0c -#define REG18_CKSEL 0x03 - -#define REG1D_CKMANUAL 0x80 - -#define REG1E_WDTIME 0xf0 -#define REG1E_LINESEL 0x0f - -#define REG41_PWRBIT 0x80 -#define REG41_BUFEMPTY 0x40 -#define REG41_FEEDFSH 0x20 -#define REG41_SCANFSH 0x10 -#define REG41_HOMESNR 0x08 -#define REG41_LAMPSTS 0x04 -#define REG41_FEBUSY 0x02 -#define REG41_MOTMFLG 0x01 - -#define REG66_LOW_CURRENT 0x10 - -#define REG6A_FSTPSEL 0xc0 -#define REG6A_FASTPWM 0x3f - -#define REG6C_TGTIME 0xc0 -#define REG6C_Z1MOD 0x38 -#define REG6C_Z2MOD 0x07 - -#define REG_SCANFED 0x1f -#define REG_LINCNT 0x25 -#define REG_DPISET 0x2c -#define REG_STRPIXEL 0x30 -#define REG_ENDPIXEL 0x32 -#define REG_MAXWD 0x35 -#define REG_LPERIOD 0x38 -#define REG_FEEDL 0x3d -#define REG_VALIDWORD 0x42 -#define REG_FEDCNT 0x48 -#define REG_SCANCNT 0x4b -#define REG_Z1MOD 0x60 -#define REG_Z2MOD 0x62 - - -/* we don't need a genesys_gl646.h yet, declarations aren't numerous enough */ -/* writable registers */ -enum -{ - reg_0x01 = 0, - reg_0x02, - reg_0x03, - reg_0x04, - reg_0x05, - reg_0x06, - reg_0x07, - reg_0x08, - reg_0x09, - reg_0x0a, - reg_0x0b, - reg_0x10, - reg_0x11, - reg_0x12, - reg_0x13, - reg_0x14, - reg_0x15, - reg_0x16, - reg_0x17, - reg_0x18, - reg_0x19, - reg_0x1a, - reg_0x1b, - reg_0x1c, - reg_0x1d, - reg_0x1e, - reg_0x1f, - reg_0x20, - reg_0x21, - reg_0x22, - reg_0x23, - reg_0x24, - reg_0x25, - reg_0x26, - reg_0x27, - reg_0x28, - reg_0x29, - reg_0x2c, - reg_0x2d, - reg_0x2e, - reg_0x2f, - reg_0x30, - reg_0x31, - reg_0x32, - reg_0x33, - reg_0x34, - reg_0x35, - reg_0x36, - reg_0x37, - reg_0x38, - reg_0x39, - reg_0x3d, - reg_0x3e, - reg_0x3f, - reg_0x52, - reg_0x53, - reg_0x54, - reg_0x55, - reg_0x56, - reg_0x57, - reg_0x58, - reg_0x59, - reg_0x5a, - reg_0x5b, - reg_0x5c, - reg_0x5d, - reg_0x5e, - reg_0x60, - reg_0x61, - reg_0x62, - reg_0x63, - reg_0x64, - reg_0x65, - reg_0x66, - reg_0x67, - reg_0x68, - reg_0x69, - reg_0x6a, - reg_0x6b, - reg_0x6c, - reg_0x6d, - GENESYS_GL646_MAX_REGS -}; - - -static SANE_Status gl646_set_fe (Genesys_Device * dev, uint8_t set); - -/** - * sets up the scanner for a scan, registers, gamma tables, shading tables - * and slope tables, based on the parameter struct. - * @param device device to set up - * @param settings settings of the scan - * @param split true if move before scan has to be done - * @param xcorrection true if scanner's X geometry must be taken into account to - * compute X, ie add left margins - * @param ycorrection true if scanner's Y geometry must be taken into account to - * compute Y, ie add top margins - */ -static SANE_Status -setup_for_scan (Genesys_Device * device, Genesys_Settings settings, - SANE_Bool split, SANE_Bool xcorrection, - SANE_Bool ycorrection); - -/** - * sets up the registers for a scan corresponding to the settings. - * Builds motor slope tables. Computes buffer sizes and data amount to - * transfer. It also sets up analog frontend. - * */ -static SANE_Status -gl646_setup_registers (Genesys_Device * dev, - Genesys_Register_Set * regs, - Genesys_Settings scan_settings, - uint16_t * slope_table1, - uint16_t * slope_table2, - SANE_Int resolution, - uint32_t move, - uint32_t linecnt, - uint16_t startx, - uint16_t endx, SANE_Bool color, SANE_Int depth); - -/** - * Does a simple scan of the area given by the settings. Scanned data - * it put in an allocated area which must be freed by the caller. - * and slope tables, based on the parameter struct. There is no shading - * correction while gamma correction is active. - * @param device device to set up - * @param settings settings of the scan - * @param move flag to enable scanhead to move - * @param data pointer that will point to the scanned data - */ -static SANE_Status -simple_scan (Genesys_Device * dev, Genesys_Settings settings, SANE_Bool move, - unsigned char **data); - -/** - * Send the stop scan command - * */ -static SANE_Status -end_scan (Genesys_Device * dev, Genesys_Register_Set * reg, - SANE_Bool check_stop, SANE_Bool eject); -/** - * writes control data to an area behind the last motor table. - */ -static SANE_Status write_control (Genesys_Device * dev, int resolution); - - -/** - * initialize scanner's registers at SANE init time - */ -static void gl646_init_regs (Genesys_Device * dev); +#include "genesys_gl646.h" /** * returns the value hold by a 3 word register @@ -443,11 +154,13 @@ { DBG (DBG_io2, "reg[0x%02x] = 0x%02x\n", buffer[i], buffer[i + 1]); } - /* when full size, decode regfister content */ + /* when full size, decode register content */ if (elems > 60) { DBG (DBG_io2, "DPISET =%d\n", gl646_get_double_reg (reg, REG_DPISET)); + DBG (DBG_io2, "DUMMY =%d\n", + sanei_genesys_get_address (reg, REG_DUMMY)->value); DBG (DBG_io2, "STRPIXEL =%d\n", gl646_get_double_reg (reg, REG_STRPIXEL)); DBG (DBG_io2, "ENDPIXEL =%d\n", @@ -644,6 +357,11 @@ data += size; } + if (dev->model->is_sheetfed == SANE_TRUE) + { + gl646_detect_document_end (dev); + } + DBG (DBG_io, "gl646_bulk_read_data: end\n"); return status; @@ -812,300 +530,38 @@ } -#define FULL_STEP 0 -#define HALF_STEP 1 -#define QUATER_STEP 2 - -#define CALIBRATION_LINES 10 - -/** - * master motor settings table entry - */ -typedef struct -{ - /* key */ - SANE_Int motor; - SANE_Int dpi; - SANE_Bool color; - - /* settings */ - SANE_Int ydpi; /* real motor dpi, may be different from the resolution */ - SANE_Int steptype; /* 0=full, 1=half, 2=quarter */ - SANE_Bool fastmod; /* fast scanning 0/1 */ - SANE_Bool fastfed; /* fast fed slope tables */ - SANE_Int mtrpwm; - SANE_Int steps1; /* table 1 informations */ - SANE_Int vstart1; - SANE_Int vend1; - SANE_Int steps2; /* table 2 informations */ - SANE_Int vstart2; - SANE_Int vend2; - float g1; - float g2; - SANE_Int fwdbwd; /* forward/backward steps */ -} Motor_Master; - -/** - * master sensor settings table entry - */ -typedef struct -{ - /* key */ - SANE_Int sensor; /**< sensor identifier */ - SANE_Int dpi; /**< required dpi */ - SANE_Bool color; /**< SANE_TRUE if color scan */ - - /* settings */ - SANE_Int xdpi; /**< real sensor dpi, may be different from the required resolution */ - SANE_Int exposure; /**< exposure time */ - SANE_Int dpiset; /**< set sensor dpi */ - SANE_Int cksel; /**< dpiset 'divisor', part of reg 18h */ - SANE_Int dummy; /**< dummy exposure time */ - uint8_t regs_0x10_0x15[6]; /**< per color exposure time for CIS scanners */ - SANE_Bool half_ccd; /**> true if manual CCD/2 clock programming or real dpi is half dpiset */ - uint8_t reg_0x18; /**> content of register 18h */ - uint8_t reg_0x1d; /**> content of register 1dh */ -} Sensor_Master; - /** - * settings for a given resolution and DPISET - * TODO clean up this when all scanners will have been added + * find the lowest resolution for the sensor in the given mode. + * @param sensor id of the sensor + * @param required required resolution + * @param color true is color mode + * @return the closest resolution for the sensor and mode */ -typedef struct +static int +get_lowest_resolution (int sensor, SANE_Bool color) { - /* key */ - SANE_Int sensor; - SANE_Int cksel; - - /* values */ - uint8_t regs_0x08_0x0b[4]; /**< settings for normal CCD clock */ - uint8_t manual_0x08_0x0b[4]; /**< settings for CCD/2 clock */ - uint8_t regs_0x16_0x1d[8]; - uint8_t regs_0x52_0x5e[13]; - uint8_t manual_0x52_0x58[7]; -} Sensor_Settings; - -/** - * master sensor settings, for a given sensor and dpi, - * it gives exposure and CCD time - */ -/* *INDENT-OFF* */ -static Sensor_Master sensor_master[] = { - /* HP3670 master settings */ - {CCD_HP3670, 50, SANE_TRUE , 50, 5758, 200, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 100, SANE_TRUE , 100, 4487, 400, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 150, SANE_TRUE , 150, 4879, 600, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 300, SANE_TRUE , 300, 4503, 1200, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 600, SANE_TRUE , 600, 10251, 1200, 2, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x31, 0x43}, - {CCD_HP3670,1200, SANE_TRUE , 1200, 12750, 1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x43}, - {CCD_HP3670, 50, SANE_FALSE, 50, 5758, 200, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 100, SANE_FALSE, 100, 4487, 400, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 150, SANE_FALSE, 150, 4879, 600, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 300, SANE_FALSE, 300, 4503, 1200, 4, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x33, 0x43}, - {CCD_HP3670, 600, SANE_FALSE, 600, 10251, 1200, 2, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x31, 0x43}, - {CCD_HP3670,1200, SANE_FALSE, 1200, 12750, 1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x43}, - - /* HP 2400 master settings */ - {CCD_HP2400, 50, SANE_TRUE, 50, 675, 200, 4, 42, {0, 0, 0, 0, 0, 0}, SANE_FALSE, 0x3f, 0x02}, - {CCD_HP2400, 300, SANE_TRUE, 300, 8751, 1200, 4, 42, {0, 0, 0, 0, 0, 0}, SANE_FALSE, 0x3f, 0x02}, - {CCD_HP2400, 600, SANE_TRUE, 1200, 18760, 1200, 2, 42, {0, 0, 0, 0, 0, 0}, SANE_FALSE, 0x3f, 0x02}, - - /* XP 200 master settings */ - {CIS_XP200 , 75, SANE_TRUE , 75, 5700, 75, 1, 42, {0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 100, SANE_TRUE , 100, 5700, 100, 1, 42, {0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 200, SANE_TRUE , 200, 5700, 200, 1, 42, {0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 300, SANE_TRUE , 300, 9000, 300, 1, 42, {0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 600, SANE_TRUE , 600, 16000, 600, 1, 42, {0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}, SANE_FALSE, 0x00, 0x11}, - - {CIS_XP200 , 75, SANE_FALSE, 75, 16000, 75, 1, 42, {0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 100, SANE_FALSE, 100, 7800, 100, 1, 42, {0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 200, SANE_FALSE, 200, 11000, 200, 1, 42, {0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 300, SANE_FALSE, 300, 13000, 300, 1, 42, {0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}, SANE_FALSE, 0x00, 0x11}, - {CIS_XP200 , 600, SANE_FALSE, 600, 24000, 600, 1, 42, {0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}, SANE_FALSE, 0x00, 0x11}, - - /* HP 2300 master settings */ - {CCD_HP2300, 75, SANE_TRUE , 75, 4480, 150, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x20, 0x85}, - {CCD_HP2300, 150, SANE_TRUE , 150, 4350, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x20, 0x85}, - {CCD_HP2300, 300, SANE_TRUE , 300, 8700, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - {CCD_HP2300, 600, SANE_TRUE , 600, 8700, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - {CCD_HP2300,1200, SANE_TRUE , 600, 8700, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - {CCD_HP2300, 75, SANE_FALSE, 75, 4480, 150, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x20, 0x85}, - {CCD_HP2300, 150, SANE_FALSE, 150, 4350, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x20, 0x85}, - {CCD_HP2300, 300, SANE_FALSE, 300, 8700, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - {CCD_HP2300, 600, SANE_FALSE, 600, 8700, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - {CCD_HP2300,1200, SANE_FALSE, 600, 8700, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x20, 0x05}, - - /* MD5345/6471 master settings */ - {CCD_5345 , 50, SANE_TRUE , 50, 12000, 100, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 75, SANE_TRUE , 75, 11000, 150, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 100, SANE_TRUE , 100, 11000, 200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 150, SANE_TRUE , 150, 11000, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 200, SANE_TRUE , 200, 11000, 400, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 300, SANE_TRUE , 300, 11000, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 400, SANE_TRUE , 400, 11000, 800, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 600, SANE_TRUE , 600, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 ,1200, SANE_TRUE ,1200, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x03}, - {CCD_5345 ,2400, SANE_TRUE ,1200, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x03}, - {CCD_5345 , 50, SANE_FALSE, 50, 12000, 100, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 75, SANE_FALSE, 75, 11000, 150, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 100, SANE_FALSE, 100, 11000, 200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 150, SANE_FALSE, 150, 11000, 300, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 200, SANE_FALSE, 200, 11000, 400, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 300, SANE_FALSE, 300, 11000, 600, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 400, SANE_FALSE, 400, 11000, 800, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 , 600, SANE_FALSE, 600, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_TRUE , 0x28, 0x03}, - {CCD_5345 ,1200, SANE_FALSE,1200, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x03}, - {CCD_5345 ,2400, SANE_FALSE,1200, 11000,1200, 1, 42, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, SANE_FALSE, 0x30, 0x03}, - -}; - -/** - * master motor settings, for a given motor and dpi, - * it gives steps and speed informations - */ -static Motor_Master motor_master[] = { - /* HP3670 motor settings */ - {MOTOR_HP3670, 50, SANE_TRUE , 50, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 229, 2329, 120, 200, 3399, 337, 0.3, 0.4, 192}, - {MOTOR_HP3670, 100, SANE_TRUE , 100, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 143, 2905, 187, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 150, SANE_TRUE , 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 73, 3429, 305, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 300, SANE_TRUE , 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 11, 1055, 563, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 600, SANE_TRUE , 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 10687, 5126, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670,1200, SANE_TRUE ,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 12751,12751, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 50, SANE_FALSE, 50, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 229, 2329, 120, 200, 3399, 337, 0.3, 0.4, 192}, - {MOTOR_HP3670, 100, SANE_FALSE, 100, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 143, 2905, 187, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 150, SANE_FALSE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 73, 3429, 305, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 11, 1055, 563, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670, 600, SANE_FALSE, 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 10687, 5126, 200, 3399, 337, 0.3, 0.4, 96}, - {MOTOR_HP3670,1200, SANE_FALSE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 12751,12751, 200, 3399, 337, 0.3, 0.4, 96}, - - /* HP2400/G2410 motor settings base motor dpi = 600 */ - {MOTOR_HP2400, 50, SANE_TRUE, 50, HALF_STEP, SANE_FALSE, SANE_FALSE, 63, 4, 1382, 800, 2, 5400, 5400, 0.25, 0.5, 16}, - {MOTOR_HP2400, 300, SANE_TRUE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 32, 16703, 2188, 120, 4905, 337, 0.25, 0.5, 16}, - {MOTOR_HP2400, 600, SANE_TRUE, 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 18761, 18761, 16, 4905, 627, 0.25, 0.5, 16}, - - /* XP 200 motor settings */ - {MOTOR_XP200, 75, SANE_TRUE, 75, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2136, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 100, SANE_TRUE, 100, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2850, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 200, SANE_TRUE, 200, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6999, 5700, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 250, SANE_TRUE, 250, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6999, 6999, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 300, SANE_TRUE, 300, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 13500, 13500, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 600, SANE_TRUE, 600, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 31998, 31998, 2, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 75, SANE_FALSE, 75, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2000, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 100, SANE_FALSE, 100, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 1300, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 200, SANE_FALSE, 200, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 6000, 3666, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 300, SANE_FALSE, 300, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6500, 6500, 8, 12000, 1200, 0.3, 0.5, 1}, - {MOTOR_XP200, 600, SANE_FALSE, 600, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 24000, 24000, 2, 12000, 1200, 0.3, 0.5, 1}, - - /* HP scanjet 2300c */ - {MOTOR_HP2300, 75, SANE_TRUE, 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 120, 8139, 560, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 150, SANE_TRUE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 67, 7903, 543, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 300, SANE_TRUE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 44, 5386, 2175, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 600, SANE_TRUE, 600, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 8700, 4350, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300,1200, SANE_TRUE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 17400, 8700, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 75, SANE_FALSE, 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 120, 8139, 560, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 150, SANE_FALSE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 67, 7903, 543, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 44, 5386, 2175, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300, 600, SANE_FALSE, 600, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 8700, 4350, 120, 4905, 337, 0.3, 0.4, 16}, - {MOTOR_HP2300,1200, SANE_FALSE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 17400, 8700, 120, 4905, 337, 0.3, 0.4, 16}, - - /* MD5345/6471 motor settings */ - /* vfinal=(exposure/(1200/dpi))/step_type */ - {MOTOR_5345, 50, SANE_TRUE , 50, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 250, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 75, SANE_TRUE , 75, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 343, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 100, SANE_TRUE , 100, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 458, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 150, SANE_TRUE , 150, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 687, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 200, SANE_TRUE , 200, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 916, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 300, SANE_TRUE, 300, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 1375, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 400, SANE_TRUE, 400, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2000, 1833, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 500, SANE_TRUE, 500, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2291, 2291, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 600, SANE_TRUE, 600, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 1200, SANE_TRUE ,1200, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 146}, - {MOTOR_5345, 2400, SANE_TRUE ,2400, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 5500, 5500, 255, 2000, 300, 0.3, 0.4, 146}, - {MOTOR_5345, 50, SANE_FALSE, 50, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 250, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 75, SANE_FALSE, 75, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 343, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 100, SANE_FALSE, 100, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 458, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 150, SANE_FALSE, 150, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 687, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 200, SANE_FALSE, 200, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 916, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 300, SANE_FALSE, 300, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 1375, 255, 2000, 300, 0.3, 0.4, 64}, - {MOTOR_5345, 400, SANE_FALSE, 400, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2000, 1833, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 500, SANE_FALSE, 500, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2291, 2291, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 600, SANE_FALSE, 600, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 32}, - {MOTOR_5345, 1200, SANE_FALSE,1200, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 146}, - {MOTOR_5345, 2400, SANE_FALSE,2400, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 5500, 5500, 255, 2000, 300, 0.3, 0.4, 146}, /* 5500 guessed */ -}; - -/** - * sensor settings for a given sensor and timing method - */ -static Sensor_Settings sensor_settings[] = { - /* HP 3670 */ - {CCD_HP3670, 1, - {0x0d, 0x0f, 0x11, 0x13}, - {0x00, 0x00, 0x00, 0x00}, - {0x2b, 0x07, 0x30, 0x2a, 0x00, 0x00, 0xc0, 0x43}, - {0x03, 0x07, 0x0b, 0x0f, 0x13, 0x17, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, }, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - }, - {CCD_HP3670, 2, - {0x00, 0x05, 0x06, 0x08}, - {0x00, 0x00, 0x00, 0x00}, - {0x33, 0x07, 0x31, 0x2a, 0x02, 0x0e, 0xc0, 0x43}, - {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x02, 0x0e, 0x00, 0x00, }, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - }, - {CCD_HP3670, 4, - {0x00, 0x0a, 0x0b, 0x0d}, - {0x00, 0x00, 0x00, 0x00}, - {0x33, 0x07, 0x33, 0x2a, 0x02, 0x13, 0xc0, 0x43}, - {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x15, 0xc1, 0x05, 0x0a, 0x0f, 0x00, }, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - }, - /* HP 2400 */ - {CCD_HP2400, 4, - {0x14, 0x15, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x00}, - {0xbf, 0x08, 0x3f, 0x2a, 0x00, 0x00, 0x00, 0x02}, - {11, 15, 19, 23, 3, 7, 0x63, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00}, - {11, 15, 19, 23, 3, 7, 0x63} - }, - {CCD_HP2400, 2, - {14, 15, 0, 0}, - {14, 15, 0, 0}, - {0xbf, 0x08, 0x3f, 0x2a, 0, 0, 0, 0x02}, - {3, 7, 11, 15, 19, 23, 0x23, 0, 0xc1, 0, 0, 0, 0}, - {3, 7, 11, 15, 19, 23, 0x23} - }, - {CCD_HP2400, 1, - {0x02, 0x04, 0x00, 0x00}, - {0x02, 0x04, 0x00, 0x00}, - {0xbf, 0x08, 0x30, 0x2a, 0x00, 0x00, 0xc0, 0x42}, - {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x0e, 0x00, 0x00}, - {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63} - }, - {CIS_XP200, 1, - {6, 7, 10, 4}, - {6, 7, 10, 4}, - {0x24, 0x04, 0x00, 0x2a, 0x0a, 0x0a, 0, 0x11}, - {8, 2, 0, 0, 0, 0, 0x1a, 0x51, 0, 0, 0, 0, 0}, - {8, 2, 0, 0, 0, 0, 0x1a} - }, - {CCD_HP2300, 1, - {0x01, 0x03, 0x04, 0x06}, - {0x16, 0x00, 0x01, 0x03}, - {0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a, 0x00, 0x05}, - {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x06, 0x0b, 0x10, 0x16}, - {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83} - }, - {CCD_5345, 1, - {0x0d, 0x0f, 0x11, 0x13}, - {0x00, 0x05, 0x06, 0x08}, /* manual clock 1/2 settings or half ccd */ - {0x0b, 0x0a, 0x30, 0x2a, 0x00, 0x00, 0x00, 0x03, }, - {0x03, 0x07, 0x0b, 0x0f, 0x13, 0x17, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00}, - {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83} /* half ccd settings */ - }, -}; -/* *INDENT-ON* */ + int i, nb; + int dpi; + i = 0; + dpi = 9600; + nb = sizeof (sensor_master) / sizeof (Sensor_Master); + while (sensor_master[i].sensor != -1 && i < nb) + { + /* computes distance and keep mode if it is closer than previous */ + if (sensor == sensor_master[i].sensor + && sensor_master[i].color == color) + { + if (sensor_master[i].dpi < dpi) + { + dpi = sensor_master[i].dpi; + } + } + i++; + } + DBG (DBG_info, "get_lowest_resolution: %d\n", dpi); + return dpi; +} /** * find the closest match in mode tables for the given resolution and scan mode. @@ -1175,7 +631,7 @@ && sensor_master[i].color == color) { DBG (DBG_io, "is_half_ccd: match found for %d (half_ccd=%d)\n", - required,sensor_master[i].half_ccd); + required, sensor_master[i].half_ccd); return sensor_master[i].half_ccd; } i++; @@ -1185,6 +641,38 @@ } /** + * Returns the cksel values used by the required scan mode. + * @param sensor id of the sensor + * @param required required resolution + * @param color true is color mode + * @return cksel value for mode + */ +static int +get_cksel (int sensor, int required, SANE_Bool color) +{ + int i, nb; + + i = 0; + nb = sizeof (sensor_master) / sizeof (Sensor_Master); + while (sensor_master[i].sensor != -1 && i < nb) + { + /* exit on perfect match */ + if (sensor == sensor_master[i].sensor + && sensor_master[i].dpi == required + && sensor_master[i].color == color) + { + DBG (DBG_io, "get_cksel: match found for %d (cksel=%d)\n", + required, sensor_master[i].cksel); + return sensor_master[i].cksel; + } + i++; + } + DBG (DBG_error, "get_cksel: failed to find match for %d dpi\n", required); + /* fail safe fallback */ + return 1; +} + +/** * Setup register and motor tables for a scan at the * given resolution and color mode. TODO try to not use any filed from * the device. @@ -1226,6 +714,7 @@ Genesys_Register_Set *r; unsigned int used1, used2, vfinal; uint32_t z1, z2; + uint16_t ex, sx; int channels = 1, stagger, wpl, max_shift; size_t requested_buffer_size; size_t read_buffer_size; @@ -1311,20 +800,25 @@ return SANE_STATUS_INVAL; } - /* vfinal=(exposure/(1200/dpi))/step_type */ - /* DBG (DBG_info, "XXX STEF XXX vfinal=%d, vend1=%d\n", - (sensor->exposure * sensor->xdpi) / ((1 << motor->steptype) * - dev->sensor.optical_res), - motor->vend1); */ - /* half_ccd if manual clock programming or dpi is half dpiset */ half_ccd = sensor->half_ccd; /* now apply values from settings to registers */ - for (i = 0; i < 6; i++) + if (sensor->regs_0x10_0x15 != NULL) { - r = sanei_genesys_get_address (regs, 0x10 + i); - r->value = sensor->regs_0x10_0x15[i]; + for (i = 0; i < 6; i++) + { + r = sanei_genesys_get_address (regs, 0x10 + i); + r->value = sensor->regs_0x10_0x15[i]; + } + } + else + { + for (i = 0; i < 6; i++) + { + r = sanei_genesys_get_address (regs, 0x10 + i); + r->value = 0; + } } for (i = 0; i < 4; i++) @@ -1382,10 +876,15 @@ else regs[reg_0x01].value &= ~REG01_CISSET; + /* if device has no calibration, don't enable shading correction */ + if (dev->model->flags & GENESYS_FLAG_NO_CALIBRATION) + { + regs[reg_0x01].value &= ~REG01_DVDSET; + } + + regs[reg_0x01].value &= ~REG01_FASTMOD; if (motor->fastmod) regs[reg_0x01].value |= REG01_FASTMOD; - else - regs[reg_0x01].value &= ~REG01_FASTMOD; /* R02 */ /* allow moving when buffer full by default */ @@ -1434,6 +933,14 @@ /* R03 */ regs[reg_0x03].value &= ~REG03_AVEENB; /* regs[reg_0x03].value |= REG03_AVEENB; */ + regs[reg_0x03].value &= ~REG03_LAMPDOG; + + /* select XPA */ + regs[reg_0x03].value &= ~REG03_XPASEL; + if (scan_settings.scan_method == SCAN_METHOD_TRANSPARENCY) + { + regs[reg_0x03].value |= REG03_XPASEL; + } /* R04 */ if (depth > 8) @@ -1470,9 +977,16 @@ else regs[reg_0x05].value &= ~REG05_GMMENB; - /* true CIS gray */ - if (dev->model->is_cis == SANE_TRUE && color == SANE_FALSE) - regs[reg_0x05].value |= REG05_LEDADD; + /* true CIS gray if needed */ + if (dev->model->is_cis == SANE_TRUE && color == SANE_FALSE + && dev->settings.true_gray) + { + regs[reg_0x05].value |= REG05_LEDADD; + } + else + { + regs[reg_0x05].value &= ~REG05_LEDADD; + } /* cktoggle, ckdelay and cksel at once, cktdelay=2 => half_ccd for md5345 */ regs[reg_0x18].value = sensor->reg_0x18; @@ -1508,48 +1022,51 @@ } /* at QUATER_STEP lines are 'staggered' and need correction */ + stagger = 0; if ((!half_ccd) && (dev->model->flags & GENESYS_FLAG_STAGGERED_LINE)) { - stagger = (4 * scan_settings.yres) / dev->motor.base_ydpi; - linecnt += stagger; + /* for HP3670, stagger happens only at >=1200 dpi */ + if ((dev->model->motor_type != MOTOR_HP3670 + && dev->model->motor_type != MOTOR_HP2400) + || scan_settings.yres >= dev->sensor.optical_res) + { + stagger = (4 * scan_settings.yres) / dev->motor.base_ydpi; + } } - else - stagger = 0; + linecnt += stagger; + DBG (DBG_info, "gl646_setup_registers : max_shift=%d, stagger=%d lines\n", max_shift, stagger); - /* CIS scanners read one line per color channel */ + /* CIS scanners read one line per color channel + * since gray mode use 'add' we also read 3 channels even not in + * color mode */ if (dev->model->is_cis == SANE_TRUE) { - /* big to get any doc out of the feeder */ - linecnt = (1000 * motor->ydpi) / MM_PER_INCH; + gl646_set_triple_reg (regs, REG_LINCNT, linecnt * 3); linecnt *= channels; } - gl646_set_triple_reg (regs, REG_LINCNT, linecnt); + else + { + gl646_set_triple_reg (regs, REG_LINCNT, linecnt); + } /* scanner's x coordinates are expressed in physical DPI but they must be divided by cksel */ - startx = startx / sensor->cksel; - endx = endx / sensor->cksel; + sx = startx / sensor->cksel; + ex = endx / sensor->cksel; if (half_ccd == SANE_TRUE) { - gl646_set_double_reg (regs, REG_STRPIXEL, startx / 2); - gl646_set_double_reg (regs, REG_ENDPIXEL, endx / 2); - DBG (DBG_info, - "gl646_setup_registers: startx=%d, endx=%d, half_ccd=%d\n", - startx / 2, endx / 2, half_ccd); - } - else - { - gl646_set_double_reg (regs, REG_STRPIXEL, startx); - gl646_set_double_reg (regs, REG_ENDPIXEL, endx); - DBG (DBG_info, - "gl646_setup_registers: startx=%d, endx=%d, half_ccd=%d\n", startx, - endx, half_ccd); + sx /= 2; + ex /= 2; } + gl646_set_double_reg (regs, REG_STRPIXEL, sx); + gl646_set_double_reg (regs, REG_ENDPIXEL, ex); + DBG (DBG_info, "gl646_setup_registers: startx=%d, endx=%d, half_ccd=%d\n", + sx, ex, half_ccd); /* wpl must be computed according to the scan's resolution */ /* in fact, wpl _gives_ the actual scan resolution */ - wpl = ((endx - startx) * sensor->xdpi) / dev->sensor.optical_res; + wpl = (((endx - startx) * sensor->xdpi) / dev->sensor.optical_res); if (depth == 16) wpl *= 2; if (dev->model->is_cis == SANE_FALSE) @@ -1682,17 +1199,10 @@ (regs[reg_0x6c].value & REG6C_TGTIME) | ((z1 >> 13) & 0x38) | ((z2 >> 16) & 0x07); - /* the 3670 seems to behave differently regarding GPIO */ - /* TODO to be added in the sensor setting struct ?? */ - if (dev->model->ccd_type == CCD_HP3670) - { - dev->reg[reg_0x66].value = 0; - } - RIE (write_control (dev, xresolution)); /* setup analog frontend */ - RIE (gl646_set_fe (dev, AFE_SET)); + RIE (gl646_set_fe (dev, AFE_SET, xresolution)); /* now we're done with registers setup values used by data transfer */ /* we setup values needed for the data transfer */ @@ -2053,11 +1563,15 @@ dev->reg[reg_0x20].value = 0x20; break; case CCD_HP2400: - case CCD_HP3670: dev->reg[reg_0x1e].value = 0x80; dev->reg[reg_0x1f].value = 0x10; dev->reg[reg_0x20].value = 0x20; break; + case CCD_HP3670: + dev->reg[reg_0x19].value = 0x2a; + dev->reg[reg_0x1e].value = 0x80; + dev->reg[reg_0x1f].value = 0x10; + dev->reg[reg_0x20].value = 0x20; break; case CIS_XP200: dev->reg[reg_0x1e].value = 0x10; @@ -2066,11 +1580,9 @@ break; default: dev->reg[reg_0x1f].value = 0x01; - dev->reg[reg_0x20].value = 0x10; + dev->reg[reg_0x20].value = 0x50; break; } - dev->reg[reg_0x1f].value = 0x01; /* XXX STEF XXX */ - dev->reg[reg_0x20].value = 0x50; /* XXX STEF XXX */ dev->reg[reg_0x21].value = 0x08 /*0x20 */ ; /* table one steps number for forward slope curve of the acc/dec */ dev->reg[reg_0x22].value = 0x10 /*0x08 */ ; /* steps number of the forward steps for start/stop */ @@ -2087,7 +1599,7 @@ dev->reg[reg_0x2e].value = 0x78; /* set black&white threshold high level */ dev->reg[reg_0x2f].value = 0x7f; /* set black&white threshold low level */ - dev->reg[reg_0x30].value = 0x00; /* begin pixel positon (16) */ + dev->reg[reg_0x30].value = 0x00; /* begin pixel position (16) */ dev->reg[reg_0x31].value = dev->sensor.dummy_pixel /*0x10 */ ; /* TGW + 2*TG_SHLD + x */ dev->reg[reg_0x32].value = 0x2a /*0x15 */ ; /* end pixel position (5390) */ dev->reg[reg_0x33].value = 0xf8 /*0x0e */ ; /* TGW + 2*TG_SHLD + y */ @@ -2162,8 +1674,9 @@ int i; #endif - DBG (DBG_proc, "gl646_send_slope_table (table_nr = %d, steps = %d)\n", - table_nr, steps); + DBG (DBG_proc, + "gl646_send_slope_table (table_nr = %d, steps = %d)=%d .. %d\n", + table_nr, steps, slope_table[0], slope_table[steps - 1]); dpihw = dev->reg[reg_0x05].value >> 6; @@ -2224,6 +1737,8 @@ gl646_set_ad_fe (Genesys_Device * dev, uint8_t set) { SANE_Status status = SANE_STATUS_GOOD; + int i; + uint16_t val; DBG (DBG_proc, "gl646_set_ad_fe(): start\n"); if (set == AFE_INIT) @@ -2235,88 +1750,274 @@ sanei_genesys_init_fe (dev); /* write them to analog frontend */ - status = sanei_genesys_fe_write_data (dev, 0x00, dev->frontend.reg[0]); + val = dev->frontend.reg[0]; + status = sanei_genesys_fe_write_data (dev, 0x00, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_set_ad_fe: failed to write reg0: %s\n", + sane_strstatus (status)); + return status; + } + val = dev->frontend.reg[1]; + status = sanei_genesys_fe_write_data (dev, 0x01, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_set_ad_fe: failed to write reg1: %s\n", + sane_strstatus (status)); + return status; + } } if (set == AFE_SET) { - status = sanei_genesys_fe_write_data (dev, 0x02, dev->frontend.gain[0]); - status = - sanei_genesys_fe_write_data (dev, 0x05, dev->frontend.offset[0]); + for (i = 0; i < 3; i++) + { + val = dev->frontend.gain[i]; + status = sanei_genesys_fe_write_data (dev, 0x02 + i, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_set_ad_fe: failed to write gain %d: %s\n", i, + sane_strstatus (status)); + return status; + } + } + for (i = 0; i < 3; i++) + { + val = dev->frontend.offset[i]; + status = sanei_genesys_fe_write_data (dev, 0x05 + i, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_set_ad_fe: failed to write offset %d: %s\n", i, + sane_strstatus (status)); + return status; + } + } } + /* + if (set == AFE_POWER_SAVE) + { + status = + sanei_genesys_fe_write_data (dev, 0x00, dev->frontend.reg[0] | 0x04); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_set_ad_fe: failed to write reg0: %s\n", + sane_strstatus (status)); + return status; + } + } */ DBG (DBG_proc, "gl646_set_ad_fe(): end\n"); return status; } -/* Set values of analog frontend */ +/** set up analog frontend + * set up analog frontend + * @param dev device to set up + * @param set action from AFE_SET, AFE_INIT and AFE_POWERSAVE + * @param dpi resolution of the scan since it affects settings + * @return SANE_STATUS_GOOD if evrithing OK + */ static SANE_Status -gl646_set_fe (Genesys_Device * dev, uint8_t set) +gl646_wm_hp3670 (Genesys_Device * dev, uint8_t set, int dpi) { - SANE_Status status; + SANE_Status status = SANE_STATUS_GOOD; int i; - uint8_t val; - DBG (DBG_proc, "gl646_set_fe (%s)\n", - set == AFE_INIT ? "init" : set == AFE_SET ? "set" : set == - AFE_POWER_SAVE ? "powersave" : "huh?"); - - /* Analog Device type frontend */ - if ((dev->reg[reg_0x04].value & REG04_FESET) == 0x02) - return gl646_set_ad_fe (dev, set); - - /* Wolfson type frontend */ - if ((dev->reg[reg_0x04].value & REG04_FESET) != 0x03) - { - DBG (DBG_proc, "gl646_set_fe(): unspported frontend type %d\n", - dev->reg[reg_0x04].value & REG04_FESET); - return SANE_STATUS_UNSUPPORTED; - } - - /* initialize analog frontend */ - if (set == AFE_INIT) + DBG (DBG_proc, "gl646_wm_hp3670: start \n"); + switch (set) { - DBG (DBG_proc, "gl646_set_fe(): setting DAC %u\n", - dev->model->dac_type); - sanei_genesys_init_fe (dev); - - /* reset only done on init */ + case AFE_INIT: status = sanei_genesys_fe_write_data (dev, 0x04, 0x80); if (status != SANE_STATUS_GOOD) { - DBG (DBG_error, "gl646_set_fe: init fe failed: %s\n", + DBG (DBG_error, "gl646_wm_hp3670: reset failed: %s\n", sane_strstatus (status)); return status; } - - /* enable GPIO for some models */ - if (dev->model->ccd_type == CCD_HP2300 - || dev->model->ccd_type == CCD_HP2400 - || dev->model->ccd_type == CCD_HP3670) + usleep (200000UL); + RIE (sanei_genesys_write_register (dev, 0x50, 0x00)); + sanei_genesys_init_fe (dev); + status = sanei_genesys_fe_write_data (dev, 0x01, dev->frontend.reg[1]); + if (status != SANE_STATUS_GOOD) { - val = 0x07; - status = gl646_gpio_output_enable (dev->dn, val); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "gl646_set_fe: failed to enable GPIO: %s\n", - sane_strstatus (status)); - return status; - } + DBG (DBG_error, "gl646_wm_hp3670: writing reg1 failed: %s\n", + sane_strstatus (status)); + return status; } - return status; - } - - /* set fontend to power saving mode */ - if (set == AFE_POWER_SAVE) - { - status = sanei_genesys_fe_write_data (dev, 0x01, 0x02); + status = sanei_genesys_fe_write_data (dev, 0x02, dev->frontend.reg[2]); if (status != SANE_STATUS_GOOD) { - DBG (DBG_error, "gl646_set_fe: writing data failed: %s\n", + DBG (DBG_error, "gl646_wm_hp3670: writing reg2 failed: %s\n", + sane_strstatus (status)); + return status; + } + status = gl646_gpio_output_enable (dev->dn, 0x07); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: failed to enable GPIO: %s\n", + sane_strstatus (status)); + return status; + } + break; + case AFE_POWER_SAVE: + status = sanei_genesys_fe_write_data (dev, 0x01, 0x06); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: writing reg1 failed: %s\n", + sane_strstatus (status)); + return status; + } + status = sanei_genesys_fe_write_data (dev, 0x06, 0x0f); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: writing reg6 failed: %s\n", sane_strstatus (status)); + return status; } return status; - } + break; + default: /* AFE_SET */ + /* mode setup */ + i = dev->frontend.reg[3]; + if (dpi > dev->sensor.optical_res / 2) + { + i = i & 0x1f; + } + status = sanei_genesys_fe_write_data (dev, 0x03, i); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: writing reg3 failed: %s\n", + sane_strstatus (status)); + return status; + } + /* offset and sign (or msb/lsb ?) */ + for (i = 0; i < 3; i++) + { + status = + sanei_genesys_fe_write_data (dev, 0x20 + i, + dev->frontend.offset[i]); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_wm_hp3670: writing offset%d failed: %s\n", i, + sane_strstatus (status)); + return status; + } + status = sanei_genesys_fe_write_data (dev, 0x24 + i, dev->frontend.sign[i]); /* MSB/LSB ? */ + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: writing sign%d failed: %s\n", + i, sane_strstatus (status)); + return status; + } + } + + /* gain */ + for (i = 0; i < 3; i++) + { + status = + sanei_genesys_fe_write_data (dev, 0x28 + i, + dev->frontend.gain[i]); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_wm_hp3670: writing gain%d failed: %s\n", + i, sane_strstatus (status)); + return status; + } + } + } + + DBG (DBG_proc, "gl646_wm_hp3670: success \n"); + return status; +} + +/** Set values of analog frontend + * @param dev device to set + * @param set action to execute + * @param dpi dpi to setup the AFE + * @return error or SANE_STATUS_GOOD */ +#ifndef UNIT_TESTING +static +#endif + SANE_Status +gl646_set_fe (Genesys_Device * dev, uint8_t set, int dpi) +{ + SANE_Status status; + int i; + uint8_t val; + + DBG (DBG_proc, "gl646_set_fe (%s,%d)\n", + set == AFE_INIT ? "init" : set == AFE_SET ? "set" : set == + AFE_POWER_SAVE ? "powersave" : "huh?", dpi); + + /* Analog Device type frontend */ + if ((dev->reg[reg_0x04].value & REG04_FESET) == 0x02) + return gl646_set_ad_fe (dev, set); + + /* Wolfson type frontend */ + if ((dev->reg[reg_0x04].value & REG04_FESET) != 0x03) + { + DBG (DBG_proc, "gl646_set_fe(): unspported frontend type %d\n", + dev->reg[reg_0x04].value & REG04_FESET); + return SANE_STATUS_UNSUPPORTED; + } + + /* per frontend function to keep code clean */ + switch (dev->model->dac_type) + { + case DAC_WOLFSON_HP3670: + case DAC_WOLFSON_HP2400: + return gl646_wm_hp3670 (dev, set, dpi); + break; + default: + DBG (DBG_proc, "gl646_set_fe(): using old method\n"); + break; + } + + /* initialize analog frontend */ + if (set == AFE_INIT) + { + DBG (DBG_proc, "gl646_set_fe(): setting DAC %u\n", + dev->model->dac_type); + sanei_genesys_init_fe (dev); + + /* reset only done on init */ + status = sanei_genesys_fe_write_data (dev, 0x04, 0x80); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_set_fe: init fe failed: %s\n", + sane_strstatus (status)); + return status; + } + + /* enable GPIO for some models */ + if (dev->model->ccd_type == CCD_HP2300) + { + val = 0x07; + status = gl646_gpio_output_enable (dev->dn, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_set_fe: failed to enable GPIO: %s\n", + sane_strstatus (status)); + return status; + } + } + return status; + } + + /* set fontend to power saving mode */ + if (set == AFE_POWER_SAVE) + { + status = sanei_genesys_fe_write_data (dev, 0x01, 0x02); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_set_fe: writing data failed: %s\n", + sane_strstatus (status)); + } + return status; + } /* here starts AFE_SET */ /* TODO : base this test on cfg reg3 or a CCD family flag to be created */ @@ -2425,6 +2126,21 @@ return SANE_STATUS_GOOD; } +/** Set values of analog frontend + * this this the public interface, the gl646 as to use one more + * parameter to work effectively, hence the redirection + * @param dev device to set + * @param set action to execute + * @return error or SANE_STATUS_GOOD */ +#ifndef UNIT_TESTING +static +#endif + SANE_Status +gl646_public_set_fe (Genesys_Device * dev, uint8_t set) +{ + return gl646_set_fe (dev, set, dev->settings.yres); +} + static void gl646_set_motor_power (Genesys_Register_Set * regs, SANE_Bool set) { @@ -2467,11 +2183,15 @@ /** * enters or leaves power saving mode + * limited to AFE for now. * @param dev scanner's device * @param SANE_TRUE to enable power saving, SANE_FALSE to leave it * @return allways SANE_STATUS_GOOD */ -static SANE_Status +#ifndef UNIT_TESTING +static +#endif + SANE_Status gl646_save_power (Genesys_Device * dev, SANE_Bool enable) { @@ -2484,12 +2204,9 @@ } else { - /* gl646_set_fe (dev, AFE_INIT); */ + gl646_set_fe (dev, AFE_INIT, 0); } - /* to make compiler happy */ - gl646_set_fe (dev, AFE_SET); - DBG (DBG_proc, "gl646_save_power: end\n"); return SANE_STATUS_GOOD; } @@ -2588,7 +2305,10 @@ * HOMESNR becomes 1 ->document left sensor * paper event -> document is out */ -static SANE_Status +#ifndef UNIT_TESTING +static +#endif + SANE_Status gl646_load_document (Genesys_Device * dev) { SANE_Status status = SANE_STATUS_GOOD; @@ -2598,6 +2318,15 @@ uint8_t val; DBG (DBG_proc, "gl646_load_document: start\n"); + + /* no need to load document is flatbed scanner */ + if (dev->model->is_sheetfed == SANE_FALSE) + { + DBG (DBG_proc, "gl646_load_document: nothing to load\n"); + DBG (DBG_proc, "gl646_load_document: end\n"); + return SANE_STATUS_GOOD; + } + status = sanei_genesys_get_status (dev, &val); if (status != SANE_STATUS_GOOD) { @@ -2764,62 +2493,69 @@ gl646_detect_document_end (Genesys_Device * dev) { SANE_Status status = SANE_STATUS_GOOD; - uint8_t val; - unsigned int bytes_to_flush, lines; - uint32_t flines, bpl, channels, depth; + uint8_t val, gpio; + unsigned int bytes_left, lines; DBG (DBG_proc, "gl646_detect_document_end: start\n"); /* test for document presence */ RIE (sanei_genesys_get_status (dev, &val)); - DBG (DBG_info, "gl646_detect_document_end: status=0x%02x\n", val); - status = gl646_gpio_read (dev->dn, &val); - DBG (DBG_info, "gl646_detect_document_end: GPIO=0x%02x\n", val); + if (DBG_LEVEL > DBG_info) + { + print_status (val); + } + status = gl646_gpio_read (dev->dn, &gpio); + DBG (DBG_info, "gl646_detect_document_end: GPIO=0x%02x\n", gpio); - /* sheetfed scanner uses home sensor as paper present */ - if ((dev->document == SANE_TRUE) && (val & REG41_HOMESNR)) + /* detect document event. There one event when the document go in, + * then another when it leaves */ + if ((dev->document == SANE_TRUE) && (gpio & 0x04) + && (dev->total_bytes_read > 0)) { DBG (DBG_info, "gl646_detect_document_end: no more document\n"); dev->document = SANE_FALSE; - channels = dev->current_setup.channels; - depth = dev->current_setup.depth; + /* adjust number of bytes to read: + * total_bytes_to_read is the number of byte to send to frontend + * total_bytes_read is the number of bytes sent to frontend + * read_bytes_left is the number of bytes to read from the scanner + */ + DBG (DBG_io, "gl646_detect_document_end: total_bytes_to_read=%lu\n", + (u_long) dev->total_bytes_to_read); + DBG (DBG_io, "gl646_detect_document_end: total_bytes_read =%lu\n", + (u_long) dev->total_bytes_read); + DBG (DBG_io, "gl646_detect_document_end: read_bytes_left =%lu\n", + (u_long) dev->read_bytes_left); - /* adjust number of bytes to read - * we need to read the final bytes which are word per line * number of last lines - * to have doc leaving feeder (x3 for CIS) */ + /* amount of data available from scanner is what to scan */ + status = sanei_genesys_read_valid_words (dev, &bytes_left); + + /* we add the number of lines needed to read the last part of the document in */ lines = (SANE_UNFIX (dev->model->y_offset) * dev->current_setup.yres) / MM_PER_INCH; DBG (DBG_io, "gl646_detect_document_end: adding %d line to flush\n", lines); - if (dev->model->is_cis == SANE_TRUE) - lines *= channels; - - /* number of bytes to read from scanner to get document out of it after - * end of document dectected by hardware sensor */ - bytes_to_flush = lines * dev->wpl; - - /* if we are already close to end of scan, flushing isn't needed */ - if (bytes_to_flush < dev->read_bytes_left) - { - /* bits per line */ - bpl = (dev->settings.pixels * channels * depth); - /* remaining lines to read by frontend for the current scan */ - flines = - ((dev->total_bytes_to_read - dev->total_bytes_read) * 8) / bpl; - if (flines > lines) - { - /* change the value controlling communication with the frontend : - * total bytes to read is current value plus the number of remaining lines - * multiplied by bytes per line */ - dev->total_bytes_to_read = - dev->total_bytes_read + (lines * bpl) / 8; - - /* then adjust the physical bytes to read */ - dev->read_bytes_left = bytes_to_flush; - } + bytes_left += lines * dev->wpl; + if (dev->current_setup.depth > 8) + { + bytes_left = 2 * bytes_left; + } + if (dev->current_setup.channels > 1) + { + bytes_left = 3 * bytes_left; + } + if (bytes_left < dev->read_bytes_left) + { + dev->total_bytes_to_read = dev->total_bytes_read + bytes_left; + dev->read_bytes_left = bytes_left; } + DBG (DBG_io, "gl646_detect_document_end: total_bytes_to_read=%lu\n", + (u_long) dev->total_bytes_to_read); + DBG (DBG_io, "gl646_detect_document_end: total_bytes_read =%lu\n", + (u_long) dev->total_bytes_read); + DBG (DBG_io, "gl646_detect_document_end: read_bytes_left =%lu\n", + (u_long) dev->read_bytes_left); } DBG (DBG_proc, "gl646_detect_document_end: end\n"); @@ -2839,12 +2575,15 @@ Genesys_Register_Set regs[11]; unsigned int used, vfinal, count; uint16_t slope_table[255]; - uint8_t val; + uint8_t gpio, state; DBG (DBG_proc, "gl646_eject_document: start\n"); + /* at the end there will be noe more document */ + dev->document = SANE_FALSE; + /* first check for document event */ - status = gl646_gpio_read (dev->dn, &val); + status = gl646_gpio_read (dev->dn, &gpio); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -2852,19 +2591,10 @@ sane_strstatus (status)); return status; } - DBG (DBG_info, "gl646_eject_document: GPIO=0x%02x\n", val); - - /* no need for eject if document left during regular scan */ - if (val != 0) - { - dev->document = SANE_FALSE; - DBG (DBG_info, "gl646_eject_document: no more document to eject\n"); - DBG (DBG_proc, "gl646_eject_document: end\n"); - return status; - } + DBG (DBG_info, "gl646_eject_document: GPIO=0x%02x\n", gpio); /* test status : paper event + HOMESNR -> no more doc ? */ - status = sanei_genesys_get_status (dev, &val); + status = sanei_genesys_get_status (dev, &state); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -2872,7 +2602,22 @@ sane_strstatus (status)); return status; } + DBG (DBG_info, "gl646_eject_document: state=0x%02x\n", state); + if (DBG_LEVEL > DBG_info) + { + print_status (state); + } + + /* HOMSNR=0 if no document inserted */ + if ((state & REG41_HOMESNR) != 0) + { + dev->document = SANE_FALSE; + DBG (DBG_info, "gl646_eject_document: no more document to eject\n"); + DBG (DBG_proc, "gl646_eject_document: end\n"); + return status; + } + /* there is a document inserted, eject it */ status = sanei_genesys_write_register (dev, 0x01, 0xb0); if (status != SANE_STATUS_GOOD) { @@ -2886,7 +2631,7 @@ do { usleep (200000UL); - status = sanei_genesys_get_status (dev, &val); + status = sanei_genesys_get_status (dev, &state); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -2895,15 +2640,15 @@ return status; } } - while (val & REG41_MOTMFLG); + while (state & REG41_MOTMFLG); /* set up to fast move before scan then move until document is detected */ regs[0].address = 0x01; regs[0].value = 0xb0; - /* AGOME, 2 slopes motor moving */ + /* AGOME, 2 slopes motor moving , eject 'backward' */ regs[1].address = 0x02; - regs[1].value = 0x5d; /* motor reverse */ + regs[1].value = 0x5d; /* motor feeding steps to 119880 */ regs[2].address = 0x3d; @@ -2974,8 +2719,8 @@ count = 0; do { - status = sanei_genesys_get_status (dev, &val); - print_status (val); + status = sanei_genesys_get_status (dev, &state); + print_status (state); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -2986,7 +2731,18 @@ usleep (200000UL); /* sleep 200 ms */ count++; } - while (((val & REG41_HOMESNR) == 0) && (count < 150)); + while (((state & REG41_HOMESNR) == 0) && (count < 150)); + + /* read GPIO on exit */ + status = gl646_gpio_read (dev->dn, &gpio); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_eject_document: failed to read paper sensor %s\n", + sane_strstatus (status)); + return status; + } + DBG (DBG_info, "gl646_eject_document: GPIO=0x%02x\n", gpio); DBG (DBG_proc, "gl646_eject_document: end\n"); return status; @@ -3044,21 +2800,42 @@ DBG (DBG_proc, "end_scan (check_stop = %d, eject = %d)\n", check_stop, eject); - /*status = sanei_genesys_get_status (dev, &val); - if (val & REG41_SCANFSH) - scanfsh = 1; - DBG (DBG_info, "end_scan: current status =0x%02x\n", val); - if (DBG_LEVEL > DBG_io) - { - print_status (val); - read_triple_reg (dev, REG_SCANCNT, &value); - } */ + /* we need to compute scanfsh before cancelling scan */ + if (dev->model->is_sheetfed == SANE_TRUE) + { + status = sanei_genesys_get_status (dev, &val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "end_scan: failed to read register: %s\n", + sane_strstatus (status)); + return status; + } + if (val & REG41_SCANFSH) + scanfsh = 1; + if (DBG_LEVEL > DBG_io2) + { + print_status (val); + } + } - /* for sheetfed scanners, we have to eject document and read - * left data in buffers */ - if (dev->model->is_sheetfed == SANE_TRUE && dev->document == SANE_TRUE) + /* ends scan */ + val = sanei_genesys_read_reg_from_set (reg, 0x01); + val &= ~REG01_SCAN; + sanei_genesys_set_reg_from_set (reg, 0x01, val); + status = sanei_genesys_write_register (dev, 0x01, val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "end_scan: failed to write register 01: %s\n", + sane_strstatus (status)); + return status; + } + + /* for sheetfed scanners, we may have to eject document */ + if (dev->model->is_sheetfed == SANE_TRUE) { - if (eject == SANE_TRUE) + if (eject == SANE_TRUE && dev->document == SANE_TRUE) { status = gl646_eject_document (dev); if (status != SANE_STATUS_GOOD) @@ -3067,22 +2844,37 @@ return status; } } + if (check_stop) + { + for (i = 0; i < 30; i++) /* do not wait longer than wait 3 seconds */ + { + status = sanei_genesys_get_status (dev, &val); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "end_scan: failed to read register: %s\n", + sane_strstatus (status)); + return status; + } + if (val & REG41_SCANFSH) + scanfsh = 1; + if (DBG_LEVEL > DBG_io2) + { + print_status (val); + } + + if (!(val & REG41_MOTMFLG) && (val & REG41_FEEDFSH) && scanfsh) + { + DBG (DBG_proc, "end_scan: scanfeed finished\n"); + break; /* leave for loop */ + } + + usleep (10000UL); /* sleep 100 ms */ + } + } } else /* flat bed scanners */ { - /* ends scan */ - val = sanei_genesys_read_reg_from_set (reg, 0x01); - val &= ~REG01_SCAN; - sanei_genesys_set_reg_from_set (reg, 0x01, val); - status = sanei_genesys_write_register (dev, 0x01, val); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, - "end_scan: failed to write register 01: %s\n", - sane_strstatus (status)); - return status; - } - if (check_stop) { for (i = 0; i < 300; i++) /* do not wait longer than wait 30 seconds */ @@ -3129,7 +2921,7 @@ gl646_end_scan (Genesys_Device * dev, Genesys_Register_Set * reg, SANE_Bool check_stop) { - return end_scan (dev, reg, check_stop, SANE_TRUE); + return end_scan (dev, reg, check_stop, SANE_FALSE); } /** @@ -3137,7 +2929,10 @@ * @param dev scanner's device * @param wait_until_home true if the function waits until head parked */ -static SANE_Status +#ifndef UNIT_TESTING +static +#endif + SANE_Status gl646_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home) { SANE_Status status; @@ -3215,8 +3010,9 @@ /* setup for a backward scan of 65535 steps, with no actual data reading */ settings.scan_method = SCAN_METHOD_FLATBED; settings.scan_mode = SCAN_MODE_COLOR; - settings.xres = 75; - settings.yres = 75; + settings.xres = + get_closest_resolution (dev->model->ccd_type, 75, SANE_FALSE); + settings.yres = settings.xres; settings.tl_x = 0; settings.tl_y = 0; settings.pixels = 600; @@ -3236,7 +3032,7 @@ gl646_set_triple_reg (dev->reg, REG_FEEDL, 65535); /* sets frontend */ - status = gl646_set_fe (dev, AFE_SET); + status = gl646_set_fe (dev, AFE_SET, settings.xres); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -3254,6 +3050,13 @@ "gl646_slow_back_home: failed to bulk write registers: %s\n", sane_strstatus (status)); + /* registers are restored to an iddl state, give up if no head to park */ + if (dev->model->is_sheetfed == SANE_TRUE) + { + DBG (DBG_proc, "gl646_slow_back_home: end \n"); + return SANE_STATUS_GOOD; + } + /* starts scan */ status = gl646_begin_scan (dev, dev->reg, SANE_TRUE); if (status != SANE_STATUS_GOOD) @@ -3338,7 +3141,8 @@ settings.exposure_time = 0; /* scan the desired area */ - status = simple_scan (dev, settings, SANE_TRUE, &data); + status = + simple_scan (dev, settings, SANE_TRUE, SANE_TRUE, SANE_FALSE, &data); /* process data if scan is OK */ if (status == SANE_STATUS_GOOD) @@ -3429,6 +3233,7 @@ Genesys_Settings settings; /* 1: no half_ccd, 2: use half number of pixels */ int half_ccd = 1; + int cksel = 1; DBG (DBG_proc, "gl646_init_register_for_shading: start\n"); @@ -3436,20 +3241,28 @@ if (dev->model->flags & GENESYS_FLAG_HALF_CCD_MODE) { /* walk the master mode list to find if half_ccd */ - if (is_half_ccd (dev->model->ccd_type, dev->settings.xres, SANE_TRUE) == SANE_TRUE) + if (is_half_ccd (dev->model->ccd_type, dev->settings.xres, SANE_TRUE) == + SANE_TRUE) { half_ccd = 2; } } - /* fill settings for scan */ - settings.scan_method = SCAN_METHOD_FLATBED; + /* fill settings for scan : always a color scan */ + settings.scan_method = dev->settings.scan_method; settings.scan_mode = dev->settings.scan_mode; + if (dev->model->is_cis == SANE_FALSE) + { + settings.scan_mode = SCAN_MODE_COLOR; + } settings.xres = dev->sensor.optical_res / half_ccd; - settings.yres = dev->sensor.optical_res / half_ccd; + cksel = get_cksel (dev->model->ccd_type, dev->settings.xres, SANE_TRUE); + settings.xres = settings.xres / cksel; + settings.yres = settings.xres; settings.tl_x = 0; settings.tl_y = 0; - settings.pixels = dev->sensor.sensor_pixels / half_ccd; + settings.pixels = + (dev->sensor.sensor_pixels * settings.xres) / dev->sensor.optical_res; settings.lines = dev->model->shading_lines * (3 - half_ccd); settings.depth = 16; settings.color_filter = dev->settings.color_filter; @@ -3468,6 +3281,10 @@ /* used when sending shading calibration data */ dev->calib_pixels = settings.pixels; dev->calib_channels = dev->current_setup.channels; + if (dev->model->is_cis == SANE_FALSE) + { + dev->calib_channels = 3; + } /* no shading */ dev->reg[reg_0x01].value &= ~REG01_DVDSET; @@ -3478,7 +3295,15 @@ /* TODO another flag to setup regs ? */ /* enforce needed LINCNT, getting rid of extra lines for color reordering */ - gl646_set_triple_reg (dev->reg, REG_LINCNT, dev->model->shading_lines); + if (dev->model->is_cis == SANE_FALSE) + { + gl646_set_triple_reg (dev->reg, REG_LINCNT, dev->model->shading_lines); + } + else + { + gl646_set_triple_reg (dev->reg, REG_LINCNT, + dev->model->shading_lines * 3); + } /* copy reg to calib_reg */ memcpy (dev->calib_reg, dev->reg, @@ -3507,7 +3332,8 @@ SANE_Status status; /* park head after calibration if needed */ - if (dev->scanhead_position_in_steps > 0) + if (dev->scanhead_position_in_steps > 0 + && dev->settings.scan_method == SCAN_METHOD_FLATBED) { status = gl646_slow_back_home (dev, SANE_TRUE); if (status != SANE_STATUS_GOOD) @@ -3517,6 +3343,7 @@ } dev->scanhead_position_in_steps = 0; } + return setup_for_scan (dev, dev->settings, SANE_FALSE, SANE_TRUE, SANE_TRUE); } @@ -3544,9 +3371,10 @@ DBG (DBG_proc, "setup_for_scan: start\n"); DBG (DBG_info, "setup_for_scan settings:\nResolution: %ux%uDPI\n" - "Lines : %u\nPixels : %u\nStartpos : %.3f/%.3f\nScan mode : %d\n\n", - settings.xres, settings.yres, settings.lines, - settings.pixels, settings.tl_x, settings.tl_y, settings.scan_mode); + "Lines : %u\nPixels : %u\nStartpos : %.3f/%.3f\nScan mode : %d\nScan method: %s\n\n", + settings.xres, settings.yres, settings.lines, settings.pixels, + settings.tl_x, settings.tl_y, settings.scan_mode, + settings.scan_method == SCAN_METHOD_FLATBED ? "flatbed" : "XPA"); if (settings.scan_mode == SCAN_MODE_COLOR) /* single pass color */ { @@ -3561,7 +3389,7 @@ /* compute distance to move */ move = 0; - /* XXX STEF XXX mD5345 -> optical_ydpi, other base_ydpi => half/full step ? */ + /* XXX STEF XXX MD5345 -> optical_ydpi, other base_ydpi => half/full step ? */ if (split == SANE_FALSE) { if (dev->model->is_sheetfed == SANE_FALSE) @@ -3602,9 +3430,18 @@ startx = dev->sensor.CCD_start_xoffset; else startx = dev->sensor.dummy_pixel; - startx += - ((SANE_UNFIX (dev->model->x_offset) * dev->sensor.optical_res) / - MM_PER_INCH); + if (settings.scan_method == SCAN_METHOD_FLATBED) + { + startx += + ((SANE_UNFIX (dev->model->x_offset) * dev->sensor.optical_res) / + MM_PER_INCH); + } + else + { + startx += + ((SANE_UNFIX (dev->model->x_offset_ta) * + dev->sensor.optical_res) / MM_PER_INCH); + } } else { @@ -3627,7 +3464,7 @@ } endx = startx + pixels; - /* XXX STEF XXX TODO check for pixel width overflow */ + /* TODO check for pixel width overflow */ /* set up correct values for scan (gamma and shading enabled) */ status = gl646_setup_registers (dev, @@ -3668,8 +3505,7 @@ dev->reg[reg_0x04].value |= 0x0c; break; default: - DBG (DBG_error, "setup_for_scan: invalid color filter\n"); - return SANE_STATUS_INVAL; + break; } } @@ -3805,15 +3641,191 @@ return SANE_STATUS_GOOD; } -/* this function does the led calibration. -*/ +/** @brief this function does the led calibration. + * this function does the led calibration by scanning one line of the calibration + * area below scanner's top on white strip. The scope of this function is + * currently limited to the XP200 + */ static SANE_Status gl646_led_calibration (Genesys_Device * dev) { - DBG (DBG_error, "Implementation for led calibration missing\n"); - if (dev || dev == NULL) - return SANE_STATUS_INVAL; - return SANE_STATUS_INVAL; + int total_size; + uint8_t *line; + unsigned int i, j; + SANE_Status status = SANE_STATUS_GOOD; + int val; + unsigned int channels; + int avg[3], avga, avge; + int turn; + char fn[20]; + uint16_t expr, expg, expb; + Genesys_Settings settings; + SANE_Int resolution; + + SANE_Bool acceptable = SANE_FALSE; + + DBG (DBG_proc, "gl646_led_calibration\n"); + if (!dev->model->is_cis) + { + DBG (DBG_proc, + "gl646_led_calibration: not a cis scanner, nothing to do...\n"); + return SANE_STATUS_GOOD; + } + + /* get led calibration resolution */ + if (dev->settings.scan_mode == SCAN_MODE_COLOR) + { + resolution = + get_closest_resolution (dev->model->ccd_type, dev->sensor.optical_res, + SANE_TRUE); + settings.scan_mode = SCAN_MODE_COLOR; + channels = 3; + } + else + { + resolution = + get_closest_resolution (dev->model->ccd_type, dev->sensor.optical_res, + SANE_FALSE); + settings.scan_mode = SCAN_MODE_GRAY; + channels = 1; + } + + /* offset calibration is always done in color mode */ + settings.scan_method = SCAN_METHOD_FLATBED; + settings.xres = resolution; + settings.yres = resolution; + settings.tl_x = 0; + settings.tl_y = 0; + settings.pixels = + (dev->sensor.sensor_pixels * resolution) / dev->sensor.optical_res; + settings.lines = 1; + settings.depth = 16; + settings.color_filter = 0; + + settings.disable_interpolation = 0; + settings.threshold = 0; + settings.exposure_time = 0; + + /* colors * bytes_per_color * scan lines */ + total_size = settings.pixels * channels * 2 * 1; + + line = malloc (total_size); + if (!line) + { + DBG (DBG_error, "gl646_led_calibration: Failed to allocate %d bytes\n", + total_size); + return SANE_STATUS_NO_MEM; + } + +/* + we try to get equal bright leds here: + + loop: + average per color + adjust exposure times + + Sensor_Master uint8_t regs_0x10_0x15[6]; + */ + + expr = (dev->sensor.regs_0x10_0x1d[0] << 8) | dev->sensor.regs_0x10_0x1d[1]; + expg = (dev->sensor.regs_0x10_0x1d[2] << 8) | dev->sensor.regs_0x10_0x1d[3]; + expb = (dev->sensor.regs_0x10_0x1d[4] << 8) | dev->sensor.regs_0x10_0x1d[5]; + + turn = 0; + + do + { + + dev->sensor.regs_0x10_0x1d[0] = (expr >> 8) & 0xff; + dev->sensor.regs_0x10_0x1d[1] = expr & 0xff; + dev->sensor.regs_0x10_0x1d[2] = (expg >> 8) & 0xff; + dev->sensor.regs_0x10_0x1d[3] = expg & 0xff; + dev->sensor.regs_0x10_0x1d[4] = (expb >> 8) & 0xff; + dev->sensor.regs_0x10_0x1d[5] = expb & 0xff; + + DBG (DBG_info, "gl646_led_calibration: starting first line reading\n"); + + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, &line); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_led_calibration: Failed to setup scan: %s\n", + sane_strstatus (status)); + return status; + } + + if (DBG_LEVEL >= DBG_data) + { + snprintf (fn, 20, "led_%02d.pnm", turn); + sanei_genesys_write_pnm_file (fn, + line, + 16, channels, settings.pixels, 1); + } + + acceptable = SANE_TRUE; + + for (j = 0; j < channels; j++) + { + avg[j] = 0; + for (i = 0; i < settings.pixels; i++) + { + if (dev->model->is_cis) + val = + line[i * 2 + j * 2 * settings.pixels + 1] * 256 + + line[i * 2 + j * 2 * settings.pixels]; + else + val = + line[i * 2 * channels + 2 * j + 1] * 256 + + line[i * 2 * channels + 2 * j]; + avg[j] += val; + } + + avg[j] /= settings.pixels; + } + + DBG (DBG_info, "gl646_led_calibration: average: " + "%d,%d,%d\n", avg[0], avg[1], avg[2]); + + acceptable = SANE_TRUE; + + if (!acceptable) + { + avga = (avg[0] + avg[1] + avg[2]) / 3; + expr = (expr * avga) / avg[0]; + expg = (expg * avga) / avg[1]; + expb = (expb * avga) / avg[2]; + + /* keep exposure time in a working window */ + avge = (expr + expg + expb) / 3; + if (avge > 0x2000) + { + expr = (expr * 0x2000) / avge; + expg = (expg * 0x2000) / avge; + expb = (expb * 0x2000) / avge; + } + if (avge < 0x400) + { + expr = (expr * 0x400) / avge; + expg = (expg * 0x400) / avge; + expb = (expb * 0x400) / avge; + } + } + + turn++; + + } + while (!acceptable && turn < 100); + + DBG (DBG_info, + "gl646_led_calibration: acceptable exposure: 0x%04x,0x%04x,0x%04x\n", + expr, expg, expb); + + /* cleanup before return */ + free (line); + + DBG (DBG_proc, "gl646_led_calibration: completed\n"); + return status; } /** @@ -3853,12 +3865,117 @@ return average; } + +/** @brief calibration for AD frontend devices + * we do simple scan until all black_pixels are higher than 0, + * raising offset at each turn. + */ +static SANE_Status +ad_fe_offset_calibration (Genesys_Device * dev) +{ + SANE_Status status = SANE_STATUS_GOOD; + uint8_t *line; + unsigned int channels; + char title[32]; + int pass = 0; + SANE_Int resolution; + Genesys_Settings settings; + unsigned int x, y, adr, min; + unsigned int bottom, black_pixels; + + DBG (DBG_proc, "ad_fe_offset_calibration: start\n"); + resolution = + get_closest_resolution (dev->model->ccd_type, dev->sensor.optical_res, + SANE_TRUE); + channels = 3; + black_pixels = + (dev->sensor.black_pixels * resolution) / dev->sensor.optical_res; + DBG (DBG_io2, "ad_fe_offset_calibration: black_pixels=%d\n", black_pixels); + + settings.scan_method = SCAN_METHOD_FLATBED; + settings.scan_mode = SCAN_MODE_COLOR; + settings.xres = resolution; + settings.yres = resolution; + settings.tl_x = 0; + settings.tl_y = 0; + settings.pixels = + (dev->sensor.sensor_pixels * resolution) / dev->sensor.optical_res; + settings.lines = CALIBRATION_LINES; + settings.depth = 8; + settings.color_filter = 0; + + settings.disable_interpolation = 0; + settings.threshold = 0; + settings.exposure_time = 0; + + /* scan first line of data with no gain */ + dev->frontend.gain[0] = 0; + dev->frontend.gain[1] = 0; + dev->frontend.gain[2] = 0; + + /* scan with no move */ + bottom = 1; + do + { + pass++; + dev->frontend.offset[0] = bottom; + dev->frontend.offset[1] = bottom; + dev->frontend.offset[2] = bottom; + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, &line); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "ad_fe_offset_calibration: failed to scan first line\n"); + return status; + } + if (DBG_LEVEL >= DBG_data) + { + sprintf (title, "offset%03d.pnm", bottom); + sanei_genesys_write_pnm_file (title, line, 8, channels, + settings.pixels, settings.lines); + } + + min = 0; + for (y = 0; y < settings.lines; y++) + { + for (x = 0; x < black_pixels; x++) + { + adr = (x + y * settings.pixels) * channels; + if (line[adr] > min) + min = line[adr]; + if (line[adr + 1] > min) + min = line[adr + 1]; + if (line[adr + 2] > min) + min = line[adr + 2]; + } + } + + free (line); + DBG (DBG_io2, "ad_fe_offset_calibration: pass=%d, min=%d\n", pass, min); + bottom++; + } + while (pass < 128 && min == 0); + if (pass == 128) + { + DBG (DBG_error, + "ad_fe_offset_calibration: failed to find correct offset\n"); + return SANE_STATUS_INVAL; + } + + DBG (DBG_info, "ad_fe_offset_calibration: offset=(%d,%d,%d)\n", + dev->frontend.offset[0], dev->frontend.offset[1], + dev->frontend.offset[2]); + DBG (DBG_proc, "ad_fe_offset_calibration: end\n"); + return status; +} + #define DARK_TARGET 8 /** * This function does the offset calibration by scanning one line of the calibration * area below scanner's top. There is a black margin and the remaining is white. * genesys_search_start() must have been called so that the offsets and margins - * are allready known. + * are already known. * @param dev scanner's device * @return SANE_STATUS_GOOD if success, else error code is failure */ @@ -3875,6 +3992,12 @@ int topavg, bottomavg; int top, bottom, black_pixels; + /* Analog Device fronted have a different calibration */ + if (dev->model->dac_type == DAC_AD_XP200) + { + return ad_fe_offset_calibration (dev); + } + DBG (DBG_proc, "gl646_offset_calibration: start\n"); /* setup for a RGB scan, one full sensor's width line */ @@ -3894,6 +4017,7 @@ channels = 3; black_pixels = (dev->sensor.black_pixels * resolution) / dev->sensor.optical_res; + DBG (DBG_io2, "gl646_offset_calibration: black_pixels=%d\n", black_pixels); settings.scan_method = SCAN_METHOD_FLATBED; settings.scan_mode = SCAN_MODE_COLOR; @@ -3918,14 +4042,13 @@ dev->frontend.gain[2] = 0; /* scan with no move */ - if (dev->model->ccd_type == CIS_XP200) - bottom = 4; - else - bottom = 90; + bottom = 90; dev->frontend.offset[0] = bottom; dev->frontend.offset[1] = bottom; dev->frontend.offset[2] = bottom; - status = simple_scan (dev, settings, SANE_FALSE, &first_line); + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, + &first_line); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -3942,16 +4065,16 @@ dark_average (first_line, settings.pixels, settings.lines, channels, black_pixels); free (first_line); + DBG (DBG_io2, "gl646_offset_calibration: bottom avg=%d\n", bottomavg); /* now top value */ - if (dev->model->ccd_type == CIS_XP200) - top = 0x80; - else - top = 231; + top = 231; dev->frontend.offset[0] = top; dev->frontend.offset[1] = top; dev->frontend.offset[2] = top; - status = simple_scan (dev, settings, SANE_FALSE, &second_line); + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, + &second_line); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -3969,6 +4092,7 @@ dark_average (second_line, settings.pixels, settings.lines, channels, black_pixels); free (second_line); + DBG (DBG_io2, "gl646_offset_calibration: top avg=%d\n", topavg); /* loop until acceptable level */ while ((pass < 32) && (top - bottom > 1)) @@ -3981,7 +4105,9 @@ dev->frontend.offset[2] = (top + bottom) / 2; /* scan with no move */ - status = simple_scan (dev, settings, SANE_FALSE, &second_line); + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, + &second_line); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -4019,7 +4145,9 @@ /* in case of debug do a final scan to get result */ if (DBG_LEVEL >= DBG_data) { - status = simple_scan (dev, settings, SANE_FALSE, &second_line); + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, + &second_line); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -4039,9 +4167,111 @@ return status; } +/** @brief gain calibration for Analog Device frontends + * Alternative coarse gain calibration + */ +static SANE_Status +ad_fe_coarse_gain_calibration (Genesys_Device * dev, int dpi) +{ + uint8_t *line; + unsigned int i, channels, val; + unsigned int size, count, resolution, pass; + SANE_Status status = SANE_STATUS_GOOD; + float average; + Genesys_Settings settings; + char title[32]; + + DBG (DBG_proc, "ad_fe_coarse_gain_calibration: start\n"); + + /* setup for a RGB scan, one full sensor's width line */ + /* resolution is the one from the final scan */ + resolution = get_closest_resolution (dev->model->ccd_type, dpi, SANE_TRUE); + channels = 3; + settings.scan_mode = SCAN_MODE_COLOR; + + settings.scan_method = SCAN_METHOD_FLATBED; + settings.xres = resolution; + settings.yres = resolution; + settings.tl_x = 0; + settings.tl_y = 0; + settings.pixels = + (dev->sensor.sensor_pixels * resolution) / dev->sensor.optical_res; + settings.lines = CALIBRATION_LINES; + settings.depth = 8; + settings.color_filter = 0; + + settings.disable_interpolation = 0; + settings.threshold = 0; + settings.exposure_time = 0; + + size = channels * settings.pixels * settings.lines; + + /* start gain value */ + dev->frontend.gain[0] = 1; + dev->frontend.gain[1] = 1; + dev->frontend.gain[2] = 1; + + average = 0; + pass = 0; + + /* loop until each channel raises to acceptable level */ + while ((average < dev->sensor.gain_white_ref) && (pass < 30)) + { + /* scan with no move */ + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, &line); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "ad_fe_coarse_gain_calibration: failed to scan first line\n"); + return status; + } + + /* log scanning data */ + if (DBG_LEVEL >= DBG_data) + { + sprintf (title, "alternative_coarse%02d.pnm", pass); + sanei_genesys_write_pnm_file (title, line, 8, + channels, settings.pixels, + settings.lines); + } + pass++; + + /* computes white average */ + average = 0; + count = 0; + for (i = 0; i < size; i++) + { + val = line[i]; + average += val; + count++; + } + average = average / count; + + /* adjusts gain for the channel */ + if (average < dev->sensor.gain_white_ref) + dev->frontend.gain[0]++; + dev->frontend.gain[1] = dev->frontend.gain[0]; + dev->frontend.gain[2] = dev->frontend.gain[0]; + + DBG (DBG_proc, + "ad_fe_coarse_gain_calibration: average = %.2f, gain = %d\n", + average, dev->frontend.gain[0]); + free (line); + } + + DBG (DBG_info, "ad_fe_coarse_gain_calibration: gains=(%d,%d,%d)\n", + dev->frontend.gain[0], dev->frontend.gain[1], dev->frontend.gain[2]); + DBG (DBG_proc, "ad_fe_coarse_gain_calibration: end\n"); + return status; +} + /** * Alternative coarse gain calibration - * this on uses the settings from offset_calibration. + * this on uses the settings from offset_calibration. First scan moves so + * we can go to calibration area for XPA. + * @param dev device for scan + * @param dpi resolutnio to calibrate at */ static SANE_Status gl646_coarse_gain_calibration (Genesys_Device * dev, int dpi) @@ -4054,6 +4284,10 @@ Genesys_Settings settings; char title[32]; + if (dev->model->ccd_type == CIS_XP200) + { + return ad_fe_coarse_gain_calibration (dev, dev->sensor.optical_res); + } DBG (DBG_proc, "gl646_coarse_gain_calibration: start\n"); /* setup for a RGB scan, one full sensor's width line */ @@ -4070,17 +4304,27 @@ else { resolution = - get_closest_resolution (dev->model->ccd_type, dpi, SANE_TRUE); + get_closest_resolution (dev->model->ccd_type, dev->settings.xres, + SANE_TRUE); } - settings.scan_method = SCAN_METHOD_FLATBED; + settings.scan_method = dev->settings.scan_method; settings.scan_mode = SCAN_MODE_COLOR; settings.xres = resolution; settings.yres = resolution; - settings.tl_x = 0; settings.tl_y = 0; - settings.pixels = - (dev->sensor.sensor_pixels * resolution) / dev->sensor.optical_res; + if (settings.scan_method == SCAN_METHOD_FLATBED) + { + settings.tl_x = 0; + settings.pixels = + (dev->sensor.sensor_pixels * resolution) / dev->sensor.optical_res; + } + else + { + settings.tl_x = SANE_UNFIX (dev->model->x_offset_ta); + settings.pixels = + (SANE_UNFIX (dev->model->x_size_ta) * resolution) / MM_PER_INCH; + } settings.lines = CALIBRATION_LINES; settings.depth = 8; settings.color_filter = 0; @@ -4119,7 +4363,8 @@ || (average[2] < dev->sensor.gain_white_ref)) && (pass < 30)) { /* scan with no move */ - status = simple_scan (dev, settings, SANE_FALSE, &line); + status = + simple_scan (dev, settings, SANE_FALSE, SANE_TRUE, SANE_FALSE, &line); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, @@ -4130,7 +4375,7 @@ /* log scanning data */ if (DBG_LEVEL >= DBG_data) { - sprintf (title, "alternative_coarse%02d.pnm", pass); + sprintf (title, "coarse_gain%02d.pnm", pass); sanei_genesys_write_pnm_file (title, line, 8, channels, settings.pixels, settings.lines); @@ -4214,6 +4459,8 @@ DBG (DBG_proc, "gl646_init_regs_for_warmup: start\n"); + sanei_genesys_init_fe (dev); + resolution = get_closest_resolution (dev->model->ccd_type, 300, SANE_FALSE); /* set up for a half width 2 lines color scan without moving */ @@ -4246,8 +4493,10 @@ /* we are not going to move, so clear these bits */ dev->reg[reg_0x02].value &= ~(REG02_FASTFED | REG02_AGOHOME); - /* don't enable gamma correction for this scan */ - dev->reg[reg_0x05].value &= ~REG05_GMMENB; + /* don't enable any correction for this scan */ + dev->reg[reg_0x01].value &= ~REG01_DVDSET; + /* XXX STEF XXX + dev->reg[reg_0x05].value &= ~REG05_GMMENB; */ /* turn off motor during this scan */ gl646_set_motor_power (local_reg, SANE_FALSE); @@ -4258,7 +4507,7 @@ *total_size = lines * settings.pixels; /* now registers are ok, write them to scanner */ - RIE (gl646_set_fe (dev, AFE_SET)); + RIE (gl646_set_fe (dev, AFE_SET, settings.xres)); RIE (gl646_bulk_write_register (dev, local_reg, GENESYS_GL646_MAX_REGS)); DBG (DBG_proc, "gl646_init_regs_for_warmup: end\n"); @@ -4282,8 +4531,9 @@ settings.scan_method = SCAN_METHOD_FLATBED; settings.scan_mode = SCAN_MODE_COLOR; - settings.xres = 75; - settings.yres = 75; + settings.xres = + get_closest_resolution (dev->model->ccd_type, 75, SANE_FALSE); + settings.yres = settings.xres; settings.tl_x = 0; settings.tl_y = 5; settings.pixels = 600; @@ -4480,7 +4730,7 @@ RIE (gl646_bulk_write_register (dev, dev->reg, GENESYS_GL646_MAX_REGS)); /* Test ASIC and RAM */ - if (!dev->model->flags & GENESYS_FLAG_LAZY_INIT) + if (!(dev->model->flags & GENESYS_FLAG_LAZY_INIT)) { RIE (gl646_asic_test (dev)); } @@ -4500,7 +4750,7 @@ } /* end if cold */ /* Set analog frontend */ - RIE (gl646_set_fe (dev, AFE_INIT)); + RIE (gl646_set_fe (dev, AFE_INIT, 0)); /* GPO enabling for XP200 */ if (dev->model->ccd_type == CIS_XP200) @@ -4528,57 +4778,74 @@ /* clear GPIO enable */ status = gl646_gpio_output_enable (dev->dn, val); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, "gl646_init: GPO disable failed ... %s\n", - sane_strstatus (status)); - } - sanei_genesys_write_register (dev, 0x66, 0x10); - sanei_genesys_write_register (dev, 0x66, 0x00); - sanei_genesys_write_register (dev, 0x66, 0x10); - } - - /* MD6471/G2410 and XP200 read/write data from an undocumented memory area which - * is after the second slope table */ - switch (dev->sensor.optical_res) - { - case 600: - addr = 0x08200; - break; - case 1200: - addr = 0x10200; - break; - case 2400: - addr = 0x1fa00; - break; - } - status = sanei_genesys_set_buffer_address (dev, addr); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_error, "gl646_init: failed to set up control address\n"); - return SANE_STATUS_INVAL; + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_init: GPO disable failed ... %s\n", + sane_strstatus (status)); + } + sanei_genesys_write_register (dev, 0x66, 0x10); + sanei_genesys_write_register (dev, 0x66, 0x00); + sanei_genesys_write_register (dev, 0x66, 0x10); } - sanei_usb_set_timeout (2 * 1000); - len = 6; - status = gl646_bulk_read_data (dev, 0x45, dev->control, len); - /* for some reason, read fails here for MD6471, HP2300 and XP200 - * one time out of 2 scanimage launches - */ - if (status != SANE_STATUS_GOOD) + + /* MD6471/G2410 and XP200 read/write data from an undocumented memory area which + * is after the second slope table */ + if (dev->model->gpo_type != GPO_HP3670 + && dev->model->gpo_type != GPO_HP2400) { - DBG (DBG_warn, "gl646_init: failed to read control\n"); + switch (dev->sensor.optical_res) + { + case 600: + addr = 0x08200; + break; + case 1200: + addr = 0x10200; + break; + case 2400: + addr = 0x1fa00; + break; + } + status = sanei_genesys_set_buffer_address (dev, addr); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_init: failed to set up control address\n"); + return SANE_STATUS_INVAL; + } + sanei_usb_set_timeout (2 * 1000); + len = 6; status = gl646_bulk_read_data (dev, 0x45, dev->control, len); + /* for some reason, read fails here for MD6471, HP2300 and XP200 + * one time out of 2 scanimage launches + */ + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_warn, "gl646_init: failed to read control\n"); + status = gl646_bulk_read_data (dev, 0x45, dev->control, len); + } + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_warn, "gl646_init: failed to read control\n"); + return SANE_STATUS_INVAL; + } + else + { + DBG (DBG_info, + "gl646_init: control read=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", + dev->control[0], dev->control[1], dev->control[2], + dev->control[3], dev->control[4], dev->control[5]); + } + sanei_usb_set_timeout (30 * 1000); } - if (status != SANE_STATUS_GOOD) + else + /* HP2400 and HP3670 case */ { - DBG (DBG_warn, "gl646_init: failed to read control\n"); - return SANE_STATUS_INVAL; + dev->control[0] = 0x00; + dev->control[1] = 0x00; + dev->control[2] = 0x01; + dev->control[3] = 0x00; + dev->control[4] = 0x00; + dev->control[5] = 0x00; } - DBG (DBG_info, - "gl646_init: control read=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", - dev->control[0], dev->control[1], dev->control[2], - dev->control[3], dev->control[4], dev->control[5]); - sanei_usb_set_timeout (30 * 1000); /* ensure head is correctly parked, and check lock */ if (dev->model->is_sheetfed == SANE_FALSE) @@ -4619,6 +4886,26 @@ return SANE_STATUS_GOOD; } +#ifndef UNIT_TESTING +static +#endif +gl646_move_to_ta (Genesys_Device * dev) +{ + SANE_Status status = SANE_STATUS_GOOD; + + DBG (DBG_proc, "gl646_move_to_ta: starting\n"); + if (simple_move (dev, SANE_UNFIX (dev->model->y_offset_calib_ta)) != + SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl646_move_to_ta: failed to move to calibration area\n"); + return status; + } + DBG (DBG_proc, "gl646_move_to_ta: end\n"); + + return status; +} + /** * Does a simple scan: ie no line reordering and avanced data buffering and @@ -4627,19 +4914,43 @@ * @param dev device of the scanner * @param settings parameters of the scan * @param move SANE_TRUE if moving during scan + * @param move SANE_TRUE if moving forward during scan * @param data pointer for the data */ -static SANE_Status +#ifndef UNIT_TESTING +static +#endif + SANE_Status simple_scan (Genesys_Device * dev, Genesys_Settings settings, SANE_Bool move, - unsigned char **data) + SANE_Bool forward, SANE_Bool shading, unsigned char **data) { - SANE_Status status; + SANE_Status status = SANE_STATUS_INVAL; unsigned int size, lines, x, y, bpp; - SANE_Bool empty; + SANE_Bool empty, split; unsigned char *buffer; + int count; + uint8_t val; DBG (DBG_proc, "simple_scan: starting\n"); - status = setup_for_scan (dev, settings, SANE_TRUE, SANE_FALSE, SANE_FALSE); + DBG (DBG_io, "simple_scan: move=%d, forward=%d, shading=%d\n", move, + forward, shading); + + /* round up to multiple of 3 in case of CIS scanner */ + if (dev->model->is_cis == SANE_TRUE) + { + settings.lines = ((settings.lines + 2) / 3) * 3; + } + + /* setup for move then scan */ + if (move == SANE_TRUE && settings.tl_y > 0) + { + split = SANE_FALSE; + } + else + { + split = SANE_TRUE; + } + status = setup_for_scan (dev, settings, split, SANE_FALSE, SANE_FALSE); if (status != SANE_STATUS_GOOD) { DBG (DBG_error, "simple_scan: setup_for_scan failed (%s)\n", @@ -4662,7 +4973,7 @@ else bpp = 1; size *= bpp; - if (dev->settings.scan_mode == SCAN_MODE_COLOR) /* single pass color */ + if (settings.scan_mode == SCAN_MODE_COLOR) /* single pass color */ size *= 3; *data = malloc (size); if (!*data) @@ -4671,9 +4982,14 @@ "simple_scan: failed to allocate %d bytes of memory\n", size); return SANE_STATUS_NO_MEM; } + DBG (DBG_io, "simple_scan: allocated %d bytes of memory for %d lines\n", + size, lines); + + /* put back real line number in settings */ + settings.lines = lines; /* initialize frontend */ - status = gl646_set_fe (dev, AFE_SET); + status = gl646_set_fe (dev, AFE_SET, settings.xres); if (status != SANE_STATUS_GOOD) { free (*data); @@ -4685,6 +5001,10 @@ /* no shading correction and not watch dog for simple scan */ dev->reg[reg_0x01].value &= ~(REG01_DVDSET | REG01_DOGENB); + if (shading == SANE_TRUE) + { + dev->reg[reg_0x01].value |= REG01_DVDSET; + } /* one table movement for simple scan */ dev->reg[reg_0x02].value &= ~REG02_FASTFED; @@ -4697,6 +5017,20 @@ /* no automatic go home if no movement */ dev->reg[reg_0x02].value &= ~REG02_AGOHOME; } + if (forward == SANE_FALSE) + { + dev->reg[reg_0x02].value |= REG02_MTRREV; + } + else + { + dev->reg[reg_0x02].value &= ~REG02_MTRREV; + } + + /* no automatic go home when using XPA */ + if (settings.scan_method == SCAN_METHOD_TRANSPARENCY) + { + dev->reg[reg_0x02].value &= ~REG02_AGOHOME; + } /* write scan registers */ status = gl646_bulk_write_register (dev, dev->reg, @@ -4721,11 +5055,25 @@ } /* wait for buffers to be filled */ + count = 0; do { + usleep (10000UL); + RIE (sanei_genesys_get_status (dev, &val)); + if (DBG_LEVEL > DBG_info) + { + print_status (val); + } RIE (sanei_genesys_test_buffer_empty (dev, &empty)); + count++; + } + while (empty && count < 1000); + if (count == 1000) + { + free (*data); + DBG (DBG_error, "simple_scan: failed toread data\n"); + return SANE_STATUS_IO_ERROR; } - while (empty); /* now we're on target, we can read data */ status = sanei_genesys_read_data_from_scanner (dev, *data, size); @@ -4742,51 +5090,61 @@ && settings.scan_mode == SCAN_MODE_COLOR) { /* alloc one line sized working buffer */ - size = size / settings.lines; - buffer = (unsigned char *) malloc (size); + buffer = (unsigned char *) malloc (settings.pixels * 3 * bpp); if (buffer == NULL) { DBG (DBG_error, - "simple_scan: failed to allocate %d bytes of memory\n", size); + "simple_scan: failed to allocate %d bytes of memory\n", + settings.pixels * 3); return SANE_STATUS_NO_MEM; } /* reorder one line of data and put it back to buffer */ if (bpp == 1) { - for (y = 0; y < settings.lines; y++) + for (y = 0; y < lines; y++) { /* reorder line */ for (x = 0; x < settings.pixels; x++) { - buffer[x * 3] = (*data)[y * size + x]; - buffer[x * 3 + 1] = (*data)[y * size + settings.pixels + x]; + buffer[x * 3] = (*data)[y * settings.pixels * 3 + x]; + buffer[x * 3 + 1] = + (*data)[y * settings.pixels * 3 + settings.pixels + x]; buffer[x * 3 + 2] = - (*data)[y * size + 2 * settings.pixels + x]; + (*data)[y * settings.pixels * 3 + 2 * settings.pixels + + x]; } /* copy line back */ - memcpy ((*data) + size * y, buffer, size); + memcpy ((*data) + settings.pixels * 3 * y, buffer, + settings.pixels * 3); } } else { - for (y = 0; y < settings.lines; y++) + for (y = 0; y < lines; y++) { /* reorder line */ for (x = 0; x < settings.pixels; x++) { - buffer[x * 6] = (*data)[y * size + x]; - buffer[x * 6 + 1] = (*data)[y * size + x + 1]; - buffer[x * 6 + 2] = (*data)[y * size + settings.pixels + x]; + buffer[x * 6] = (*data)[y * settings.pixels * 6 + x * 2]; + buffer[x * 6 + 1] = + (*data)[y * settings.pixels * 6 + x * 2 + 1]; + buffer[x * 6 + 2] = + (*data)[y * settings.pixels * 6 + 2 * settings.pixels + + x * 2]; buffer[x * 6 + 3] = - (*data)[y * size + settings.pixels + x + 1]; + (*data)[y * settings.pixels * 6 + 2 * settings.pixels + + x * 2 + 1]; buffer[x * 6 + 4] = - (*data)[y * size + 2 * settings.pixels + x]; + (*data)[y * settings.pixels * 6 + 4 * settings.pixels + + x * 2]; buffer[x * 6 + 5] = - (*data)[y * size + 2 * settings.pixels + x + 1]; + (*data)[y * settings.pixels * 6 + 4 * settings.pixels + + x * 2 + 1]; } /* copy line back */ - memcpy ((*data) + size * y, buffer, size); + memcpy ((*data) + settings.pixels * 6 * y, buffer, + settings.pixels * 6); } } free (buffer); @@ -4807,6 +5165,55 @@ } /** + * Does a simple move of the given distance by doing a scan at lowest resolution + * shading correction. Memory for data is allocated in this function + * and must be freed by caller. + * @param dev device of the scanner + * @param distance distance to move in MM + */ +#ifndef UNIT_TESTING +static +#endif + SANE_Status +simple_move (Genesys_Device * dev, SANE_Int distance) +{ + SANE_Status status = SANE_STATUS_INVAL; + unsigned char *data = NULL; + Genesys_Settings settings; + + DBG (DBG_proc, "simple_move: %d mm\n", distance); + + /* TODO give a no AGOHOME flag */ + settings.scan_method = SCAN_METHOD_TRANSPARENCY; + settings.scan_mode = SCAN_MODE_COLOR; + settings.xres = get_lowest_resolution (dev->model->ccd_type, SANE_TRUE); + settings.yres = settings.xres; + settings.tl_y = 0; + settings.tl_x = 0; + settings.pixels = + (dev->sensor.sensor_pixels * settings.xres) / dev->sensor.optical_res; + settings.lines = (distance * settings.xres) / MM_PER_INCH; + settings.depth = 8; + settings.color_filter = 0; + + settings.disable_interpolation = 0; + settings.threshold = 0; + settings.exposure_time = 0; + + status = + simple_scan (dev, settings, SANE_TRUE, SANE_TRUE, SANE_FALSE, &data); + free (data); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "simple_move: simple_scan failed\n"); + return status; + } + + DBG (DBG_proc, "simple_move: end.\n"); + return status; +} + +/** * update the status of the required sensor in the scanner session * the last_val fileds are used to make events 'sticky' */ @@ -4817,7 +5224,7 @@ uint8_t value; SANE_Status status; - /* do what is needed to get a new set of events, but try to not lose + /* do what is needed to get a new set of events, but try to not loose any of them. */ status = gl646_gpio_read (dev->dn, &value); @@ -4845,6 +5252,10 @@ case GPO_HP2300: session->val[OPT_SCAN_SW].b = (value == 0x6c); break; + case GPO_HP3670: + case GPO_HP2400: + session->val[OPT_SCAN_SW].b = ((value & 0x20) == 0); + break; default: return SANE_STATUS_UNSUPPORTED; } @@ -4859,6 +5270,10 @@ case GPO_5345: session->val[OPT_EMAIL_SW].b = (value == 0x12); break; + case GPO_HP3670: + case GPO_HP2400: + session->val[OPT_EMAIL_SW].b = ((value & 0x08) == 0); + break; default: return SANE_STATUS_UNSUPPORTED; } @@ -4876,6 +5291,10 @@ case GPO_HP2300: session->val[OPT_COPY_SW].b = (value == 0x5c); break; + case GPO_HP3670: + case GPO_HP2400: + session->val[OPT_COPY_SW].b = ((value & 0x10) == 0); + break; default: return SANE_STATUS_UNSUPPORTED; } @@ -4924,6 +5343,29 @@ } } + /* XPA detection */ + if (dev->model->flags & GENESYS_FLAG_XPA) + { + switch (dev->model->gpo_type) + { + case GPO_HP3670: + case GPO_HP2400: + /* test if XPA is plugged-in */ + if ((value & 0x40) == 0) + { + DBG (DBG_io, "gl646_update_hardware_sensors: enabling XPA\n"); + session->opt[OPT_SOURCE].cap &= ~SANE_CAP_INACTIVE; + } + else + { + DBG (DBG_io, "gl646_update_hardware_sensors: disabling XPA\n"); + session->opt[OPT_SOURCE].cap |= SANE_CAP_INACTIVE; + } + break; + default: + return SANE_STATUS_UNSUPPORTED; + } + } return status; } @@ -4968,8 +5410,9 @@ control[2] = dev->control[4]; control[3] = dev->control[5]; break; - case MOTOR_5345: case MOTOR_HP3670: + case MOTOR_HP2400: + case MOTOR_5345: default: control[0] = dev->control[2]; control[1] = dev->control[3]; @@ -5009,6 +5452,11 @@ Genesys_Calibration_Cache * cache, int for_overwrite) { +#ifdef HAVE_SYS_TIME_H + struct timeval time; +#endif + int compatible = 1; + DBG (DBG_proc, "gl646_is_compatible_calibration: start (for_overwrite=%d)\n", for_overwrite); @@ -5028,22 +5476,230 @@ dev->current_setup.channels = 1; } dev->current_setup.xres = dev->settings.xres; + dev->current_setup.scan_method = dev->settings.scan_method; + + DBG (DBG_io, + "gl646_is_compatible_calibration: requested=(%d,%f), tested=(%d,%f)\n", + dev->current_setup.channels, dev->current_setup.xres, + cache->used_setup.channels, cache->used_setup.xres); /* a calibration cache is compatible if color mode and x dpi match the user - * requested scan */ - if ((dev->current_setup.channels != cache->used_setup.channels) - || (dev->current_setup.xres != cache->used_setup.xres)) + * requested scan. In the case of CIS scanners, dpi isn't a criteria */ + if (dev->model->is_cis == SANE_FALSE) + { + compatible = + ((dev->current_setup.channels == cache->used_setup.channels) + && (((int) dev->current_setup.xres) == + ((int) cache->used_setup.xres))); + } + else + { + compatible = + (dev->current_setup.channels == cache->used_setup.channels); + } + if (dev->current_setup.scan_method != cache->used_setup.scan_method) + { + DBG (DBG_io, + "gl646_is_compatible_calibration: current method=%d, used=%d\n", + dev->current_setup.scan_method, cache->used_setup.scan_method); + compatible = 0; + } + if (!compatible) { DBG (DBG_proc, "gl646_is_compatible_calibration: completed, non compatible cache\n"); return SANE_STATUS_UNSUPPORTED; } + /* a cache entry expires after 30 minutes for non CIS scanners */ +#ifdef HAVE_SYS_TIME_H + gettimeofday (&time, NULL); + if ((time.tv_sec - cache->last_calibration > 30 * 60) + && (dev->model->is_cis == SANE_FALSE) + && (dev->settings.scan_method == SCAN_METHOD_FLATBED)) + { + DBG (DBG_proc, + "gl646_is_compatible_calibration: expired entry, non compatible cache\n"); + return SANE_STATUS_UNSUPPORTED; + } +#endif + DBG (DBG_proc, "gl646_is_compatible_calibration: completed, cache compatible\n"); return SANE_STATUS_GOOD; } +/** + * search for a full width black or white strip. + * @param dev scanner device + * @param forward SANE_TRUE if searching forward, SANE_FALSE if searching backward + * @param black SANE_TRUE if searching for a black strip, SANE_FALSE for a white strip + * @return SANE_STATUS_GOOD if a matching strip is found, SANE_STATUS_UNSUPPORTED if not + */ +static SANE_Status +gl646_search_strip (Genesys_Device * dev, SANE_Bool forward, SANE_Bool black) +{ + SANE_Status status = SANE_STATUS_GOOD; + SANE_Bool half_ccd = SANE_FALSE; + Genesys_Settings settings; + int res = get_closest_resolution (dev->model->ccd_type, 75, SANE_FALSE); + unsigned char *data = NULL; + unsigned int pass, count, found, x, y; + char title[80]; + + DBG (DBG_proc, "gl646_search_strip: start\n"); + /* adapt to half_ccd case */ + if (dev->model->flags & GENESYS_FLAG_HALF_CCD_MODE) + { + /* walk the master mode list to find if half_ccd */ + if (is_half_ccd (dev->model->ccd_type, res, SANE_TRUE) == SANE_TRUE) + { + half_ccd = SANE_TRUE; + } + } + + /* we set up for a lowest available resolution color grey scan, full width */ + settings.scan_method = SCAN_METHOD_FLATBED; + settings.scan_mode = SCAN_MODE_GRAY; + settings.xres = res; + settings.yres = res; + settings.tl_x = 0; + settings.tl_y = 0; + settings.pixels = (SANE_UNFIX (dev->model->x_size) * res) / MM_PER_INCH; + if (half_ccd == SANE_TRUE) + { + settings.pixels /= 2; + } + + /* 15 mm at at time */ + settings.lines = (15 * settings.yres) / MM_PER_INCH; /* may become a parameter from genesys_devices.c */ + settings.depth = 8; + settings.color_filter = 0; + + settings.disable_interpolation = 0; + settings.threshold = 0; + settings.exposure_time = 0; + + /* signals if a strip of the given color has been found */ + found = 0; + + /* detection pass done */ + pass = 0; + + /* loop until strip is found or maximum pass number done */ + while (pass < 20 && !found) + { + /* scan a full width strip */ + status = + simple_scan (dev, settings, SANE_TRUE, forward, SANE_FALSE, &data); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "gl646_search_strip: simple_scan failed\n"); + free (data); + return status; + } + if (DBG_LEVEL >= DBG_data) + { + sprintf (title, "search_strip_%s%02d.pnm", forward ? "fwd" : "bwd", + pass); + sanei_genesys_write_pnm_file (title, data, settings.depth, 1, + settings.pixels, settings.lines); + } + + /* search data to find black strip */ + /* when searching forward, we only need one line of the searched color since we + * will scan forward. But when doing backward search, we need all the area of the + * same color */ + if (forward) + { + for (y = 0; y < settings.lines && !found; y++) + { + count = 0; + /* count of white/black pixels depending on the color searched */ + for (x = 0; x < settings.pixels; x++) + { + /* when searching for black, detect white pixels */ + if (black && data[y * settings.pixels + x] > 90) + { + count++; + } + /* when searching for white, detect black pixels */ + if (!black && data[y * settings.pixels + x] < 60) + { + count++; + } + } + + /* at end of line, if count >= 3%, line is not fully of the desired color + * so we must go to next line of the buffer */ + /* count*100/pixels < 3 */ + if ((count * 100) / settings.pixels < 3) + { + found = 1; + DBG (DBG_data, + "gl646_search_strip: strip found forward during pass %d at line %d\n", + pass, y); + } + else + { + DBG (DBG_data, "gl646_search_strip: pixels=%d, count=%d\n", + settings.pixels, count); + } + } + } + else /* since calibration scans are done forward, we need the whole area + to be of the required color when searching backward */ + { + count = 0; + for (y = 0; y < settings.lines; y++) + { + /* count of white/black pixels depending on the color searched */ + for (x = 0; x < settings.pixels; x++) + { + /* when searching for black, detect white pixels */ + if (black && data[y * settings.pixels + x] > 60) + { + count++; + } + /* when searching for white, detect black pixels */ + if (!black && data[y * settings.pixels + x] < 60) + { + count++; + } + } + } + + /* at end of area, if count >= 3%, area is not fully of the desired color + * so we must go to next buffer */ + if ((count * 100) / (settings.pixels * settings.lines) < 3) + { + found = 1; + DBG (DBG_data, + "gl646_search_strip: strip found backward during pass %d \n", + pass); + } + else + { + DBG (DBG_data, "gl646_search_strip: pixels=%d, count=%d\n", + settings.pixels, count); + } + } + pass++; + } + free (data); + if (found) + { + status = SANE_STATUS_GOOD; + DBG (DBG_info, "gl646_search_strip: strip found\n"); + } + else + { + status = SANE_STATUS_UNSUPPORTED; + DBG (DBG_info, "gl646_search_strip: strip not found\n"); + } + return status; +} + /** the gl646 command set */ static Genesys_Command_Set gl646_cmd_set = { "gl646-generic", /* the name of this set */ @@ -5064,7 +5720,7 @@ gl646_bulk_full_size, - gl646_set_fe, + gl646_public_set_fe, gl646_set_powersaving, gl646_save_power, gl646_set_motor_power, @@ -5089,11 +5745,14 @@ gl646_update_hardware_sensors, + /* sheetfed related functions */ gl646_load_document, gl646_detect_document_end, gl646_eject_document, + gl646_search_strip, - gl646_is_compatible_calibration + gl646_is_compatible_calibration, + gl646_move_to_ta }; SANE_Status @@ -5102,3 +5761,5 @@ dev->model->cmd_set = &gl646_cmd_set; return SANE_STATUS_GOOD; } + +/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/genesys_gl646.h sane-backends-1.0.21/backend/genesys_gl646.h --- sane-backends-1.0.20/backend/genesys_gl646.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys_gl646.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,690 @@ +/* sane - Scanner Access Now Easy. + + Copyright (C) 2003-2004 Henning Meier-Geinitz + Copyright (C) 2004-2005 Gerhard Jaeger + Copyright (C) 2004-2010 Stéphane Voltz + Copyright (C) 2005-2009 Pierre Willenbrock + + 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. +*/ +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include + +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" + +#undef BACKEND_NAME +#define BACKEND_NAME genesys_gl646 + +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_usb.h" + +#include "../include/_stdint.h" +#include "genesys.h" + +/* + * Genesys Logic GL646 based scanners + */ +/* Individual bits */ +#define REG01_CISSET 0x80 +#define REG01_DOGENB 0x40 +#define REG01_DVDSET 0x20 +#define REG01_FASTMOD 0x10 +#define REG01_COMPENB 0x08 +#define REG01_DRAMSEL 0x04 +#define REG01_SHDAREA 0x02 +#define REG01_SCAN 0x01 + +#define REG02_NOTHOME 0x80 +#define REG02_ACDCDIS 0x40 +#define REG02_AGOHOME 0x20 +#define REG02_MTRPWR 0x10 +#define REG02_FASTFED 0x08 +#define REG02_MTRREV 0x04 +#define REG02_STEPSEL 0x03 + +#define REG02_FULLSTEP 0x00 +#define REG02_HALFSTEP 0x01 +#define REG02_QUATERSTEP 0x02 + +#define REG03_TG3 0x80 +#define REG03_AVEENB 0x40 +#define REG03_XPASEL 0x20 +#define REG03_LAMPPWR 0x10 +#define REG03_LAMPDOG 0x08 +#define REG03_LAMPTIM 0x07 + +#define REG04_LINEART 0x80 +#define REG04_BITSET 0x40 +#define REG04_ADTYPE 0x30 +#define REG04_FILTER 0x0c +#define REG04_FESET 0x03 + +#define REG05_DPIHW 0xc0 +#define REG05_DPIHW_600 0x00 +#define REG05_DPIHW_1200 0x40 +#define REG05_DPIHW_2400 0x80 +#define REG05_GMMTYPE 0x30 +#define REG05_GMM14BIT 0x10 +#define REG05_GMMENB 0x08 +#define REG05_LEDADD 0x04 +#define REG05_BASESEL 0x03 + +#define REG06_PWRBIT 0x10 +#define REG06_GAIN4 0x08 +#define REG06_OPTEST 0x07 + +#define REG07_DMASEL 0x02 +#define REG07_DMARDWR 0x01 + +#define REG16_CTRLHI 0x80 +#define REG16_SELINV 0x40 +#define REG16_TGINV 0x20 +#define REG16_CK1INV 0x10 +#define REG16_CK2INV 0x08 +#define REG16_CTRLINV 0x04 +#define REG16_CKDIS 0x02 +#define REG16_CTRLDIS 0x01 + +#define REG17_TGMODE 0xc0 +#define REG17_TGMODE_NO_DUMMY 0x00 +#define REG17_TGMODE_REF 0x40 +#define REG17_TGMODE_XPA 0x80 +#define REG17_TGW 0x3f + +#define REG18_CNSET 0x80 +#define REG18_DCKSEL 0x60 +#define REG18_CKTOGGLE 0x10 +#define REG18_CKDELAY 0x0c +#define REG18_CKSEL 0x03 + +#define REG1D_CKMANUAL 0x80 + +#define REG1E_WDTIME 0xf0 +#define REG1E_LINESEL 0x0f + +#define REG41_PWRBIT 0x80 +#define REG41_BUFEMPTY 0x40 +#define REG41_FEEDFSH 0x20 +#define REG41_SCANFSH 0x10 +#define REG41_HOMESNR 0x08 +#define REG41_LAMPSTS 0x04 +#define REG41_FEBUSY 0x02 +#define REG41_MOTMFLG 0x01 + +#define REG66_LOW_CURRENT 0x10 + +#define REG6A_FSTPSEL 0xc0 +#define REG6A_FASTPWM 0x3f + +#define REG6C_TGTIME 0xc0 +#define REG6C_Z1MOD 0x38 +#define REG6C_Z2MOD 0x07 + +#define REG_SCANFED 0x1f +#define REG_BUFSEL 0x20 +#define REG_LINCNT 0x25 +#define REG_DPISET 0x2c +#define REG_STRPIXEL 0x30 +#define REG_ENDPIXEL 0x32 +#define REG_DUMMY 0x34 +#define REG_MAXWD 0x35 +#define REG_LPERIOD 0x38 +#define REG_FEEDL 0x3d +#define REG_VALIDWORD 0x42 +#define REG_FEDCNT 0x48 +#define REG_SCANCNT 0x4b +#define REG_Z1MOD 0x60 +#define REG_Z2MOD 0x62 + + +#include "genesys.h" + +enum +{ + reg_0x01 = 0, + reg_0x02, + reg_0x03, + reg_0x04, + reg_0x05, + reg_0x06, + reg_0x07, + reg_0x08, + reg_0x09, + reg_0x0a, + reg_0x0b, + reg_0x10, + reg_0x11, + reg_0x12, + reg_0x13, + reg_0x14, + reg_0x15, + reg_0x16, + reg_0x17, + reg_0x18, + reg_0x19, + reg_0x1a, + reg_0x1b, + reg_0x1c, + reg_0x1d, + reg_0x1e, + reg_0x1f, + reg_0x20, + reg_0x21, + reg_0x22, + reg_0x23, + reg_0x24, + reg_0x25, + reg_0x26, + reg_0x27, + reg_0x28, + reg_0x29, + reg_0x2c, + reg_0x2d, + reg_0x2e, + reg_0x2f, + reg_0x30, + reg_0x31, + reg_0x32, + reg_0x33, + reg_0x34, + reg_0x35, + reg_0x36, + reg_0x37, + reg_0x38, + reg_0x39, + reg_0x3d, + reg_0x3e, + reg_0x3f, + reg_0x52, + reg_0x53, + reg_0x54, + reg_0x55, + reg_0x56, + reg_0x57, + reg_0x58, + reg_0x59, + reg_0x5a, + reg_0x5b, + reg_0x5c, + reg_0x5d, + reg_0x5e, + reg_0x60, + reg_0x61, + reg_0x62, + reg_0x63, + reg_0x64, + reg_0x65, + reg_0x66, + reg_0x67, + reg_0x68, + reg_0x69, + reg_0x6a, + reg_0x6b, + reg_0x6c, + reg_0x6d, + GENESYS_GL646_MAX_REGS +}; + +#ifndef UNIT_TESTING +static +#endif +SANE_Status gl646_set_fe (Genesys_Device * dev, uint8_t set, int dpi); + +#ifndef UNIT_TESTING +static +#endif +SANE_Status gl646_public_set_fe (Genesys_Device * dev, uint8_t set); + +/** + * sets up the scanner for a scan, registers, gamma tables, shading tables + * and slope tables, based on the parameter struct. + * @param device device to set up + * @param settings settings of the scan + * @param split true if move before scan has to be done + * @param xcorrection true if scanner's X geometry must be taken into account to + * compute X, ie add left margins + * @param ycorrection true if scanner's Y geometry must be taken into account to + * compute Y, ie add top margins + */ +static SANE_Status +setup_for_scan (Genesys_Device * device, Genesys_Settings settings, + SANE_Bool split, SANE_Bool xcorrection, + SANE_Bool ycorrection); + +/** + * sets up the registers for a scan corresponding to the settings. + * Builds motor slope tables. Computes buffer sizes and data amount to + * transfer. It also sets up analog frontend. + * */ +static SANE_Status +gl646_setup_registers (Genesys_Device * dev, + Genesys_Register_Set * regs, + Genesys_Settings scan_settings, + uint16_t * slope_table1, + uint16_t * slope_table2, + SANE_Int resolution, + uint32_t move, + uint32_t linecnt, + uint16_t startx, + uint16_t endx, SANE_Bool color, SANE_Int depth); + +/** + * Does a simple move of the given distance by doing a scan at lowest resolution + * shading correction. Memory for data is allocated in this function + * and must be freed by caller. + * @param dev device of the scanner + * @param distance distance to move in MM + */ +#ifndef UNIT_TESTING +static +#endif + SANE_Status +simple_move (Genesys_Device * dev, SANE_Int distance); + +/** + * Does a simple scan of the area given by the settings. Scanned data + * it put in an allocated area which must be freed by the caller. + * and slope tables, based on the parameter struct. There is no shading + * correction while gamma correction is active. + * @param device device to set up + * @param settings settings of the scan + * @param move flag to enable scanhead to move + * @param forward flag to tell movement direction + * @param shading flag to tell if shading correction should be done + * @param data pointer that will point to the scanned data + */ +#ifndef UNIT_TESTING +static +#endif +SANE_Status +simple_scan (Genesys_Device * dev, Genesys_Settings settings, SANE_Bool move, SANE_Bool forward, + SANE_Bool shading, unsigned char **data); + +/** + * Send the stop scan command + * */ +static SANE_Status +end_scan (Genesys_Device * dev, Genesys_Register_Set * reg, + SANE_Bool check_stop, SANE_Bool eject); +/** + * writes control data to an area behind the last motor table. + */ +static SANE_Status write_control (Genesys_Device * dev, int resolution); + + +/** + * initialize scanner's registers at SANE init time + */ +static void gl646_init_regs (Genesys_Device * dev); + +#ifndef UNIT_TESTING +static +#endif +SANE_Status gl646_load_document (Genesys_Device * dev); + +static SANE_Status +gl646_detect_document_end (Genesys_Device * dev); + +#define FULL_STEP 0 +#define HALF_STEP 1 +#define QUATER_STEP 2 + +#define CALIBRATION_LINES 10 + +/** + * master motor settings table entry + */ +typedef struct +{ + /* key */ + SANE_Int motor; + SANE_Int dpi; + SANE_Bool color; + + /* settings */ + SANE_Int ydpi; /* real motor dpi, may be different from the resolution */ + SANE_Int steptype; /* 0=full, 1=half, 2=quarter */ + SANE_Bool fastmod; /* fast scanning 0/1 */ + SANE_Bool fastfed; /* fast fed slope tables */ + SANE_Int mtrpwm; + SANE_Int steps1; /* table 1 informations */ + SANE_Int vstart1; + SANE_Int vend1; + SANE_Int steps2; /* table 2 informations */ + SANE_Int vstart2; + SANE_Int vend2; + float g1; + float g2; + SANE_Int fwdbwd; /* forward/backward steps */ +} Motor_Master; + +/** + * master sensor settings table entry + */ +typedef struct +{ + /* key */ + SANE_Int sensor; /**< sensor identifier */ + SANE_Int dpi; /**< required dpi */ + SANE_Bool color; /**< SANE_TRUE if color scan */ + + /* settings */ + SANE_Int xdpi; /**< real sensor dpi, may be different from the required resolution */ + SANE_Int exposure; /**< exposure time */ + SANE_Int dpiset; /**< set sensor dpi */ + SANE_Int cksel; /**< dpiset 'divisor', part of reg 18h */ + SANE_Int dummy; /**< dummy exposure time */ + /* uint8_t regs_0x10_0x15[6];*/ + uint8_t *regs_0x10_0x15; /**< per color exposure time for CIS scanners */ + SANE_Bool half_ccd; /**> true if manual CCD/2 clock programming or real dpi is half dpiset */ + uint8_t reg_0x18; /**> content of register 18h */ + uint8_t reg_0x1d; /**> content of register 1dh */ +} Sensor_Master; + +/** + * settings for a given resolution and DPISET + * TODO clean up this when all scanners will have been added + */ +typedef struct +{ + /* key */ + SANE_Int sensor; + SANE_Int cksel; + + /* values */ + uint8_t regs_0x08_0x0b[4]; /**< settings for normal CCD clock */ + uint8_t manual_0x08_0x0b[4]; /**< settings for CCD/2 clock */ + uint8_t regs_0x16_0x1d[8]; + uint8_t regs_0x52_0x5e[13]; + uint8_t manual_0x52_0x58[7]; +} Sensor_Settings; + +static uint8_t xp200_color[6]={0x16, 0x44, 0x0c, 0x80, 0x09, 0x2e}; +static uint8_t xp200_gray[6]={0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10}; + +/** + * master sensor settings, for a given sensor and dpi, + * it gives exposure and CCD time + */ +/* *INDENT-OFF* */ +static Sensor_Master sensor_master[] = { + /* HP3670 master settings */ + {CCD_HP3670, 75, SANE_TRUE , 75, 4879, 300, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 100, SANE_TRUE , 100, 4487, 400, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 150, SANE_TRUE , 150, 4879, 600, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 300, SANE_TRUE , 300, 4503, 1200, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 600, SANE_TRUE , 600, 10251, 1200, 2, 42, NULL, SANE_FALSE, 0x31, 0x43}, + {CCD_HP3670,1200, SANE_TRUE , 1200, 12750, 1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x43}, + {CCD_HP3670,2400, SANE_TRUE , 1200, 12750, 1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x43}, + {CCD_HP3670, 75, SANE_FALSE, 75, 4879, 300, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 100, SANE_FALSE, 100, 4487, 400, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 150, SANE_FALSE, 150, 4879, 600, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 300, SANE_FALSE, 300, 4503, 1200, 4, 42, NULL, SANE_FALSE, 0x33, 0x43}, + {CCD_HP3670, 600, SANE_FALSE, 600, 10251, 1200, 2, 42, NULL, SANE_FALSE, 0x31, 0x43}, + {CCD_HP3670,1200, SANE_FALSE, 1200, 12750, 1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x43}, + {CCD_HP3670,2400, SANE_FALSE, 1200, 12750, 1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x43}, + + /* HP 2400 master settings */ + {CCD_HP2400, 50, SANE_TRUE , 50, 675, 200, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 100, SANE_TRUE , 100, 7211, 400, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 300, SANE_TRUE , 300, 8751, 1200, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 600, SANE_TRUE , 1200, 18760, 1200, 2, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 50, SANE_FALSE, 50, 675, 200, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 100, SANE_FALSE, 100, 7211, 400, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 300, SANE_FALSE, 300, 8751, 1200, 4, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + {CCD_HP2400, 600, SANE_FALSE, 1200, 18760, 1200, 2, 42, NULL, SANE_FALSE, 0x3f, 0x02}, + + /* XP 200 master settings */ + {CIS_XP200 , 75, SANE_TRUE , 75, 5700, 75, 1, 42, xp200_color, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 100, SANE_TRUE , 100, 5700, 100, 1, 42, xp200_color, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 200, SANE_TRUE , 200, 5700, 200, 1, 42, xp200_color, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 300, SANE_TRUE , 300, 9000, 300, 1, 42, xp200_color, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 600, SANE_TRUE , 600, 16000, 600, 1, 42, xp200_color, SANE_FALSE, 0x00, 0x11}, + + {CIS_XP200 , 75, SANE_FALSE, 75, 16000, 75, 1, 42, xp200_gray, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 100, SANE_FALSE, 100, 7800, 100, 1, 42, xp200_gray, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 200, SANE_FALSE, 200, 11000, 200, 1, 42, xp200_gray, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 300, SANE_FALSE, 300, 13000, 300, 1, 42, xp200_gray, SANE_FALSE, 0x00, 0x11}, + {CIS_XP200 , 600, SANE_FALSE, 600, 24000, 600, 1, 42, xp200_gray, SANE_FALSE, 0x00, 0x11}, + + /* HP 2300 master settings */ + {CCD_HP2300, 75, SANE_TRUE , 75, 4480, 150, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 150, SANE_TRUE , 150, 4350, 300, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 300, SANE_TRUE, 300, 4350, 600, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 600, SANE_TRUE , 600, 8700, 600, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + {CCD_HP2300,1200, SANE_TRUE , 600, 8700, 600, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + {CCD_HP2300, 75, SANE_FALSE, 75, 4480, 150, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 150, SANE_FALSE, 150, 4350, 300, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 300, SANE_FALSE, 300, 4350, 600, 1, 42, NULL, SANE_TRUE , 0x20, 0x85}, + {CCD_HP2300, 600, SANE_FALSE, 600, 8700, 600, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + {CCD_HP2300,1200, SANE_FALSE, 600, 8700, 600, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + /* non half ccd 300 dpi settings + {CCD_HP2300, 300, SANE_TRUE , 300, 8700, 300, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + {CCD_HP2300, 300, SANE_FALSE, 300, 8700, 300, 1, 42, NULL, SANE_FALSE, 0x20, 0x05}, + */ + + /* MD5345/6471 master settings */ + {CCD_5345 , 50, SANE_TRUE , 50, 12000, 100, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 75, SANE_TRUE , 75, 11000, 150, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 100, SANE_TRUE , 100, 11000, 200, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 150, SANE_TRUE , 150, 11000, 300, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 200, SANE_TRUE , 200, 11000, 400, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 300, SANE_TRUE , 300, 11000, 600, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 400, SANE_TRUE , 400, 11000, 800, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 600, SANE_TRUE , 600, 11000,1200, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 ,1200, SANE_TRUE ,1200, 11000,1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x03}, + {CCD_5345 ,2400, SANE_TRUE ,1200, 11000,1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x03}, + {CCD_5345 , 50, SANE_FALSE, 50, 12000, 100, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 75, SANE_FALSE, 75, 11000, 150, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 100, SANE_FALSE, 100, 11000, 200, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 150, SANE_FALSE, 150, 11000, 300, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 200, SANE_FALSE, 200, 11000, 400, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 300, SANE_FALSE, 300, 11000, 600, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 400, SANE_FALSE, 400, 11000, 800, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 , 600, SANE_FALSE, 600, 11000,1200, 1, 42, NULL, SANE_TRUE , 0x28, 0x03}, + {CCD_5345 ,1200, SANE_FALSE,1200, 11000,1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x03}, + {CCD_5345 ,2400, SANE_FALSE,1200, 11000,1200, 1, 42, NULL, SANE_FALSE, 0x30, 0x03}, + +}; + +/** + * master motor settings, for a given motor and dpi, + * it gives steps and speed informations + */ +static Motor_Master motor_master[] = { + /* HP3670 motor settings */ + {MOTOR_HP3670, 75, SANE_TRUE , 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 1, 200, 3429, 305, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 100, SANE_TRUE , 100, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 143, 2905, 187, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 150, SANE_TRUE , 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 73, 3429, 305, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 300, SANE_TRUE , 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 11, 1055, 563, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 600, SANE_TRUE , 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 10687, 5126, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670,1200, SANE_TRUE ,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 15937, 6375, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670,2400, SANE_TRUE ,2400, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 15937, 12750, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 75, SANE_FALSE, 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 1, 200, 3429, 305, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 100, SANE_FALSE, 100, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 143, 2905, 187, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 150, SANE_FALSE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 73, 3429, 305, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 1, 11, 1055, 563, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670, 600, SANE_FALSE, 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 10687, 5126, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670,1200, SANE_FALSE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 15937, 6375, 192, 3399, 337, 0.3, 0.4, 192}, + {MOTOR_HP3670,2400, SANE_TRUE ,2400, HALF_STEP, SANE_FALSE, SANE_TRUE , 0, 3, 15937, 12750, 192, 3399, 337, 0.3, 0.4, 192}, + + /* HP2400/G2410 motor settings base motor dpi = 600 */ + {MOTOR_HP2400, 50, SANE_TRUE , 50, HALF_STEP, SANE_FALSE, SANE_FALSE, 63, 4, 1382, 800, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 100, SANE_TRUE , 100, FULL_STEP, SANE_FALSE, SANE_TRUE, 63, 120, 8736, 601, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 300, SANE_TRUE , 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 32, 16703, 2188, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 600, SANE_TRUE , 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 18761, 18761, 192, 4905, 627, 0.30, 0.4, 192}, + {MOTOR_HP2400, 50, SANE_FALSE, 50, HALF_STEP, SANE_FALSE, SANE_FALSE, 63, 4, 1382, 800, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 100, SANE_FALSE, 100, FULL_STEP, SANE_FALSE, SANE_TRUE, 63, 120, 8736, 601, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 32, 16703, 2188, 192, 4905, 337, 0.30, 0.4, 192}, + {MOTOR_HP2400, 600, SANE_FALSE, 600, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 18761, 18761, 192, 4905, 337, 0.30, 0.4, 192}, + + /* XP 200 motor settings */ + {MOTOR_XP200, 75, SANE_TRUE, 75, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2136, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 100, SANE_TRUE, 100, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2850, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 200, SANE_TRUE, 200, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6999, 5700, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 250, SANE_TRUE, 250, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6999, 6999, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 300, SANE_TRUE, 300, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 13500, 13500, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 600, SANE_TRUE, 600, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 31998, 31998, 2, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 75, SANE_FALSE, 75, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 2000, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 100, SANE_FALSE, 100, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6000, 1300, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 200, SANE_FALSE, 200, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 6000, 3666, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 300, SANE_FALSE, 300, HALF_STEP, SANE_TRUE , SANE_FALSE, 0, 4, 6500, 6500, 8, 12000, 1200, 0.3, 0.5, 1}, + {MOTOR_XP200, 600, SANE_FALSE, 600, HALF_STEP, SANE_TRUE , SANE_TRUE, 0, 4, 24000, 24000, 2, 12000, 1200, 0.3, 0.5, 1}, + + /* HP scanjet 2300c */ + {MOTOR_HP2300, 75, SANE_TRUE, 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 120, 8139, 560, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 150, SANE_TRUE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 67, 7903, 543, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 300, SANE_TRUE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 2175, 1087, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 600, SANE_TRUE, 600, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 8700, 4350, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300,1200, SANE_TRUE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 17400, 8700, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 75, SANE_FALSE, 75, FULL_STEP, SANE_FALSE, SANE_TRUE , 63, 120, 8139, 560, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 150, SANE_FALSE, 150, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 67, 7903, 543, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 2175, 1087, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 600, SANE_FALSE, 600, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 8700, 4350, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300,1200, SANE_FALSE,1200, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 3, 17400, 8700, 120, 4905, 337, 0.3, 0.4, 16}, + /* non half ccd settings for 300 dpi + {MOTOR_HP2300, 300, SANE_TRUE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 44, 5386, 2175, 120, 4905, 337, 0.3, 0.4, 16}, + {MOTOR_HP2300, 300, SANE_FALSE, 300, HALF_STEP, SANE_FALSE, SANE_TRUE , 63, 44, 5386, 2175, 120, 4905, 337, 0.3, 0.4, 16}, + */ + + /* MD5345/6471 motor settings */ + /* vfinal=(exposure/(1200/dpi))/step_type */ + {MOTOR_5345, 50, SANE_TRUE , 50, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 250, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 75, SANE_TRUE , 75, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 343, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 100, SANE_TRUE , 100, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 458, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 150, SANE_TRUE , 150, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 687, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 200, SANE_TRUE , 200, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 916, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 300, SANE_TRUE, 300, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 1375, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 400, SANE_TRUE, 400, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2000, 1833, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 500, SANE_TRUE, 500, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2291, 2291, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 600, SANE_TRUE, 600, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 1200, SANE_TRUE ,1200, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 146}, + {MOTOR_5345, 2400, SANE_TRUE ,2400, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 5500, 5500, 255, 2000, 300, 0.3, 0.4, 146}, + {MOTOR_5345, 50, SANE_FALSE, 50, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 250, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 75, SANE_FALSE, 75, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 343, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 100, SANE_FALSE, 100, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 458, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 150, SANE_FALSE, 150, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 687, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 200, SANE_FALSE, 200, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 916, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 300, SANE_FALSE, 300, HALF_STEP , SANE_FALSE, SANE_TRUE , 2, 255, 2500, 1375, 255, 2000, 300, 0.3, 0.4, 64}, + {MOTOR_5345, 400, SANE_FALSE, 400, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2000, 1833, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 500, SANE_FALSE, 500, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2291, 2291, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 600, SANE_FALSE, 600, HALF_STEP , SANE_FALSE, SANE_TRUE , 0, 32, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 32}, + {MOTOR_5345, 1200, SANE_FALSE,1200, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 2750, 2750, 255, 2000, 300, 0.3, 0.4, 146}, + {MOTOR_5345, 2400, SANE_FALSE,2400, QUATER_STEP, SANE_FALSE, SANE_TRUE , 0, 16, 5500, 5500, 255, 2000, 300, 0.3, 0.4, 146}, /* 5500 guessed */ +}; + +/** + * sensor settings for a given sensor and timing method + */ +static Sensor_Settings sensor_settings[] = { + /* HP 3670 */ + {CCD_HP3670, 1, + {0x0d, 0x0f, 0x11, 0x13}, + {0x00, 0x00, 0x00, 0x00}, + {0x2b, 0x07, 0x30, 0x2a, 0x00, 0x00, 0xc0, 0x43}, + {0x03, 0x07, 0x0b, 0x0f, 0x13, 0x17, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, }, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + }, + {CCD_HP3670, 2, + {0x00, 0x05, 0x06, 0x08}, + {0x00, 0x00, 0x00, 0x00}, + {0x33, 0x07, 0x31, 0x2a, 0x02, 0x0e, 0xc0, 0x43}, + {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x02, 0x0e, 0x00, 0x00, }, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + }, + {CCD_HP3670, 4, + {0x00, 0x0a, 0x0b, 0x0d}, + {0x00, 0x00, 0x00, 0x00}, + {0x33, 0x07, 0x33, 0x2a, 0x02, 0x13, 0xc0, 0x43}, + {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x15, 0xc1, 0x05, 0x0a, 0x0f, 0x00, }, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + }, + /* HP 2400 */ + {CCD_HP2400, 4, + {0x14, 0x15, 0x00, 0x00}, + {0x00, 0x00, 0x00, 0x00}, + {0xbf, 0x08, 0x3f, 0x2a, 0x00, 0x00, 0x00, 0x02}, + {11, 15, 19, 23, 3, 7, 0x63, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00}, + {11, 15, 19, 23, 3, 7, 0x63} + }, + {CCD_HP2400, 2, + {14, 15, 0, 0}, + {14, 15, 0, 0}, + {0xbf, 0x08, 0x3f, 0x2a, 0, 0, 0, 0x02}, + {3, 7, 11, 15, 19, 23, 0x23, 0, 0xc1, 0, 0, 0, 0}, + {3, 7, 11, 15, 19, 23, 0x23} + }, + {CCD_HP2400, 1, + {0x02, 0x04, 0x00, 0x00}, + {0x02, 0x04, 0x00, 0x00}, + {0xbf, 0x08, 0x30, 0x2a, 0x00, 0x00, 0xc0, 0x42}, + {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x0e, 0x00, 0x00}, + {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63} + }, + {CIS_XP200, 1, + {6, 7, 10, 4}, + {6, 7, 10, 4}, + {0x24, 0x04, 0x00, 0x2a, 0x0a, 0x0a, 0, 0x11}, + {8, 2, 0, 0, 0, 0, 0x1a, 0x51, 0, 0, 0, 0, 0}, + {8, 2, 0, 0, 0, 0, 0x1a} + }, + {CCD_HP2300, 1, + {0x01, 0x03, 0x04, 0x06}, + {0x16, 0x00, 0x01, 0x03}, + {0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a, 0x00, 0x05}, + {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x06, 0x0b, 0x10, 0x16}, + {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83} + }, + {CCD_5345, 1, + {0x0d, 0x0f, 0x11, 0x13}, + {0x00, 0x05, 0x06, 0x08}, /* manual clock 1/2 settings or half ccd */ + {0x0b, 0x0a, 0x30, 0x2a, 0x00, 0x00, 0x00, 0x03, }, + {0x03, 0x07, 0x0b, 0x0f, 0x13, 0x17, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00}, + {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83} /* half ccd settings */ + }, +}; +/* *INDENT-ON* */ diff -Nru sane-backends-1.0.20/backend/genesys_gl841.c sane-backends-1.0.21/backend/genesys_gl841.c --- sane-backends-1.0.20/backend/genesys_gl841.c 2009-04-20 05:39:21.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys_gl841.c 2010-04-05 23:18:04.000000000 +1000 @@ -3,7 +3,7 @@ Copyright (C) 2003 Oliver Rauch Copyright (C) 2003, 2004 Henning Meier-Geinitz Copyright (C) 2004 Gerhard Jaeger - Copyright (C) 2004, 2005 Stephane Voltz + Copyright (C) 2004, 2009 Stephane Voltz Copyright (C) 2005 Philipp Schmid Copyright (C) 2005 - 2009 Pierre Willenbrock Copyright (C) 2006 Laurent Charpentier @@ -58,7 +58,7 @@ #include #include #include -#include "_stdint.h" +#include "../include/_stdint.h" #include "../include/sane/sane.h" #include "../include/sane/sanei.h" @@ -256,6 +256,7 @@ #define REG6C_GPIOH 0xff #define REG6C_GPIOL 0xff +#define REG87_LEDADD 0x04 /* we don't need a genesys_sanei_gl841.h yet, declarations aren't numerous enough */ /* writable registers *//*adapted to sanei_gl841 */ @@ -1473,10 +1474,19 @@ dev->reg[reg_0x06].value |= REG06_PWRBIT; dev->reg[reg_0x06].value |= REG06_GAIN4; - dev->reg[reg_0x06].value |= 0 << REG06S_SCANMOD; - - dev->reg[reg_0x09].value |= 1 << REG09S_CLKSET; + /* XP300 CCD needs different clock and clock/pixels values */ + if (dev->model->ccd_type != CCD_XP300 && dev->model->ccd_type != CCD_DP685) + { + dev->reg[reg_0x06].value |= 0 << REG06S_SCANMOD; + dev->reg[reg_0x09].value |= 1 << REG09S_CLKSET; + } + else + { + dev->reg[reg_0x06].value |= 0x05 << REG06S_SCANMOD; /* 15 clocks/pixel */ + dev->reg[reg_0x09].value = 0; /* 24 MHz CLKSET */ + } + dev->reg[reg_0x1e].value = 0xf0; /* watch-dog time */ dev->reg[reg_0x17].value |= 1 << REG17S_TGW; @@ -1538,6 +1548,12 @@ dev->reg[reg_0x6b].value |= REG6B_GPO17; } + if (dev->model->gpo_type == GPO_DP685) + { + /* REG6B_GPO18 lights on green led */ + dev->reg[reg_0x6b].value |= REG6B_GPO17|REG6B_GPO18; + } + DBG (DBG_proc, "gl841_init_registers complete\n"); } @@ -1623,8 +1639,8 @@ uint8_t val; DBG (DBG_proc, "gl841_set_fe (%s)\n", - set == 1 ? "init" : set == 2 ? "set" : set == - 3 ? "powersave" : "huh?"); + set == AFE_INIT ? "init" : set == AFE_SET ? "set" : set == + AFE_POWER_SAVE ? "powersave" : "huh?"); if ((dev->reg[reg_0x04].value & REG04_FESET) != 0x00) { @@ -2171,7 +2187,7 @@ &fast_exposure, scan_power_mode); - if (dev->model->gpo_type == GPO_XP300) + if (dev->model->gpo_type == GPO_XP300 || dev->model->gpo_type == GPO_DP685) { /* quirk: looks like at least this scanner is unable to use 2-feed mode */ @@ -2411,9 +2427,10 @@ return 0; } -#define OPTICAL_FLAG_DISABLE_GAMMA 1 +#define OPTICAL_FLAG_DISABLE_GAMMA 1 #define OPTICAL_FLAG_DISABLE_SHADING 2 -#define OPTICAL_FLAG_DISABLE_LAMP 4 +#define OPTICAL_FLAG_DISABLE_LAMP 4 +#define OPTICAL_FLAG_ENABLE_LEDADD 8 static SANE_Status gl841_init_optical_regs_off(Genesys_Device * dev, @@ -2561,8 +2578,6 @@ } r->value &= ~(REG04_FILTER | REG04_AFEMOD); - /* we could make the color filter used an advanced option of the - backend */ if (channels == 1) { switch (color_filter) { case 0: @@ -2577,6 +2592,18 @@ } } else r->value |= 0x10; /* color pixel by pixel */ + + /* CIS scanners can do true gray by setting LEDADD */ + if (dev->model->is_cis == SANE_TRUE) + { + r = sanei_genesys_get_address (reg, 0x87); + r->value &= ~REG87_LEDADD; + /* we set up LEDADD only when asked */ + if (channels==1 && (flags & OPTICAL_FLAG_ENABLE_LEDADD)) + { + r->value |= REG87_LEDADD; + } + } /* enable gamma tables */ r = sanei_genesys_get_address (reg, 0x05); @@ -2664,6 +2691,7 @@ #define SCAN_FLAG_IGNORE_LINE_DISTANCE 0x10 #define SCAN_FLAG_USE_OPTICAL_RES 0x20 #define SCAN_FLAG_DISABLE_LAMP 0x40 +#define SCAN_FLAG_DYNAMIC_LINEART 0x80 /* set up registers for an actual scan * @@ -2903,8 +2931,12 @@ exposure_time); /*** optical parameters ***/ - - + /* in case of dynamic lineart, we use an internal 8 bit gray scan + * to generate 1 lineart data */ + if(flags & SCAN_FLAG_DYNAMIC_LINEART) + { + depth=8; + } if (depth == 16) flags |= SCAN_FLAG_DISABLE_GAMMA; @@ -3157,7 +3189,8 @@ /* half_ccd */ /* we have 2 domains for ccd: xres below or above half ccd max dpi */ - if (dev->sensor.optical_res < 2 * xres) { + if ((dev->sensor.optical_res < 2 * xres) || + !(dev->model->flags & GENESYS_FLAG_HALF_CCD_MODE)) { half_ccd = SANE_FALSE; } else { half_ccd = SANE_TRUE; @@ -3445,6 +3478,13 @@ sanei_genesys_write_register(dev, 0x6D, val & ~0x80); } + if (dev->model->gpo_type == GPO_DP685) + { + sanei_genesys_read_register(dev, 0x6B, &val); + sanei_genesys_write_register(dev, 0x6B, val & ~REG6B_GPO17); + dev->reg[reg_0x6b].value &= ~REG6B_GPO17; + dev->calib_reg[reg_0x6b].value &= ~REG6B_GPO17; + } gl841_set_fe (dev, AFE_POWER_SAVE); @@ -3490,7 +3530,8 @@ dev->calib_reg[reg_0x6b].value |= REG6B_GPO18; } - if (dev->model->gpo_type == GPO_DP665) + if (dev->model->gpo_type == GPO_DP665 + || dev->model->gpo_type == GPO_DP685) { sanei_genesys_read_register(dev, 0x6B, &val); sanei_genesys_write_register(dev, 0x6B, val | REG6B_GPO17); @@ -3619,9 +3660,11 @@ return status; } - /* stop motor if needed */ + /* only stop action if needed */ if (!(val40 & REG40_DATAENB) && !(val40 & REG40_MOTMFLG)) { + DBG (DBG_info, + "%s: already stopped\n", __FUNCTION__); DBG (DBG_proc, "%s: completed\n", __FUNCTION__); return SANE_STATUS_GOOD; @@ -3644,6 +3687,10 @@ return status; } + /* looks like writing the right registers to zero is enough to get the chip + out of scan mode into command mode, actually triggering(writing to + register 0x0f) seems to be unnecessary */ + loop = 10; while (loop > 0) { @@ -3725,7 +3772,7 @@ if (status != SANE_STATUS_GOOD) { DBG (DBG_error, - "gl841_slow_back_home: Failed to read status register: %s\n", + "gl841_eject_document: Failed to read status register: %s\n", sane_strstatus (status)); return status; } @@ -3911,8 +3958,9 @@ { SANE_Status status = SANE_STATUS_GOOD; SANE_Bool paper_loaded; - unsigned int flines, channels, depth, bytes_remain, sublines, - bytes_to_flush, lines, sub_bytes; + unsigned int scancnt = 0; + int flines, channels, depth, bytes_remain, sublines, + bytes_to_flush, lines, sub_bytes, tmp, read_bytes_left; DBG (DBG_proc, "%s: begin\n", __FUNCTION__); RIE (gl841_get_paper_sensor (dev, &paper_loaded)); @@ -3925,30 +3973,68 @@ channels = dev->current_setup.channels; depth = dev->current_setup.depth; + read_bytes_left = (int) dev->read_bytes_left; + DBG (DBG_io, "gl841_detect_document_end: read_bytes_left=%d\n", + read_bytes_left); + + /* read lins read */ + status = sanei_genesys_read_scancnt (dev, &scancnt); + if (status != SANE_STATUS_GOOD) + { + flines = 0; + } + else + { + /* compute number of line read */ + tmp = (int) dev->total_bytes_read; + if (depth == 1 || dev->settings.scan_mode == SCAN_MODE_LINEART) + flines = tmp * 8 / dev->settings.pixels / channels; + else + flines = tmp / (depth / 8) / dev->settings.pixels / channels; + + /* number of scanned lines, but no read yet */ + flines = scancnt - flines; + + DBG (DBG_io, + "gl841_detect_document_end: %d scanned but not read lines\n", + flines); + } /* adjust number of bytes to read * we need to read the final bytes which are word per line * number of last lines * to have doc leaving feeder */ lines = - (SANE_UNFIX(dev->model->post_scan) * dev->current_setup.yres) / - MM_PER_INCH; - DBG (DBG_io, "gl841_detect_document_end: adding %d line to flush\n", lines); + (SANE_UNFIX (dev->model->post_scan) * dev->current_setup.yres) / + MM_PER_INCH + flines; + DBG (DBG_io, "gl841_detect_document_end: adding %d line to flush\n", + lines); + /* number of bytes to read from scanner to get document out of it after * end of document dectected by hardware sensor */ bytes_to_flush = lines * dev->wpl; /* if we are already close to end of scan, flushing isn't needed */ - if (bytes_to_flush < dev->read_bytes_left) + if (bytes_to_flush < read_bytes_left) { - bytes_remain = dev->total_bytes_to_read - dev->total_bytes_read; + /* we take all these step to work around an overflow on some plateforms */ + tmp = (int) dev->total_bytes_read; + DBG (DBG_io, "gl841_detect_document_end: tmp=%d\n", tmp); + bytes_remain = (int) dev->total_bytes_to_read; + DBG (DBG_io, "gl841_detect_document_end: bytes_remain=%d\n", + bytes_remain); + bytes_remain = bytes_remain - tmp; + DBG (DBG_io, "gl841_detect_document_end: bytes_remain=%d\n", + bytes_remain); /* remaining lines to read by frontend for the current scan */ if (depth == 1 || dev->settings.scan_mode == SCAN_MODE_LINEART) - flines = bytes_remain * 8 - / dev->settings.pixels / channels; + { + flines = bytes_remain * 8 / dev->settings.pixels / channels; + } else - flines = bytes_remain / (depth / 8) + flines = bytes_remain / (depth / 8) / dev->settings.pixels / channels; + DBG (DBG_io, "gl841_detect_document_end: flines=%d\n", flines); if (flines > lines) { @@ -3960,8 +4046,8 @@ if (depth == 1 || dev->settings.scan_mode == SCAN_MODE_LINEART) sub_bytes = ((dev->settings.pixels * sublines) / 8 + - (((dev->settings.pixels * sublines)%8)?1:0) - ) * channels; + (((dev->settings.pixels * sublines) % 8) ? 1 : 0)) * + channels; else sub_bytes = dev->settings.pixels * sublines * channels * (depth / 8); @@ -3969,9 +4055,31 @@ dev->total_bytes_to_read -= sub_bytes; /* then adjust the physical bytes to read */ - dev->read_bytes_left -= sub_bytes; + if (read_bytes_left > sub_bytes) + { + dev->read_bytes_left -= sub_bytes; + } + else + { + dev->total_bytes_to_read = dev->total_bytes_read; + dev->read_bytes_left = 0; + } + + DBG (DBG_io, "gl841_detect_document_end: sublines=%d\n", + sublines); + DBG (DBG_io, "gl841_detect_document_end: subbytes=%d\n", + sub_bytes); + DBG (DBG_io, + "gl841_detect_document_end: total_bytes_to_read=%d\n", + dev->total_bytes_to_read); + DBG (DBG_io, "gl841_detect_document_end: read_bytes_left=%d\n", + read_bytes_left); } } + else + { + DBG (DBG_io, "gl841_detect_document_end: no flushing needed\n"); + } } DBG (DBG_proc, "%s: finished\n", __FUNCTION__); @@ -4504,6 +4612,7 @@ gl841_init_regs_for_scan (Genesys_Device * dev) { int channels; + int flags; int depth; float move; int move_dpi; @@ -4573,6 +4682,23 @@ start = (start * dev->sensor.optical_res) / MM_PER_INCH; + flags=0; + + /* we enable true gray for cis scanners only, and just when doing + * scan since color calibration is OK for this mode + */ + flags = 0; + if(dev->model->is_cis && dev->settings.true_gray) + { + flags |= OPTICAL_FLAG_ENABLE_LEDADD; + } + /* enable emulated lineart from gray data */ + if(dev->settings.scan_mode == SCAN_MODE_LINEART + && dev->settings.dynamic_lineart) + { + flags |= SCAN_FLAG_DYNAMIC_LINEART; + } + status = gl841_init_scan_regs (dev, dev->reg, dev->settings.xres, @@ -4584,8 +4710,7 @@ depth, channels, dev->settings.color_filter, - 0 - ); + flags); if (status != SANE_STATUS_GOOD) return status; @@ -4718,15 +4843,19 @@ DBG (DBG_proc, "gl841_led_calibration\n"); - status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/ - - if (status != SANE_STATUS_GOOD) + + if (dev->model->gpo_type == GPO_CANONLIDE35) { - DBG (DBG_error, - "gl841_coarse_gain_calibration: Failed to feed: %s\n", - sane_strstatus (status)); - return status; - } + status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/ + + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_led_calibration: Failed to feed: %s\n", + sane_strstatus (status)); + return status; + } + } /* offset calibration is always done in color mode */ channels = 3; @@ -4873,7 +5002,7 @@ } - RIE (gl841_end_scan (dev, dev->calib_reg, SANE_TRUE)); + RIE (gl841_stop_action (dev)); turn++; @@ -4915,7 +5044,7 @@ int turn; char fn[20]; SANE_Bool acceptable = SANE_FALSE; - int mintgt = 0x2000; + int mintgt = 0x400; DBG (DBG_proc, "gl841_offset_calibration\n"); @@ -4937,8 +5066,9 @@ SCAN_FLAG_DISABLE_GAMMA | SCAN_FLAG_SINGLE_LINE | SCAN_FLAG_IGNORE_LINE_DISTANCE | - SCAN_FLAG_USE_OPTICAL_RES - ); + SCAN_FLAG_USE_OPTICAL_RES | + SCAN_FLAG_DISABLE_LAMP + ); if (status != SANE_STATUS_GOOD) { @@ -4948,9 +5078,6 @@ return status; } - RIE (gl841_bulk_write_register - (dev, dev->calib_reg, GENESYS_GL841_MAX_REGS)); - used_res = dev->current_setup.xres; num_pixels = dev->current_setup.pixels; @@ -4969,7 +5096,7 @@ /* scan first line of data with no offset nor gain */ /*WM8199: gain=0.73; offset=-260mV*/ -/*okay. the sensor black level is now at -260V. we only get 0 from AFE...*/ +/*okay. the sensor black level is now at -260mV. we only get 0 from AFE...*/ /* we should probably do real calibration here: * -detect acceptable offset with binary search * -calculate offset from this last version @@ -4999,6 +5126,9 @@ do { + RIE (gl841_bulk_write_register + (dev, dev->calib_reg, GENESYS_GL841_MAX_REGS)); + for (j=0; j < channels; j++) { off[j] = (offh[j]+offl[j])/2; dev->frontend.offset[j] = off[j]; @@ -5021,7 +5151,7 @@ RIE (sanei_genesys_read_data_from_scanner (dev, first_line, total_size)); if (DBG_LEVEL >= DBG_data) { - snprintf(fn,20,"offset1_%d.pnm",turn); + snprintf(fn,20,"offset1_%02d.pnm",turn); sanei_genesys_write_pnm_file (fn, first_line, 16, @@ -5052,6 +5182,11 @@ cmax[j]++; } + /* TODO the DP685 has a black strip in the middle of the sensor + * should be handled in a more elegant way , could be a bug */ + if (dev->model->ccd_type == CCD_DP685) + cmin[j] -= 20; + if (cmin[j] > num_pixels/100) { acceptable = SANE_FALSE; if (dev->model->is_cis) @@ -5077,10 +5212,9 @@ offl[2] = offl[1] = offl[0]; } - RIE (gl841_end_scan (dev, dev->calib_reg, SANE_TRUE)); + RIE (gl841_stop_action (dev)); turn++; - } while (!acceptable && turn < 100); DBG(DBG_info,"gl841_offset_calibration: acceptable offsets: %d,%d,%d\n", @@ -5103,7 +5237,7 @@ val = first_line[i * 2 * channels + 2 * j + 1] * 256 + first_line[i * 2 * channels + 2 * j]; - if (min1[j] > val) + if (min1[j] > val && val >= 10) min1[j] = val; } } @@ -5195,7 +5329,7 @@ offl[2] = offl[1] = offl[0]; } - RIE (gl841_end_scan (dev, dev->calib_reg, SANE_TRUE)); + RIE (gl841_stop_action (dev)); turn++; @@ -5221,7 +5355,7 @@ val = second_line[i * 2 * channels + 2 * j + 1] * 256 + second_line[i * 2 * channels + 2 * j]; - if (min2[j] > val) + if (min2[j] > val && val != 0) min2[j] = val; } } @@ -5260,7 +5394,7 @@ else off[j] = 0xffff; } else - off[j] = -(mintgt * (off1[j] - off2[j]) + min2[j] * off1[j] - min1[j] * off2[j])/(min2[j]-min1[j]); + off[j] = (mintgt * (off1[j] - off2[j]) + min1[j] * off2[j] - min2[j] * off1[j])/(min1[j]-min2[j]); if (off[j] > 255) off[j] = 255; if (off[j] < 0) @@ -5320,15 +5454,17 @@ DBG (DBG_proc, "gl841_coarse_gain_calibration\n"); - - status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/ - - if (status != SANE_STATUS_GOOD) + if (dev->model->gpo_type == GPO_CANONLIDE35) { - DBG (DBG_error, - "gl841_coarse_gain_calibration: Failed to feed: %s\n", - sane_strstatus (status)); - return status; + status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/ + + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_coarse_gain_calibration: Failed to feed: %s\n", + sane_strstatus (status)); + return status; + } } /* coarse gain calibration is allways done in color mode */ @@ -5405,7 +5541,9 @@ gain[j] = 65535.0/max[j]; - if (dev->model->dac_type == DAC_CANONLIDE35) { + if (dev->model->dac_type == DAC_CANONLIDE35 || + dev->model->dac_type == DAC_WOLFSON_XP300 || + dev->model->dac_type == DAC_WOLFSON_DSM600) { gain[j] *= 0.69;/*seems we don't get the real maximum. empirically derived*/ if (283 - 208/gain[j] > 255) dev->frontend.gain[j] = 255; @@ -5459,7 +5597,7 @@ free (line); - RIE (gl841_end_scan (dev, dev->calib_reg, SANE_TRUE)); + RIE (gl841_stop_action (dev)); gl841_slow_back_home(dev, SANE_TRUE); @@ -5601,6 +5739,8 @@ DBG_INIT (); DBG (DBG_proc, "gl841_init\n"); + dev->scanhead_position_in_steps = 0; + /* Check if the device has already been initialized and powered up */ if (dev->already_initialized) { @@ -5791,7 +5931,9 @@ s->val[OPT_COPY_SW].b = (val & 0x08) == 0; } - if (s->dev->model->gpo_type == GPO_XP300) + if (s->dev->model->gpo_type == GPO_XP300 || + s->dev->model->gpo_type == GPO_DP665 || + s->dev->model->gpo_type == GPO_DP685) { RIE(sanei_genesys_read_register(s->dev, 0x6d, &val)); @@ -5804,6 +5946,304 @@ return status; } +/** @brief search for a full width black or white strip. + * This function searches for a black or white stripe across the scanning area. + * When searching backward, the searched area must completely be of the desired + * color since this area will be used for calibration which scans forward. + * @param dev scanner device + * @param forward SANE_TRUE if searching forward, SANE_FALSE if searching backward + * @param black SANE_TRUE if searching for a black strip, SANE_FALSE for a white strip + * @return SANE_STATUS_GOOD if a matching strip is found, SANE_STATUS_UNSUPPORTED if not + */ +static SANE_Status +gl841_search_strip (Genesys_Device * dev, SANE_Bool forward, SANE_Bool black) +{ + unsigned int pixels, lines, channels; + SANE_Status status; + Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS + 1]; + size_t size; + uint8_t *data; + int steps, depth, dpi; + unsigned int pass, count, found, x, y; + char title[80]; + Genesys_Register_Set *r; + + DBG (DBG_proc, "gl841_search_strip %s %s\n", black ? "black" : "white", + forward ? "forward" : "reverse"); + + gl841_set_fe (dev, AFE_SET); + status = gl841_stop_action (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_search_strip: Failed to stop: %s\n", + sane_strstatus (status)); + return status; + } + + /* set up for a gray scan at lowest dpi */ + dpi = 9600; + for (x = 0; x < MAX_RESOLUTIONS; x++) + { + if (dev->model->xdpi_values[x] > 0 && dev->model->xdpi_values[x] < dpi) + dpi = dev->model->xdpi_values[x]; + } + channels = 1; + /* 10 MM */ + lines = (10 * dpi) / MM_PER_INCH; + /* shading calibation is done with dev->motor.base_ydpi */ + lines = (dev->model->shading_lines * dpi) / dev->motor.base_ydpi; + depth = 8; + pixels = (dev->sensor.sensor_pixels * dpi) / dev->sensor.optical_res; + size = pixels * channels * lines * (depth / 8); + data = malloc (size); + if (!data) + { + DBG (DBG_error, "gl841_search_strip: failed to allocate memory\n"); + return SANE_STATUS_NO_MEM; + } + dev->scanhead_position_in_steps = 0; + + memcpy (local_reg, dev->reg, + (GENESYS_GL841_MAX_REGS + 1) * sizeof (Genesys_Register_Set)); + + status = gl841_init_scan_regs (dev, + local_reg, + dpi, + dpi, + 0, + 0, + pixels, + lines, + depth, + channels, + 0, + SCAN_FLAG_DISABLE_SHADING | SCAN_FLAG_DISABLE_GAMMA); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_search_strip: Failed to setup for scan: %s\n", + sane_strstatus (status)); + return status; + } + + /* set up for reverse or forward */ + r = sanei_genesys_get_address (local_reg, 0x02); + if (forward) + r->value &= ~4; + else + r->value |= 4; + + + status = gl841_bulk_write_register (dev, local_reg, GENESYS_GL841_MAX_REGS); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_search_strip: Failed to bulk write registers: %s\n", + sane_strstatus (status)); + return status; + } + + status = gl841_begin_scan (dev, local_reg, SANE_TRUE); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, + "gl841_search_strip: failed to begin scan: %s\n", + sane_strstatus (status)); + return status; + } + + /* waits for valid data */ + do + sanei_genesys_test_buffer_empty (dev, &steps); + while (steps); + + /* now we're on target, we can read data */ + status = sanei_genesys_read_data_from_scanner (dev, data, size); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, + "gl841_search_start_position: failed to read data: %s\n", + sane_strstatus (status)); + return status; + } + + status = gl841_stop_action (dev); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, "gl841_search_strip: gl841_stop_action failed\n"); + return status; + } + + pass = 0; + if (DBG_LEVEL >= DBG_data) + { + sprintf (title, "search_strip_%s_%s%02d.pnm", black ? "black" : "white", + forward ? "fwd" : "bwd", pass); + sanei_genesys_write_pnm_file (title, data, depth, channels, pixels, + lines); + } + + /* loop until strip is found or maximum pass number done */ + found = 0; + while (pass < 20 && !found) + { + status = + gl841_bulk_write_register (dev, local_reg, GENESYS_GL841_MAX_REGS); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, + "gl841_search_strip: Failed to bulk write registers: %s\n", + sane_strstatus (status)); + return status; + } + + /* now start scan */ + status = gl841_begin_scan (dev, local_reg, SANE_TRUE); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, + "gl841_search_strip: failed to begin scan: %s\n", + sane_strstatus (status)); + return status; + } + + /* waits for valid data */ + do + sanei_genesys_test_buffer_empty (dev, &steps); + while (steps); + + /* now we're on target, we can read data */ + status = sanei_genesys_read_data_from_scanner (dev, data, size); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, + "gl841_search_start_position: failed to read data: %s\n", + sane_strstatus (status)); + return status; + } + + status = gl841_stop_action (dev); + if (status != SANE_STATUS_GOOD) + { + free (data); + DBG (DBG_error, "gl841_search_strip: gl841_stop_action failed\n"); + return status; + } + + if (DBG_LEVEL >= DBG_data) + { + sprintf (title, "search_strip_%s_%s%02d.pnm", + black ? "black" : "white", forward ? "fwd" : "bwd", pass); + sanei_genesys_write_pnm_file (title, data, depth, channels, pixels, + lines); + } + + /* search data to find black strip */ + /* when searching forward, we only need one line of the searched color since we + * will scan forward. But when doing backward search, we need all the area of the + * same color */ + if (forward) + { + for (y = 0; y < lines && !found; y++) + { + count = 0; + /* count of white/black pixels depending on the color searched */ + for (x = 0; x < pixels; x++) + { + /* when searching for black, detect white pixels */ + if (black && data[y * pixels + x] > 90) + { + count++; + } + /* when searching for white, detect black pixels */ + if (!black && data[y * pixels + x] < 60) + { + count++; + } + } + + /* at end of line, if count >= 3%, line is not fully of the desired color + * so we must go to next line of the buffer */ + /* count*100/pixels < 3 */ + if ((count * 100) / pixels < 3) + { + found = 1; + DBG (DBG_data, + "gl841_search_strip: strip found forward during pass %d at line %d\n", + pass, y); + } + else + { + DBG (DBG_data, + "gl841_search_strip: pixels=%d, count=%d (%d%%)\n", + pixels, count, (100 * count) / pixels); + } + } + } + else /* since calibration scans are done forward, we need the whole area + to be of the required color when searching backward */ + { + count = 0; + for (y = 0; y < lines; y++) + { + /* count of white/black pixels depending on the color searched */ + for (x = 0; x < pixels; x++) + { + /* when searching for black, detect white pixels */ + if (black && data[y * pixels + x] > 90) + { + count++; + } + /* when searching for white, detect black pixels */ + if (!black && data[y * pixels + x] < 60) + { + count++; + } + } + } + + /* at end of area, if count >= 3%, area is not fully of the desired color + * so we must go to next buffer */ + if ((count * 100) / (pixels * lines) < 3) + { + found = 1; + DBG (DBG_data, + "gl841_search_strip: strip found backward during pass %d \n", + pass); + } + else + { + DBG (DBG_data, + "gl841_search_strip: pixels=%d, count=%d (%d%%)\n", pixels, + count, (100 * count) / pixels); + } + } + pass++; + } + free (data); + if (found) + { + status = SANE_STATUS_GOOD; + DBG (DBG_info, "gl841_search_strip: %s strip found\n", + black ? "black" : "white"); + } + else + { + status = SANE_STATUS_UNSUPPORTED; + DBG (DBG_info, "gl841_search_strip: %s strip not found\n", + black ? "black" : "white"); + } + + DBG (DBG_proc, "gl841_search_strip: completed\n"); + return status; +} + /** the gl841 command set */ static Genesys_Command_Set gl841_cmd_set = { "gl841-generic", /* the name of this set */ @@ -5853,8 +6293,10 @@ gl841_load_document, gl841_detect_document_end, gl841_eject_document, + gl841_search_strip, gl841_is_compatible_calibration, + NULL }; SANE_Status @@ -5863,3 +6305,5 @@ dev->model->cmd_set = &gl841_cmd_set; return SANE_STATUS_GOOD; } + +/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/genesys.h sane-backends-1.0.21/backend/genesys.h --- sane-backends-1.0.20/backend/genesys.h 2009-04-20 05:39:21.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys.h 2010-04-05 23:18:04.000000000 +1000 @@ -1,7 +1,7 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2003, 2004 Henning Meier-Geinitz - Copyright (C) 2005 Stephane Voltz + Copyright (C) 2005-2010 Stephane Voltz Copyright (C) 2006 Laurent Charpentier Copyright (C) 2009 Pierre Willenbrock @@ -56,7 +56,10 @@ #define GENESYS_CONFIG_FILE "genesys.conf" /* Maximum time for lamp warm-up */ -#define WARMUP_TIME 45 +#define WARMUP_TIME 65 + +#define FLATBED "Flatbed" +#define TRANSPARENCY_ADAPTER "Transparency Adapter" #ifndef SANE_I18N #define SANE_I18N(text) text @@ -92,6 +95,8 @@ OPT_EXTRAS_GROUP, OPT_LAMP_OFF_TIME, OPT_THRESHOLD, + OPT_THRESHOLD_CURVE, + OPT_DISABLE_DYNAMIC_LINEART, OPT_DISABLE_INTERPOLATION, OPT_COLOR_FILTER, @@ -103,6 +108,7 @@ OPT_PAGE_LOADED_SW, OPT_OCR_SW, OPT_POWER_SW, + OPT_NEED_CALIBRATION_SW, OPT_BUTTON_GROUP, OPT_CALIBRATE, OPT_CLEAR_CALIBRATION, diff -Nru sane-backends-1.0.20/backend/genesys_low.h sane-backends-1.0.21/backend/genesys_low.h --- sane-backends-1.0.20/backend/genesys_low.h 2009-04-20 05:39:21.000000000 +1000 +++ sane-backends-1.0.21/backend/genesys_low.h 2010-04-05 23:18:04.000000000 +1000 @@ -3,7 +3,7 @@ Copyright (C) 2003 Oliver Rauch Copyright (C) 2003, 2004 Henning Meier-Geinitz Copyright (C) 2004, 2005 Gerhard Jaeger - Copyright (C) 2004-2009 Stéphane Voltz + Copyright (C) 2004-2010 Stéphane Voltz Copyright (C) 2005-2009 Pierre Willenbrock Copyright (C) 2006 Laurent Charpentier Parts of the structs have been taken from the gt68xx backend by @@ -52,6 +52,9 @@ #define GENESYS_LOW_H #include +#ifdef HAVE_SYS_TIME_H +#include +#endif #include "../include/sane/sane.h" #define DBG_error0 0 /* errors/warnings printed even with devuglevel 0 */ @@ -69,13 +72,12 @@ if (status != SANE_STATUS_GOOD) return status; \ } while (SANE_FALSE) -#define MM_PER_INCH 25.4 /* Flags */ #define GENESYS_FLAG_UNTESTED (1 << 0) /* Print a warning for these scanners */ #define GENESYS_FLAG_14BIT_GAMMA (1 << 1) /* use 14bit Gamma table instead of 12 */ #define GENESYS_FLAG_LAZY_INIT (1 << 2) /* skip extensive ASIC test at init */ -/*#define GENESYS_FLAG_UNUSED (1 << 3) */ +#define GENESYS_FLAG_XPA (1 << 3) #define GENESYS_FLAG_SKIP_WARMUP (1 << 4) /* skip genesys_warmup() */ #define GENESYS_FLAG_OFFSET_CALIBRATION (1 << 5) /* do offset calibration */ #define GENESYS_FLAG_SEARCH_START (1 << 6) /* do start search beofre scanning */ @@ -252,6 +254,7 @@ #define DAC_AD_XP200 7 /* Analog Device frontend */ #define DAC_WOLFSON_XP300 8 #define DAC_WOLFSON_HP3670 9 +#define DAC_WOLFSON_DSM600 10 #define CCD_UMAX 0 #define CCD_ST12 1 /* SONY ILX548: 5340 Pixel ??? */ @@ -261,10 +264,13 @@ #define CCD_HP2300 5 #define CCD_CANONLIDE35 6 #define CIS_XP200 7 /* CIS sensor for Strobe XP200 */ -#define CCD_XP300 8 + /* 8 is unused currently */ #define CCD_HP3670 9 #define CCD_DP665 10 #define CCD_ROADWARRIOR 11 +#define CCD_DSMOBILE600 12 +#define CCD_XP300 13 +#define CCD_DP685 14 #define GPO_UMAX 0 #define GPO_ST12 1 @@ -277,6 +283,7 @@ #define GPO_XP300 8 #define GPO_HP3670 9 #define GPO_DP665 10 +#define GPO_DP685 11 #define MOTOR_UMAX 0 #define MOTOR_5345 1 @@ -289,6 +296,7 @@ #define MOTOR_HP3670 9 #define MOTOR_DP665 10 #define MOTOR_ROADWARRIOR 11 +#define MOTOR_DSMOBILE_600 12 /* Forward typedefs */ @@ -393,11 +401,21 @@ * eject document from scanner */ SANE_Status (*eject_document) (Genesys_Device * dev); + /** + * search for an black or white area in forward or reverse + * direction */ + SANE_Status (*search_strip) (Genesys_Device * dev, SANE_Bool forward, SANE_Bool black); SANE_Status (*is_compatible_calibration) ( Genesys_Device * dev, Genesys_Calibration_Cache *cache, SANE_Bool for_overwrite); + + /* functions for transparency adapter */ + /** + * move scanning head to transparency adapter + */ + SANE_Status (*move_to_ta) (Genesys_Device * dev); } Genesys_Command_Set; typedef struct Genesys_Model @@ -469,27 +487,37 @@ { int scan_method; /* todo: change >=2: Transparency, 0x88: negative film */ int scan_mode; /* todo: change 0,1 = lineart, halftone; 2 = gray, 3 = 3pass color, 4=single pass color */ - int xres; /* dpi */ - int yres; /* dpi */ + int xres; /**> horizontal dpi */ + int yres; /**> vertical dpi */ double tl_x; /* x start on scan table in mm */ double tl_y; /* y start on scan table in mm */ - unsigned int lines; /* number of lines at scan resolution */ - unsigned int pixels; /* number of pixels at scan resolution */ + unsigned int lines; /**> number of lines at scan resolution */ + unsigned int pixels; /**> number of pixels at scan resolution */ unsigned int depth;/* bit depth of the scan */ /* todo : remove these fields ? */ int exposure_time; - unsigned int color_filter; /* todo: check, may be make it an advanced option */ + unsigned int color_filter; + + /**> true if scan is true gray, false if monochrome scan */ + int true_gray; - /* BW threshold */ + /**> lineart threshold */ int threshold; - /* Disable interpolation for xres lineart threshold curve for dynamic rasterization */ + int threshold_curve; + + /**> Disable interpolation for xres true is lineart is generated from gray data by + * the dynamic rasterization algo */ + int dynamic_lineart; } Genesys_Settings; typedef struct Genesys_Current_Setup @@ -498,6 +526,7 @@ int lines; /* line count expected from scanner */ int depth; /* depth expected from scanner */ int channels; /* channel count expected from scanner */ + int scan_method; /* scanning method: flatbed or XPA */ int exposure_time; /* used exposure time */ float xres; /* used xres */ float yres; /* used yres*/ @@ -562,7 +591,7 @@ SANE_Int lamp_off_time; SANE_Bool read_active; - SANE_Bool document; /* for sheetfed scanner's, is TRUE when there + SANE_Bool document; /**> for sheetfed scanner's, is TRUE when there is a document in the scanner */ Genesys_Buffer read_buffer; @@ -577,6 +606,9 @@ size_t wpl; /* asic's word per line */ Genesys_Current_Setup current_setup; /* contains the real used values */ + + /**> look up table used in dynamic rasterization */ + unsigned char lineart_lut[256]; Genesys_Calibration_Cache *calibration_cache; @@ -626,6 +658,9 @@ extern SANE_Status sanei_genesys_read_valid_words (Genesys_Device * dev, unsigned int *steps); +extern SANE_Status sanei_genesys_read_scancnt (Genesys_Device * dev, + unsigned int *steps); + extern SANE_Status sanei_genesys_read_feed_steps (Genesys_Device * dev, unsigned int *steps); diff -Nru sane-backends-1.0.20/backend/gphoto2.c sane-backends-1.0.21/backend/gphoto2.c --- sane-backends-1.0.20/backend/gphoto2.c 2009-04-30 23:58:35.000000000 +1000 +++ sane-backends-1.0.21/backend/gphoto2.c 2010-04-05 23:18:04.000000000 +1000 @@ -77,7 +77,7 @@ ***************************************************************************/ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -85,15 +85,15 @@ #include #include #include -#include "sane/sanei_jpeg.h" +#include "../include/sane/sanei_jpeg.h" #include -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/saneopts.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" #define BACKEND_NAME gphoto2 -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" /* PSF 1/12/02 - gphoto2.h does a #include of config.h. We don't have * config.h by that name (we call it sane/config.h), so the #undef of @@ -663,7 +663,7 @@ DBG_INIT (); DBG (1, - "GPHOTO2 Backend $Id: gphoto2.c,v 1.34 2009-04-30 13:58:35 kitno-guest Exp $\n"); + "GPHOTO2 Backend $Id$\n"); if (getenv ("GP_DEBUG")) { diff -Nru sane-backends-1.0.20/backend/gt68xx.c sane-backends-1.0.21/backend/gt68xx.c --- sane-backends-1.0.20/backend/gt68xx.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/gt68xx.c 2010-04-05 23:18:04.000000000 +1000 @@ -2,6 +2,8 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002 - 2007 Henning Geinitz + Copyright (C) 2009 Stéphane Voltz for sheetfed + calibration code. This file is part of the SANE package. @@ -95,7 +97,7 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" #include "../include/sane/sane.h" #include "../include/sane/sanei.h" @@ -344,6 +346,7 @@ scan_request->calculate = SANE_FALSE; scan_request->lamp = SANE_TRUE; + scan_request->mbs = SANE_FALSE; if (strcmp (s->val[OPT_SOURCE].s, "Transparency Adapter") == 0) scan_request->use_ta = SANE_TRUE; @@ -638,7 +641,9 @@ s->val[OPT_QUALITY_CAL].w = SANE_TRUE; if (!debug_options) DISABLE (OPT_QUALITY_CAL); - if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) + /* we disable image correction for scanners that can't calibrate */ + if ((s->dev->model->flags & GT68XX_FLAG_SHEET_FED) + &&(!(s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE))) { s->val[OPT_QUALITY_CAL].w = SANE_FALSE; DISABLE (OPT_QUALITY_CAL); @@ -745,6 +750,75 @@ s->opt[OPT_BR_Y].constraint.range = &y_range; s->val[OPT_BR_Y].w = y_range.max; + /* sensor group */ + s->opt[OPT_SENSOR_GROUP].name = SANE_NAME_SENSORS; + s->opt[OPT_SENSOR_GROUP].title = SANE_TITLE_SENSORS; + s->opt[OPT_SENSOR_GROUP].desc = SANE_DESC_SENSORS; + s->opt[OPT_SENSOR_GROUP].type = SANE_TYPE_GROUP; + s->opt[OPT_SENSOR_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + /* calibration needed */ + s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration"; + s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Need calibration"); + s->opt[OPT_NEED_CALIBRATION_SW].desc = SANE_I18N ("The scanner needs calibration for the current settings"); + s->opt[OPT_NEED_CALIBRATION_SW].type = SANE_TYPE_BOOL; + s->opt[OPT_NEED_CALIBRATION_SW].unit = SANE_UNIT_NONE; + if (s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE) + s->opt[OPT_NEED_CALIBRATION_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + else + s->opt[OPT_NEED_CALIBRATION_SW].cap = SANE_CAP_INACTIVE; + s->val[OPT_NEED_CALIBRATION_SW].b = 0; + + /* document present sensor */ + s->opt[OPT_PAGE_LOADED_SW].name = SANE_NAME_PAGE_LOADED; + s->opt[OPT_PAGE_LOADED_SW].title = SANE_TITLE_PAGE_LOADED; + s->opt[OPT_PAGE_LOADED_SW].desc = SANE_DESC_PAGE_LOADED; + s->opt[OPT_PAGE_LOADED_SW].type = SANE_TYPE_BOOL; + s->opt[OPT_PAGE_LOADED_SW].unit = SANE_UNIT_NONE; + if (s->dev->model->command_set->document_present) + s->opt[OPT_PAGE_LOADED_SW].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + else + s->opt[OPT_PAGE_LOADED_SW].cap = SANE_CAP_INACTIVE; + s->val[OPT_PAGE_LOADED_SW].b = 0; + + /* button group */ + s->opt[OPT_BUTTON_GROUP].name = "Buttons"; + s->opt[OPT_BUTTON_GROUP].title = SANE_I18N ("Buttons"); + s->opt[OPT_BUTTON_GROUP].desc = SANE_I18N ("Buttons"); + s->opt[OPT_BUTTON_GROUP].type = SANE_TYPE_GROUP; + s->opt[OPT_BUTTON_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + /* calibrate button */ + s->opt[OPT_CALIBRATE].name = "calibrate"; + s->opt[OPT_CALIBRATE].title = SANE_I18N ("Calibrate"); + s->opt[OPT_CALIBRATE].desc = + SANE_I18N ("Start calibration using special sheet"); + s->opt[OPT_CALIBRATE].type = SANE_TYPE_BUTTON; + s->opt[OPT_CALIBRATE].unit = SANE_UNIT_NONE; + if (s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE) + s->opt[OPT_CALIBRATE].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; + else + s->opt[OPT_CALIBRATE].cap = SANE_CAP_INACTIVE; + s->val[OPT_CALIBRATE].b = 0; + + /* clear calibration cache button */ + s->opt[OPT_CLEAR_CALIBRATION].name = "clear"; + s->opt[OPT_CLEAR_CALIBRATION].title = SANE_I18N ("Clear calibration"); + s->opt[OPT_CLEAR_CALIBRATION].desc = SANE_I18N ("Clear calibration cache"); + s->opt[OPT_CLEAR_CALIBRATION].type = SANE_TYPE_BUTTON; + s->opt[OPT_CLEAR_CALIBRATION].unit = SANE_UNIT_NONE; + if (s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE) + s->opt[OPT_CLEAR_CALIBRATION].cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; + else + s->opt[OPT_CLEAR_CALIBRATION].cap = SANE_CAP_INACTIVE; + s->val[OPT_CLEAR_CALIBRATION].b = 0; + + RIE (calc_parameters (s)); DBG (5, "init_options: exit\n"); @@ -1157,6 +1231,7 @@ if (i == 0) DBG (5, "sane_init: can't set model name %s, set device " "first\n", word); + free (word); } else { @@ -1195,6 +1270,7 @@ if (i == 0) DBG (5, "sane_init: can't override model to %s, set device " "first\n", word); + free (word); } else { @@ -1321,18 +1397,31 @@ if (devicename[0]) { - for (dev = first_dev; dev; dev = dev->next) - if (strcmp (dev->file_name, devicename) == 0) - break; - - if (!dev) + /* test for gt68xx short hand name */ + if(strcmp(devicename,"gt68xx")!=0) { - DBG (5, "sane_open: couldn't find `%s' in devlist, trying attach\n", - devicename); - RIE (attach (devicename, &dev, SANE_TRUE)); + for (dev = first_dev; dev; dev = dev->next) + if (strcmp (dev->file_name, devicename) == 0) + break; + + if (!dev) + { + DBG (5, "sane_open: couldn't find `%s' in devlist, trying attach\n", + devicename); + RIE (attach (devicename, &dev, SANE_TRUE)); + } + else + DBG (5, "sane_open: found `%s' in devlist\n", dev->model->name); } else - DBG (5, "sane_open: found `%s' in devlist\n", dev->model->name); + { + dev = first_dev; + if (dev) + { + devicename = dev->file_name; + DBG (5, "sane_open: default empty devicename, using first device `%s'\n", devicename); + } + } } else { @@ -1438,9 +1527,17 @@ s->scanning = SANE_FALSE; s->first_scan = SANE_TRUE; s->gamma_table = 0; + s->calibrated = SANE_FALSE; RIE (init_options (s)); dev->gray_mode_color = 0x02; + /* try to restore calibration from file */ + if((s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE)) + { + /* error restoring calibration is non blocking */ + gt68xx_read_calibration(s); + } + DBG (5, "sane_open: exit\n"); return SANE_STATUS_GOOD; @@ -1477,6 +1574,13 @@ gt68xx_device_lamp_control (s->dev, SANE_FALSE, SANE_FALSE); dev = s->dev; + + free (s->val[OPT_MODE].s); + free (s->val[OPT_GRAY_MODE_COLOR].s); + free (s->val[OPT_SOURCE].s); + free (dev->file_name); + free (s->opt[OPT_RESOLUTION].constraint.word_list); + gt68xx_scanner_free (s); gt68xx_device_fix_descriptor (dev); @@ -1504,7 +1608,7 @@ SANE_Action action, void *val, SANE_Int * info) { GT68xx_Scanner *s = handle; - SANE_Status status; + SANE_Status status = SANE_STATUS_GOOD; SANE_Word cap; SANE_Int myinfo = 0; @@ -1570,6 +1674,12 @@ case OPT_SOURCE: strcpy (val, s->val[option].s); break; + case OPT_NEED_CALIBRATION_SW: + *(SANE_Bool *) val = !s->calibrated; + break; + case OPT_PAGE_LOADED_SW: + s->dev->model->command_set->document_present (s->dev, val); + break; default: DBG (2, "sane_control_option: can't get unknown option %d\n", option); @@ -1703,6 +1813,16 @@ myinfo |= SANE_INFO_RELOAD_OPTIONS; break; + case OPT_CALIBRATE: + status = gt68xx_sheetfed_scanner_calibrate (s); + myinfo |= SANE_INFO_RELOAD_OPTIONS; + break; + + case OPT_CLEAR_CALIBRATION: + gt68xx_clear_calibration (s); + myinfo |= SANE_INFO_RELOAD_OPTIONS; + break; + default: DBG (2, "sane_control_option: can't set unknown option %d\n", option); @@ -1718,7 +1838,7 @@ *info = myinfo; DBG (5, "sane_control_option: exit\n"); - return SANE_STATUS_GOOD; + return status; } SANE_Status @@ -1754,6 +1874,7 @@ SANE_Status status; SANE_Int i, gamma_size; unsigned int *buffer_pointers[3]; + SANE_Bool document; DBG (5, "sane_start: start\n"); @@ -1808,7 +1929,11 @@ #endif } - s->calib = s->val[OPT_QUALITY_CAL].w; + if(!(s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE)) + { + s->calib = s->val[OPT_QUALITY_CAL].w; + } + if (!(s->dev->model->flags & GT68XX_FLAG_NO_STOP)) RIE (gt68xx_device_stop_scan (s->dev)); @@ -1833,9 +1958,62 @@ else scan_request.backtrack_lines = 0; - RIE (gt68xx_scanner_calibrate (s, &scan_request)); - + /* don't call calibration for scanners that use sheetfed_calibrate */ + if(!(s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE)) + { + RIE (gt68xx_scanner_calibrate (s, &scan_request)); + } + else + { + s->calib = s->calibrated; + } + + /* is possible, wait for document to be inserted before scanning */ + /* wait for 5 secondes max */ + if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED + && s->dev->model->command_set->document_present) + { + i=0; + do + { + RIE(s->dev->model->command_set->document_present(s->dev,&document)); + if(document==SANE_FALSE) + { + i++; + sleep(1); + } + } while ((i<5) && (document==SANE_FALSE)); + if(document==SANE_FALSE) + { + DBG (4, "sane_start: no doucment detected after %d s\n",i); + return SANE_STATUS_NO_DOCS; + } + } + + /* some sheetfed scanners need a special operation to move + * paper before starting real scan */ + if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) + { + RIE (gt68xx_sheetfed_move_to_scan_area (s, &scan_request)); + } + + /* restore calibration */ + if( (s->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE) + &&(s->calibrated == SANE_TRUE)) + { + /* compute scan parameters */ + scan_request.calculate = SANE_TRUE; + gt68xx_device_setup_scan (s->dev, &scan_request, SA_SCAN, &scan_params); + + /* restore settings from calibration stored */ + memcpy(s->dev->afe,&(s->afe_params), sizeof(GT68xx_AFE_Parameters)); + RIE (gt68xx_assign_calibration (s, scan_params)); + scan_request.calculate = SANE_FALSE; + } + + /* send scan request to the scanner */ RIE (gt68xx_scanner_start_scan (s, &scan_request, &scan_params)); + for (i = 0; i < scan_params.overscan_lines; ++i) RIE (gt68xx_scanner_read_line (s, buffer_pointers)); DBG (4, "sane_start: wanted: dpi=%d, x=%.1f, y=%.1f, width=%.1f, " diff -Nru sane-backends-1.0.20/backend/gt68xx.conf.in sane-backends-1.0.21/backend/gt68xx.conf.in --- sane-backends-1.0.20/backend/gt68xx.conf.in 2009-03-18 00:10:08.000000000 +1100 +++ sane-backends-1.0.21/backend/gt68xx.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -189,6 +189,10 @@ #model "Scanalizer Professional 2.5" ############################################################################## +# Iriscan Express 2 +usb 0x07b3 0x045f + +############################################################################## # Autodetect NeatReceipts Mobile Scanner usb 0x07b3 0x0462 diff -Nru sane-backends-1.0.20/backend/gt68xx_devices.c sane-backends-1.0.21/backend/gt68xx_devices.c --- sane-backends-1.0.20/backend/gt68xx_devices.c 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_devices.c 2010-04-05 23:18:04.000000000 +1000 @@ -85,7 +85,9 @@ gt68xx_generic_setup_scan, gt68xx_generic_set_afe, gt68xx_generic_set_exposure_time, - gt68xx_generic_get_id + gt68xx_generic_get_id, + /* gt68xx_generic_move_paper */ NULL, + /* gt6816_document_present */ NULL }; static GT68xx_Command_Set mustek_gt6816_sheetfed_command_set = { @@ -124,7 +126,9 @@ gt68xx_generic_setup_scan, gt68xx_generic_set_afe, gt68xx_generic_set_exposure_time, - gt68xx_generic_get_id + gt68xx_generic_get_id, + gt68xx_generic_move_paper, + gt6816_document_present }; static GT68xx_Command_Set mustek_gt6801_command_set = { @@ -164,7 +168,9 @@ gt68xx_generic_setup_scan, gt68xx_generic_set_afe, gt68xx_generic_set_exposure_time, - gt68xx_generic_get_id + gt68xx_generic_get_id, + /* gt68xx_generic_move_paper */ NULL, + /* gt6816_document_present */ NULL }; static GT68xx_Command_Set plustek_gt6801_command_set = { @@ -203,7 +209,9 @@ gt68xx_generic_setup_scan, gt68xx_generic_set_afe, /* set_exposure_time */ NULL, - gt68xx_generic_get_id + gt68xx_generic_get_id, + /* gt68xx_generic_move_paper */ NULL, + /* gt6816_document_present */ NULL }; static GT68xx_Model unknown_model = { @@ -1548,6 +1556,56 @@ /* Tested by hmg */ }; +static GT68xx_Model iriscan_express_2_model = { + "iriscan-express-2", /* Name */ + "Iris", /* Device vendor string */ + "Iriscan Express 2", /* Device model name */ + "cism216.fw", /* Name of the firmware file */ + SANE_FALSE, /* Dynamic allocation flag */ + + &mustek_gt6816_sheetfed_command_set, /* Command set used by this scanner */ + + 600, /* maximum optical sensor resolution */ + 1200, /* maximum motor resolution */ + 600, /* base x-res used to calculate geometry */ + 600, /* base y-res used to calculate geometry */ + 1200, /* if ydpi is equal or higher, disable backtracking */ + SANE_FALSE, /* Use base_ydpi for all resolutions */ + + /* values based on analyze of the firmware */ + {600, 400, 300, 200, 150, 100, 50, 0}, /* possible x-resolutions */ + {1200, 600, 400, 300, 200, 150, 100, 50, 0}, /* possible y-resolutions */ + {16, 8, 0}, /* possible depths in gray mode */ + {16, 8, 0}, /* possible depths in color mode */ + + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.5), /* Start of scan area in mm (y) */ + SANE_FIX (218.0), /* Size of scan area in mm (x) */ + SANE_FIX (299.0), /* Size of scan area in mm (y) */ + + SANE_FIX (18.0), /* Start of white strip in mm (y) */ + SANE_FIX (21.72), /* Start of black mark in mm (x) */ + + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ + SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */ + SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */ + + SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */ + + 0, 0, 0, /* RGB CCD Line-distance correction in pixel */ + 0, /* CCD distcance for CCD with 6 lines) */ + + COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */ + {0x22, 0x0c, 0x22, 0x0a, 0x24, 0x09}, /* Default offset/gain */ + {0x157, 0x157, 0x157}, /* Default exposure parameters */ + SANE_FIX (2.0), /* Default gamma value */ + + SANE_TRUE, /* Is this a CIS scanner? */ + GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_SHEET_FED | GT68XX_FLAG_OFFSET_INV | GT68XX_FLAG_HAS_CALIBRATE +}; + + static GT68xx_Model plustek_opticslim_m12_model = { "plustek-opticslim-m12", /* Name */ "Plustek", /* Device vendor string */ @@ -1564,18 +1622,18 @@ 1200, /* if ydpi is equal or higher, disable backtracking */ SANE_FALSE, /* Use base_ydpi for all resolutions */ - {600, 300, 200, 150, 100, 0}, /* possible x-resolutions */ - {600, 300, 200, 150, 100, 0}, /* possible y-resolutions */ + {600, 400, 300, 200, 150, 100, 50, 0}, /* possible x-resolutions */ + {1200, 600, 400, 300, 200, 150, 100, 50, 0}, /* possible y-resolutions */ {16, 8, 0}, /* possible depths in gray mode */ {16, 8, 0}, /* possible depths in color mode */ - SANE_FIX (1.0), /* Start of scan area in mm (x) */ - SANE_FIX (9.5), /* Start of scan area in mm (y) */ + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.5), /* Start of scan area in mm (y) */ SANE_FIX (218.0), /* Size of scan area in mm (x) */ SANE_FIX (299.0), /* Size of scan area in mm (y) */ - SANE_FIX (10.0), /* Start of white strip in mm (y) */ - SANE_FIX (140.0), /* Start of black mark in mm (x) */ + SANE_FIX (18.0), /* Start of white strip in mm (y) */ + SANE_FIX (21.72), /* Start of black mark in mm (x) */ SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ @@ -1593,7 +1651,7 @@ SANE_FIX (2.0), /* Default gamma value */ SANE_TRUE, /* Is this a CIS scanner? */ - GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_SHEET_FED + GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_SHEET_FED | GT68XX_FLAG_OFFSET_INV | GT68XX_FLAG_HAS_CALIBRATE }; static GT68xx_Model genius_sf600_model = { @@ -1617,13 +1675,13 @@ {16, 8, 0}, /* possible depths in gray mode */ {16, 8, 0}, /* possible depths in color mode */ - SANE_FIX (1.0), /* Start of scan area in mm (x) */ - SANE_FIX (9.5), /* Start of scan area in mm (y) */ + SANE_FIX (0.0), /* Start of scan area in mm (x) */ + SANE_FIX (1.5), /* Start of scan area in mm (y) */ SANE_FIX (218.0), /* Size of scan area in mm (x) */ SANE_FIX (299.0), /* Size of scan area in mm (y) */ - SANE_FIX (10.0), /* Start of white strip in mm (y) */ - SANE_FIX (140.0), /* Start of black mark in mm (x) */ + SANE_FIX (18.0), /* Start of white strip in mm (y) */ + SANE_FIX (21.72), /* Start of black mark in mm (x) */ SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */ SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */ @@ -1641,7 +1699,7 @@ SANE_FIX (2.0), /* Default gamma value */ SANE_TRUE, /* Is this a CIS scanner? */ - GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_SHEET_FED | GT68XX_FLAG_UNTESTED + GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_UNTESTED | GT68XX_FLAG_SHEET_FED | GT68XX_FLAG_OFFSET_INV | GT68XX_FLAG_HAS_CALIBRATE | GT68XX_FLAG_NO_STOP }; /* Untested but should work according to Ryan Reading . Based on Plustek M12 */ @@ -1874,6 +1932,7 @@ {0x07b3, 0x0412, &plustek_opticslim_m12_model}, {0x07b3, 0x0413, &plustek_opticslim1200_model}, {0x07b3, 0x0422, &plustek_opticslim2400_model}, + {0x07b3, 0x045f, &iriscan_express_2_model}, {0x0458, 0x2011, &genius_vivid3x_model}, {0x0458, 0x2014, &genius_vivid4_model}, {0x0458, 0x2017, &genius_vivid3xe_model}, diff -Nru sane-backends-1.0.20/backend/gt68xx_generic.c sane-backends-1.0.21/backend/gt68xx_generic.c --- sane-backends-1.0.20/backend/gt68xx_generic.c 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_generic.c 2010-04-05 23:18:04.000000000 +1000 @@ -635,7 +635,45 @@ params->scan_bpl = scan_bpl; params->line_mode = line_mode; params->overscan_lines = overscan_lines; + params->pixel_x0 = pixel_x0; DBG (6, "gt68xx_generic_setup_scan: leave: ok\n"); return SANE_STATUS_GOOD; } + +SANE_Status +gt68xx_generic_move_paper (GT68xx_Device * dev, + GT68xx_Scan_Request * request) +{ + GT68xx_Packet req; + SANE_Status status; + SANE_Int ydpi; + SANE_Int pixel_y0; + SANE_Int abs_y0, base_ydpi; + GT68xx_Model *model = dev->model; + + ydpi = request->ydpi; + base_ydpi = model->base_ydpi; + + if (ydpi > model->base_ydpi) + ydpi = base_ydpi; + + pixel_y0 = + SANE_UNFIX ((request->y0 + model->y_offset)) * ydpi / MM_PER_INCH + 0.5; + abs_y0 = pixel_y0 * base_ydpi / ydpi; + + DBG (6, "gt68xx_generic_move_paper: base_ydpi=%d\n", base_ydpi); + DBG (6, "gt68xx_generic_move_paper: ydpi=%d\n", ydpi); + DBG (6, "gt68xx_generic_move_paper: abs_y0=%d\n", abs_y0); + + /* paper move request */ + memset (req, 0, sizeof (req)); + req[0] = 0x82; + req[1] = 0x01; + req[2] = LOBYTE (abs_y0); + req[3] = HIBYTE (abs_y0); + RIE (gt68xx_device_req (dev, req, req)); + + DBG (6, "gt68xx_generic_move_paper: leave: ok\n"); + return SANE_STATUS_GOOD; +} diff -Nru sane-backends-1.0.20/backend/gt68xx_generic.h sane-backends-1.0.21/backend/gt68xx_generic.h --- sane-backends-1.0.20/backend/gt68xx_generic.h 2005-09-30 04:22:30.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_generic.h 2010-04-05 23:18:04.000000000 +1000 @@ -68,5 +68,8 @@ GT68xx_Scan_Request * request, GT68xx_Scan_Action action, GT68xx_Scan_Parameters * params); +static SANE_Status +gt68xx_generic_move_paper (GT68xx_Device * dev, + GT68xx_Scan_Request * request); #endif /* not GT68XX_GENERIC_H */ diff -Nru sane-backends-1.0.20/backend/gt68xx_gt6816.c sane-backends-1.0.21/backend/gt68xx_gt6816.c --- sane-backends-1.0.20/backend/gt68xx_gt6816.c 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_gt6816.c 2010-04-05 23:18:04.000000000 +1000 @@ -236,3 +236,28 @@ return gt68xx_device_small_req (dev, req, req); } + +SANE_Status +gt6816_document_present (GT68xx_Device * dev, SANE_Bool * present) +{ + SANE_Status status; + GT68xx_Packet req; + + memset (req, 0, sizeof (req)); + req[0] = 0x59; + req[1] = 0x01; + + RIE (gt68xx_device_req (dev, req, req)); + + if (req[0] == 0x00 && req[1] == 0x59) + { + if (req[2] == 0) + *present = SANE_FALSE; + else + *present = SANE_TRUE; + } + else + return SANE_STATUS_IO_ERROR; + + return SANE_STATUS_GOOD; +} diff -Nru sane-backends-1.0.20/backend/gt68xx_gt6816.h sane-backends-1.0.21/backend/gt68xx_gt6816.h --- sane-backends-1.0.20/backend/gt68xx_gt6816.h 2005-05-21 03:21:55.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_gt6816.h 2010-04-05 23:18:04.000000000 +1000 @@ -67,4 +67,6 @@ static SANE_Status gt6816_stop_scan (GT68xx_Device * dev); +static SANE_Status gt6816_document_present (GT68xx_Device * dev, SANE_Bool * present); + #endif /* not GT68XX_GT6816_H */ diff -Nru sane-backends-1.0.20/backend/gt68xx_high.c sane-backends-1.0.21/backend/gt68xx_high.c --- sane-backends-1.0.20/backend/gt68xx_high.c 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_high.c 2010-04-05 23:18:04.000000000 +1000 @@ -3,6 +3,8 @@ Copyright (C) 2002 Sergey Vlasov AFE offset/gain setting by David Stevenson Copyright (C) 2002 - 2007 Henning Geinitz + Copyright (C) 2009 Stéphane Voltz for sheetfed + calibration code. This file is part of the SANE package. @@ -324,6 +326,7 @@ gt68xx_scanner_new (GT68xx_Device * dev, GT68xx_Scanner ** scanner_return) { GT68xx_Scanner *scanner; + int i; *scanner_return = NULL; @@ -341,6 +344,15 @@ scanner->cal_g = NULL; scanner->cal_b = NULL; + for(i=0;icalibrations[i].dpi = 0; + scanner->calibrations[i].red = NULL; + scanner->calibrations[i].green = NULL; + scanner->calibrations[i].blue = NULL; + scanner->calibrations[i].gray = NULL; + } + *scanner_return = scanner; return SANE_STATUS_GOOD; } @@ -376,6 +388,8 @@ SANE_Status gt68xx_scanner_free (GT68xx_Scanner * scanner) { + int i; + if (!scanner) { DBG (5, "gt68xx_scanner_free: scanner==NULL\n"); @@ -390,6 +404,28 @@ gt68xx_scanner_free_calibrators (scanner); + /* free in memory calibration data */ + for (i = 0; i < MAX_RESOLUTIONS; i++) + { + scanner->calibrations[i].dpi = 0; + if (scanner->calibrations[i].red != NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].red); + } + if (scanner->calibrations[i].green != NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].green); + } + if (scanner->calibrations[i].blue != NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].blue); + } + if (scanner->calibrations[i].gray != NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].gray); + } + } + free (scanner); return SANE_STATUS_GOOD; @@ -525,7 +561,7 @@ } if (scanner->dev->model->is_cis - && !(scanner->dev->model->flags & GT68XX_FLAG_SHEET_FED)) + && !((scanner->dev->model->flags & GT68XX_FLAG_SHEET_FED) && scanner->calibrated == SANE_FALSE)) { status = gt68xx_device_set_exposure_time (scanner->dev, @@ -1883,15 +1919,15 @@ r_gbuffer, g_gbuffer, b_gbuffer)); if (!red_done) red_done = - gt68xx_afe_cis_adjust_exposure ("red", &values, r_gbuffer, 248, + gt68xx_afe_cis_adjust_exposure ("red", &values, r_gbuffer, 245, &exposure->r_time); if (!green_done) green_done = - gt68xx_afe_cis_adjust_exposure ("green", &values, g_gbuffer, 248, + gt68xx_afe_cis_adjust_exposure ("green", &values, g_gbuffer, 245, &exposure->g_time); if (!blue_done) blue_done = - gt68xx_afe_cis_adjust_exposure ("blue", &values, b_gbuffer, 248, + gt68xx_afe_cis_adjust_exposure ("blue", &values, b_gbuffer, 245, &exposure->b_time); exposure_count++; total_count++; @@ -1901,6 +1937,15 @@ if (!red_done || !green_done || !blue_done) DBG (0, "gt68xx_afe_cis_auto: setting exposure reached limit\n"); + /* store afe calibration when needed */ + if(scanner->dev->model->flags & GT68XX_FLAG_HAS_CALIBRATE) + { + memcpy(&(scanner->afe_params), afe, sizeof(GT68xx_AFE_Parameters)); + scanner->exposure_params.r_time=exposure->r_time; + scanner->exposure_params.g_time=exposure->g_time; + scanner->exposure_params.b_time=exposure->b_time; + } + free (r_gbuffer); free (g_gbuffer); free (b_gbuffer); @@ -1912,5 +1957,788 @@ return SANE_STATUS_GOOD; } +/** @brief create and copy calibrator + * Creates a calibrator of the given width and copy data from reference + * to initialize it + * @param calibator pointer to the calibrator to create + * @param reference calibrator with reference data to copy + * @param width the width in pixels of the calibrator + * @param offset offset in pixels when copying data from reference + * @return SANE_STATUS_GOOD and a filled calibrator if enough memory + */ +static SANE_Status +gt68xx_calibrator_create_copy (GT68xx_Calibrator ** calibrator, + GT68xx_Calibrator * reference, int width, + int offset) +{ + SANE_Status status; + int i; + + if (reference == NULL) + { + DBG (1, "gt68xx_calibrator_create_copy: NULL reference, skipping...\n"); + *calibrator = NULL; + return SANE_STATUS_GOOD; + } + /* check for reference overflow */ + if(width+offset>reference->width) + { + DBG (1, "gt68xx_calibrator_create_copy: required with and offset exceed reference width\n"); + return SANE_STATUS_INVAL; + } + + status = gt68xx_calibrator_new (width, 65535, calibrator); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_calibrator_create_copy: failed to create calibrator: %s\n", + sane_strstatus (status)); + return status; + } + + for(i=0;ik_white[i]=reference->k_white[i+offset]; + (*calibrator)->k_black[i]=reference->k_black[i+offset]; + (*calibrator)->white_line[i]=reference->white_line[i+offset]; + (*calibrator)->black_line[i]=reference->black_line[i+offset]; + } + + return status; +} + +static SANE_Status +gt68xx_sheetfed_move_to_scan_area (GT68xx_Scanner * scanner, + GT68xx_Scan_Request * request) +{ + SANE_Status status; + + if (!(scanner->dev->model->flags & GT68XX_FLAG_SHEET_FED) + || scanner->dev->model->command_set->move_paper == NULL) + return SANE_STATUS_GOOD; + + /* send move paper command */ + RIE (scanner->dev->model->command_set->move_paper (scanner->dev, request)); + + /* wait until paper is set to the desired position */ + return gt68xx_scanner_wait_for_positioning (scanner); +} + +/**< number of consecutive white line to detect a white area */ +#define WHITE_LINES 2 + +/** @brief calibrate sheet fed scanner + * This function calibrates sheet fed scanner by scanning a calibration + * target (which may be a blank page). It first move to a white area then + * does afe and exposure calibration. Then it scans white lines to get data + * for shading correction. + * @param scanner structure describing the frontend session and the device + * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL + * otherwise. + */ +static SANE_Status +gt68xx_sheetfed_scanner_calibrate (GT68xx_Scanner * scanner) +{ + SANE_Status status; + GT68xx_Scan_Request request; + GT68xx_Scan_Parameters params; + int count, i, x, y, white; + unsigned int *buffer_pointers[3]; +#ifdef DEBUG_CALIBRATION + FILE *fcal; + char title[50]; +#endif + + DBG (3, "gt68xx_sheetfed_scanner_calibrate: start.\n"); + + /* clear calibration if needed */ + gt68xx_scanner_free_calibrators (scanner); + for (i = 0; i < MAX_RESOLUTIONS; i++) + { + if(scanner->calibrations[i].red!=NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].red); + } + if(scanner->calibrations[i].green!=NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].green); + } + if(scanner->calibrations[i].blue!=NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].blue); + } + if(scanner->calibrations[i].gray!=NULL) + { + gt68xx_calibrator_free (scanner->calibrations[i].gray); + } + } + scanner->calibrated = SANE_FALSE; + + /* find minimum horizontal resolution */ + request.xdpi = 9600; + for (i = 0; scanner->dev->model->xdpi_values[i] != 0; i++) + { + if (scanner->dev->model->xdpi_values[i] < request.xdpi) + { + request.xdpi = scanner->dev->model->xdpi_values[i]; + request.ydpi = scanner->dev->model->xdpi_values[i]; + } + } + + /* move to white area SA_CALIBRATE uses its own y0/ys fixed values */ + request.x0 = 0; + request.y0 = scanner->dev->model->y_offset_calib; + request.xs = scanner->dev->model->x_size; + request.depth = 8; + + request.color = SANE_FALSE; + request.mbs = SANE_TRUE; + request.mds = SANE_TRUE; + request.mas = SANE_FALSE; + request.lamp = SANE_TRUE; + request.calculate = SANE_FALSE; + request.use_ta = SANE_FALSE; + request.backtrack = SANE_FALSE; + request.backtrack_lines = 0; + + /* skip start of calibration sheet */ + status = gt68xx_sheetfed_move_to_scan_area (scanner, &request); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: failed to skip start of calibration sheet %s\n", + sane_strstatus (status)); + return status; + } + + status = gt68xx_device_lamp_control (scanner->dev, SANE_FALSE, SANE_TRUE); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: gt68xx_device_lamp_control returned %s\n", + sane_strstatus (status)); + return status; + } + + /* loop until we find a white area to calibrate on */ + i = 0; + request.y0 = 0; + do + { + /* start scan */ + status = + gt68xx_scanner_start_scan_extended (scanner, &request, SA_CALIBRATE, + ¶ms); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: gt68xx_scanner_start_scan_extended returned %s\n", + sane_strstatus (status)); + return status; + } + + /* loop until we find WHITE_LINES consecutive white lines or we reach and of area */ + white = 0; + y = 0; + do + { + status = gt68xx_line_reader_read (scanner->reader, buffer_pointers); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: gt68xx_line_reader_read returned %s\n", + sane_strstatus (status)); + gt68xx_scanner_stop_scan (scanner); + return status; + } + + /* check for white line */ + count = 0; + for (x = 0; x < params.pixel_xs; x++) + { + if (((buffer_pointers[0][x] >> 8) & 0xff) > 50) + { + count++; + } + } + + /* line is white if 93% is above black level */ + if ((100 * count) / params.pixel_xs < 93) + { + white = 0; + } + else + { + white++; + } + y++; + } + while ((white < WHITE_LINES) && (y < params.pixel_ys)); + + /* end scan */ + gt68xx_scanner_stop_scan (scanner); + + i++; + } + while (i < 20 && white < WHITE_LINES); + + /* check if we found a white area */ + if (white != WHITE_LINES) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: didn't find a white area\n"); + return SANE_STATUS_INVAL; + } + + /* now do calibration */ + scanner->auto_afe = SANE_TRUE; + scanner->calib = SANE_TRUE; + + /* loop at each possible xdpi to create calibrators */ + i = 0; + while (scanner->dev->model->xdpi_values[i] > 0) + { + request.xdpi = scanner->dev->model->xdpi_values[i]; + request.ydpi = scanner->dev->model->xdpi_values[i]; + request.x0 = 0; + request.y0 = 0; + request.xs = scanner->dev->model->x_size; + request.color = SANE_FALSE; + request.mbs = SANE_FALSE; + request.mds = SANE_TRUE; + request.mas = SANE_FALSE; + request.lamp = SANE_TRUE; + request.calculate = SANE_FALSE; + request.use_ta = SANE_FALSE; + request.backtrack = SANE_FALSE; + request.backtrack_lines = 0; + + /* calibrate in color */ + request.color = SANE_TRUE; + status = gt68xx_scanner_calibrate (scanner, &request); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: gt68xx_scanner_calibrate returned %s\n", + sane_strstatus (status)); + return status; + } + + /* since auto afe is done at a fixed resolution, we don't need to + * do each each time, once is enough */ + scanner->auto_afe = SANE_FALSE; + + /* allocate and save per dpi calibrators */ + scanner->calibrations[i].dpi = request.xdpi; + + /* recompute params */ + request.calculate = SANE_TRUE; + gt68xx_device_setup_scan (scanner->dev, &request, SA_SCAN, ¶ms); + + scanner->calibrations[i].pixel_x0 = params.pixel_x0; + status = + gt68xx_calibrator_create_copy (&(scanner->calibrations[i].red), + scanner->cal_r, scanner->cal_r->width, + 0); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: failed to create red calibrator: %s\n", + sane_strstatus (status)); + return status; + } + + status = + gt68xx_calibrator_create_copy (&(scanner->calibrations[i].green), + scanner->cal_g, scanner->cal_g->width, + 0); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: failed to create green calibrator: %s\n", + sane_strstatus (status)); + return status; + } + + status = + gt68xx_calibrator_create_copy (&(scanner->calibrations[i].blue), + scanner->cal_b, scanner->cal_b->width, + 0); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: failed to create blue calibrator: %s\n", + sane_strstatus (status)); + return status; + } + + /* calibrate in gray */ + request.color = SANE_FALSE; + status = gt68xx_scanner_calibrate (scanner, &request); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: gt68xx_scanner_calibrate returned %s\n", + sane_strstatus (status)); + return status; + } + + if (scanner->cal_gray) + { + status = + gt68xx_calibrator_create_copy (&(scanner->calibrations[i].gray), + scanner->cal_gray, + scanner->cal_gray->width, 0); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_sheetfed_scanner_calibrate: failed to create gray calibrator: %s\n", + sane_strstatus (status)); + return status; + } + } + +#ifdef DEBUG_CALIBRATION + sprintf (title, "cal-%03d-red.pnm", scanner->calibrations[i].dpi); + fcal = fopen (title, "wb"); + if (fcal != NULL) + { + fprintf (fcal, "P5\n%d 1\n255\n", params.pixel_xs); + for (x = 0; x < params.pixel_xs; x++) + fputc ((scanner->calibrations[i].red->k_white[x] >> 8) & 0xff, + fcal); + fclose (fcal); + } + sprintf (title, "cal-%03d-green.pnm", scanner->calibrations[i].dpi); + fcal = fopen (title, "wb"); + if (fcal != NULL) + { + fprintf (fcal, "P5\n%d 1\n255\n", params.pixel_xs); + for (x = 0; x < params.pixel_xs; x++) + fputc ((scanner->calibrations[i].green->k_white[x] >> 8) & 0xff, + fcal); + fclose (fcal); + } + sprintf (title, "cal-%03d-blue.pnm", scanner->calibrations[i].dpi); + fcal = fopen (title, "wb"); + if (fcal != NULL) + { + fprintf (fcal, "P5\n%d 1\n255\n", params.pixel_xs); + for (x = 0; x < params.pixel_xs; x++) + fputc ((scanner->calibrations[i].blue->k_white[x] >> 8) & 0xff, + fcal); + fclose (fcal); + } +#endif + + /* next resolution */ + i++; + } + + scanner->calibrated = SANE_TRUE; + + /* eject calibration target from feeder */ + gt68xx_device_paperfeed (scanner->dev); + + /* save calibration to file */ + gt68xx_write_calibration (scanner); + + DBG (3, "gt68xx_sheetfed_scanner_calibrate: end.\n"); + return SANE_STATUS_GOOD; +} + +/** @brief assign calibration for scan + * This function creates the calibrators and set up afe for the requested + * scan. It uses calibration data that has been created by + * gt68xx_sheetfed_scanner_calibrate. + * @param scanner structure describing the frontend session and the device + * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL + * otherwise. + */ +static SANE_Status +gt68xx_assign_calibration (GT68xx_Scanner * scanner, + GT68xx_Scan_Parameters params) +{ + int i, dpi, offset; + SANE_Status status = SANE_STATUS_GOOD; + + DBG (3, "gt68xx_assign_calibration: start.\n"); + + dpi = params.xdpi; + DBG (4, "gt68xx_assign_calibration: searching calibration for %d dpi\n", + dpi); + + /* search matching dpi */ + i = 0; + while (scanner->calibrations[i].dpi > 0 + && scanner->calibrations[i].dpi != dpi) + { + i++; + } + + /* check if found a match */ + if (scanner->calibrations[i].dpi == 0) + { + DBG (4, + "gt68xx_assign_calibration: failed to find calibration for %d dpi\n", + dpi); + return SANE_STATUS_INVAL; + } + DBG (4, "gt68xx_assign_calibration: using entry %d for %d dpi\n", i, dpi); + + DBG (5, + "gt68xx_assign_calibration: using scan_parameters: pixel_x0=%d, pixel_xs=%d \n", + params.pixel_x0, params.pixel_xs); + + /* AFE/exposure data copy */ + memcpy (scanner->dev->afe, &(scanner->afe_params), + sizeof (GT68xx_AFE_Parameters)); + scanner->dev->exposure->r_time = scanner->exposure_params.r_time; + scanner->dev->exposure->g_time = scanner->exposure_params.g_time; + scanner->dev->exposure->b_time = scanner->exposure_params.b_time; + + /* free calibrators if needed */ + gt68xx_scanner_free_calibrators (scanner); + + /* TODO compute offset based on the x0 value from scan_request */ + offset = params.pixel_x0 - scanner->calibrations[i].pixel_x0; + + /* calibrator allocation and copy */ + if (scanner->calibrations[i].red!=NULL) + { + status = + gt68xx_calibrator_create_copy (&(scanner->cal_r), + scanner->calibrations[i].red, + params.pixel_xs, + offset); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_assign_calibration: failed to create calibrator: %s\n", + sane_strstatus (status)); + return status; + } + } + + if (scanner->calibrations[i].green!=NULL) + { + status = + gt68xx_calibrator_create_copy (&(scanner->cal_g), + scanner->calibrations[i].green, + params.pixel_xs, + offset); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_assign_calibration: failed to create calibrator: %s\n", + sane_strstatus (status)); + return status; + } + } + + if (scanner->calibrations[i].blue!=NULL) + { + status = + gt68xx_calibrator_create_copy (&(scanner->cal_b), + scanner->calibrations[i].blue, + params.pixel_xs, + offset); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_assign_calibration: failed to create calibrator: %s\n", + sane_strstatus (status)); + return status; + } + } + + if (scanner->calibrations[i].gray!=NULL) + { + status = + gt68xx_calibrator_create_copy (&(scanner->cal_gray), + scanner->calibrations[i].gray, + params.pixel_xs, + offset); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "gt68xx_assign_calibration: failed to create calibrator: %s\n", + sane_strstatus (status)); + return status; + } + } + + DBG (3, "gt68xx_assign_calibration: end.\n"); + return status; +} + +static char *gt68xx_calibration_file(GT68xx_Scanner * scanner) +{ + char *ptr=NULL; + char tmp_str[PATH_MAX]; + + ptr=getenv("HOME"); + if(ptr!=NULL) + { + sprintf (tmp_str, "%s/.sane/gt68xx-%s.cal", ptr, scanner->dev->model->name); + } + else + { + ptr=getenv("TMPDIR"); + if(ptr!=NULL) + { + sprintf (tmp_str, "%s/gt68xx-%s.cal", ptr, scanner->dev->model->name); + } + else + { + sprintf (tmp_str, "/tmp/gt68xx-%s.cal", scanner->dev->model->name); + } + } + DBG(5,"gt68xx_calibration_file: using >%s< for calibration file name\n",tmp_str); + return strdup(tmp_str); +} + +static SANE_Status +gt68xx_clear_calibration (GT68xx_Scanner * scanner) +{ + char *fname; + int i; + + if (scanner->calibrated == SANE_FALSE) + return SANE_STATUS_GOOD; + + /* clear file */ + fname = gt68xx_calibration_file (scanner); + unlink (fname); + free (fname); + + /* free calibrators */ + for (i = 0; i < MAX_RESOLUTIONS && scanner->calibrations[i].dpi > 0; i++) + { + scanner->calibrations[i].dpi = 0; + if (scanner->calibrations[i].red) + gt68xx_calibrator_free (scanner->calibrations[i].red); + if (scanner->calibrations[i].green) + gt68xx_calibrator_free (scanner->calibrations[i].green); + if (scanner->calibrations[i].blue) + gt68xx_calibrator_free (scanner->calibrations[i].blue); + if (scanner->calibrations[i].gray) + gt68xx_calibrator_free (scanner->calibrations[i].gray); + } + + /* reset flags */ + scanner->calibrated = SANE_FALSE; + scanner->val[OPT_QUALITY_CAL].w = SANE_FALSE; + scanner->val[OPT_NEED_CALIBRATION_SW].w = SANE_TRUE; + DBG (5, "gt68xx_clear_calibration: done\n"); + return SANE_STATUS_GOOD; +} + +static SANE_Status +gt68xx_write_calibration (GT68xx_Scanner * scanner) +{ + char *fname; + FILE *fcal; + int i; + SANE_Int nullwidth = 0; + + if (scanner->calibrated == SANE_FALSE) + { + return SANE_STATUS_GOOD; + } + + /* open file */ + fname = gt68xx_calibration_file (scanner); + fcal = fopen (fname, "wb"); + free (fname); + if (fcal == NULL) + { + DBG (1, + "gt68xx_write_calibration: failed to open calibration file for writing %s\n", + strerror (errno)); + return SANE_STATUS_IO_ERROR; + } + + /* TODO we save check endianness and word alignment in case of a home + * directory used trough different archs */ + fwrite (&(scanner->afe_params), sizeof (GT68xx_AFE_Parameters), 1, fcal); + fwrite (&(scanner->exposure_params), sizeof (GT68xx_Exposure_Parameters), 1, + fcal); + for (i = 0; i < MAX_RESOLUTIONS && scanner->calibrations[i].dpi > 0; i++) + { + DBG (1, "gt68xx_write_calibration: saving %d dpi calibration\n", + scanner->calibrations[i].dpi); + fwrite (&(scanner->calibrations[i].dpi), sizeof (SANE_Int), 1, fcal); + fwrite (&(scanner->calibrations[i].pixel_x0), sizeof (SANE_Int), 1, + fcal); + + fwrite (&(scanner->calibrations[i].red->width), sizeof (SANE_Int), 1, + fcal); + fwrite (&(scanner->calibrations[i].red->white_level), sizeof (SANE_Int), + 1, fcal); + fwrite (scanner->calibrations[i].red->k_white, sizeof (unsigned int), + scanner->calibrations[i].red->width, fcal); + fwrite (scanner->calibrations[i].red->k_black, sizeof (unsigned int), + scanner->calibrations[i].red->width, fcal); + fwrite (scanner->calibrations[i].red->white_line, sizeof (double), + scanner->calibrations[i].red->width, fcal); + fwrite (scanner->calibrations[i].red->black_line, sizeof (double), + scanner->calibrations[i].red->width, fcal); + + fwrite (&(scanner->calibrations[i].green->width), sizeof (SANE_Int), 1, + fcal); + fwrite (&(scanner->calibrations[i].green->white_level), + sizeof (SANE_Int), 1, fcal); + fwrite (scanner->calibrations[i].green->k_white, sizeof (unsigned int), + scanner->calibrations[i].green->width, fcal); + fwrite (scanner->calibrations[i].green->k_black, sizeof (unsigned int), + scanner->calibrations[i].green->width, fcal); + fwrite (scanner->calibrations[i].green->white_line, sizeof (double), + scanner->calibrations[i].green->width, fcal); + fwrite (scanner->calibrations[i].green->black_line, sizeof (double), + scanner->calibrations[i].green->width, fcal); + + fwrite (&(scanner->calibrations[i].blue->width), sizeof (SANE_Int), 1, + fcal); + fwrite (&(scanner->calibrations[i].blue->white_level), + sizeof (SANE_Int), 1, fcal); + fwrite (scanner->calibrations[i].blue->k_white, sizeof (unsigned int), + scanner->calibrations[i].blue->width, fcal); + fwrite (scanner->calibrations[i].blue->k_black, sizeof (unsigned int), + scanner->calibrations[i].blue->width, fcal); + fwrite (scanner->calibrations[i].blue->white_line, sizeof (double), + scanner->calibrations[i].blue->width, fcal); + fwrite (scanner->calibrations[i].blue->black_line, sizeof (double), + scanner->calibrations[i].blue->width, fcal); + + if (scanner->calibrations[i].gray != NULL) + { + fwrite (&(scanner->calibrations[i].gray->width), sizeof (SANE_Int), + 1, fcal); + fwrite (&(scanner->calibrations[i].gray->white_level), + sizeof (SANE_Int), 1, fcal); + fwrite (scanner->calibrations[i].gray->k_white, + sizeof (unsigned int), scanner->calibrations[i].gray->width, + fcal); + fwrite (scanner->calibrations[i].gray->k_black, + sizeof (unsigned int), scanner->calibrations[i].gray->width, + fcal); + fwrite (scanner->calibrations[i].gray->white_line, sizeof (double), + scanner->calibrations[i].gray->width, fcal); + fwrite (scanner->calibrations[i].gray->black_line, sizeof (double), + scanner->calibrations[i].gray->width, fcal); + } + else + { + fwrite (&nullwidth, sizeof (SANE_Int), 1, fcal); + } + } + DBG (5, "gt68xx_write_calibration: wrote %d calibrations\n", i); + + fclose (fcal); + return SANE_STATUS_GOOD; +} + +static SANE_Status +gt68xx_read_calibration (GT68xx_Scanner * scanner) +{ + char *fname; + FILE *fcal; + int i; + SANE_Int width, level; + + scanner->calibrated = SANE_FALSE; + fname = gt68xx_calibration_file (scanner); + fcal = fopen (fname, "rb"); + free (fname); + if (fcal == NULL) + { + DBG (1, + "gt68xx_read_calibration: failed to open calibration file for reading %s\n", + strerror (errno)); + return SANE_STATUS_IO_ERROR; + } + + /* TODO we should check endiannes and word alignment in case of a home + * directory used trough different archs */ + + /* TODO check for errors */ + fread (&(scanner->afe_params), sizeof (GT68xx_AFE_Parameters), 1, fcal); + fread (&(scanner->exposure_params), sizeof (GT68xx_Exposure_Parameters), 1, + fcal); + + /* loop on calibrators */ + i = 0; + fread (&(scanner->calibrations[i].dpi), sizeof (SANE_Int), 1, fcal); + while (!feof (fcal) && scanner->calibrations[i].dpi > 0) + { + fread (&(scanner->calibrations[i].pixel_x0), sizeof (SANE_Int), 1, + fcal); + + fread (&width, sizeof (SANE_Int), 1, fcal); + fread (&level, sizeof (SANE_Int), 1, fcal); + gt68xx_calibrator_new (width, level, &(scanner->calibrations[i].red)); + fread (scanner->calibrations[i].red->k_white, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].red->k_black, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].red->white_line, sizeof (double), width, + fcal); + fread (scanner->calibrations[i].red->black_line, sizeof (double), width, + fcal); + + fread (&width, sizeof (SANE_Int), 1, fcal); + fread (&level, sizeof (SANE_Int), 1, fcal); + gt68xx_calibrator_new (width, level, &(scanner->calibrations[i].green)); + fread (scanner->calibrations[i].green->k_white, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].green->k_black, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].green->white_line, sizeof (double), + width, fcal); + fread (scanner->calibrations[i].green->black_line, sizeof (double), + width, fcal); + + fread (&width, sizeof (SANE_Int), 1, fcal); + fread (&level, sizeof (SANE_Int), 1, fcal); + gt68xx_calibrator_new (width, level, &(scanner->calibrations[i].blue)); + fread (scanner->calibrations[i].blue->k_white, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].blue->k_black, sizeof (unsigned int), + width, fcal); + fread (scanner->calibrations[i].blue->white_line, sizeof (double), + width, fcal); + fread (scanner->calibrations[i].blue->black_line, sizeof (double), + width, fcal); + + fread (&width, sizeof (SANE_Int), 1, fcal); + if (width > 0) + { + fread (&level, sizeof (SANE_Int), 1, fcal); + gt68xx_calibrator_new (width, level, + &(scanner->calibrations[i].gray)); + fread (scanner->calibrations[i].gray->k_white, + sizeof (unsigned int), width, fcal); + fread (scanner->calibrations[i].gray->k_black, + sizeof (unsigned int), width, fcal); + fread (scanner->calibrations[i].gray->white_line, sizeof (double), + width, fcal); + fread (scanner->calibrations[i].gray->black_line, sizeof (double), + width, fcal); + } + /* prepare for nex resolution */ + i++; + fread (&(scanner->calibrations[i].dpi), sizeof (SANE_Int), 1, fcal); + } + + DBG (5, "gt68xx_read_calibration: read %d calibrations\n", i); + fclose (fcal); + + scanner->val[OPT_QUALITY_CAL].w = SANE_TRUE; + scanner->val[OPT_NEED_CALIBRATION_SW].w = SANE_FALSE; + scanner->calibrated = SANE_TRUE; + return SANE_STATUS_GOOD; +} + /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/gt68xx_high.h sane-backends-1.0.21/backend/gt68xx_high.h --- sane-backends-1.0.20/backend/gt68xx_high.h 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_high.h 2010-04-05 23:18:04.000000000 +1000 @@ -48,6 +48,7 @@ #include "gt68xx_mid.h" typedef struct GT68xx_Calibrator GT68xx_Calibrator; +typedef struct GT68xx_Calibration GT68xx_Calibration; typedef struct GT68xx_Scanner GT68xx_Scanner; /** Calibration data for one channel. @@ -72,6 +73,21 @@ #endif /* TUNE_CALIBRATOR */ }; + +/** Calibration data for a given resolution + */ +struct GT68xx_Calibration +{ + SANE_Int dpi; /**< optical horizontal dpi used to + build the calibration data */ + SANE_Int pixel_x0; /**< x start position used at calibration time */ + + GT68xx_Calibrator *gray; /**< Calibrator for grayscale data */ + GT68xx_Calibrator *red; /**< Calibrator for the red channel */ + GT68xx_Calibrator *green; /**< Calibrator for the green channel */ + GT68xx_Calibrator *blue; /**< Calibrator for the blue channel */ +}; + /** Create a new calibrator for one (color or mono) channel. * * @param width Image width in pixels. @@ -213,6 +229,15 @@ OPT_BR_X, /* bottom-right x */ OPT_BR_Y, /* bottom-right y */ + OPT_SENSOR_GROUP, + OPT_NEED_CALIBRATION_SW, /* signals calibration is needed */ + OPT_PAGE_LOADED_SW, /* signals that a document is inserted in feeder */ + + OPT_BUTTON_GROUP, + OPT_CALIBRATE, /* button option to trigger call + to sheetfed calibration */ + OPT_CLEAR_CALIBRATION, /* clear calibration */ + /* must come last: */ NUM_OPTIONS }; @@ -251,6 +276,16 @@ SANE_Int max_white; SANE_Int min_black; #endif + + /** SANE_TRUE when the scanner has been calibrated */ + SANE_Bool calibrated; + + /** per horizontal resolution calibration data */ + GT68xx_Calibration calibrations[MAX_RESOLUTIONS]; + + /* AFE and exposure settings */ + GT68xx_AFE_Parameters afe_params; + GT68xx_Exposure_Parameters exposure_params; }; @@ -316,6 +351,24 @@ */ static SANE_Status gt68xx_scanner_stop_scan (GT68xx_Scanner * scanner); +/** Save calibration data to file + * + * This function stores in memory calibration data created at calibration + * time into file + * @param scanner Scanner object. + * @return SANE_STATUS_GOOD when succesfull + */ +static SANE_Status gt68xx_write_calibration (GT68xx_Scanner * scanner); + +/** Read calibration data from file + * + * This function sets in memory calibration data from data saved into file. + * + * @param scanner Scanner object. + * @return SANE_STATUS_GOOD when succesfull + */ +static SANE_Status gt68xx_read_calibration (GT68xx_Scanner * scanner); + #endif /* not GT68XX_HIGH_H */ /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/gt68xx_low.h sane-backends-1.0.21/backend/gt68xx_low.h --- sane-backends-1.0.20/backend/gt68xx_low.h 2007-08-19 23:30:45.000000000 +1000 +++ sane-backends-1.0.21/backend/gt68xx_low.h 2010-04-05 23:18:04.000000000 +1000 @@ -70,7 +70,6 @@ #define HIBYTE(w) ((SANE_Byte)(((SANE_Word)(w) >> 8) & 0xFF)) #define LOBYTE(w) ((SANE_Byte)(w)) -#define MM_PER_INCH 25.4 /* return if an error occured while the function was called */ #ifdef MAX_DEBUG @@ -114,6 +113,8 @@ #define GT68XX_FLAG_USE_OPTICAL_X (1 << 10) /* Use optical xdpi for 50 dpi and below */ #define GT68XX_FLAG_ALWAYS_LINEMODE (1 << 11) /* Linemode must be used for any resolution */ #define GT68XX_FLAG_SHEET_FED (1 << 12) /* we have a sheet fed scanner */ +#define GT68XX_FLAG_HAS_CALIBRATE (1 << 13) /* for sheet fed scanners that be calibrated with + an calibration sheet */ /* Forward typedefs */ typedef struct GT68xx_USB_Device_Entry GT68xx_USB_Device_Entry; @@ -390,6 +391,22 @@ /** Get the vendor, product and some more ids from the scanner */ SANE_Status (*get_id) (GT68xx_Device * dev); + + /** Move the paper by the amount of y offset needed to reach scan area + * + * @param dev Device object. + * @param request scan request used to compute move to reach scan area + */ + SANE_Status (*move_paper) (GT68xx_Device * dev, + GT68xx_Scan_Request * request); + + /** Detect if a document is inserted in the feeder + * + * @param dev Device object. + * @param present + */ + SANE_Status (*document_present) (GT68xx_Device * dev, + SANE_Bool *present); /*@} */ }; @@ -567,6 +584,7 @@ SANE_Int ld_shift_b; SANE_Int ld_shift_double; SANE_Int double_column; + SANE_Int pixel_x0; /**< x start postion */ }; diff -Nru sane-backends-1.0.20/backend/hp3500.c sane-backends-1.0.21/backend/hp3500.c --- sane-backends-1.0.20/backend/hp3500.c 2008-11-27 08:21:25.000000000 +1100 +++ sane-backends-1.0.21/backend/hp3500.c 2010-04-05 23:18:04.000000000 +1000 @@ -73,7 +73,7 @@ /* ------------------------------------------------------------------------- */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -91,12 +91,12 @@ # include /* NeXTStep/OpenStep */ #endif -#include "sane/sane.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" -#include "sane/sanei_config.h" -#include "sane/sanei_thread.h" -#include "sane/sanei_backend.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_thread.h" +#include "../include/sane/sanei_backend.h" #define RTCMD_GETREG 0x80 #define RTCMD_READSRAM 0x81 @@ -117,7 +117,6 @@ typedef int (*rts8801_callback) (void *param, unsigned bytes, void *data); #define DEBUG 1 -#define MM_PER_INCH 25.4 #define SCANNER_UNIT_TO_FIXED_MM(number) SANE_FIX(number * MM_PER_INCH / 1200) #define FIXED_MM_TO_SCANNER_UNIT(number) SANE_UNFIX(number) * 1200 / MM_PER_INCH @@ -3393,27 +3392,28 @@ sigset_t sigterm_set; struct SIGACTION act; struct hp3500_write_info winfo; + int status; if (sanei_thread_is_forked ()) { close (scanner->pipe_r); - } - sigfillset (&ignore_set); - sigdelset (&ignore_set, SIGTERM); -#if defined (__APPLE__) && defined (__MACH__) - sigdelset (&ignore_set, SIGUSR2); + sigfillset (&ignore_set); + sigdelset (&ignore_set, SIGTERM); +#if defined (__APPLE__) && defined (__MACH__) + sigdelset (&ignore_set, SIGUSR2); #endif - sigprocmask (SIG_SETMASK, &ignore_set, 0); + sigprocmask (SIG_SETMASK, &ignore_set, 0); - sigemptyset (&sigterm_set); - sigaddset (&sigterm_set, SIGTERM); + sigemptyset (&sigterm_set); + sigaddset (&sigterm_set, SIGTERM); - memset (&act, 0, sizeof (act)); -#ifdef _POSIX_SOURCE - act.sa_handler = sigtermHandler; + memset (&act, 0, sizeof (act)); +#ifdef _POSIX_SOURCE + act.sa_handler = sigtermHandler; #endif - sigaction (SIGTERM, &act, 0); + sigaction (SIGTERM, &act, 0); + } /* Warm up the lamp again if our last scan ended more than 5 minutes ago. */ @@ -3448,6 +3448,8 @@ scanner->actres_pixels.bottom - scanner->actres_pixels.top, scanner->resolution, scanner->mode, (rts8801_callback) writefunc, &winfo) >= 0) - exit (SANE_STATUS_GOOD); - exit (SANE_STATUS_IO_ERROR); + status = SANE_STATUS_GOOD; + status = SANE_STATUS_IO_ERROR; + close (scanner->pipe_w); + return status; } diff -Nru sane-backends-1.0.20/backend/hp3900_config.c sane-backends-1.0.21/backend/hp3900_config.c --- sane-backends-1.0.20/backend/hp3900_config.c 2009-02-24 01:37:00.000000000 +1100 +++ sane-backends-1.0.21/backend/hp3900_config.c 2010-04-05 23:18:04.000000000 +1000 @@ -1,6 +1,6 @@ /* HP Scanjet 3900 series - RTS8822 internal config - Copyright (C) 2005-2008 Jonathan Bravo Lopez + Copyright (C) 2005-2009 Jonathan Bravo Lopez This file is part of the SANE package. @@ -196,6 +196,8 @@ /* ----- Implementation ----- */ +/* DEPRECATED enumerations */ + enum ConfigFiles { FITCALIBRATE=0, @@ -379,8 +381,9 @@ SANE_Int rst = -1; /* default */ SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if ((vendor == myreg[a].vendor)&&(product == myreg[a].product)) { @@ -417,8 +420,9 @@ SANE_Int rst = RTS8822L_01H; /* default */ SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (device == myreg[a].device) { @@ -499,8 +503,9 @@ }; SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (RTS_Debug->dev_model == myreg[a].device) { @@ -544,13 +549,14 @@ }; SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); /* default values */ *enable = 0; *mode = 0; *clock = 3; - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (RTS_Debug->dev_model == myreg[a].device) { @@ -595,12 +601,13 @@ }; SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); /* default values */ memset(reg, 0, sizeof(struct st_motorcfg)); reg->type = -1; - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (RTS_Debug->dev_model == myreg[a].device) { @@ -644,12 +651,13 @@ }; SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_myreg); /* default values */ memset(reg, 0, sizeof(struct st_sensorcfg)); reg->type = -1; - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (RTS_Debug->dev_model == myreg[a].device) { @@ -686,10 +694,11 @@ if ((vrts != NULL)&&(vrms != NULL)&&(vrbs != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); *vrts = *vrms = *vrbs = 0; - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if ((myreg[a].usb == usb)&&(myreg[a].sensor == sensor)) { @@ -723,10 +732,11 @@ if ((vrts != NULL)&&(vrms != NULL)&&(vrbs != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); *vrts = *vrms = *vrbs = 0; - for (a = 0; a < 4; a++) + for (a = 0; a < count; a++) { if ((myreg[a].usb == usb)&&(myreg[a].sensor == sensor)) { @@ -787,8 +797,9 @@ if ((left != NULL)&&(width != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); - for (a = 0; a < 5; a++) + for (a = 0; a < count; a++) { if (myreg[a].resolution == resolution) { @@ -842,8 +853,9 @@ if ((left != NULL)&&(width != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); - for (a = 0; a < 12; a++) + for (a = 0; a < count; a++) { if ((myreg[a].sensor == sensor)&&(myreg[a].resolution == resolution)) { @@ -888,8 +900,9 @@ if ((left != NULL)&&(width != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (myreg[a].resolution == resolution) { @@ -934,8 +947,9 @@ if ((left != NULL)&&(width != NULL)) { SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); - for (a = 0; a < 12; a++) + for (a = 0; a < count; a++) { if (myreg[a].resolution == resolution) { @@ -1006,8 +1020,9 @@ if (constrain != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (reg[a].device == RTS_Debug->dev_model) { @@ -1088,8 +1103,9 @@ }; SANE_Int a; + SANE_Int count = sizeof(myreg) / sizeof(struct st_reg); - for (a = 0; a < DEVSCOUNT; a++) + for (a = 0; a < count; a++) { if (myreg[a].device == RTS_Debug->dev_model) { @@ -1120,9 +1136,10 @@ }; SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); SANE_Int rst = 230; /* default */ - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == resolution) { @@ -1154,9 +1171,10 @@ }; SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); SANE_Int rst = 230; /* default */ - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == resolution) { @@ -1188,9 +1206,10 @@ }; SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); SANE_Int rst = 230; /* default */ - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == resolution) { @@ -1222,9 +1241,10 @@ }; SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); SANE_Int rst = 230; /* default */ - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == resolution) { @@ -1287,8 +1307,9 @@ if (myreg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1322,8 +1343,9 @@ if (myreg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1361,8 +1383,9 @@ if (myreg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 4; a++) + for (a = 0; count < 4; a++) { if ((reg[a].usb == usb)&&(reg[a].sensor == sensor)) { @@ -1396,8 +1419,9 @@ if (myreg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1431,8 +1455,9 @@ if (myreg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1502,8 +1527,9 @@ if (reg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 3; a++) + for (a = 0; a < count; a++) { if (reg[a].lamp == lamp) { @@ -1538,8 +1564,9 @@ if (reg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 3; a++) + for (a = 0; a < count; a++) { if (reg[a].lamp == lamp) { @@ -1574,8 +1601,9 @@ if (reg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 3; a++) + for (a = 0; a < count; a++) { if (reg[a].lamp == lamp) { @@ -1610,8 +1638,9 @@ if (reg != NULL) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 3; a++) + for (a = 0; a < count; a++) { if (reg[a].lamp == lamp) { @@ -1672,8 +1701,9 @@ }; SANE_Int a, rst = 0x16; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1708,8 +1738,9 @@ }; SANE_Int a, rst = 0x16; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 4; a++) + for (a = 0; a < count; a++) { if ((reg[a].usb == usb)&&(reg[a].sensor == sensor)) { @@ -1740,8 +1771,9 @@ }; SANE_Int a, rst = 0x16; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1772,8 +1804,9 @@ }; SANE_Int a, rst = 0x16; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < 2; a++) + for (a = 0; a < count; a++) { if (reg[a].usb == usb) { @@ -1858,16 +1891,15 @@ { 2400, { 408, 808}} }; - SANE_Int total = 5; - if ((ser != NULL)&&(ler != NULL)) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); /* values by default */ *ser = *ler = 0; - for (a = 0; a < total; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == res) { @@ -1931,11 +1963,12 @@ if ((ser != NULL)&&(ler != NULL)) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); /* values by default */ *ser = *ler = 0; - for (a = 0; a < 24; a++) + for (a = 0; a < count; a++) { if ((reg[a].usb == usb)&&(reg[a].sensor == sensor)&&(reg[a].resolution == res)) { @@ -1969,11 +2002,12 @@ if ((ser != NULL)&&(ler != NULL)) { SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); /* values by default */ *ser = *ler = 0; - for (a = 0; a < 6; a++) + for (a = 0; a < count; a++) { if (reg[a].resolution == res) { @@ -2091,8 +2125,9 @@ if (item < 2) { SANE_Int a, count = 0; + SANE_Int total = sizeof(mv) / sizeof(struct st_mtmove); - for (a = 0; a < 8; a++) + for (a = 0; a < total; a++) { if ((mv[a].usbtype == usb)&&(mv[a].sensor == ccd)) { @@ -2342,7 +2377,7 @@ if (mymode != NULL) { SANE_Int a; - SANE_Int total = 156; + SANE_Int total = sizeof(reg) / sizeof(struct st_modes); SANE_Int count = 0; struct st_modes *md; @@ -2472,7 +2507,7 @@ if (mymode != NULL) { SANE_Int a; - SANE_Int total = 72; + SANE_Int total = sizeof(reg) / sizeof(struct st_modes); SANE_Int count = 0; struct st_modes *md; @@ -2590,7 +2625,7 @@ if (mymode != NULL) { SANE_Int a; - SANE_Int total = 60; + SANE_Int total = sizeof(reg) / sizeof(struct st_modes); SANE_Int count = 0; struct st_modes *md; @@ -2690,7 +2725,7 @@ if (mymode != NULL) { SANE_Int a; - SANE_Int total = 45; + SANE_Int total = sizeof(reg) / sizeof(struct st_modes); SANE_Int count = 0; struct st_modes *md; @@ -2766,7 +2801,7 @@ if (mymode != NULL) { SANE_Int a; - SANE_Int total = 30; + SANE_Int total = sizeof(reg) / sizeof(struct st_modes); SANE_Int count = 0; struct st_modes *md; @@ -2886,8 +2921,9 @@ if (scantype != ST_NORMAL) { SANE_Int a; + SANE_Int count = sizeof(wrefs) / sizeof(struct st_wref); - for (a = 0; a < 48; a++) + for (a = 0; a < count; a++) { rf = &wrefs[a]; if ((rf->usb == usb)&&(rf->sensor == ccd)&&(rf->depth == depth)&&(rf->res == res)) @@ -2975,8 +3011,9 @@ if (scantype != ST_NORMAL) { SANE_Int a; + SANE_Int count = sizeof(wrefs) / sizeof(struct st_wref); - for (a = 0; a < 20; a++) + for (a = 0; a < count; a++) { rf = &wrefs[a]; if ((rf->usb == usb)&&(rf->depth == depth)&&(rf->res == res)) @@ -3044,8 +3081,9 @@ if (scantype != ST_NORMAL) { SANE_Int a; + SANE_Int count = sizeof(wrefs) / sizeof(struct st_wref); - for (a = 0; a < 20; a++) + for (a = 0; a < count; a++) { rf = &wrefs[a]; if (rf->res == res) @@ -3118,7 +3156,9 @@ if (scantype != ST_NORMAL) { - for (a = 0; a < 6; a++) + SANE_Int count = sizeof(wrefs) / sizeof(struct st_wref); + + for (a = 0; a < count; a++) { rf = &wrefs[a]; if (rf->res == res) @@ -3199,6 +3239,7 @@ struct st_cut *ct; SANE_Int a; + SANE_Int count = sizeof(cuts) / sizeof(struct st_cut); *red = *green = *blue = 0; @@ -3212,7 +3253,7 @@ res = 1200; else res = 2400; - for (a = 0; a < 5; a++) + for (a = 0; a < count; a++) { ct = &cuts[a]; if (ct->res == res) @@ -3319,6 +3360,7 @@ struct st_cut *ct; SANE_Int a; + SANE_Int count = sizeof(cuts) / sizeof(struct st_cut); *red = *green = *blue = 0; @@ -3334,7 +3376,7 @@ res = 1200; else res = 2400; - for (a = 0; a < 48; a++) + for (a = 0; a < count; a++) { ct = &cuts[a]; if ((ct->usb == usb)&&(ct->sensor == ccd)&&(ct->depth == depth)&&(ct->res == res)) @@ -3395,6 +3437,7 @@ struct st_cut *ct; SANE_Int a; + SANE_Int count = sizeof(cuts) / sizeof(struct st_cut); *red = *green = *blue = 0; @@ -3410,7 +3453,7 @@ res = 2400; else res = 4800; - for (a = 0; a < 12; a++) + for (a = 0; a < count; a++) { ct = &cuts[a]; if ((ct->depth == depth)&&(ct->res == res)) @@ -3482,6 +3525,7 @@ struct st_cut *ct; SANE_Int a; + SANE_Int count = sizeof(cuts) / sizeof(struct st_cut); *red = *green = *blue = 0; @@ -3495,7 +3539,7 @@ res = 600; else res = 1200; - for (a = 0; a < 20; a++) + for (a = 0; a < count; a++) { ct = &cuts[a]; if ((ct->usb == usb)&&(ct->depth == depth)&&(ct->res == res)) @@ -4182,6 +4226,8 @@ return rst; } +/* DEPRECATED functions */ + static int ua4900_calibreflective(int option, int defvalue) { int rst = defvalue; diff -Nru sane-backends-1.0.20/backend/hp3900_sane.c sane-backends-1.0.21/backend/hp3900_sane.c --- sane-backends-1.0.20/backend/hp3900_sane.c 2009-01-10 03:10:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hp3900_sane.c 2010-04-05 23:18:04.000000000 +1000 @@ -378,7 +378,7 @@ /* at this moment all devices use the same list */ SANE_String_Const mycolormode[] = - { SANE_I18N ("Color"), SANE_I18N ("Gray"), SANE_I18N ("Lineart"), 0 }; + { SANE_VALUE_SCAN_MODE_COLOR, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_LINEART, 0 }; /* silence gcc */ model = model; @@ -1031,11 +1031,11 @@ { SANE_Int rst; - if (strcmp (colormode, SANE_I18N ("Color")) == 0) + if (strcmp (colormode, SANE_VALUE_SCAN_MODE_COLOR) == 0) rst = CM_COLOR; - else if (strcmp (colormode, SANE_I18N ("Gray")) == 0) + else if (strcmp (colormode, SANE_VALUE_SCAN_MODE_GRAY) == 0) rst = CM_GRAY; - else if (strcmp (colormode, SANE_I18N ("Lineart")) == 0) + else if (strcmp (colormode, SANE_VALUE_SCAN_MODE_LINEART) == 0) rst = CM_LINEART; else rst = CM_COLOR; /* default */ @@ -1189,6 +1189,7 @@ scanner->rng_vertical.quant = 1; /* allocate option lists */ + bknd_info (scanner); bknd_colormodes (scanner, RTS_Debug->dev_model); bknd_depths (scanner, RTS_Debug->dev_model); bknd_models (scanner); @@ -1562,6 +1563,7 @@ pDesc->constraint_type = SANE_CONSTRAINT_NONE; pDesc->cap = SANE_CAP_ADVANCED | SANE_CAP_SOFT_DETECT; pVal->s = strdup (SANE_I18N ("Unknown")); + pDesc->size = strlen(pVal->s) + 1; break; case opt_chipid: @@ -1981,7 +1983,9 @@ case opt_scantype: case opt_model: case opt_chipname: - strcpy (result, scanner->aValues[optid].s); + strncpy (result, scanner->aValues[optid].s, scanner->aOptions[optid].size); + ((char*)result)[scanner->aOptions[optid].size-1] = '\0'; + break; /* scanner buttons */ @@ -2113,6 +2117,7 @@ Load_Config (device); /* update options according to selected device */ + bknd_info (scanner); bknd_colormodes (scanner, model); bknd_depths (scanner, model); bknd_resolutions (scanner, model); diff -Nru sane-backends-1.0.20/backend/hp4200.h sane-backends-1.0.21/backend/hp4200.h --- sane-backends-1.0.20/backend/hp4200.h 2005-08-14 01:30:01.000000000 +1000 +++ sane-backends-1.0.21/backend/hp4200.h 2010-04-05 23:18:04.000000000 +1000 @@ -27,7 +27,6 @@ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) -#define MM_PER_INCH 25.4 /*--------------------------------------------------------------------------*/ diff -Nru sane-backends-1.0.20/backend/hp5400.h sane-backends-1.0.21/backend/hp5400.h --- sane-backends-1.0.20/backend/hp5400.h 2003-06-05 17:05:59.000000000 +1000 +++ sane-backends-1.0.21/backend/hp5400.h 2009-06-09 13:03:36.000000000 +1000 @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - $Id: hp5400.h,v 1.3 2003-06-05 07:05:59 soumarmt Exp $ + $Id$ */ diff -Nru sane-backends-1.0.20/backend/hp5400_internal.h sane-backends-1.0.21/backend/hp5400_internal.h --- sane-backends-1.0.20/backend/hp5400_internal.h 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hp5400_internal.h 2010-04-05 23:18:04.000000000 +1000 @@ -52,6 +52,7 @@ tables and stores the results of a scan. - 19/02/2003 Martijn */ +#include "../include/_stdint.h" #ifdef __GNUC__ #define PACKED __attribute__ ((packed)) diff -Nru sane-backends-1.0.20/backend/hp5590.c sane-backends-1.0.21/backend/hp5590.c --- sane-backends-1.0.20/backend/hp5590.c 2009-01-10 03:10:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hp5590.c 2010-04-05 23:18:04.000000000 +1000 @@ -39,20 +39,21 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file is part of a SANE backend for HP 4570/5550/5590/7650 Scanners + This file is part of a SANE backend for + HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include #include -#include "sane/sane.h" +#include "../include/sane/sane.h" #define BACKEND_NAME hp5590 -#include "sane/sanei_backend.h" -#include "sane/sanei_usb.h" -#include "sane/saneopts.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/saneopts.h" #include "hp5590_cmds.c" #include "hp5590_low.c" @@ -72,7 +73,7 @@ } /* #define HAS_WORKING_COLOR_48 */ -#define BUILD 4 +#define BUILD 5 #define USB_TIMEOUT 30 * 1000 static SANE_Word @@ -84,7 +85,7 @@ #define SANE_VALUE_SCAN_SOURCE_TMA_SLIDES SANE_I18N("TMA Slides") #define SANE_VALUE_SCAN_SOURCE_TMA_NEGATIVES SANE_I18N("TMA Negatives") -#define SANE_VALUE_SCAN_MODE_COLOR_24 SANE_I18N("Color") +#define SANE_VALUE_SCAN_MODE_COLOR_24 SANE_VALUE_SCAN_MODE_COLOR #define SANE_VALUE_SCAN_MODE_COLOR_48 SANE_I18N("Color (48 bits)") #define SANE_NAME_LAMP_TIMEOUT "extend-lamp-timeout" @@ -318,7 +319,8 @@ DBG_INIT(); - DBG (1, "SANE backed for HP 4570/5550/5590/7650 %u.%u.%u\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD); + DBG (1, "SANE backed for HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 %u.%u.%u\n", + SANE_CURRENT_MAJOR, V_MINOR, BUILD); DBG (1, "(c) Ilia Sotnikov \n"); if (version_code) diff -Nru sane-backends-1.0.20/backend/hp5590_cmds.c sane-backends-1.0.21/backend/hp5590_cmds.c --- sane-backends-1.0.20/backend/hp5590_cmds.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hp5590_cmds.c 2010-04-05 23:18:04.000000000 +1000 @@ -39,10 +39,11 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file is part of a SANE backend for HP 4570/5550/5590/7650 Scanners + This file is part of a SANE backend for + HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners */ -#include "sane/config.h" +#include "../include/sane/config.h" #ifdef HAVE_UNISTD_H # include @@ -53,7 +54,8 @@ #include #include -#include "sane/sanei_debug.h" +#include "../include/sane/sanei_debug.h" +#include "../include/_stdint.h" #include "hp5590_low.h" #include "hp5590_cmds.h" @@ -72,12 +74,12 @@ { SCANNER_HP4570, 0x03f0, 0x1305, "SILITEKIElwood", - "4570", "Workgroup scanner" + "4570C/5500C", "Workgroup scanner" }, { SCANNER_HP5550, 0x03f0, 0x1205, "SILITEKIPenguin", - "5550", "Workgroup scanner" + "4500C/5550C", "Workgroup scanner" }, { SCANNER_HP5590, diff -Nru sane-backends-1.0.20/backend/hp5590_cmds.h sane-backends-1.0.21/backend/hp5590_cmds.h --- sane-backends-1.0.20/backend/hp5590_cmds.h 2008-06-19 21:03:49.000000000 +1000 +++ sane-backends-1.0.21/backend/hp5590_cmds.h 2010-04-05 23:18:04.000000000 +1000 @@ -39,7 +39,8 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file is part of a SANE backend for HP 4570/5550/5590/7650 Scanners + This file is part of a SANE backend for + HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners */ #ifndef HP5590_H diff -Nru sane-backends-1.0.20/backend/hp5590_low.c sane-backends-1.0.21/backend/hp5590_low.c --- sane-backends-1.0.20/backend/hp5590_low.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hp5590_low.c 2010-04-05 23:18:04.000000000 +1000 @@ -38,10 +38,11 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file is part of a SANE backend for HP 4570/5550/5590/7650 Scanners + This file is part of a SANE backend for + HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -50,8 +51,9 @@ # include #endif /* HAVE_NETINET_IN_H */ -#include "sane/sanei_debug.h" -#include "sane/sanei_usb.h" +#include "../include/sane/sanei_debug.h" +#include "../include/sane/sanei_usb.h" +#include "../include/_stdint.h" #include "hp5590_low.h" /* Debug levels */ diff -Nru sane-backends-1.0.20/backend/hp5590_low.h sane-backends-1.0.21/backend/hp5590_low.h --- sane-backends-1.0.20/backend/hp5590_low.h 2008-06-19 21:03:49.000000000 +1000 +++ sane-backends-1.0.21/backend/hp5590_low.h 2010-04-05 23:18:04.000000000 +1000 @@ -38,13 +38,14 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file is part of a SANE backend for HP 4570/5550/5590/7650 Scanners + This file is part of a SANE backend for + HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners */ #ifndef HP5590_LOW_H #define HP5590_LOW_H -#include "sane/sane.h" +#include "../include/sane/sane.h" /* Flags for hp5590_cmd() */ #define CMD_IN 1 << 0 /* Indicates IN direction, otherwise - OUT */ diff -Nru sane-backends-1.0.20/backend/hp-accessor.c sane-backends-1.0.21/backend/hp-accessor.c --- sane-backends-1.0.20/backend/hp-accessor.c 2002-11-26 07:36:33.000000000 +1100 +++ sane-backends-1.0.21/backend/hp-accessor.c 2010-04-05 23:18:04.000000000 +1000 @@ -46,7 +46,8 @@ extern int sanei_debug_hp; */ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" +#include "../include/sane/sanei_backend.h" #include "../include/lassert.h" #include diff -Nru sane-backends-1.0.20/backend/hp.c sane-backends-1.0.21/backend/hp.c --- sane-backends-1.0.20/backend/hp.c 2008-11-27 08:21:25.000000000 +1100 +++ sane-backends-1.0.21/backend/hp.c 2010-04-05 23:18:04.000000000 +1000 @@ -44,12 +44,12 @@ */ static char *hp_backend_version = "1.06"; -static char *hp_backend_revision = "$Revision: 1.22 $"; +static char *hp_backend_revision = "$Revision$"; /* Changes: V 1.06: - $Log: hp.c,v $ - Revision 1.22 2008-11-26 21:21:25 kitno-guest + $Log$ + Revision 1.22 2008/11/26 21:21:25 kitno-guest * backend/*.[ch]: nearly every backend used V_MAJOR instead of SANE_CURRENT_MAJOR in sane_init() * backend/snapscan.c: remove EXPECTED_VERSION check @@ -232,17 +232,17 @@ #define VERSIO 8 -#include "sane/config.h" +#include "../include/sane/config.h" #include "hp.h" #include /* #include */ -/* #include */ -#include "sane/sanei_config.h" -#include "sane/sanei_backend.h" -#include "sane/sanei_usb.h" -#include "sane/sanei_thread.h" -/* #include */ +/* #include "../include/sane/sane.h" */ +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_thread.h" +/* #include "../include/sane/sanei_debug.h" */ #include "hp-device.h" #include "hp-handle.h" diff -Nru sane-backends-1.0.20/backend/hp-device.c sane-backends-1.0.21/backend/hp-device.c --- sane-backends-1.0.20/backend/hp-device.c 2002-11-26 07:36:35.000000000 +1100 +++ sane-backends-1.0.21/backend/hp-device.c 2010-04-05 23:18:04.000000000 +1000 @@ -45,7 +45,7 @@ /*#define STUBS extern int sanei_debug_hp;*/ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" #include #include diff -Nru sane-backends-1.0.20/backend/hp.h sane-backends-1.0.21/backend/hp.h --- sane-backends-1.0.20/backend/hp.h 2004-10-05 04:09:05.000000000 +1000 +++ sane-backends-1.0.21/backend/hp.h 2010-04-05 23:18:04.000000000 +1000 @@ -46,12 +46,12 @@ #define HP_H_INCLUDED #include #include -#include "sane/sane.h" +#include "../include/sane/sane.h" #undef BACKEND_NAME #define BACKEND_NAME hp #define DEBUG_NOT_STATIC -#include "sane/sanei_debug.h" +#include "../include/sane/sanei_debug.h" #ifdef __GNUC__ #define UNUSEDARG __attribute__ ((unused)) @@ -70,7 +70,6 @@ #define HP_CONFIG_FILE STRINGIFY(BACKEND_NAME) ".conf" -#define MM_PER_INCH 25.4 #define DEVPIX_PER_INCH 300.0 #define MM_PER_DEVPIX (MM_PER_INCH / DEVPIX_PER_INCH) diff -Nru sane-backends-1.0.20/backend/hp-handle.c sane-backends-1.0.21/backend/hp-handle.c --- sane-backends-1.0.20/backend/hp-handle.c 2008-05-15 22:50:20.000000000 +1000 +++ sane-backends-1.0.21/backend/hp-handle.c 2010-04-05 23:18:04.000000000 +1000 @@ -45,7 +45,7 @@ /* #define STUBS extern int sanei_debug_hp; */ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" #ifdef HAVE_UNISTD_H # include @@ -59,8 +59,8 @@ #include "hp-handle.h" -#include "sane/sanei_backend.h" -#include "sane/sanei_thread.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_thread.h" #include "hp-device.h" #include "hp-option.h" diff -Nru sane-backends-1.0.20/backend/hp-hpmem.c sane-backends-1.0.21/backend/hp-hpmem.c --- sane-backends-1.0.20/backend/hp-hpmem.c 2001-10-28 05:01:52.000000000 +1100 +++ sane-backends-1.0.21/backend/hp-hpmem.c 2010-04-05 23:18:04.000000000 +1000 @@ -45,7 +45,7 @@ #define STUBS extern int sanei_debug_hp;*/ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" #include #include diff -Nru sane-backends-1.0.20/backend/hpljm1005.c sane-backends-1.0.21/backend/hpljm1005.c --- sane-backends-1.0.20/backend/hpljm1005.c 2009-03-21 01:41:47.000000000 +1100 +++ sane-backends-1.0.21/backend/hpljm1005.c 2010-04-05 23:18:04.000000000 +1000 @@ -128,8 +128,8 @@ static SANE_Range range_br_cont = { BR_CONT_MIN, BR_CONT_MAX, 0 }; static const SANE_String_Const mode_list[] = { - "Gray", - "Color", + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, NULL }; diff -Nru sane-backends-1.0.20/backend/hp-option.c sane-backends-1.0.21/backend/hp-option.c --- sane-backends-1.0.20/backend/hp-option.c 2005-04-13 22:50:07.000000000 +1000 +++ sane-backends-1.0.21/backend/hp-option.c 2010-04-05 23:18:04.000000000 +1000 @@ -43,8 +43,8 @@ */ /* - $Log: hp-option.c,v $ - Revision 1.13 2005-04-13 12:50:07 ellert-guest + $Log$ + Revision 1.13 2005/04/13 12:50:07 ellert-guest Add missing SANE_I18N, Regenerate .po files accordingly, Update Swedish translations Revision 1.12 2003/10/09 19:32:50 kig-guest @@ -68,7 +68,8 @@ #define STUBS extern int sanei_debug_hp; */ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" +#include "../include/sane/sanei_backend.h" #include "../include/lalloca.h" #include @@ -81,8 +82,8 @@ #include #include #include -#include "sane/saneopts.h" -#include "sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei.h" #include "hp.h" #include "hp-option.h" #include "hp-accessor.h" @@ -2923,10 +2924,10 @@ }}; static const struct hp_choice_s _scanmode_choices[] = { - { HP_SCANMODE_LINEART, SANE_I18N("Lineart"), 0, 0, 0 }, - { HP_SCANMODE_HALFTONE, SANE_I18N("Halftone"), 0, 0, 0 }, - { HP_SCANMODE_GRAYSCALE, SANE_I18N("Grayscale"), 0, 0, 0 }, - { HP_SCANMODE_COLOR, SANE_I18N("Color"), 0, 0, 0 }, + { HP_SCANMODE_LINEART, SANE_VALUE_SCAN_MODE_LINEART, 0, 0, 0 }, + { HP_SCANMODE_HALFTONE, SANE_VALUE_SCAN_MODE_HALFTONE, 0, 0, 0 }, + { HP_SCANMODE_GRAYSCALE, SANE_VALUE_SCAN_MODE_GRAY, 0, 0, 0 }, + { HP_SCANMODE_COLOR, SANE_VALUE_SCAN_MODE_COLOR, 0, 0, 0 }, { 0, 0, 0, 0, 0 } }; static const struct hp_option_descriptor_s SCAN_MODE[1] = {{ diff -Nru sane-backends-1.0.20/backend/hp-option.h sane-backends-1.0.21/backend/hp-option.h --- sane-backends-1.0.20/backend/hp-option.h 2003-10-07 05:52:26.000000000 +1000 +++ sane-backends-1.0.21/backend/hp-option.h 2009-06-09 13:03:36.000000000 +1000 @@ -43,7 +43,7 @@ */ /* - $Id: hp-option.h,v 1.7 2003-10-06 19:52:26 kig-guest Exp $ + $Id$ */ #ifndef HP_OPTION_H_INCLUDED #define HP_OPTION_H_INCLUDED diff -Nru sane-backends-1.0.20/backend/hp-scl.c sane-backends-1.0.21/backend/hp-scl.c --- sane-backends-1.0.20/backend/hp-scl.c 2008-03-29 01:37:36.000000000 +1100 +++ sane-backends-1.0.21/backend/hp-scl.c 2010-04-05 23:18:04.000000000 +1000 @@ -43,8 +43,8 @@ */ /* - $Log: hp-scl.c,v $ - Revision 1.15 2008-03-28 14:37:36 kitno-guest + $Log$ + Revision 1.15 2008/03/28 14:37:36 kitno-guest add usleep to improve usb performance, from jim a t meyering d o t net Revision 1.14 2004-10-04 18:09:05 kig-guest @@ -64,7 +64,7 @@ #define STUBS extern int sanei_debug_hp;*/ #define DEBUG_DECLARE_ONLY -#include "sane/config.h" +#include "../include/sane/config.h" #include "../include/lalloca.h" /* Must be first */ #ifdef HAVE_UNISTD_H @@ -80,13 +80,13 @@ #include #include #include -#include "sane/sanei_scsi.h" -#include "sane/sanei_usb.h" -#include "sane/sanei_pio.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_pio.h" #include "hp.h" -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "hp-option.h" #include "hp-scsi.h" diff -Nru sane-backends-1.0.20/backend/hs2p.c sane-backends-1.0.21/backend/hs2p.c --- sane-backends-1.0.20/backend/hs2p.c 2009-02-06 01:36:36.000000000 +1100 +++ sane-backends-1.0.21/backend/hs2p.c 2010-04-05 23:18:04.000000000 +1000 @@ -2609,7 +2609,7 @@ s->params.pixels_per_line = s->params.bytes_per_line * 8; s->params.depth = 1; } - else /* if (strcmp (mode, "Gray") == 0) */ + else /* if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) */ { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; diff -Nru sane-backends-1.0.20/backend/hs2p.h sane-backends-1.0.21/backend/hs2p.h --- sane-backends-1.0.20/backend/hs2p.h 2009-02-24 09:03:09.000000000 +1100 +++ sane-backends-1.0.21/backend/hs2p.h 2010-04-05 23:18:04.000000000 +1000 @@ -299,11 +299,11 @@ 0 /* quantization */ }; -#define SM_LINEART "Lineart B/W" -#define SM_HALFTONE "Halftone" +#define SM_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define SM_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE #define SM_DITHER "Dither" #define SM_ERRORDIFFUSION "Error Diffusion" -#define SM_COLOR "Color" +#define SM_COLOR SANE_VALUE_SCAN_MODE_COLOR #define SM_4BITGRAY "4-Bit Gray" #define SM_6BITGRAY "6-Bit Gray" #define SM_8BITGRAY "8-Bit Gray" diff -Nru sane-backends-1.0.20/backend/hs2p-scsi.h sane-backends-1.0.21/backend/hs2p-scsi.h --- sane-backends-1.0.20/backend/hs2p-scsi.h 2009-01-10 03:10:17.000000000 +1100 +++ sane-backends-1.0.21/backend/hs2p-scsi.h 2010-04-05 23:18:04.000000000 +1000 @@ -521,7 +521,6 @@ } MP_CXN; /* 1 inch = 6 picas = 72 points = 25.4 mm */ -#define MM_PER_INCH 25.4 #define DEFAULT_MUD 1200 /* WHY ? */ /* BASIC MEASUREMENT UNIT * 00H INCH diff -Nru sane-backends-1.0.20/backend/ibm.c sane-backends-1.0.21/backend/ibm.c --- sane-backends-1.0.20/backend/ibm.c 2008-11-27 08:21:26.000000000 +1100 +++ sane-backends-1.0.21/backend/ibm.c 2010-04-05 23:18:04.000000000 +1000 @@ -76,7 +76,6 @@ #include "ibm.h" #include "ibm-scsi.c" -#define MM_PER_INCH 25.4 #define MAX(a,b) ((a) > (b) ? (a) : (b)) static int num_devices = 0; @@ -900,8 +899,8 @@ } mode = s->val[OPT_MODE].s; - if ((strcmp (mode, "Lineart") == 0) || - (strcmp (mode, "Halftone")) == 0) + if ((strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) || + (strcmp (mode, SANE_VALUE_SCAN_MODE_HALFTONE)) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line / 8; @@ -909,7 +908,7 @@ s->params.pixels_per_line = s->params.bytes_per_line * 8; s->params.depth = 1; } - else /* if (strcmp (mode, "Gray") == 0) */ + else /* if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) */ { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; @@ -967,15 +966,15 @@ s->brightness = s->val[OPT_BRIGHTNESS].w; s->contrast = s->val[OPT_CONTRAST].w; s->bpp = s->params.depth; - if (strcmp (mode_str, "Lineart") == 0) + if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->image_composition = IBM_BINARY_MONOCHROME; } - else if (strcmp (mode_str, "Halftone") == 0) + else if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) { s->image_composition = IBM_DITHERED_MONOCHROME; } - else if (strcmp (mode_str, "Gray") == 0) + else if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_GRAY) == 0) { s->image_composition = IBM_GRAYSCALE; } diff -Nru sane-backends-1.0.20/backend/ibm.h sane-backends-1.0.21/backend/ibm.h --- sane-backends-1.0.20/backend/ibm.h 2009-02-24 09:02:52.000000000 +1100 +++ sane-backends-1.0.21/backend/ibm.h 2010-04-05 23:18:04.000000000 +1000 @@ -80,7 +80,9 @@ static const SANE_String_Const mode_list[] = { - "Lineart", "Halftone", "Gray", + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_HALFTONE, + SANE_VALUE_SCAN_MODE_GRAY, 0 }; diff -Nru sane-backends-1.0.20/backend/kodak.c sane-backends-1.0.21/backend/kodak.c --- sane-backends-1.0.20/backend/kodak.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kodak.c 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,2911 @@ +/* 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 various large Kodak scanners. + + The source code is divided in sections which you can easily find by + searching for the tag "@@". + + Section 1 - Init & static stuff + Section 2 - sane_init, _get_devices, _open & friends + Section 3 - sane_*_option functions + Section 4 - sane_start, _get_param, _read & friends + Section 5 - sane_close functions + Section 6 - misc functions + + Changes: + v0 through v5 2008-01-15, MAN + - development versions + v6 2009-06-22, MAN + - improved set_window() to build desciptor from scratch + - initial release + v7 2010-02-10, MAN + - add SANE_I18N to static strings + - don't fail if scsi buffer is too small + + SANE FLOW DIAGRAM + + - sane_init() : initialize backend + . - sane_get_devices() : query list of scanner devices + . - sane_open() : open a particular scanner device + . . - sane_set_io_mode : set blocking mode + . . - sane_get_select_fd : get scanner fd + . . + . . - sane_get_option_descriptor() : get option information + . . - sane_control_option() : change option values + . . - sane_get_parameters() : returns estimated scan parameters + . . - (repeat previous 3 functions) + . . + . . - sane_start() : start image acquisition + . . - sane_get_parameters() : returns actual scan parameters + . . - sane_read() : read image data (from pipe) + . . (sane_read called multiple times; after sane_read returns EOF, + . . loop may continue with sane_start which may return a 2nd page + . . when doing duplex scans, or load the next page from the ADF) + . . + . . - sane_cancel() : cancel operation + . - sane_close() : close opened scanner device + - sane_exit() : terminate use of backend + +*/ + +/* + * @@ Section 1 - Init + */ + +#include "sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef HAVE_LIBC_H +# include /* NeXTStep/OpenStep */ +#endif + +#include "sane/sanei_backend.h" +#include "sane/sanei_scsi.h" +#include "sane/saneopts.h" +#include "sane/sanei_config.h" + +#include "kodak-cmd.h" +#include "kodak.h" + +#define DEBUG 1 +#define BUILD 7 + +/* values for SANE_DEBUG_KODAK env var: + - errors 5 + - function trace 10 + - function detail 15 + - get/setopt cmds 20 + - scsi cmd trace 25 + - scsi cmd detail 30 + - useless noise 35 +*/ + +/* ------------------------------------------------------------------------- */ +#define STRING_ADFFRONT SANE_I18N("ADF Front") +#define STRING_ADFBACK SANE_I18N("ADF Back") +#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex") + +#define STRING_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define STRING_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE +#define STRING_GRAYSCALE SANE_VALUE_SCAN_MODE_GRAY +#define STRING_COLOR SANE_VALUE_SCAN_MODE_COLOR + +/* Also set via config file. */ +static int global_buffer_size = DEFAULT_BUFFER_SIZE; + +/* + * used by attach* and sane_get_devices + * a ptr to a null term array of ptrs to SANE_Device structs + * a ptr to a single-linked list of scanner structs + */ +static const SANE_Device **sane_devArray = NULL; +static struct scanner *scanner_devList = NULL; + +/* + * @@ Section 2 - SANE & scanner init code + */ + +/* + * Called by SANE initially. + * + * From the SANE spec: + * This function must be called before any other SANE function can be + * called. The behavior of a SANE backend is undefined if this + * function is not called first. The version code of the backend is + * returned in the value pointed to by version_code. If that pointer + * is NULL, no version code is returned. Argument authorize is either + * a pointer to a function that is invoked when the backend requires + * authentication for a specific resource or NULL if the frontend does + * not support authentication. + */ +SANE_Status +sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) +{ + authorize = authorize; /* get rid of compiler warning */ + + DBG_INIT (); + DBG (10, "sane_init: start\n"); + + if (version_code) + *version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, BUILD); + + DBG (5, "sane_init: kodak backend %d.%d.%d, from %s\n", + V_MAJOR, V_MINOR, BUILD, PACKAGE_STRING); + + DBG (10, "sane_init: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * Called by SANE to find out about supported devices. + * + * From the SANE spec: + * This function can be used to query the list of devices that are + * available. If the function executes successfully, it stores a + * pointer to a NULL terminated array of pointers to SANE_Device + * structures in *device_list. The returned list is guaranteed to + * remain unchanged and valid until (a) another call to this function + * is performed or (b) a call to sane_exit() is performed. This + * function can be called repeatedly to detect when new devices become + * available. If argument local_only is true, only local devices are + * returned (devices directly attached to the machine that SANE is + * running on). If it is false, the device list includes all remote + * devices that are accessible to the SANE library. + * + * SANE does not require that this function is called before a + * sane_open() call is performed. A device name may be specified + * explicitly by a user which would make it unnecessary and + * undesirable to call this function first. + */ +/* Read the config file, find scanners with help from sanei_* + * store in two global lists of device structs + */ +SANE_Status +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) +{ + struct scanner *dev; + char line[PATH_MAX]; + const char *lp; + FILE *fp; + int num_devices=0; + int i=0; + + local_only = local_only; /* get rid of compiler warning */ + + DBG (10, "sane_get_devices: start\n"); + + /* set this to default before reading the file */ + global_buffer_size = DEFAULT_BUFFER_SIZE; + + fp = sanei_config_open (KODAK_CONFIG_FILE); + + if (fp) { + + DBG (15, "sane_get_devices: reading config file %s\n", KODAK_CONFIG_FILE); + + while (sanei_config_read (line, PATH_MAX, fp)) { + + lp = line; + + /* ignore comments */ + if (*lp == '#') + continue; + + /* skip empty lines */ + if (*lp == 0) + continue; + + if ((strncmp ("option", lp, 6) == 0) && isspace (lp[6])) { + + lp += 6; + lp = sanei_config_skip_whitespace (lp); + + /* we allow setting buffersize too big */ + if ((strncmp (lp, "buffer-size", 11) == 0) && isspace (lp[11])) { + + int buf; + lp += 11; + lp = sanei_config_skip_whitespace (lp); + buf = atoi (lp); + + if (buf < 4096) { + DBG (5, "sane_get_devices: config option \"buffer-size\" \ + (%d) is < 4096, ignoring!\n", buf); + continue; + } + + if (buf > DEFAULT_BUFFER_SIZE) { + DBG (5, "sane_get_devices: config option \"buffer-size\" \ + (%d) is > %d, warning!\n", buf, DEFAULT_BUFFER_SIZE); + } + + DBG (15, "sane_get_devices: setting \"buffer-size\" to %d\n", + buf); + global_buffer_size = buf; + } + else { + DBG (5, "sane_get_devices: config option \"%s\" \ + unrecognized\n", lp); + } + } + else if ((strncmp ("scsi", lp, 4) == 0) && isspace (lp[4])) { + DBG (15, "sane_get_devices: looking for '%s'\n", lp); + sanei_config_attach_matching_devices (lp, attach_one); + } + else{ + DBG (5, "sane_get_devices: config line \"%s\" unrecognized\n", + lp); + } + } + fclose (fp); + } + + else { + DBG (5, "sane_get_devices: no config file '%s', using defaults\n", + KODAK_CONFIG_FILE); + DBG (15, "sane_get_devices: looking for 'scsi KODAK'\n"); + sanei_config_attach_matching_devices ("scsi KODAK", attach_one); + } + + for (dev = scanner_devList; dev; dev=dev->next) { + DBG (15, "sane_get_devices: found scanner %s\n",dev->device_name); + num_devices++; + } + + DBG (15, "sane_get_devices: found %d scanner(s)\n",num_devices); + + sane_devArray = calloc (num_devices + 1, sizeof (SANE_Device*)); + if (!sane_devArray) + return SANE_STATUS_NO_MEM; + + for (dev = scanner_devList; dev; dev=dev->next) { + sane_devArray[i++] = (SANE_Device *)&dev->sane; + } + + sane_devArray[i] = 0; + + if(device_list){ + *device_list = sane_devArray; + } + + DBG (10, "sane_get_devices: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* build the scanner struct and link to global list + * unless struct is already loaded, then pretend + */ +static SANE_Status +attach_one (const char *device_name) +{ + struct scanner *s; + int ret; + + DBG (10, "attach_one: start\n"); + DBG (15, "attach_one: looking for '%s'\n", device_name); + + for (s = scanner_devList; s; s = s->next) { + if (strcmp (s->sane.name, device_name) == 0) { + DBG (10, "attach_one: already attached!\n"); + return SANE_STATUS_GOOD; + } + } + + /* build a struct to hold it */ + if ((s = calloc (sizeof (*s), 1)) == NULL) + return SANE_STATUS_NO_MEM; + + /* scsi command/data buffer */ + s->buffer_size = global_buffer_size; + + /* copy the device name */ + s->device_name = strdup (device_name); + if (!s->device_name){ + free (s); + return SANE_STATUS_NO_MEM; + } + + /* connect the fd */ + s->fd = -1; + ret = connect_fd(s); + if(ret != SANE_STATUS_GOOD){ + free (s->device_name); + free (s); + return ret; + } + + /* Now query the device to load its vendor/model/version */ + ret = init_inquire (s); + if (ret != SANE_STATUS_GOOD) { + disconnect_fd(s); + free (s->device_name); + free (s); + DBG (5, "attach_one: inquiry failed\n"); + return ret; + } + + /* clean up the scanner struct based on model */ + /* this is the only piece of model specific code */ + ret = init_model (s); + if (ret != SANE_STATUS_GOOD) { + disconnect_fd(s); + free (s->device_name); + free (s); + DBG (5, "attach_one: model failed\n"); + return ret; + } + + /* sets user 'values' to good defaults */ + ret = init_user (s); + if (ret != SANE_STATUS_GOOD) { + disconnect_fd(s); + free (s->device_name); + free (s); + DBG (5, "attach_one: user failed\n"); + return ret; + } + + /* sets SANE option 'values' to good defaults */ + ret = init_options (s); + if (ret != SANE_STATUS_GOOD) { + disconnect_fd(s); + free (s->device_name); + free (s); + DBG (5, "attach_one: options failed\n"); + return ret; + } + + /* we close the connection, so that another backend can talk to scanner */ + disconnect_fd(s); + + /* load info into sane_device struct */ + s->sane.name = s->device_name; + s->sane.vendor = s->vendor_name; + s->sane.model = s->product_name; + s->sane.type = "scanner"; + + s->next = scanner_devList; + scanner_devList = s; + + DBG (10, "attach_one: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * connect the fd in the scanner struct + */ +static SANE_Status +connect_fd (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int buffer_size = s->buffer_size; + + DBG (10, "connect_fd: start\n"); + + if(s->fd > -1){ + DBG (5, "connect_fd: already open\n"); + ret = SANE_STATUS_GOOD; + } + else { + ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handler, + s, &s->buffer_size); + if(!ret && buffer_size != s->buffer_size){ + DBG (5, "connect_fd: cannot get requested buffer size (%d/%d)\n", + buffer_size, s->buffer_size); + } + else{ + DBG (15, "connect_fd: opened SCSI device\n"); + } + } + + DBG (10, "connect_fd: finish %d\n", ret); + + return ret; +} + +/* + * This routine will check if a certain device is a Kodak scanner + * It also copies interesting data from INQUIRY into the handle structure + */ +static SANE_Status +init_inquire (struct scanner *s) +{ + int i; + SANE_Status ret; + + unsigned char cmd[INQUIRY_len]; + size_t cmdLen = INQUIRY_len; + + unsigned char in[I_data_len]; + size_t inLen = I_data_len; + + DBG (10, "init_inquire: start\n"); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, INQUIRY_code); + set_I_evpd (cmd, 0); + set_I_page_code (cmd, I_page_code_default); + set_I_data_length (cmd, inLen); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + in, &inLen + ); + + if (ret != SANE_STATUS_GOOD){ + return ret; + } + + if (get_I_periph_qual(in) != I_periph_qual_valid){ + DBG (5, "The device at '%s' has invalid periph_qual.\n", s->device_name); + return SANE_STATUS_INVAL; + } + + if (get_I_periph_devtype(in) != I_periph_devtype_scanner){ + DBG (5, "The device at '%s' is not a scanner.\n", s->device_name); + return SANE_STATUS_INVAL; + } + + get_I_vendor (in, s->vendor_name); + get_I_product (in, s->product_name); + get_I_version (in, s->version_name); + get_I_build (in, s->build_name); + + s->vendor_name[8] = 0; + s->product_name[16] = 0; + s->version_name[4] = 0; + s->build_name[2] = 0; + + /* gobble trailing spaces */ + for (i = 7; s->vendor_name[i] == ' ' && i >= 0; i--) + s->vendor_name[i] = 0; + for (i = 15; s->product_name[i] == ' ' && i >= 0; i--) + s->product_name[i] = 0; + for (i = 3; s->version_name[i] == ' ' && i >= 0; i--) + s->version_name[i] = 0; + for (i = 2; s->build_name[i] == ' ' && i >= 0; i--) + s->build_name[i] = 0; + + if (strcmp ("KODAK", s->vendor_name)) { + DBG (5, "The device at '%s' is reported to be made by '%s'\n", s->device_name, s->vendor_name); + DBG (5, "This backend only supports Kodak products.\n"); + return SANE_STATUS_INVAL; + } + + DBG (15, "init_inquire: Found '%s' '%s' '%s' '%s' at '%s'\n", + s->vendor_name, s->product_name, s->version_name, s->build_name, + s->device_name); + + /*defined in SCSI spec*/ + DBG (15, "standard inquiry options\n"); + + /*FIXME: do we need to save these?*/ + DBG (15, " PQ: %d\n",get_I_periph_qual(in)); + DBG (15, " PDT: %d\n",get_I_periph_devtype(in)); + + DBG (15, " RMB: %d\n",get_I_rmb(in)); + DBG (15, " DTQ: %d\n",get_I_devtype_qual(in)); + + DBG (15, " ISO: %d\n",get_I_iso_version(in)); + DBG (15, " ECMA: %d\n",get_I_ecma_version(in)); + DBG (15, " ANSI: %d\n",get_I_ansi_version(in)); + + DBG (15, " AENC: %d\n",get_I_aenc(in)); + DBG (15, " TrmIOP: %d\n",get_I_trmiop(in)); + DBG (15, " RDF: %d\n",get_I_resonse_format(in)); + + DBG (15, " Length: %d\n",get_I_length(in)); + + DBG (15, " RelAdr: %d\n",get_I_reladr(in)); + DBG (15, " WBus32: %d\n",get_I_wbus32(in)); + DBG (15, " WBus16: %d\n",get_I_wbus16(in)); + DBG (15, " Sync: %d\n",get_I_sync(in)); + DBG (15, " Linked: %d\n",get_I_linked(in)); + DBG (15, " CmdQue: %d\n",get_I_cmdque(in)); + DBG (15, " SftRe: %d\n",get_I_sftre(in)); + + /*kodak specific*/ + DBG (15, "vendor inquiry options\n"); + + DBG (15, " MF Disable: %d\n",get_I_mf_disable(in)); + DBG (15, " Checkdigit: %d\n",get_I_checkdigit(in)); + DBG (15, " Front Prism: %d\n",get_I_front_prism(in)); + DBG (15, " Comp Gray: %d\n",get_I_compressed_gray(in)); + DBG (15, " Front Toggle: %d\n",get_I_front_toggle(in)); + DBG (15, " Front DP1: %d\n",get_I_front_dp1(in)); + DBG (15, " Front Color: %d\n",get_I_front_color(in)); + DBG (15, " Front ATP: %d\n",get_I_front_atp(in)); + + DBG (15, " DP1 180: %d\n",get_I_dp1_180(in)); + DBG (15, " MF Pause: %d\n",get_I_mf_pause(in)); + DBG (15, " Rear Prism: %d\n",get_I_rear_prism(in)); + DBG (15, " Uncomp Gray: %d\n",get_I_uncompressed_gray(in)); + DBG (15, " Rear Toggle: %d\n",get_I_rear_toggle(in)); + DBG (15, " Rear DP1: %d\n",get_I_rear_dp1(in)); + DBG (15, " Rear Color: %d\n",get_I_rear_color(in)); + DBG (15, " Rear ATP: %d\n",get_I_rear_atp(in)); + + /* we actually care about these */ + DBG (15, " Min Binary Res: %d\n",get_I_min_bin_res(in)); + s->s_res_min[MODE_LINEART] = get_I_min_bin_res(in); + DBG (15, " Max Binary Res: %d\n",get_I_max_bin_res(in)); + s->s_res_max[MODE_LINEART] = get_I_max_bin_res(in); + DBG (15, " Min Color Res: %d\n",get_I_min_col_res(in)); + s->s_res_min[MODE_COLOR] = get_I_min_col_res(in); + DBG (15, " Max Color Res: %d\n",get_I_max_col_res(in)); + s->s_res_max[MODE_COLOR] = get_I_max_col_res(in); + + DBG (15, " Max Width: %d\n",get_I_max_image_width(in)); + s->s_width_max = get_I_max_image_width(in); + DBG (15, " Max Length: %d\n",get_I_max_image_length(in)); + s->s_length_max = get_I_max_image_length(in); + + /*FIXME: do we need to save these?*/ + DBG (15, " Finecrop: %d\n",get_I_finecrop(in)); + DBG (15, " iThresh: %d\n",get_I_ithresh(in)); + DBG (15, " ECD: %d\n",get_I_ecd(in)); + DBG (15, " VBLR: %d\n",get_I_vblr(in)); + DBG (15, " Elevator: %d\n",get_I_elevator(in)); + DBG (15, " RelCrop: %d\n",get_I_relcrop(in)); + + DBG (15, " CDeskew: %d\n",get_I_cdeskew(in)); + DBG (15, " IA: %d\n",get_I_ia(in)); + DBG (15, " Patch: %d\n",get_I_patch(in)); + DBG (15, " Null Mode: %d\n",get_I_nullmode(in)); + DBG (15, " SABRE: %d\n",get_I_sabre(in)); + DBG (15, " LDDDS: %d\n",get_I_lddds(in)); + DBG (15, " UDDDS: %d\n",get_I_uddds(in)); + DBG (15, " Fixed Gap: %d\n",get_I_fixedgap(in)); + + DBG (15, " HR Printer: %d\n",get_I_hr_printer(in)); + DBG (15, " Elev 100/250: %d\n",get_I_elev_100_250(in)); + DBG (15, " UDDS Individual: %d\n",get_I_udds_individual(in)); + DBG (15, " Auto Color: %d\n",get_I_auto_color(in)); + DBG (15, " WB: %d\n",get_I_wb(in)); + DBG (15, " ES: %d\n",get_I_es(in)); + DBG (15, " FC: %d\n",get_I_fc(in)); + + DBG (15, " Max Rate: %d\n",get_I_max_rate(in)); + DBG (15, " Buffer Size: %d\n",get_I_buffer_size(in)); + + DBG (10, "init_inquire: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * get model specific info that is not in vpd, and correct + * errors in vpd data. struct is already initialized to 0. + */ +static SANE_Status +init_model (struct scanner *s) +{ + + DBG (10, "init_model: start\n"); + + s->s_mode[MODE_LINEART] = 1; + s->s_mode[MODE_HALFTONE] = 1; + s->s_mode[MODE_GRAYSCALE] = 1; + s->s_mode[MODE_COLOR] = 1; + + /* scanner did not tell us these */ + s->s_res_min[MODE_HALFTONE] = s->s_res_min[MODE_LINEART]; + s->s_res_max[MODE_HALFTONE] = s->s_res_max[MODE_LINEART]; + + s->s_res_min[MODE_GRAYSCALE] = s->s_res_min[MODE_COLOR]; + s->s_res_max[MODE_GRAYSCALE] = s->s_res_max[MODE_COLOR]; + + s->s_width_min = 96; + s->s_length_min = 96; + + s->s_brightness_steps = 0; + s->s_contrast_steps = 255; + s->s_threshold_steps = 255; + s->s_rif = 1; + + DBG (10, "init_model: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * set good default user values. + * struct is already initialized to 0. + */ +static SANE_Status +init_user (struct scanner *s) +{ + + DBG (10, "init_user: start\n"); + + /* source */ + s->u_source = SOURCE_ADF_FRONT; + + /* scan mode */ + s->u_mode = MODE_LINEART; + + /*res, minimum for this mode*/ + s->u_res = s->s_res_min[s->u_mode]; + + /* page width US-Letter */ + s->u_page_width = 8.5 * 1200; + if(s->u_page_width > s->s_width_max){ + s->u_page_width = s->s_width_max; + } + + /* page height US-Letter */ + s->u_page_height = 11 * 1200; + if(s->u_page_height > s->s_length_max){ + s->u_page_height = s->s_length_max; + } + + /* bottom-right x */ + s->u_br_x = s->u_page_width; + + /* bottom-right y */ + s->u_br_y = s->u_page_height; + + DBG (10, "init_user: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * This function presets the "option" array to blank + */ +static SANE_Status +init_options (struct scanner *s) +{ + int i; + + DBG (10, "init_options: start\n"); + + memset (s->opt, 0, sizeof (s->opt)); + for (i = 0; i < NUM_OPTIONS; ++i) { + s->opt[i].name = "filler"; + s->opt[i].size = sizeof (SANE_Word); + s->opt[i].cap = SANE_CAP_INACTIVE; + } + + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor + */ + s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; + s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; + s->opt[OPT_NUM_OPTS].desc = SANE_DESC_NUM_OPTIONS; + s->opt[OPT_NUM_OPTS].type = SANE_TYPE_INT; + s->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT; + + DBG (10, "init_options: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * From the SANE spec: + * This function is used to establish a connection to a particular + * device. The name of the device to be opened is passed in argument + * name. If the call completes successfully, a handle for the device + * is returned in *h. As a special case, specifying a zero-length + * string as the device requests opening the first available device + * (if there is such a device). + */ +SANE_Status +sane_open (SANE_String_Const name, SANE_Handle * handle) +{ + struct scanner *dev = NULL; + struct scanner *s = NULL; + SANE_Status ret; + unsigned char cmd[SEND_len]; + size_t cmdLen = SEND_len; + unsigned char out[SR_len_time]; /*longest used in this function*/ + int try=0; + time_t gmt_tt; + struct tm * gmt_tm_p; + struct tm * local_tm_p; + + DBG (10, "sane_open: start\n"); + + if(scanner_devList){ + DBG (15, "sane_open: searching currently attached scanners\n"); + } + else{ + DBG (15, "sane_open: no scanners currently attached, attaching\n"); + + ret = sane_get_devices(NULL,0); + if(ret != SANE_STATUS_GOOD){ + return ret; + } + } + + if(name[0] == 0){ + DBG (15, "sane_open: no device requested, using default\n"); + s = scanner_devList; + } + else{ + DBG (15, "sane_open: device %s requested\n", name); + + for (dev = scanner_devList; dev; dev = dev->next) { + if (strcmp (dev->sane.name, name) == 0) { + s = dev; + break; + } + } + } + + if (!s) { + DBG (5, "sane_open: no device found\n"); + return SANE_STATUS_INVAL; + } + + DBG (15, "sane_open: device %s found\n", s->sane.name); + + *handle = s; + + /* connect the fd so we can talk to scanner */ + ret = connect_fd(s); + if(ret != SANE_STATUS_GOOD){ + return ret; + } + + /*send the end batch (GX) command*/ + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SEND_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_end); + set_SR_xfer_length(cmd,SR_len_end); + + /*start the following loop*/ + ret = SANE_STATUS_DEVICE_BUSY; + s->rs_info = 0; + + /*loop until scanner is ready*/ + while(ret == SANE_STATUS_DEVICE_BUSY){ + DBG (15, "sane_open: GX, try %d, sleep %d\n", try, s->rs_info); + try++; + sleep(s->rs_info); + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + if(try > 5){ + break; + } + } + if(ret){ + DBG (5, "sane_open: GX error %d\n",ret); + return ret; + } + + /*send the clear buffer (CB) command*/ + DBG (15, "sane_open: CB\n"); + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SEND_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_clear); + set_SR_xfer_length(cmd,SR_len_clear); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + if(ret){ + DBG (5, "sane_open: CB error %d\n",ret); + return ret; + } + + /*send the GT command*/ + DBG (15, "sane_open: GT\n"); + gmt_tt = time(NULL); + gmt_tm_p = gmtime(&gmt_tt); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SEND_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_gmt); + set_SR_xfer_length(cmd,SR_len_time); + + memset(out,0,SR_len_time); + set_SR_payload_len(out,SR_len_time); + set_SR_time_hour(out,gmt_tm_p->tm_hour); + set_SR_time_min(out,gmt_tm_p->tm_min); + set_SR_time_mon(out,gmt_tm_p->tm_mon); + set_SR_time_day(out,gmt_tm_p->tm_mday); + set_SR_time_year(out,gmt_tm_p->tm_year+1900); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + out, SR_len_time, + NULL, NULL + ); + if(ret){ + DBG (5, "sane_open: GT error %d\n",ret); + return ret; + } + + /*FIXME: read the LC command? */ + + /*send the LC command*/ + DBG (15, "sane_open: LC\n"); + gmt_tt = time(NULL); + local_tm_p = localtime(&gmt_tt); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SEND_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_clock); + set_SR_xfer_length(cmd,SR_len_time); + + memset(out,0,SR_len_time); + set_SR_payload_len(out,SR_len_time); + set_SR_time_hour(out,local_tm_p->tm_hour); + set_SR_time_min(out,local_tm_p->tm_min); + set_SR_time_mon(out,local_tm_p->tm_mon); + set_SR_time_day(out,local_tm_p->tm_mday); + set_SR_time_year(out,local_tm_p->tm_year+1900); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + out, SR_len_time, + NULL, NULL + ); + if(ret){ + DBG (5, "sane_open: LC error %d\n",ret); + return ret; + } + + DBG (10, "sane_open: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * @@ Section 3 - SANE Options functions + */ + +/* + * Returns the options we know. + * + * From the SANE spec: + * This function is used to access option descriptors. The function + * returns the option descriptor for option number n of the device + * represented by handle h. Option number 0 is guaranteed to be a + * valid option. Its value is an integer that specifies the number of + * options that are available for device handle h (the count includes + * option 0). If n is not a valid option index, the function returns + * NULL. The returned option descriptor is guaranteed to remain valid + * (and at the returned address) until the device is closed. + */ +const SANE_Option_Descriptor * +sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) +{ + struct scanner *s = handle; + int i; + SANE_Option_Descriptor *opt = &s->opt[option]; + + DBG (20, "sane_get_option_descriptor: %d\n", option); + + if ((unsigned) option >= NUM_OPTIONS) + return NULL; + + /* "Mode" group -------------------------------------------------------- */ + if(option==OPT_MODE_GROUP){ + opt->title = "Scan Mode"; + opt->desc = ""; + opt->type = SANE_TYPE_GROUP; + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + + /* source */ + if(option==OPT_SOURCE){ + i=0; + s->o_source_list[i++]=STRING_ADFFRONT; + s->o_source_list[i++]=STRING_ADFBACK; + s->o_source_list[i++]=STRING_ADFDUPLEX; + s->o_source_list[i]=NULL; + + opt->name = SANE_NAME_SCAN_SOURCE; + opt->title = SANE_TITLE_SCAN_SOURCE; + opt->desc = SANE_DESC_SCAN_SOURCE; + opt->type = SANE_TYPE_STRING; + opt->constraint_type = SANE_CONSTRAINT_STRING_LIST; + opt->constraint.string_list = s->o_source_list; + opt->size = maxStringSize (opt->constraint.string_list); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* scan mode */ + if(option==OPT_MODE){ + i=0; + if(s->s_mode[MODE_LINEART]){ + s->o_mode_list[i++]=STRING_LINEART; + } + if(s->s_mode[MODE_HALFTONE]){ + s->o_mode_list[i++]=STRING_HALFTONE; + } + if(s->s_mode[MODE_GRAYSCALE]){ + s->o_mode_list[i++]=STRING_GRAYSCALE; + } + if(s->s_mode[MODE_COLOR]){ + s->o_mode_list[i++]=STRING_COLOR; + } + s->o_mode_list[i]=NULL; + + opt->name = SANE_NAME_SCAN_MODE; + opt->title = SANE_TITLE_SCAN_MODE; + opt->desc = SANE_DESC_SCAN_MODE; + opt->type = SANE_TYPE_STRING; + opt->constraint_type = SANE_CONSTRAINT_STRING_LIST; + opt->constraint.string_list = s->o_mode_list; + opt->size = maxStringSize (opt->constraint.string_list); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* resolution */ + /* build a list of possible choices for current mode */ + if(option==OPT_RES){ + int reslist[]={100,150,200,240,300,400}; + int j; + + i=0; + for(j=0;j<6;j++){ + if(reslist[j] >= s->s_res_min[s->u_mode] + && reslist[j] <= s->s_res_max[s->u_mode]){ + s->o_res_list[s->u_mode][++i] = reslist[j]; + } + } + s->o_res_list[s->u_mode][0] = i; + + opt->name = SANE_NAME_SCAN_RESOLUTION; + opt->title = SANE_TITLE_SCAN_RESOLUTION; + opt->desc = SANE_DESC_SCAN_RESOLUTION; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_DPI; + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + opt->constraint_type = SANE_CONSTRAINT_WORD_LIST; + opt->constraint.word_list = s->o_res_list[s->u_mode]; + } + + /* "Geometry" group ---------------------------------------------------- */ + if(option==OPT_GEOMETRY_GROUP){ + opt->title = "Geometry"; + opt->desc = ""; + opt->type = SANE_TYPE_GROUP; + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + + /* top-left x */ + if(option==OPT_TL_X){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_width_min); + s->o_tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_width_max); + s->o_tl_x_range.quant = MM_PER_UNIT_FIX; + + opt->name = SANE_NAME_SCAN_TL_X; + opt->title = SANE_TITLE_SCAN_TL_X; + opt->desc = SANE_DESC_SCAN_TL_X; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &(s->o_tl_x_range); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* top-left y */ + if(option==OPT_TL_Y){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_length_min); + s->o_tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_length_max); + s->o_tl_y_range.quant = MM_PER_UNIT_FIX; + + opt->name = SANE_NAME_SCAN_TL_Y; + opt->title = SANE_TITLE_SCAN_TL_Y; + opt->desc = SANE_DESC_SCAN_TL_Y; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &(s->o_tl_y_range); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* bottom-right x */ + if(option==OPT_BR_X){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_width_min); + s->o_br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_width_max); + s->o_br_x_range.quant = MM_PER_UNIT_FIX; + + opt->name = SANE_NAME_SCAN_BR_X; + opt->title = SANE_TITLE_SCAN_BR_X; + opt->desc = SANE_DESC_SCAN_BR_X; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &(s->o_br_x_range); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* bottom-right y */ + if(option==OPT_BR_Y){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_length_min); + s->o_br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_length_max); + s->o_br_y_range.quant = MM_PER_UNIT_FIX; + + opt->name = SANE_NAME_SCAN_BR_Y; + opt->title = SANE_TITLE_SCAN_BR_Y; + opt->desc = SANE_DESC_SCAN_BR_Y; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &(s->o_br_y_range); + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* page width */ + if(option==OPT_PAGE_WIDTH){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_page_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_width_min); + s->o_page_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_width_max); + s->o_page_x_range.quant = MM_PER_UNIT_FIX; + + opt->name = "pagewidth"; + opt->title = "ADF paper width"; + opt->desc = "Must be set properly to align scanning window"; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->o_page_x_range; + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* page height */ + if(option==OPT_PAGE_HEIGHT){ + /* values stored in 1200 dpi units */ + /* must be converted to MM for sane */ + s->o_page_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_length_min); + s->o_page_y_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_length_max); + s->o_page_y_range.quant = MM_PER_UNIT_FIX; + + opt->name = "pageheight"; + opt->title = "ADF paper length"; + opt->desc = "Must be set properly to eject pages"; + opt->type = SANE_TYPE_FIXED; + opt->unit = SANE_UNIT_MM; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->o_page_y_range; + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* "Enhancement" group ------------------------------------------------- */ + if(option==OPT_ENHANCEMENT_GROUP){ + opt->title = "Enhancement"; + opt->desc = ""; + opt->type = SANE_TYPE_GROUP; + opt->constraint_type = SANE_CONSTRAINT_NONE; + } + + /* brightness */ + if(option==OPT_BRIGHTNESS){ + opt->name = SANE_NAME_BRIGHTNESS; + opt->title = SANE_TITLE_BRIGHTNESS; + opt->desc = SANE_DESC_BRIGHTNESS; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->o_brightness_range; + s->o_brightness_range.quant=1; + s->o_brightness_range.min=-(s->s_brightness_steps/2); + s->o_brightness_range.max=s->s_brightness_steps/2; + if(opt->constraint.range->max > opt->constraint.range->min){ + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + else{ + opt->cap = SANE_CAP_INACTIVE; + } + } + + /* contrast */ + if(option==OPT_CONTRAST){ + opt->name = SANE_NAME_CONTRAST; + opt->title = SANE_TITLE_CONTRAST; + opt->desc = SANE_DESC_CONTRAST; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->o_contrast_range; + s->o_contrast_range.quant=1; + s->o_contrast_range.min=-(s->s_contrast_steps/2); + s->o_contrast_range.max=s->s_contrast_steps/2; + if(opt->constraint.range->max > opt->constraint.range->min){ + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + else{ + opt->cap = SANE_CAP_INACTIVE; + } + } + + /*threshold*/ + if(option==OPT_THRESHOLD){ + opt->name = SANE_NAME_THRESHOLD; + opt->title = SANE_TITLE_THRESHOLD; + opt->desc = SANE_DESC_THRESHOLD; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->o_threshold_range; + s->o_threshold_range.min=0; + s->o_threshold_range.max=s->s_threshold_steps; + s->o_threshold_range.quant=1; + if(opt->constraint.range->max > opt->constraint.range->min){ + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + else{ + opt->cap = SANE_CAP_INACTIVE; + } + } + + /*rif*/ + if(option==OPT_RIF){ + opt->name = "rif"; + opt->title = "RIF"; + opt->desc = "Reverse image format"; + opt->type = SANE_TYPE_BOOL; + opt->unit = SANE_UNIT_NONE; + if (s->s_rif) + opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + else + opt->cap = SANE_CAP_INACTIVE; + } + + return opt; +} + +/** + * Gets or sets an option value. + * + * From the SANE spec: + * This function is used to set or inquire the current value of option + * number n of the device represented by handle h. The manner in which + * the option is controlled is specified by parameter action. The + * possible values of this parameter are described in more detail + * below. The value of the option is passed through argument val. It + * is a pointer to the memory that holds the option value. The memory + * area pointed to by v must be big enough to hold the entire option + * value (determined by member size in the corresponding option + * descriptor). + * + * The only exception to this rule is that when setting the value of a + * string option, the string pointed to by argument v may be shorter + * since the backend will stop reading the option value upon + * encountering the first NUL terminator in the string. If argument i + * is not NULL, the value of *i will be set to provide details on how + * well the request has been met. + */ +SANE_Status +sane_control_option (SANE_Handle handle, SANE_Int option, + SANE_Action action, void *val, SANE_Int * info) +{ + struct scanner *s = (struct scanner *) handle; + SANE_Int dummy = 0; + + /* Make sure that all those statements involving *info cannot break (better + * than having to do "if (info) ..." everywhere!) + */ + if (info == 0) + info = &dummy; + + if (option >= NUM_OPTIONS) { + DBG (5, "sane_control_option: %d too big\n", option); + return SANE_STATUS_INVAL; + } + + if (!SANE_OPTION_IS_ACTIVE (s->opt[option].cap)) { + DBG (5, "sane_control_option: %d inactive\n", option); + return SANE_STATUS_INVAL; + } + + /* + * SANE_ACTION_GET_VALUE: We have to find out the current setting and + * return it in a human-readable form (often, text). + */ + if (action == SANE_ACTION_GET_VALUE) { + SANE_Word * val_p = (SANE_Word *) val; + + DBG (20, "sane_control_option: get value for '%s' (%d)\n", s->opt[option].name,option); + + switch (option) { + + case OPT_NUM_OPTS: + *val_p = NUM_OPTIONS; + return SANE_STATUS_GOOD; + + case OPT_SOURCE: + if(s->u_source == SOURCE_ADF_FRONT){ + strcpy (val, STRING_ADFFRONT); + } + else if(s->u_source == SOURCE_ADF_BACK){ + strcpy (val, STRING_ADFBACK); + } + else if(s->u_source == SOURCE_ADF_DUPLEX){ + strcpy (val, STRING_ADFDUPLEX); + } + else{ + DBG(5,"missing option val for source\n"); + } + return SANE_STATUS_GOOD; + + case OPT_MODE: + if(s->u_mode == MODE_LINEART){ + strcpy (val, STRING_LINEART); + } + else if(s->u_mode == MODE_HALFTONE){ + strcpy (val, STRING_HALFTONE); + } + else if(s->u_mode == MODE_GRAYSCALE){ + strcpy (val, STRING_GRAYSCALE); + } + else if(s->u_mode == MODE_COLOR){ + strcpy (val, STRING_COLOR); + } + return SANE_STATUS_GOOD; + + case OPT_RES: + *val_p = s->u_res; + return SANE_STATUS_GOOD; + + case OPT_TL_X: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_tl_x); + return SANE_STATUS_GOOD; + + case OPT_TL_Y: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_tl_y); + return SANE_STATUS_GOOD; + + case OPT_BR_X: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_br_x); + return SANE_STATUS_GOOD; + + case OPT_BR_Y: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_br_y); + return SANE_STATUS_GOOD; + + case OPT_PAGE_WIDTH: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_page_width); + return SANE_STATUS_GOOD; + + case OPT_PAGE_HEIGHT: + *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_page_height); + return SANE_STATUS_GOOD; + + case OPT_BRIGHTNESS: + *val_p = s->u_brightness; + return SANE_STATUS_GOOD; + + case OPT_CONTRAST: + *val_p = s->u_contrast; + return SANE_STATUS_GOOD; + + case OPT_THRESHOLD: + *val_p = s->u_threshold; + return SANE_STATUS_GOOD; + + case OPT_RIF: + *val_p = s->u_rif; + return SANE_STATUS_GOOD; + } + } + else if (action == SANE_ACTION_SET_VALUE) { + int tmp; + SANE_Word val_c; + SANE_Status status; + + DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); + + if ( s->started ) { + DBG (5, "sane_control_option: cant set, device busy\n"); + return SANE_STATUS_DEVICE_BUSY; + } + + if (!SANE_OPTION_IS_SETTABLE (s->opt[option].cap)) { + DBG (5, "sane_control_option: not settable\n"); + return SANE_STATUS_INVAL; + } + + status = sanei_constrain_value (s->opt + option, val, info); + if (status != SANE_STATUS_GOOD) { + DBG (5, "sane_control_option: bad value\n"); + return status; + } + + /* may have been changed by constrain, so dont copy until now */ + val_c = *(SANE_Word *)val; + + /* + * Note - for those options which can assume one of a list of + * valid values, we can safely assume that they will have + * exactly one of those values because that's what + * sanei_constrain_value does. Hence no "else: invalid" branches + * below. + */ + switch (option) { + + /* Mode Group */ + case OPT_SOURCE: + if (!strcmp (val, STRING_ADFFRONT)) { + tmp = SOURCE_ADF_FRONT; + } + else if (!strcmp (val, STRING_ADFBACK)) { + tmp = SOURCE_ADF_BACK; + } + else{ + tmp = SOURCE_ADF_DUPLEX; + } + + if (s->u_source != tmp) { + s->u_source = tmp; + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_MODE: + if (!strcmp (val, STRING_LINEART)) { + tmp = MODE_LINEART; + } + else if (!strcmp (val, STRING_HALFTONE)) { + tmp = MODE_HALFTONE; + } + else if (!strcmp (val, STRING_GRAYSCALE)) { + tmp = MODE_GRAYSCALE; + } + else{ + tmp = MODE_COLOR; + } + + if (tmp != s->u_mode){ + s->u_mode = tmp; + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_RES: + + if (s->u_res != val_c) { + s->u_res = val_c; + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + /* Geometry Group */ + case OPT_TL_X: + if (s->u_tl_x != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_tl_x = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_TL_Y: + if (s->u_tl_y != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_tl_y = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_BR_X: + if (s->u_br_x != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_br_x = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_BR_Y: + if (s->u_br_y != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_br_y = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_PAGE_WIDTH: + if (s->u_page_width != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_page_width = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + case OPT_PAGE_HEIGHT: + if (s->u_page_height != FIXED_MM_TO_SCANNER_UNIT(val_c)){ + s->u_page_height = FIXED_MM_TO_SCANNER_UNIT(val_c); + *info |= SANE_INFO_RELOAD_OPTIONS; + } + return SANE_STATUS_GOOD; + + /* Enhancement Group */ + case OPT_BRIGHTNESS: + if (s->u_brightness != val_c){ + s->u_brightness = val_c; + } + return SANE_STATUS_GOOD; + + case OPT_CONTRAST: + if (s->u_contrast != val_c){ + s->u_contrast = val_c; + } + return SANE_STATUS_GOOD; + + case OPT_THRESHOLD: + if (s->u_threshold != val_c){ + s->u_threshold = val_c; + } + return SANE_STATUS_GOOD; + + case OPT_RIF: + if (s->u_rif != val_c){ + s->u_rif = val_c; + } + return SANE_STATUS_GOOD; + + } /* switch */ + } /* else */ + + return SANE_STATUS_INVAL; +} + +/* + * @@ Section 4 - SANE scanning functions + */ +/* + * Called by SANE to retrieve information about the type of data + * that the current scan will return. + * + * From the SANE spec: + * This function is used to obtain the current scan parameters. The + * returned parameters are guaranteed to be accurate between the time + * a scan has been started (sane_start() has been called) and the + * completion of that request. Outside of that window, the returned + * values are best-effort estimates of what the parameters will be + * when sane_start() gets invoked. + * + * Calling this function before a scan has actually started allows, + * for example, to get an estimate of how big the scanned image will + * be. The parameters passed to this function are the handle h of the + * device for which the parameters should be obtained and a pointer p + * to a parameter structure. + */ +/* SANE_Parameters is defined as a struct containing: + SANE_Frame format; + SANE_Bool last_frame; + SANE_Int lines; + SANE_Int depth; ( binary=1, gray=8, color=8 (!24) ) + SANE_Int pixels_per_line; + SANE_Int bytes_per_line; +*/ +SANE_Status +sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) +{ + SANE_Status ret = SANE_STATUS_GOOD; + struct scanner *s = (struct scanner *) handle; + + DBG (10, "sane_get_parameters: start\n"); + + /* started? get param data from image header */ + if(s->started){ + DBG (15, "sane_get_parameters: image settings:\n"); + + DBG (15, " tlx=%d, brx=%d, iw=%d, maxx=%d\n", + s->i_tlx, (s->i_tlx+s->i_width), s->i_width, s->s_width_max/1200); + DBG (15, " tly=%d, bry=%d, il=%d, maxy=%d\n", + s->i_tly, (s->i_tly+s->i_length), s->i_length, s->s_length_max/1200); + DBG (15, " res=%d, id=%d, bytes=%d\n", + s->i_dpi, s->i_id, s->i_bytes); + + params->last_frame = 1; + params->lines = s->i_length; + params->pixels_per_line = s->i_width; + + /* bitonal */ + if (s->i_bpp == 1) { + params->format = SANE_FRAME_GRAY; + params->depth = 1; + params->bytes_per_line = params->pixels_per_line / 8; + +#ifdef SANE_FRAME_G42D + /*G4 fax compression*/ + if (s->i_compr) { + params->format = SANE_FRAME_G42D; + } +#endif + } + /* gray */ + else if (s->i_bpp == 8) { + params->format = SANE_FRAME_GRAY; + params->depth = 8; + params->bytes_per_line = params->pixels_per_line; + +#ifdef SANE_FRAME_JPEG + /*jpeg compression*/ + if (s->i_compr) { + params->format = SANE_FRAME_JPEG; + } +#endif + } + /* color */ + else if (s->i_bpp == 24 || s->i_bpp == 96) { + params->format = SANE_FRAME_RGB; + params->depth = 8; + params->bytes_per_line = params->pixels_per_line * 3; + +#ifdef SANE_FRAME_JPEG + /*jpeg compression*/ + if (s->i_compr) { + params->format = SANE_FRAME_JPEG; + } +#endif + } + else{ + DBG(5,"sane_get_parameters: unsupported depth %d\n", s->i_bpp); + return SANE_STATUS_INVAL; + } + } + + /* not started? get param data from user input */ + else{ + + DBG (15, "sane_get_parameters: user settings:\n"); + + DBG (15, " tlx=%d, brx=%d, pw=%d, maxx=%d\n", + s->u_tl_x, s->u_br_x, s->u_page_width, s->s_width_max); + DBG (15, " tly=%d, bry=%d, ph=%d, maxy=%d\n", + s->u_tl_y, s->u_br_y, s->u_page_height, s->s_length_max); + DBG (15, " res=%d, user_x=%d, user_y=%d\n", + s->u_res, (s->u_res * (s->u_br_x - s->u_tl_x) / 1200), + (s->u_res * (s->u_br_y - s->u_tl_y) / 1200)); + + if (s->u_mode == MODE_COLOR) { + params->format = SANE_FRAME_RGB; + params->depth = 8; + } + else if (s->u_mode == MODE_GRAYSCALE) { + params->format = SANE_FRAME_GRAY; + params->depth = 8; + } + else { + params->format = SANE_FRAME_GRAY; + params->depth = 1; + } + + params->last_frame = 1; + params->lines = s->u_res * (s->u_br_y - s->u_tl_y) / 1200; + params->pixels_per_line = s->u_res * (s->u_br_x - s->u_tl_x) / 1200; + + /* bytes per line differs by mode */ + if (s->u_mode == MODE_COLOR) { + params->bytes_per_line = params->pixels_per_line * 3; + } + else if (s->u_mode == MODE_GRAYSCALE) { + params->bytes_per_line = params->pixels_per_line; + } + else { + params->bytes_per_line = params->pixels_per_line / 8; + } + + } + + DBG (15, "sane_get_parameters: returning:\n"); + DBG (15, " scan_x=%d, Bpl=%d, depth=%d\n", + params->pixels_per_line, params->bytes_per_line, params->depth ); + + DBG (15, " scan_y=%d, frame=%d, last=%d\n", + params->lines, params->format, params->last_frame ); + + DBG (10, "sane_get_parameters: finish\n"); + + return ret; +} + +/* + * Called by SANE when a page acquisition operation is to be started. + * commands: scanner control (lampon), send (lut), send (dither), + * set window, object pos, and scan + * + * this will be called before each image, including duplex backsides, + * and at the start of adf batch. + * hence, we spend alot of time playing with s->started, etc. + */ +SANE_Status +sane_start (SANE_Handle handle) +{ + struct scanner *s = handle; + SANE_Status ret; + + DBG (10, "sane_start: start\n"); + + DBG (15, "started=%d, source=%d\n", s->started, s->u_source); + + /* batch already running */ + if(s->started){ + /* not finished with current image, error */ + if (s->bytes_tx != s->i_bytes) { + DBG(5,"sane_start: previous transfer not finished?"); + return do_cancel(s); + } + } + + /* first page of batch */ + else{ + + unsigned char cmd[SCAN_len]; + unsigned char pay[SR_len_startstop]; + + /* set window command */ + ret = set_window(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot set window\n"); + do_cancel(s); + return ret; + } + + /* read/send JQ command */ + + /* read/send SC command */ + ret = send_sc(s); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR: cannot send SC\n"); + do_cancel(s); + return ret; + } + + /* read/send CT command */ + + DBG (15, "sane_start: send SCAN\n"); + memset(cmd, 0, SCAN_len); + set_SCSI_opcode(cmd, SCAN_code); + + ret = do_cmd ( + s, 1, 0, + cmd, SCAN_len, + NULL, 0, + NULL, NULL + ); + if (ret != SANE_STATUS_GOOD) { + DBG (5, "sane_start: ERROR sending SCAN\n"); + do_cancel(s); + return ret; + } + + /* send SS command */ + DBG (15, "sane_start: send SS\n"); + memset(cmd,0,SEND_len); + set_SCSI_opcode(cmd,SEND_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_startstop); + set_SR_xfer_length(cmd,SR_len_startstop); + + memset(pay,0,SR_len_startstop); + set_SR_payload_len(pay,SR_len_startstop); + set_SR_startstop_cmd(pay,1); + + ret = do_cmd ( + s, 1, 0, + cmd, SEND_len, + pay, SR_len_startstop, + NULL, NULL + ); + if(ret){ + DBG (5, "sane_open: SS error %d\n",ret); + return ret; + } + + DBG (15, "sane_start: sleeping\n"); + sleep(2); + + s->started=1; + } + + ret = read_imageheader(s); + if(ret){ + DBG (5, "sane_open: error reading imageheader %d\n",ret); + return ret; + } + + /* set clean defaults */ + s->bytes_rx = 0; + s->bytes_tx = 0; + + /* make large buffer to hold the images */ + DBG (15, "sane_start: setup buffer\n"); + + /* free current buffer if too small */ + if (s->buffer && s->bytes_buf < s->i_bytes) { + DBG (15, "sane_start: free buffer.\n"); + free(s->buffer); + s->buffer = NULL; + s->bytes_buf = 0; + } + + /* grab new buffer if dont have one */ + if (!s->buffer) { + DBG (15, "sane_start: calloc buffer.\n"); + s->buffer = calloc (1,s->i_bytes); + if (!s->buffer) { + DBG (5, "sane_start: Error, no buffer\n"); + do_cancel(s); + return SANE_STATUS_NO_MEM; + } + } + + DBG (15, "started=%d, source=%d\n", s->started, s->u_source); + + DBG (10, "sane_start: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * This routine issues a SCSI SET WINDOW command to the scanner, using the + * values currently in the scanner data structure. + * the scanner has 4 separate windows, and all must be set similarly, + * even if you dont intend to aquire images from all of them. + */ +static SANE_Status +set_window (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + unsigned char cmd[SET_WINDOW_len]; + size_t cmdLen = SET_WINDOW_len; + + /* the data phase has a header, followed by a window desc block + * the header specifies the number of bytes in 1 window desc block */ + unsigned char pay[WINDOW_HEADER_len + WINDOW_DESCRIPTOR_len]; + size_t payLen = WINDOW_HEADER_len + WINDOW_DESCRIPTOR_len; + + unsigned char * desc = pay + WINDOW_HEADER_len; + + int width = (s->u_br_x - s->u_tl_x) * s->u_res/1200; + int length = (s->u_br_y - s->u_tl_y) * s->u_res/1200; + + DBG (10, "set_window: start\n"); + + /* binary window settings */ + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SET_WINDOW_code); + set_SW_xferlen(cmd,payLen); + + memset(pay,0,payLen); + set_WH_desc_len(pay,WINDOW_DESCRIPTOR_len); + + set_WD_wid(desc,WD_wid_front_binary); + + /* common settings */ + set_WD_Xres (desc, s->u_res); + set_WD_Yres (desc, s->u_res); + + set_WD_ULX (desc, s->u_tl_x); + set_WD_ULY (desc, s->u_tl_y); + + /* width % 32 == 0 && length % 1 == 0 */ + width -= width % 32; + width = width*1200/s->u_res; + + length = length*1200/s->u_res; + + set_WD_width (desc, width); + set_WD_length (desc, length); + + /* brightness not supported? */ + set_WD_brightness (desc, 0); + set_WD_threshold (desc, s->u_threshold); + set_WD_contrast (desc, 0); + if(s->s_contrast_steps){ + /*convert our common -127 to +127 range into HW's range + *FIXME: this code assumes hardware range of 1-255 */ + set_WD_contrast (desc, s->u_contrast+128); + } + + if(s->u_mode == MODE_HALFTONE){ + set_WD_composition (desc, WD_compo_HALFTONE); + set_WD_bitsperpixel (desc, 1); + } + else{ + set_WD_composition (desc, WD_compo_LINEART); + set_WD_bitsperpixel (desc, 1); + } + + /* FIXME ht pattern */ + + set_WD_rif (desc, s->u_rif); + + set_WD_bitorder (desc, 1); + + /* compression options */ + if(s->u_compr) + set_WD_compress_type (desc, WD_compr_FAXG4); + + /*FIXME: noise filter */ + + set_WD_allow_zero(desc,1); + set_WD_cropping (desc, WD_crop_RELATIVE); + + /*FIXME: more settings here*/ + + hexdump(15, "front binary window:", desc, WINDOW_DESCRIPTOR_len); + + DBG (15, "set_window: set window binary back\n"); + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + if(ret){ + DBG (5, "set_window: error setting binary front window %d\n",ret); + return ret; + } + + /*send the window for backside too*/ + set_WD_wid(desc,WD_wid_back_binary); + + DBG (15, "set_window: set window binary back\n"); + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + if(ret){ + DBG (5, "set_window: error setting binary back window %d\n",ret); + return ret; + } + +#if 0 + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,GET_WINDOW_code); + set_GW_single(cmd,1); + set_GW_wid(cmd,WD_wid_front_color); + set_GW_xferlen(cmd,payLen); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + pay, &payLen + ); + if(ret){ + DBG (5, "set_window: error getting window %d\n",ret); + return ret; + } + hexdump(15,"foo",pay,payLen); +#endif + + /* color window settings */ + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,SET_WINDOW_code); + set_SW_xferlen(cmd,payLen); + + memset(pay,0,payLen); + set_WH_desc_len(pay,WINDOW_DESCRIPTOR_len); + + set_WD_wid(desc,WD_wid_front_color); + + /* common settings */ + set_WD_Xres (desc, s->u_res); + set_WD_Yres (desc, s->u_res); + + set_WD_ULX (desc, s->u_tl_x); + set_WD_ULY (desc, s->u_tl_y); + + set_WD_width (desc, width); + set_WD_length (desc, length); + + /*gray mode*/ + if(s->u_mode == MODE_GRAYSCALE){ + /* + gamma + width % 8 == 0 && length % 8 == 0 + */ + set_WD_composition (desc, WD_compo_MULTILEVEL); + set_WD_bitsperpixel (desc, 8); + } + /*color mode or color window in binary mode*/ + else{ + /* + width % 16 == 0 && length % 8 == 0 + */ + set_WD_composition (desc, WD_compo_MULTILEVEL); + set_WD_bitsperpixel (desc, 24); + + /* compression options */ + if(s->u_compr) + set_WD_compress_type (desc, WD_compr_JPEG); + } + + set_WD_bitorder (desc, 1); + + /*FIXME: noise filter */ + + set_WD_allow_zero(desc,1); + set_WD_cropping (desc, WD_crop_RELATIVE); + + /*FIXME: more settings here*/ + + DBG (15, "set_window: set window color front\n"); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + if(ret){ + DBG (5, "set_window: error setting color front window %d\n",ret); + return ret; + } + + /*send the window for backside too*/ + set_WD_wid(desc,WD_wid_back_color); + + DBG (15, "set_window: set window color back\n"); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + if(ret){ + DBG (5, "set_window: error setting color back window %d\n",ret); + return ret; + } + + DBG (10, "set_window: finish\n"); + + return ret; +} + +/* + * This routine reads the SC (scanner config) data from the scanner + * modifies a few params based on user data, and sends it back + */ +static SANE_Status +send_sc(struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + unsigned char cmd[READ_len]; + size_t cmdLen = READ_len; + unsigned char pay[SR_len_config]; + size_t payLen = SR_len_config; + + /* send SC command */ + DBG (10, "send_sc: start\n"); + + DBG (15, "send_sc: reading config\n"); + memset(cmd,0,READ_len); + set_SCSI_opcode(cmd,READ_code); + + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_config); + set_SR_xfer_length(cmd,SR_len_config); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + pay, &payLen + ); + if(ret || !payLen){ + DBG (5, "send_sc: error reading: %d\n",ret); + return ret; + } + + memset(cmd,0,SEND_len); + set_SCSI_opcode(cmd,SEND_code); + + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_config); + set_SR_xfer_length(cmd,payLen); + + if(s->u_source == SOURCE_ADF_FRONT){ + if(s->u_mode == MODE_COLOR || s->u_mode == MODE_GRAYSCALE){ + set_SR_sc_io1(pay,SR_sc_io_front_color); + } + else{ + set_SR_sc_io1(pay,SR_sc_io_front_binary); + } + set_SR_sc_io2(pay,SR_sc_io_none); + set_SR_sc_io3(pay,SR_sc_io_none); + set_SR_sc_io4(pay,SR_sc_io_none); + } + else if(s->u_source == SOURCE_ADF_BACK){ + if(s->u_mode == MODE_COLOR || s->u_mode == MODE_GRAYSCALE){ + set_SR_sc_io1(pay,SR_sc_io_rear_color); + } + else{ + set_SR_sc_io1(pay,SR_sc_io_rear_binary); + } + set_SR_sc_io2(pay,SR_sc_io_none); + set_SR_sc_io3(pay,SR_sc_io_none); + set_SR_sc_io4(pay,SR_sc_io_none); + } + else{ + if(s->u_mode == MODE_COLOR || s->u_mode == MODE_GRAYSCALE){ + set_SR_sc_io1(pay,SR_sc_io_front_color); + set_SR_sc_io2(pay,SR_sc_io_rear_color); + } + else{ + set_SR_sc_io1(pay,SR_sc_io_front_binary); + set_SR_sc_io2(pay,SR_sc_io_rear_binary); + } + set_SR_sc_io3(pay,SR_sc_io_none); + set_SR_sc_io4(pay,SR_sc_io_none); + } + + /*FIXME: there are hundreds of other settings in this payload*/ + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + pay, payLen, + NULL, NULL + ); + + DBG (10, "send_sc: finish %d\n",ret); + + return ret; +} + +/* + * This routine reads the image header from the scanner, and updates + * values currently in the scanner data structure. + */ +static SANE_Status +read_imageheader (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + + unsigned char cmd[READ_len]; + unsigned char pay[SR_len_imageheader]; + size_t payLen = SR_len_imageheader; + int pass = 0; + + /* read img header */ + DBG (10, "read_imageheader: start\n"); + + memset(cmd,0,READ_len); + set_SCSI_opcode(cmd,READ_code); + set_SR_datatype_code(cmd,SR_datatype_imageheader); + set_SR_xfer_length(cmd,SR_len_imageheader); + + while (pass++ < 1000){ + + DBG (15, "read_imageheader: pass %d\n", pass); + + payLen = SR_len_imageheader; + + ret = do_cmd ( + s, 1, 0, + cmd, READ_len, + NULL, 0, + pay, &payLen + ); + + DBG (15, "read_imageheader: pass status %d\n", ret); + + if(ret != SANE_STATUS_DEVICE_BUSY){ + break; + } + + usleep(50000); + } + + if (ret == SANE_STATUS_GOOD){ + + DBG (15, "image header:\n"); + + DBG (15, " bytes: %d\n",get_SR_ih_image_length(pay)); + s->i_bytes = get_SR_ih_image_length(pay); + + DBG (15, " id: %d\n",get_SR_ih_image_id(pay)); + s->i_id = get_SR_ih_image_id(pay); + + DBG (15, " dpi: %d\n",get_SR_ih_resolution(pay)); + s->i_dpi = get_SR_ih_resolution(pay); + + DBG (15, " tlx: %d\n",get_SR_ih_ulx(pay)); + s->i_tlx = get_SR_ih_ulx(pay); + + DBG (15, " tly: %d\n",get_SR_ih_uly(pay)); + s->i_tly = get_SR_ih_uly(pay); + + DBG (15, " width: %d\n",get_SR_ih_width(pay)); + s->i_width = get_SR_ih_width(pay); + + DBG (15, " length: %d\n",get_SR_ih_length(pay)); + s->i_length = get_SR_ih_length(pay); + + DBG (15, " bpp: %d\n",get_SR_ih_bpp(pay)); + s->i_bpp = get_SR_ih_bpp(pay); + + DBG (15, " comp: %d\n",get_SR_ih_comp_type(pay)); + s->i_compr = get_SR_ih_comp_type(pay); + + /*FIXME: there are alot more of these?*/ + } + + DBG (10, "read_imageheader: finish %d\n", ret); + + return ret; +} + +/* + * Called by SANE to read data. + * + * From the SANE spec: + * This function is used to read image data from the device + * represented by handle h. Argument buf is a pointer to a memory + * area that is at least maxlen bytes long. The number of bytes + * returned is stored in *len. A backend must set this to zero when + * the call fails (i.e., when a status other than SANE_STATUS_GOOD is + * returned). + * + * When the call succeeds, the number of bytes returned can be + * anywhere in the range from 0 to maxlen bytes. + */ +SANE_Status +sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len) +{ + struct scanner *s = (struct scanner *) handle; + SANE_Status ret=0; + + DBG (10, "sane_read: start\n"); + + *len=0; + + /* maybe cancelled? */ + if(!s->started){ + DBG (5, "sane_read: not started, call sane_start\n"); + return SANE_STATUS_CANCELLED; + } + + /* sane_start required between images */ + if(s->bytes_tx == s->i_bytes){ + DBG (15, "sane_read: returning eof\n"); + return SANE_STATUS_EOF; + } + + if(s->i_bytes > s->bytes_rx ){ + ret = read_from_scanner(s); + if(ret){ + DBG(5,"sane_read: returning %d\n",ret); + return ret; + } + } + + /* copy a block from buffer to frontend */ + ret = read_from_buffer(s,buf,max_len,len); + + DBG (10, "sane_read: finish\n"); + + return ret; +} + +static SANE_Status +read_from_scanner(struct scanner *s) +{ + SANE_Status ret=SANE_STATUS_GOOD; + int bytes = s->buffer_size; + int remain = s->i_bytes - s->bytes_rx; + unsigned char * buf; + size_t inLen = 0; + + unsigned char cmd[READ_len]; + int cmdLen=READ_len; + + DBG (10, "read_from_scanner: start\n"); + + memset(cmd, 0, cmdLen); + set_SCSI_opcode(cmd, READ_code); + + /* figure out the max amount to transfer */ + if(bytes > remain){ + bytes = remain; + } + + DBG(15, "read_from_scanner: to:%d rx:%d re:%d bu:%d pa:%d\n", + s->i_bytes, s->bytes_rx, remain, s->buffer_size, bytes); + + if(ret){ + return ret; + } + + inLen = bytes; + + buf = malloc(bytes); + if(!buf){ + DBG(5, "read_from_scanner: not enough mem for buffer: %d\n",bytes); + return SANE_STATUS_NO_MEM; + } + + set_SR_datatype_code (cmd, SR_datatype_imagedata); + set_SR_xfer_length (cmd, bytes); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + buf, &inLen + ); + + if (ret == SANE_STATUS_GOOD) { + DBG(15, "read_from_scanner: got GOOD, returning GOOD\n"); + } + else if (ret == SANE_STATUS_EOF) { + DBG(15, "read_from_scanner: got EOF, finishing\n"); + } + else if (ret == SANE_STATUS_DEVICE_BUSY) { + DBG(5, "read_from_scanner: got BUSY, returning GOOD\n"); + inLen = 0; + ret = SANE_STATUS_GOOD; + } + else { + DBG(5, "read_from_scanner: error reading data block status = %d\n",ret); + inLen = 0; + } + + if(inLen){ + copy_buffer (s, buf, inLen); + } + + free(buf); + + if(ret == SANE_STATUS_EOF){ + DBG (5, "read_from_scanner: unexpected EOF, shortening image\n"); + s->i_bytes = s->bytes_rx; + ret = SANE_STATUS_GOOD; + } + + DBG (10, "read_from_scanner: finish\n"); + + return ret; +} + +static SANE_Status +copy_buffer(struct scanner *s, unsigned char * buf, int len) +{ + SANE_Status ret=SANE_STATUS_GOOD; + + DBG (10, "copy_buffer: start\n"); + + memcpy(s->buffer+s->bytes_rx,buf,len); + s->bytes_rx += len; + + DBG (10, "copy_buffer: finish\n"); + + return ret; +} + +static SANE_Status +read_from_buffer(struct scanner *s, SANE_Byte * buf, + SANE_Int max_len, SANE_Int * len) +{ + SANE_Status ret=SANE_STATUS_GOOD; + int bytes = max_len; + int remain = s->bytes_rx - s->bytes_tx; + + DBG (10, "read_from_buffer: start\n"); + + /* figure out the max amount to transfer */ + if(bytes > remain){ + bytes = remain; + } + + *len = bytes; + + DBG(15, "read_from_buffer: to:%d tx:%d re:%d bu:%d pa:%d\n", + s->i_bytes, s->bytes_tx, remain, max_len, bytes); + + /*FIXME this needs to timeout eventually */ + if(!bytes){ + DBG(5,"read_from_buffer: nothing to do\n"); + return SANE_STATUS_GOOD; + } + + memcpy(buf,s->buffer+s->bytes_tx,bytes); + + s->bytes_tx += *len; + + DBG (10, "read_from_buffer: finish\n"); + + return ret; +} + + +/* + * @@ Section 4 - SANE cleanup functions + */ +/* + * Cancels a scan. + * + * It has been said on the mailing list that sane_cancel is a bit of a + * misnomer because it is routinely called to signal the end of a + * batch - quoting David Mosberger-Tang: + * + * > In other words, the idea is to have sane_start() be called, and + * > collect as many images as the frontend wants (which could in turn + * > consist of multiple frames each as indicated by frame-type) and + * > when the frontend is done, it should call sane_cancel(). + * > Sometimes it's better to think of sane_cancel() as "sane_stop()" + * > but that name would have had some misleading connotations as + * > well, that's why we stuck with "cancel". + * + * The current consensus regarding duplex and ADF scans seems to be + * the following call sequence: sane_start; sane_read (repeat until + * EOF); sane_start; sane_read... and then call sane_cancel if the + * batch is at an end. I.e. do not call sane_cancel during the run but + * as soon as you get a SANE_STATUS_NO_DOCS. + * + * From the SANE spec: + * This function is used to immediately or as quickly as possible + * cancel the currently pending operation of the device represented by + * handle h. This function can be called at any time (as long as + * handle h is a valid handle) but usually affects long-running + * operations only (such as image is acquisition). It is safe to call + * this function asynchronously (e.g., from within a signal handler). + * It is important to note that completion of this operaton does not + * imply that the currently pending operation has been cancelled. It + * only guarantees that cancellation has been initiated. Cancellation + * completes only when the cancelled call returns (typically with a + * status value of SANE_STATUS_CANCELLED). Since the SANE API does + * not require any other operations to be re-entrant, this implies + * that a frontend must not call any other operation until the + * cancelled operation has returned. + */ +void +sane_cancel (SANE_Handle handle) +{ + DBG (10, "sane_cancel: start\n"); + do_cancel ((struct scanner *) handle); + DBG (10, "sane_cancel: finish\n"); +} + +/* + * Performs cleanup. + * FIXME: do better cleanup if scanning is ongoing... + */ +static SANE_Status +do_cancel (struct scanner *s) +{ + DBG (10, "do_cancel: start\n"); + + s->started = 0; + + DBG (10, "do_cancel: finish\n"); + + return SANE_STATUS_CANCELLED; +} + +/* + * Ends use of the scanner. + * + * From the SANE spec: + * This function terminates the association between the device handle + * passed in argument h and the device it represents. If the device is + * presently active, a call to sane_cancel() is performed first. After + * this function returns, handle h must not be used anymore. + */ +void +sane_close (SANE_Handle handle) +{ + DBG (10, "sane_close: start\n"); + + do_cancel((struct scanner *) handle); + disconnect_fd((struct scanner *) handle); + + DBG (10, "sane_close: finish\n"); +} + +static SANE_Status +disconnect_fd (struct scanner *s) +{ + DBG (10, "disconnect_fd: start\n"); + + if(s->fd > -1){ + DBG (15, "disconnecting scsi device\n"); + sanei_scsi_close (s->fd); + s->fd = -1; + } + + DBG (10, "disconnect_fd: finish\n"); + + return SANE_STATUS_GOOD; +} + +/* + * Terminates the backend. + * + * From the SANE spec: + * This function must be called to terminate use of a backend. The + * function will first close all device handles that still might be + * open (it is recommended to close device handles explicitly through + * a call to sane_close(), but backends are required to release all + * resources upon a call to this function). After this function + * returns, no function other than sane_init() may be called + * (regardless of the status value returned by sane_exit(). Neglecting + * to call this function may result in some resources not being + * released properly. + */ +void +sane_exit (void) +{ + struct scanner *dev, *next; + + DBG (10, "sane_exit: start\n"); + + for (dev = scanner_devList; dev; dev = next) { + disconnect_fd(dev); + next = dev->next; + free (dev->device_name); + free (dev); + } + + if (sane_devArray) + free (sane_devArray); + + scanner_devList = NULL; + sane_devArray = NULL; + + DBG (10, "sane_exit: finish\n"); +} + + +/* + * @@ Section 5 - misc helper functions + */ +/* + * Called by the SANE SCSI core on device errors + * parses the request sense return data buffer, + * decides the best SANE_Status for the problem + * and produces debug msgs + */ +static SANE_Status +sense_handler (int fd, unsigned char * sensed_data, void *arg) +{ + struct scanner *s = arg; + unsigned int ili = get_RS_ILI (sensed_data); + unsigned int sk = get_RS_sense_key (sensed_data); + unsigned int asc = get_RS_ASC (sensed_data); + unsigned int ascq = get_RS_ASCQ (sensed_data); + + DBG (5, "sense_handler: start\n"); + + /* kill compiler warning */ + fd = fd; + + /* save for later */ + s->rs_info = get_RS_information (sensed_data); + + DBG (5, "SK=%#02x, ASC=%#02x, ASCQ=%#02x, ILI=%d, info=%#08x\n", + sk, asc, ascq, ili, s->rs_info); + + switch (sk) { + + /* no sense */ + case 0x0: + if (0x00 != asc) { + DBG (5, "No sense: unknown asc\n"); + return SANE_STATUS_IO_ERROR; + } + if (0x00 != ascq) { + DBG (5, "No sense: unknown ascq\n"); + return SANE_STATUS_IO_ERROR; + } + if (ili) { + DBG (5, "No sense: ILI set\n"); + return SANE_STATUS_EOF; + } + DBG (5, "No sense: ready\n"); + return SANE_STATUS_GOOD; + + /* not ready */ + case 0x2: + if (0x80 != asc) { + DBG (5, "Not ready: unknown asc\n"); + return SANE_STATUS_IO_ERROR; + } + if (0x00 != ascq) { + DBG (5, "Not ready: unknown ascq\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "Not ready: end of job\n"); + return SANE_STATUS_NO_DOCS; + break; + + /* hardware error */ + case 0x4: + if (0x3b != asc) { + DBG (5, "Hardware error: unknown asc\n"); + return SANE_STATUS_IO_ERROR; + } + if (0x05 == ascq) { + DBG (5, "Hardware error: paper jam\n"); + return SANE_STATUS_JAMMED; + } + if (0x80 == ascq) { + DBG (5, "Hardware error: multi-feed\n"); + return SANE_STATUS_JAMMED; + } + DBG (5, "Hardware error: unknown ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + /* illegal request */ + case 0x5: + if (asc != 0x20 && asc != 0x24 && asc != 0x25 && asc != 0x26 + && asc != 0x83 && asc != 0x8f) { + DBG (5, "Illegal request: unknown asc\n"); + return SANE_STATUS_IO_ERROR; + } + if (0x20 == asc && 0x00 == ascq) { + DBG (5, "Illegal request: invalid opcode\n"); + return SANE_STATUS_INVAL; + } + if (0x24 == asc && 0x00 == ascq) { + DBG (5, "Illegal request: invalid field in CDB\n"); + return SANE_STATUS_INVAL; + } + if (0x25 == asc && 0x00 == ascq) { + DBG (5, "Illegal request: invalid LUN\n"); + return SANE_STATUS_INVAL; + } + if (0x26 == asc && 0x00 == ascq) { + DBG (5, "Illegal request: invalid field in params\n"); + return SANE_STATUS_INVAL; + } + if (0x83 == asc && 0x00 == ascq) { + DBG (5, "Illegal request: command failed, check log\n"); + return SANE_STATUS_INVAL; + } + if (0x83 == asc && 0x01 == ascq) { + DBG (5, "Illegal request: command failed, invalid state\n"); + return SANE_STATUS_INVAL; + } + if (0x83 == asc && 0x02 == ascq) { + DBG (5, "Illegal request: command failed, critical error\n"); + return SANE_STATUS_INVAL; + } + if (0x8f == asc && 0x00 == ascq) { + DBG (5, "Illegal request: no image\n"); + return SANE_STATUS_DEVICE_BUSY; + } + DBG (5, "Illegal request: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + /* unit attention */ + case 0x6: + if (asc != 0x29 && asc != 0x80) { + DBG (5, "Unit attention: unknown asc\n"); + return SANE_STATUS_IO_ERROR; + } + if (0x29 == asc && 0x60 == ascq) { + DBG (5, "Unit attention: device reset\n"); + return SANE_STATUS_GOOD; + } + if (0x80 == asc && 0x00 == ascq) { + DBG (5, "Unit attention: Energy Star warm up\n"); + return SANE_STATUS_DEVICE_BUSY; + } + if (0x80 == asc && 0x01 == ascq) { + DBG (5, "Unit attention: lamp warm up for scan\n"); + return SANE_STATUS_DEVICE_BUSY; + } + if (0x80 == asc && 0x02 == ascq) { + DBG (5, "Unit attention: lamp warm up for cal\n"); + return SANE_STATUS_DEVICE_BUSY; + } + if (0x80 == asc && 0x04 == ascq) { + DBG (5, "Unit attention: calibration failed\n"); + return SANE_STATUS_INVAL; + } + DBG (5, "Unit attention: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + /* ia overflow */ + case 0x9: + if (0x80 == asc && 0x00 == ascq) { + DBG (5, "IA overflow: IA field overflow\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "IA overflow: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + /* volume overflow */ + case 0xd: + if (0x80 == asc && 0x00 == ascq) { + DBG (5, "Volume overflow: Image buffer full\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (5, "Volume overflow: unknown asc/ascq\n"); + return SANE_STATUS_IO_ERROR; + break; + + default: + DBG (5, "Unknown Sense Code\n"); + return SANE_STATUS_IO_ERROR; + } + + DBG (5, "sense_handler: should never happen!\n"); + + return SANE_STATUS_IO_ERROR; +} + +/* +SANE_Status +do_rs(scanner * s) +{ + SANE_Status ret; + unsigned char cmd[REQUEST_SENSE_len]; + size_t cmdLen = REQUEST_SENSE_len; + + DBG (10, "do_rs: start\n"); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,REQUEST_SENSE_code); + set_SR_datatype_code(cmd,SR_datatype_random); + set_SR_datatype_qual(cmd,SR_qual_end); + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + + while(ret == SANE_STATUS_DEVICE_BUSY){ + ret = run_rs(s); + } + + DBG (10, "do_rs: finish\n"); + + return SANE_STATUS_GOOD; +} +*/ + +SANE_Status +do_cmd(struct scanner *s, int runRS, int shortTime, + unsigned char * cmdBuff, size_t cmdLen, + unsigned char * outBuff, size_t outLen, + unsigned char * inBuff, size_t * inLen +) +{ + SANE_Status ret = SANE_STATUS_GOOD; + size_t actLen = 0; + + /*shut up compiler*/ + runRS=runRS; + shortTime=shortTime; + + DBG(10, "do_cmd: start\n"); + + DBG(25, "cmd: writing %d bytes\n", (int)cmdLen); + hexdump(30, "cmd: >>", cmdBuff, cmdLen); + + if(outBuff && outLen){ + DBG(25, "out: writing %d bytes\n", (int)outLen); + hexdump(30, "out: >>", outBuff, outLen); + } + if (inBuff && inLen){ + DBG(25, "in: reading %d bytes\n", (int)*inLen); + actLen = *inLen; + } + + ret = sanei_scsi_cmd2(s->fd, cmdBuff, cmdLen, outBuff, outLen, inBuff, inLen); + + if(ret != SANE_STATUS_GOOD && ret != SANE_STATUS_EOF){ + DBG(5,"do_cmd: return '%s'\n",sane_strstatus(ret)); + return ret; + } + + /* FIXME: should we look at s->rs_info here? */ + if (inBuff && inLen){ + hexdump(30, "in: <<", inBuff, *inLen); + DBG(25, "in: read %d bytes\n", (int)*inLen); + } + + DBG(10, "do_cmd: finish\n"); + + return ret; +} + +static SANE_Status +wait_scanner(struct scanner *s) +{ + int ret; + + unsigned char cmd[TEST_UNIT_READY_len]; + size_t cmdLen = TEST_UNIT_READY_len; + + DBG (10, "wait_scanner: start\n"); + + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd,TEST_UNIT_READY_code); + + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + + if (ret != SANE_STATUS_GOOD) { + DBG(5,"WARNING: Brain-dead scanner. Hitting with stick\n"); + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + } + if (ret != SANE_STATUS_GOOD) { + DBG(5,"WARNING: Brain-dead scanner. Hitting with stick again\n"); + ret = do_cmd ( + s, 0, 1, + cmd, cmdLen, + NULL, 0, + NULL, NULL + ); + } + + if (ret != SANE_STATUS_GOOD) { + DBG (5, "wait_scanner: error '%s'\n", sane_strstatus (ret)); + } + + DBG (10, "wait_scanner: finish\n"); + + return ret; +} + +/** + * Convenience method to determine longest string size in a list. + */ +static size_t +maxStringSize (const SANE_String_Const strings[]) +{ + size_t size, max_size = 0; + int i; + + for (i = 0; strings[i]; ++i) { + size = strlen (strings[i]) + 1; + if (size > max_size) + max_size = size; + } + + return max_size; +} + +/** + * Prints a hex dump of the given buffer onto the debug output stream. + */ +static void +hexdump (int level, char *comment, unsigned char *p, int l) +{ + int i; + char line[128]; + char *ptr; + + if(DBG_LEVEL < level) + return; + + DBG (level, "%s\n", comment); + ptr = line; + for (i = 0; i < l; i++, p++) + { + if ((i % 16) == 0) + { + if (ptr != line) + { + *ptr = '\0'; + DBG (level, "%s\n", line); + ptr = line; + } + sprintf (ptr, "%3.3x:", i); + ptr += 4; + } + sprintf (ptr, " %2.2x", *p); + ptr += 3; + } + *ptr = '\0'; + DBG (level, "%s\n", line); +} + +/** + * An advanced method we don't support but have to define. + */ +SANE_Status +sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) +{ + DBG (10, "sane_set_io_mode\n"); + DBG (15, "%d %p\n", non_blocking, h); + return SANE_STATUS_UNSUPPORTED; +} + +/** + * An advanced method we don't support but have to define. + */ +SANE_Status +sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) +{ + DBG (10, "sane_get_select_fd\n"); + DBG (15, "%p %d\n", h, *fdp); + return SANE_STATUS_UNSUPPORTED; +} diff -Nru sane-backends-1.0.20/backend/kodak-cmd.h sane-backends-1.0.21/backend/kodak-cmd.h --- sane-backends-1.0.20/backend/kodak-cmd.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kodak-cmd.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,645 @@ +#ifndef KODAK_CMD_H +#define KODAK_CMD_H + +/* + * Part of SANE - Scanner Access Now Easy. + * + * Please see to opening comments in kodak.c + */ + +/* ==================================================================== */ +/* helper char array manipulation functions */ + +static void +setbitfield (unsigned char *pageaddr, int mask, int shift, int val) +{ + *pageaddr = (*pageaddr & ~(mask << shift)) | ((val & mask) << shift); +} + +static int +getbitfield (unsigned char *pageaddr, int shift, int mask) +{ + return ((*pageaddr >> shift) & mask); +} + +static int +getnbyte (unsigned char *pnt, int nbytes) +{ + unsigned int result = 0; + int i; + + for (i = 0; i < nbytes; i++) + result = (result << 8) | (pnt[i] & 0xff); + return result; +} + +static void +putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) +{ + int i; + + for (i = nbytes - 1; i >= 0; i--) { + pnt[i] = value & 0xff; + value = value >> 8; + } +} + +/* ==================================================================== */ +/* SCSI commands */ + +#define set_SCSI_opcode(out, val) out[0]=val +#define set_SCSI_lun(out, val) setbitfield(out + 1, 7, 5, val) + +/* ==================================================================== */ +/* TEST_UNIT_READY */ + +#define TEST_UNIT_READY_code 0x00 +#define TEST_UNIT_READY_len 6 + +/* ==================================================================== */ +/* REQUEST_SENSE */ + +/* out */ +#define REQUEST_SENSE_code 0x03 +#define REQUEST_SENSE_len 6 + +#define RS_return_size 0x12 + +/* in */ +#define get_RS_information_valid(b) getbitfield(b + 0x00, 7, 1) +#define get_RS_error_code(b) getbitfield(b + 0x00, 0, 0x7f) +#define RS_error_code_current 0x70 +#define RS_error_code_deferred 0x71 + +#define get_RS_segment_num(b) b[1] + +#define get_RS_filemark(b) getbitfield(b + 0x02, 7, 1) +#define get_RS_EOM(b) getbitfield(b + 0x02, 6, 1) +#define get_RS_ILI(b) getbitfield(b + 0x02, 5, 1) +#define get_RS_sense_key(b) getbitfield(b + 0x02, 0, 0x0f) + +#define get_RS_information(b) getnbyte(b+0x03, 4) + +#define get_RS_additional_length(b) b[0x07] + +#define get_RS_cmd_info(b) getnbyte(b+8, 4) + +#define get_RS_ASC(b) b[0x0c] +#define get_RS_ASCQ(b) b[0x0d] +#define get_RS_FRUC(b) b[0x0e] +#define get_RS_SKSV(b) getbitfield(b+0x0f,7,1) +#define get_RS_SKSB(b) getnbyte(b+0x0f, 3) + +/* ==================================================================== */ +/* INQUIRY */ + +/* out */ +#define INQUIRY_code 0x12 +#define INQUIRY_len 6 + +#define set_I_evpd(out, val) setbitfield(out + 1, 1, 0, val) +#define set_I_page_code(out, val) out[0x02]=val +#define I_page_code_default 0 +#define set_I_data_length(out,n) out[0x04]=n +#define I_data_len 128 + +/* in */ +#define get_I_periph_qual(in) getbitfield(in, 5, 7) +#define I_periph_qual_valid 0x00 +#define I_periph_qual_nolun 0x03 +#define get_I_periph_devtype(in) getbitfield(in, 0, 0x1f) +#define I_periph_devtype_scanner 0x06 +#define I_periph_devtype_unknown 0x1f + +/* dont use these, until vendor */ +#define get_I_rmb(in) getbitfield(in + 1, 7, 1) +#define get_I_devtype_qual(in) getbitfield(in + 1, 0, 0x7f) + +#define get_I_iso_version(in) getbitfield(in + 2, 6, 3) +#define get_I_ecma_version(in) getbitfield(in + 2, 3, 7) +#define get_I_ansi_version(in) getbitfield(in + 2, 0, 7) + +#define get_I_aenc(in) getbitfield(in + 3, 7, 1) +#define get_I_trmiop(in) getbitfield(in + 3, 6, 1) +#define get_I_resonse_format(in) getbitfield(in + 3, 0, 0x0f) + +#define get_I_length(in) getnbyte(in + 4, 1) + +#define get_I_reladr(in) getbitfield(in + 7, 7, 1) +#define get_I_wbus32(in) getbitfield(in + 7, 6, 1) +#define get_I_wbus16(in) getbitfield(in + 7, 5, 1) +#define get_I_sync(in) getbitfield(in + 7, 4, 1) +#define get_I_linked(in) getbitfield(in + 7, 3, 1) +#define get_I_cmdque(in) getbitfield(in + 7, 1, 1) +#define get_I_sftre(in) getbitfield(in + 7, 0, 1) + +#define get_I_vendor(in, buf) strncpy(buf,(char *)in + 0x08, 0x08) +#define get_I_product(in, buf) strncpy(buf,(char *)in + 0x10, 0x10) +#define get_I_version(in, buf) strncpy(buf,(char *)in + 0x20, 0x04) +#define get_I_build(in, buf) strncpy(buf,(char *)in + 0x24, 0x02) + +#define get_I_mf_disable(in) getbitfield(in + 38, 7, 1) +#define get_I_checkdigit(in) getbitfield(in + 38, 6, 1) +#define get_I_front_prism(in) getbitfield(in + 38, 5, 1) +#define get_I_compressed_gray(in) getbitfield(in + 38, 4, 1) +#define get_I_front_toggle(in) getbitfield(in + 38, 3, 1) +#define get_I_front_dp1(in) getbitfield(in + 38, 2, 1) +#define get_I_front_color(in) getbitfield(in + 38, 1, 1) +#define get_I_front_atp(in) getbitfield(in + 38, 0, 1) + +#define get_I_dp1_180(in) getbitfield(in + 39, 7, 1) +#define get_I_mf_pause(in) getbitfield(in + 39, 6, 1) +#define get_I_rear_prism(in) getbitfield(in + 39, 5, 1) +#define get_I_uncompressed_gray(in) getbitfield(in + 39, 4, 1) +#define get_I_rear_toggle(in) getbitfield(in + 39, 3, 1) +#define get_I_rear_dp1(in) getbitfield(in + 39, 2, 1) +#define get_I_rear_color(in) getbitfield(in + 39, 1, 1) +#define get_I_rear_atp(in) getbitfield(in + 39, 0, 1) + +#define get_I_min_bin_res(in) getnbyte(in + 40, 2) +#define get_I_max_bin_res(in) getnbyte(in + 42, 2) +#define get_I_min_col_res(in) getnbyte(in + 44, 2) +#define get_I_max_col_res(in) getnbyte(in + 46, 2) + +#define get_I_max_image_width(in) getnbyte(in + 48, 4) +#define get_I_max_image_length(in) getnbyte(in + 52, 4) + +/* 56-95 reserved */ + +#define get_I_finecrop(in) getbitfield(in + 96, 7, 1) +#define get_I_ithresh(in) getbitfield(in + 96, 6, 1) +#define get_I_ecd(in) getbitfield(in + 96, 3, 1) +#define get_I_vblr(in) getbitfield(in + 96, 2, 1) +#define get_I_elevator(in) getbitfield(in + 96, 1, 1) +#define get_I_relcrop(in) getbitfield(in + 96, 0, 1) + +#define get_I_cdeskew(in) getbitfield(in + 97, 7, 1) +#define get_I_ia(in) getbitfield(in + 97, 6, 1) +#define get_I_patch(in) getbitfield(in + 97, 5, 1) +#define get_I_nullmode(in) getbitfield(in + 97, 4, 1) +#define get_I_sabre(in) getbitfield(in + 97, 3, 1) +#define get_I_lddds(in) getbitfield(in + 97, 2, 1) +#define get_I_uddds(in) getbitfield(in + 97, 1, 1) +#define get_I_fixedgap(in) getbitfield(in + 97, 0, 1) + +#define get_I_hr_printer(in) getbitfield(in + 98, 6, 1) +#define get_I_elev_100_250(in) getbitfield(in + 98, 5, 1) +#define get_I_udds_individual(in) getbitfield(in + 98, 4, 1) +#define get_I_auto_color(in) getbitfield(in + 98, 3, 1) +#define get_I_wb(in) getbitfield(in + 98, 2, 1) +#define get_I_es(in) getbitfield(in + 98, 1, 1) +#define get_I_fc(in) getbitfield(in + 98, 0, 1) + +#define get_I_max_rate(in) getnbyte(in + 99, 2) +#define get_I_buffer_size(in) getnbyte(in + 101, 4) + +/* ==================================================================== */ +/* RESERVE UNIT */ + +#define RESERVE_UNIT_code 0x16 +#define RESERVE_UNIT_len 6 + +/* ==================================================================== */ +/* RELEASE UNIT */ + +#define RELEASE_UNIT_code 0x17 +#define RELEASE_UNIT_len 6 + +/* ==================================================================== */ +/* SCAN */ + +#define SCAN_code 0x1b +#define SCAN_len 10 + +#define set_SC_xfer_length(sb, val) sb[0x04] = (unsigned char)val + +/* ==================================================================== */ +/* SEND DIAGNOSTIC */ + +#define SEND_DIAGNOSTIC_code 0x1d +#define SEND_DIAGNOSTIC_len 6 + +/* ==================================================================== */ +/* SET WINDOW */ + +#define SET_WINDOW_code 0x24 +#define SET_WINDOW_len 10 + +/* transfer length is header+descriptor (8+64) */ +#define set_SW_xferlen(sb, len) putnbyte(sb + 0x06, len, 3) + +/* ==================================================================== */ +/* GET WINDOW */ + +#define GET_WINDOW_code 0x25 +#define GET_WINDOW_len 10 + +#define set_GW_single(sb, val) setbitfield(sb + 1, 1, 0, val) +#define set_GW_wid(sb, len) sb[5] = len + +/* window transfer length is for following header+descriptor (8+64) */ +#define set_GW_xferlen(sb, len) putnbyte(sb + 0x06, len, 3) + +/* ==================================================================== */ +/* WINDOW HEADER, used by get and set */ + +#define WINDOW_HEADER_len 8 + +/* header transfer length is for following descriptor (64) */ +#define set_WH_data_len(sb, len) putnbyte(sb, len, 2) +#define set_WH_desc_len(sb, len) putnbyte(sb + 0x06, len, 2) + +/* ==================================================================== */ +/* WINDOW descriptor, used by get and set */ + +#define WINDOW_DESCRIPTOR_len 64 + +#define set_WD_wid(sb, val) sb[0]=val +#define WD_wid_front_binary 0x01 +#define WD_wid_back_binary 0x02 +#define WD_wid_front_color 0x03 +#define WD_wid_back_color 0x04 + +/* color/gray = 100,150,200,240,300 */ +/* binary = 200,240,300,400 */ +#define set_WD_Xres(sb, val) putnbyte(sb + 0x02, val, 2) +#define get_WD_Xres(sb) getnbyte(sb + 0x02, 2) + +/* color/gray = 100,150,200,240,300 */ +/* binary = 200,240,300,400 */ +#define set_WD_Yres(sb, val) putnbyte(sb + 0x04, val, 2) +#define get_WD_Yres(sb) getnbyte(sb + 0x04, 2) + +#define set_WD_ULX(sb, val) putnbyte(sb + 0x06, val, 4) +#define get_WD_ULX(sb) getnbyte(sb + 0x06, 4) + +#define set_WD_ULY(sb, val) putnbyte(sb + 0x0a, val, 4) +#define get_WD_ULY(sb) getnbyte(sb + 0x0a, 4) + +#define set_WD_width(sb, val) putnbyte(sb + 0x0e, val, 4) +#define get_WD_width(sb) getnbyte(sb + 0x0e, 4) + +#define set_WD_length(sb, val) putnbyte(sb + 0x12, val, 4) +#define get_WD_length(sb) getnbyte(sb + 0x12, 4) + +#define set_WD_brightness(sb, val) sb[0x16] = val +#define get_WD_brightness(sb) sb[0x16] + +#define set_WD_threshold(sb, val) sb[0x17] = val +#define get_WD_threshold(sb) sb[0x17] + +#define set_WD_contrast(sb, val) sb[0x18] = val +#define get_WD_contrast(sb) sb[0x18] + +#define set_WD_composition(sb, val) sb[0x19] = val +#define get_WD_composition(sb) sb[0x19] +#define WD_compo_LINEART 0 +#define WD_compo_HALFTONE 1 +#define WD_compo_MULTILEVEL 5 + +/* 1, 8, or 24 */ +#define set_WD_bitsperpixel(sb, val) sb[0x1a] = val +#define get_WD_bitsperpixel(sb) sb[0x1a] + +/* not used? */ +#define set_WD_halftone(sb, val) putnbyte(sb + 0x1b, val, 2) +#define get_WD_halftone(sb) getnbyte(sb + 0x1b, 2) + +#define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val) +#define get_WD_rif(sb) getbitfield(sb + 0x1d, 7, 1) + +/* always set to 1? */ +#define set_WD_bitorder(sb, val) putnbyte(sb + 0x1e, val, 2) +#define get_WD_bitorder(sb) getnbyte(sb + 0x1e, 2) + +#define set_WD_compress_type(sb, val) sb[0x20] = val +#define get_WD_compress_type(sb) sb[0x20] +#define WD_compr_NONE 0 +#define WD_compr_FAXG4 3 +#define WD_compr_JPEG 0x80 + +/* not used? */ +#define set_WD_compress_arg(sb, val) sb[0x21] = val +#define get_WD_compress_arg(sb) sb[0x21] + +/* kodak specific stuff starts here */ +#define set_WD_noise_filter(sb, val) setbitfield(sb + 40, 7, 2, val) +#define WD_nf_NONE 0 +#define WD_nf_LONE 1 +#define WD_nf_MAJORITY 2 +#define get_WD_noise_filter(sb) getbitfield(sb + 40, 7, 1) + +#define set_WD_allow_zero(sb, val) setbitfield(sb + 40, 1, 1, val) +#define get_WD_allow_zero(sb, val) getbitfield(sb + 40, 1, 1) + +#define set_WD_vblr(sb, val) setbitfield(sb + 40, 1, 0, val) +#define get_WD_vblr(sb, val) getbitfield(sb + 40, 0, 1) + +#define set_WD_image_overscan(sb, val) putnbyte(sb + 41, val, 2) + +#define set_WD_IS(sb, val) setbitfield(sb + 43, 1, 7, val) + +#define set_WD_deskew(sb, val) setbitfield(sb + 43, 1, 6, val) +#define WD_deskew_DISABLE 0 +#define WD_deskew_ENABLE 1 + +#define set_WD_BR(sb, val) setbitfield(sb + 43, 1, 5, val) +#define set_WD_BF(sb, val) setbitfield(sb + 43, 1, 4, val) +#define set_WD_ED(sb, val) setbitfield(sb + 43, 1, 3, val) +#define set_WD_HR(sb, val) setbitfield(sb + 43, 1, 2, val) + +#define set_WD_cropping(sb, val) setbitfield(sb + 43, 3, 0, val) +#define WD_crop_AUTO 0 +#define WD_crop_FIXED 1 +#define WD_crop_RELATIVE 2 +#define WD_crop_FINE 3 + +#define set_WD_ithresh(sb, val) setbitfield(sb + 44, 1, 7, val) +#define WD_ithresh_DISABLE 0 +#define WD_ithresh_ENABLE 1 + +#define set_WD_dropout_color(sb, val) setbitfield(sb + 44, 7, 0, val) + +#define set_WD_dropout_bg(sb, val) sb[45] = val + +#define set_WD_dropout_thresh(sb, val) sb[46] = val + +#define set_WD_dropout_source(sb, val) sb[47] = val + +#define set_WD_disable_gamma(sb, val) sb[48] = val + +#define set_WD_ortho_rotation(sb, val) sb[49] = val + +#define set_WD_fine_crop_max(sb, val) putnbyte(sb + 50, val, 2) + +#define set_WD_color_detect_thresh(sb, val) sb[52] = val + +#define set_WD_color_detect_area(sb, val) sb[53] = val + +#define set_WD_border_add(sb, val) sb[54] = val + +#define max_WDB_size 0xc8 + +/* ==================================================================== */ +/* READ */ + +#define READ_code 0x28 +#define READ_len 10 + +/* ==================================================================== */ +/* SEND */ + +#define SEND_code 0x2a +#define SEND_len 10 + +/* ==================================================================== */ +/* READ and SEND are basically the same, so the following 'SR' macros */ + +/* output */ +#define set_SR_datatype_code(sb, val) sb[0x02] = val +#define SR_datatype_imagedata 0x00 +#define SR_datatype_random 0x80 +#define SR_datatype_imageheader 0x81 +#define SR_len_imageheader 1088 + +#define set_SR_datatype_qual(sb, val) memcpy(sb + 4, val, 2) +#define set_SR_xfer_length(sb, val) putnbyte(sb + 6, val, 3) + +/* if the data type is 'imageheader': */ +#define get_SR_ih_header_length(in) getnbyte(in + 0x00, 4) +#define get_SR_ih_image_length(in) getnbyte(in + 0x04, 4) +#define get_SR_ih_image_id(in) in[8] +#define get_SR_ih_resolution(in) getnbyte(in + 9, 2) +#define get_SR_ih_ulx(in) getnbyte(in + 11, 4) +#define get_SR_ih_uly(in) getnbyte(in + 15, 4) +#define get_SR_ih_width(in) getnbyte(in + 19, 4) +#define get_SR_ih_length(in) getnbyte(in + 23, 4) +#define get_SR_ih_bpp(in) in[27] +#define get_SR_ih_comp_type(in) in[28] +#define get_SR_ih_ACD(in) getbit(in + 29, 1, 5) +#define get_SR_ih_MF(in) getbit(in + 29, 1, 4) +#define get_SR_ih_RIF(in) getbit(in + 29, 1, 2) +#define get_SR_ih_ID(in) getbit(in + 29, 1, 1) +#define get_SR_ih_DE(in) getbit(in + 29, 1, 0) +#define get_SR_ih_skew_angle(in) getnbyte(in + 30, 2) +#define get_SR_ih_ia_level(in) in[32] +#define get_SR_ih_ia(in) getnbyte(in + 33, 60) +#define get_SR_ih_print_string(in) getnbyte(in + 93, 60) +#define get_SR_ih_seqence_counter(in) getnbyte(in + 173, 4) +#define get_SR_ih_ia_f1_definition(in) in[177] +#define get_SR_ih_ia_f1_value(in) getnbyte(in + 178, 18) +#define get_SR_ih_ia_f2_definition(in) in[196] +#define get_SR_ih_ia_f2_value(in) getnbyte(in + 197, 18) +#define get_SR_ih_ia_f3_definition(in) in[215] +#define get_SR_ih_ia_f3_value(in) getnbyte(in + 216, 18) +#define get_SR_ih_ia_f4_definition(in) in[234] +#define get_SR_ih_ia_f5_value(in) getnbyte(in + 235, 18) +#define get_SR_ih_PD(in) getbit(in + 253, 1, 7) +#define get_SR_ih_patch_type(in) getbit(in + 253, 0x7f, 0) +#define get_SR_ih_deskew_confidence(in) in[255] +#define get_SR_ih_bt_contrast_perc(in) in[256] +#define get_SR_ih_bt_contrast(in) getnbyte(in + 257, 2) +#define get_SR_ih_bt_threshold(in) in[259] +#define get_SR_ih_sum_histogram(in) getnbyte(in + 260, 256) +#define get_SR_ih_diff_histogram(in) getnbyte(in + 516, 256) +#define get_SR_ih_gamma_table(in) getnbyte(in + 772, 256) +#define get_SR_ih_auto_color_area(in) in[1028] +#define get_SR_ih_auto_color_thresh(in) in[1029] + +/* ==================================================================== */ +/* if the data type is 'random', we have all kinds of 2 byte */ +/* qualifiers and oddly sized commands. some are bidirectional */ +/* while others are only send or read */ + +/* all payloads for these seem to start with 4 byte inclusive length? */ +#define set_SR_payload_len(sb, val) putnbyte(sb, val, 4) + +/* */ +#define SR_qual_jpeg_quant "JQ" /*both*/ +#define SR_len_jpeg_quant 262 /*front and back tables*/ + +/* */ +#define SR_qual_config "SC" /*both*/ +#define SR_len_config 512 /*lots of stuff*/ +#define set_SR_sc_length(in,val) putnbyte(in, val, 4) +#define get_SR_sc_length(in) getnbyte(in, 4) + +#define set_SR_sc_io1(in,val) putnbyte(in + 4, val, 1) +#define get_SR_sc_io1(in) getnbyte(in + 4, 1) +#define set_SR_sc_io2(in,val) putnbyte(in + 5, val, 1) +#define get_SR_sc_io2(in) getnbyte(in + 5, 1) +#define set_SR_sc_io3(in,val) putnbyte(in + 6, val, 1) +#define get_SR_sc_io3(in) getnbyte(in + 6, 1) +#define set_SR_sc_io4(in,val) putnbyte(in + 7, val, 1) +#define get_SR_sc_io4(in) getnbyte(in + 7, 1) +#define SR_sc_io_none 0 +#define SR_sc_io_front_binary 1 +#define SR_sc_io_rear_binary 2 +#define SR_sc_io_front_color 3 +#define SR_sc_io_rear_color 4 + +#define set_SR_sc_trans_to(in,val) putnbyte(in + 13, val, 2) +#define get_SR_sc_trans_to(in) getnbyte(in + 13, 2) +#define set_SR_sc_trans_to_resp(in,val) putnbyte(in + 15, val, 1) +#define get_SR_sc_trans_to_resp(in) getnbyte(in + 15, 1) + +#define get_SR_sc_DLS(in) getbitfield(in + 16, 7, 1) +#define set_SR_sc_DLS(in, val) setbitfield(in + 16, 1, 7) +#define get_SR_sc_DMS(in) getbitfield(in + 16, 6, 1) +#define set_SR_sc_DMS(in, val) setbitfield(in + 16, 1, 6) +#define get_SR_sc_DRS(in) getbitfield(in + 16, 5, 1) +#define set_SR_sc_DRS(in, val) setbitfield(in + 16, 1, 5) +#define get_SR_sc_UD_mode(in) getbitfield(in + 16, 0, 0x1f) +#define set_SR_sc_UD_mode(in, val) setbitfield(in + 16, 0x1f, 0) +#define get_SR_sc_LD_length(in) getnbyte(in + 17, 2) +#define set_SR_sc_LD_length(in, val) setnbyte(in + 17, 2) +#define get_SR_sc_DF_resp(in) getnbyte(in + 19, 1) +#define set_SR_sc_DF_resp(in, val) setnbyte(in + 19, 1) + +#define get_SR_sc_TP_mode(in) getnbyte(in + 20, 1) +#define get_SR_sc_CPT(in) getbitfield(in + 21, 0, 1) +#define get_SR_sc_POD_mode(in) getnbyte(in + 22, 2) +#define get_SR_sc_batch_mode(in) getnbyte(in + 24, 2) +#define get_SR_sc_batch_level(in) getnbyte(in + 26, 1) +#define get_SR_sc_start_batch(in) getnbyte(in + 27, 1) +#define get_SR_sc_end_batch(in) getnbyte(in + 28, 1) +#define get_SR_sc_patch_conf_tone(in) getnbyte(in + 29, 1) + +#define get_SR_sc_T6_patch(in) getbitfield(in + 30, 7, 1) +#define get_SR_sc_T5_patch(in) getbitfield(in + 30, 6, 1) +#define get_SR_sc_T4_patch(in) getbitfield(in + 30, 5, 1) +#define get_SR_sc_T3_patch(in) getbitfield(in + 30, 4, 1) +#define get_SR_sc_T2_patch(in) getbitfield(in + 30, 3, 1) +#define get_SR_sc_T1_patch(in) getbitfield(in + 30, 2, 1) +#define get_SR_sc_trans_patch(in) getbitfield(in + 30, 0, 3) + +#define get_SR_sc_IA_A_start(in) getnbyte(in + 31, 18) +#define get_SR_sc_IA_B_start(in) getnbyte(in + 49, 18) +#define get_SR_sc_IA_C_start(in) getnbyte(in + 67, 18) +#define get_SR_sc_IA_D_start(in) getnbyte(in + 85, 18) + +#define get_SR_sc_IA_A_def(in) getnbyte(in + 103, 1) +#define get_SR_sc_IA_B_def(in) getnbyte(in + 104, 1) +#define get_SR_sc_IA_C_def(in) getnbyte(in + 105, 1) +#define get_SR_sc_IA_D_def(in) getnbyte(in + 106, 1) + +#define get_SR_sc_IA_ltf_3(in) getnbyte(in + 107, 1) +#define get_SR_sc_IA_ltf_2(in) getnbyte(in + 108, 1) +#define get_SR_sc_IA_ltf_1(in) getnbyte(in + 109, 1) + +#define get_SR_sc_DP1_pos(in) getnbyte(in + 110, 4) +#define get_SR_sc_hires_mode(in) getbitfield(in + 114, 4, 0xf) +#define get_SR_sc_DP1_font(in) getbitfield(in + 114, 0, 0xf) +#define get_SR_sc_DP1_orient(in) getnbyte(in + 115, 1) +#define get_SR_sc_DP1_IA_format(in) getnbyte(in + 116, 1) +#define get_SR_sc_DP1_date_format(in) getnbyte(in + 117, 1) +#define get_SR_sc_DP1_date_delim(in) getnbyte(in + 118, 1) +#define get_SR_sc_DP1_start_seq(in) getnbyte(in + 119, 4) +#define get_SR_sc_DP1_seq_date_format(in) getnbyte(in + 123, 1) +#define get_SR_sc_DP1_seq_print_width(in) getnbyte(in + 124, 1) + +#define get_SR_sc_DP1_msg1(in) getnbyte(in + 125, 40) +#define get_SR_sc_DP1_msg2(in) getnbyte(in + 165, 40) +#define get_SR_sc_DP1_msg3(in) getnbyte(in + 205, 40) +#define get_SR_sc_DP1_msg4(in) getnbyte(in + 245, 40) +#define get_SR_sc_DP1_msg5(in) getnbyte(in + 285, 40) +#define get_SR_sc_DP1_msg6(in) getnbyte(in + 325, 40) +#define get_SR_sc_DP1_l1_template(in) getnbyte(in + 365, 20) +#define get_SR_sc_DP1_l2_template(in) getnbyte(in + 385, 20) +#define get_SR_sc_DP1_l3_template(in) getnbyte(in + 405, 20) + +#define get_SR_sc_UDFK1(in) getnbyte(in + 425, 1) +#define get_SR_sc_UDFK2(in) getnbyte(in + 426, 1) +#define get_SR_sc_UDFK3(in) getnbyte(in + 427, 1) +#define get_SR_sc_MPASS(in) getbitfield(in + 428, 1, 1) +#define get_SR_sc_CE(in) getbitfield(in + 428, 0, 1) +#define get_SR_sc_elevator_mode(in) getnbyte(in + 429, 1) +#define get_SR_sc_stacking_mode(in) getnbyte(in + 430, 1) + +#define get_SR_sc_energy_star_to(in) getnbyte(in + 433, 1) + +#define get_SR_sc_PR1(in) getbitfield(in + 435, 3, 1) +#define get_SR_sc_PR2(in) getbitfield(in + 435, 2, 1) +#define get_SR_sc_PR3(in) getbitfield(in + 435, 1, 1) +#define get_SR_sc_PR4(in) getbitfield(in + 435, 0, 1) + +/* */ +#define SR_qual_color_table "CT" /*read*/ +#define SR_len_color_table 52 + +/* */ +#define SR_qual_color_table "CT" /*read*/ +#define SR_len_color_table 52 + +/* */ +#define SR_qual_clear "CB" /*send*/ +#define SR_len_clear 0 + +/* */ +#define SR_qual_end "GX" /*send*/ +#define SR_len_end 0 + +/* local and gmt time commands, same format */ +#define SR_qual_clock "LC" /*both*/ +#define SR_qual_gmt "GT" /*send*/ +#define SR_len_time 10 +#define set_SR_time_hour(sb, val) putnbyte(sb+4, val, 1) +#define set_SR_time_min(sb, val) putnbyte(sb+5, val, 1) +#define set_SR_time_mon(sb, val) putnbyte(sb+6, val, 1) +#define set_SR_time_day(sb, val) putnbyte(sb+7, val, 1) +#define set_SR_time_year(sb, val) putnbyte(sb+8, val, 2) + +/* */ +#define SR_qual_lamp "LD" /*????*/ +#define SR_len_lamp 0 /*????*/ + +/* */ +#define SR_qual_log_en "L0" /*read*/ +#define SR_qual_log_fr "L1" /*read*/ +#define SR_qual_log_it "L2" /*read*/ +#define SR_qual_log_de "L3" /*read*/ +#define SR_qual_log_br "L4" /*read*/ +#define SR_qual_log_jp "L5" /*read*/ +#define SR_qual_log_nl "L6" /*read*/ +#define SR_qual_log_es "L7" /*read*/ +#define SR_qual_log_cns "L8" /*read*/ +#define SR_qual_log_cnt "L9" /*read*/ +#define SR_qual_log_ko "LA" /*read*/ +#define SR_qual_log_ru "LB" /*read*/ +#define SR_qual_log_cz "LE" /*read*/ +#define SR_qual_log_tr "LF" /*read*/ + +/* */ +#define SR_qual_startstop "SS" /*send*/ +#define SR_len_startstop 5 +#define set_SR_startstop_cmd(sb, val) putnbyte(sb+4, val, 1) + +/* */ +#define SR_qual_media "CM" /*read*/ +#define SR_len_media 5 +#define get_SR_media_status(sb, val) getnbyte(sb+4, 1) + +/* */ +#define SR_qual_img_cal "IC" /*send*/ +#define SR_len_img_cal 0 + +/* */ +#define SR_qual_udds_cal "UC" /*send*/ +#define SR_len_udds_cal 0 + +/* ==================================================================== */ +/* WRITE BUFFER */ + +#define WRITE_BUFFER_code 0x3b +#define WRITE_BUFFER_len 10 + +#define set_WB_mode(sb, val) setbitfield(sb + 0x01, 7, 0, val) +#define WB_mode_front 6 +#define WB_mode_back 7 +#define set_WB_buffer_id(sb, val) sb[0x02] = (unsigned char)val +#define WB_buffer_id_block(sb, val) 0 +#define WB_buffer_id_last(sb, val) 1 +#define set_WB_buffer_offset(sb, val) putnbyte(sb + 3, val, 3) +#define set_WB_list_length(sb, val) putnbyte(sb + 6, val, 3) + +#endif diff -Nru sane-backends-1.0.20/backend/kodak.conf.in sane-backends-1.0.21/backend/kodak.conf.in --- sane-backends-1.0.20/backend/kodak.conf.in 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kodak.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,14 @@ +# NOTE: any 'option' lines only apply to +# scanners discovered later in this file + +# to set data buffer size, in bytes +# the value ranges from 4096 - infinity +# but you may have scanning problems with +# a value larger than 32768 (the default) +option buffer-size 32768 + +# To search for all KODAK scsi devices +scsi KODAK + +# To use a specific scsi device +#scsi /dev/sg1 diff -Nru sane-backends-1.0.20/backend/kodak.h sane-backends-1.0.21/backend/kodak.h --- sane-backends-1.0.20/backend/kodak.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kodak.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,278 @@ +#ifndef KODAK_H +#define KODAK_H + +/* + * Part of SANE - Scanner Access Now Easy. + * Please see opening comment in kodak.c + */ + +/* ------------------------------------------------------------------------- + * This option list has to contain all options for all scanners supported by + * this driver. If a certain scanner cannot handle a certain option, there's + * still the possibility to say so, later. + */ +enum kodak_Option +{ + OPT_NUM_OPTS = 0, + + OPT_MODE_GROUP, + OPT_SOURCE, /*front/back/duplex*/ + OPT_MODE, /*mono/ht/gray/color*/ + OPT_RES, + + OPT_GEOMETRY_GROUP, + OPT_TL_X, + OPT_TL_Y, + OPT_BR_X, + OPT_BR_Y, + OPT_PAGE_WIDTH, + OPT_PAGE_HEIGHT, + + OPT_ENHANCEMENT_GROUP, + OPT_BRIGHTNESS, + OPT_CONTRAST, + OPT_THRESHOLD, + OPT_RIF, + + /* must come last: */ + NUM_OPTIONS +}; + +struct scanner +{ + /* --------------------------------------------------------------------- */ + /* immutable values which are set during init of scanner. */ + struct scanner *next; + char *device_name; /* The name of the scanner device for sane */ + + /* --------------------------------------------------------------------- */ + /* immutable values which are set during reading of config file. */ + int buffer_size; + + /* --------------------------------------------------------------------- */ + /* immutable values which are set during inquiry probing of the scanner. */ + /* members in order found in scsi data... */ + SANE_Device sane; + + char vendor_name[9]; /* null-term data returned by SCSI inquiry.*/ + char product_name[17]; /* null-term data returned by SCSI inquiry.*/ + char version_name[5]; /* null-term data returned by SCSI inquiry.*/ + char build_name[3]; /* null-term data returned by SCSI inquiry.*/ + + /* --------------------------------------------------------------------- */ + /* immutable values which are set during INQUIRY probing of the scanner, */ + /* or in the init_model cleanup routine... */ + + /* which modes scanner has */ + int s_mode[4]; + + /* min and max resolution for each mode */ + int s_res_min[4]; + int s_res_max[4]; + + /* in 1/1200th inches, NOT sane units */ + int s_width_min; + int s_width_max; + int s_length_min; + int s_length_max; + + int s_brightness_steps; + int s_contrast_steps; + int s_threshold_steps; + int s_rif; + + /* --------------------------------------------------------------------- */ + /* changeable SANE_Option structs provide our interface to frontend. */ + /* some options require lists of strings or numbers, we keep them here */ + /* instead of in global vars so that they can differ for each scanner */ + + /* long array of option structs */ + SANE_Option_Descriptor opt[NUM_OPTIONS]; + + /*mode group*/ + SANE_String_Const o_source_list[4]; + SANE_String_Const o_mode_list[5]; + SANE_Int o_res_list[4][6]; + + /*geometry group*/ + SANE_Range o_tl_x_range; + SANE_Range o_tl_y_range; + SANE_Range o_br_x_range; + SANE_Range o_br_y_range; + SANE_Range o_page_x_range; + SANE_Range o_page_y_range; + + /*enhancement group*/ + SANE_Range o_brightness_range; + SANE_Range o_contrast_range; + SANE_Range o_threshold_range; + + /* --------------------------------------------------------------------- */ + /* changeable vars to hold user input. modified by SANE_Options above */ + + /*mode group*/ + int u_mode; /* color,lineart,etc */ + int u_source; /* adf front,adf duplex,etc */ + int u_res; /* resolution in dpi */ + + /*geometry group*/ + /* The desired size of the scan, all in 1/1200 inch */ + int u_tl_x; + int u_tl_y; + int u_br_x; + int u_br_y; + int u_page_width; + int u_page_height; + + /*enhancement group*/ + int u_brightness; + int u_contrast; + int u_threshold; + int u_rif; + int u_compr; + + /* --------------------------------------------------------------------- */ + /* values which are set by the scanner's post-scan image header */ + int i_bytes; + int i_id; + int i_dpi; + int i_tlx; + int i_tly; + int i_width; + int i_length; + int i_bpp; + int i_compr; + + /* --------------------------------------------------------------------- */ + /* values which are set by scanning functions to keep track of pages, etc */ + int started; + + /* total to read/write */ + int bytes_tot; + + /* how far we have read */ + int bytes_rx; + + /* how far we have written */ + int bytes_tx; + + /* size of buffer */ + int bytes_buf; + + /* the buffer */ + unsigned char * buffer; + + /* --------------------------------------------------------------------- */ + /* values which used by the command and data sending functions (scsi/usb)*/ + int fd; /* The scanner device file descriptor. */ + size_t rs_info; + +}; + +#define DEFAULT_BUFFER_SIZE 32768 + +#define SIDE_FRONT 0 +#define SIDE_BACK 1 + +#define SOURCE_ADF_FRONT 0 +#define SOURCE_ADF_BACK 1 +#define SOURCE_ADF_DUPLEX 2 + +#define MODE_LINEART 0 +#define MODE_HALFTONE 1 +#define MODE_GRAYSCALE 2 +#define MODE_COLOR 3 + +/* ------------------------------------------------------------------------- */ + +#define MM_PER_INCH 25.4 +#define MM_PER_UNIT_UNFIX SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0)) +#define MM_PER_UNIT_FIX SANE_FIX(SANE_UNFIX(SANE_FIX(MM_PER_INCH / 1200.0))) + +#define SCANNER_UNIT_TO_FIXED_MM(number) SANE_FIX((number) * MM_PER_UNIT_UNFIX) +#define FIXED_MM_TO_SCANNER_UNIT(number) SANE_UNFIX(number) / MM_PER_UNIT_UNFIX + +#define KODAK_CONFIG_FILE "kodak.conf" + +#ifndef PATH_MAX +# define PATH_MAX 1024 +#endif + +#ifndef PATH_SEP +#ifdef HAVE_OS2_H +# define PATH_SEP '\\' +#else +# define PATH_SEP '/' +#endif +#endif + +/* ------------------------------------------------------------------------- */ + +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_one (const char *name); +static SANE_Status connect_fd (struct scanner *s); +static SANE_Status disconnect_fd (struct scanner *s); +static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg); + +static SANE_Status init_inquire (struct scanner *s); +static SANE_Status init_model (struct scanner *s); +static SANE_Status init_user (struct scanner *s); +static SANE_Status init_options (struct scanner *s); + +static SANE_Status +do_cmd(struct scanner *s, int runRS, int shortTime, + unsigned char * cmdBuff, size_t cmdLen, + unsigned char * outBuff, size_t outLen, + unsigned char * inBuff, size_t * inLen +); + +static SANE_Status wait_scanner (struct scanner *s); + +static SANE_Status do_cancel (struct scanner *scanner); + +static SANE_Status set_window (struct scanner *s); +static SANE_Status read_imageheader(struct scanner *s); +static SANE_Status send_sc(struct scanner *s); + +static SANE_Status read_from_scanner(struct scanner *s); +static SANE_Status copy_buffer(struct scanner *s, unsigned char * buf, int len); +static SANE_Status read_from_buffer(struct scanner *s, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len); + +static void hexdump (int level, char *comment, unsigned char *p, int l); + +static size_t maxStringSize (const SANE_String_Const strings[]); + +#endif /* KODAK_H */ diff -Nru sane-backends-1.0.20/backend/kvs1025.c sane-backends-1.0.21/backend/kvs1025.c --- sane-backends-1.0.20/backend/kvs1025.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025.c 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,414 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. + Copyright (C) 2010, m. allan noah +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#define DEBUG_NOT_STATIC + +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" +#include "../include/lassert.h" + +#include "kvs1025.h" +#include "kvs1025_low.h" + +#include "../include/sane/sanei_debug.h" + +/* SANE backend operations, see Sane standard 1.04 documents (sane_dev.pdf) + for details */ + +/* Init the KV-S1025 SANE backend. This function must be called before any other + SANE function can be called. */ +SANE_Status +sane_init (SANE_Int * version_code, + SANE_Auth_Callback __sane_unused__ authorize) +{ + SANE_Status status; + + DBG_INIT (); + + DBG (DBG_sane_init, "sane_init\n"); + + DBG (DBG_error, + "This is panasonic KV-S1020C / KV-S1025C version %d.%d build %d\n", + V_MAJOR, V_MINOR, V_BUILD); + + if (version_code) + { + *version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, V_BUILD); + } + + /* Initialize USB */ + sanei_usb_init (); + + status = kv_enum_devices (); + if (status) + return status; + + DBG (DBG_proc, "sane_init: leave\n"); + return SANE_STATUS_GOOD; +} + +/* Terminate the KV-S1025 SANE backend */ +void +sane_exit (void) +{ + DBG (DBG_proc, "sane_exit: enter\n"); + + kv_exit (); + + DBG (DBG_proc, "sane_exit: exit\n"); +} + +/* Get device list */ +SANE_Status +sane_get_devices (const SANE_Device *** device_list, + SANE_Bool __sane_unused__ local_only) +{ + DBG (DBG_proc, "sane_get_devices: enter\n"); + kv_get_devices_list (device_list); + DBG (DBG_proc, "sane_get_devices: leave\n"); + return SANE_STATUS_GOOD; +} + +/* Open device, return the device handle */ +SANE_Status +sane_open (SANE_String_Const devicename, SANE_Handle * handle) +{ + return kv_open_by_name (devicename, handle); +} + +/* Close device */ +void +sane_close (SANE_Handle handle) +{ + DBG (DBG_proc, "sane_close: enter\n"); + kv_close ((PKV_DEV) handle); + DBG (DBG_proc, "sane_close: leave\n"); +} + +/* Get option descriptor */ +const SANE_Option_Descriptor * +sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) +{ + return kv_get_option_descriptor ((PKV_DEV) handle, option); +} + +/* Control option */ +SANE_Status +sane_control_option (SANE_Handle handle, SANE_Int option, + SANE_Action action, void *val, SANE_Int * info) +{ + return kv_control_option ((PKV_DEV) handle, option, action, val, info); +} + +/* Get scan parameters */ +SANE_Status +sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) +{ + PKV_DEV dev = (PKV_DEV) handle; + + int side = dev->current_side == SIDE_FRONT ? 0 : 1; + + DBG (DBG_proc, "sane_get_parameters: enter\n"); + + if (!(dev->scanning)) + { + /* Setup the parameters for the scan. (guessed value) */ + int resolution = dev->val[OPT_RESOLUTION].w; + int width, length, depth = kv_get_depth (kv_get_mode (dev));; + + DBG (DBG_proc, "sane_get_parameters: initial settings\n"); + kv_calc_paper_size (dev, &width, &length); + + DBG (DBG_error, "Resolution = %d\n", resolution); + DBG (DBG_error, "Paper width = %d, height = %d\n", width, length); + + /* Prepare the parameters for the caller. */ + dev->params[0].format = kv_get_mode (dev) == SM_COLOR ? + SANE_FRAME_RGB : SANE_FRAME_GRAY; + + dev->params[0].last_frame = SANE_TRUE; + dev->params[0].pixels_per_line = ((width * resolution) / 1200) & (~0xf); + + dev->params[0].depth = depth > 8 ? 8 : depth; + + dev->params[0].bytes_per_line = + (dev->params[0].pixels_per_line / 8) * depth; + dev->params[0].lines = (length * resolution) / 1200; + + memcpy (&dev->params[1], &dev->params[0], sizeof (SANE_Parameters)); + } + + /* Return the current values. */ + if (params) + *params = (dev->params[side]); + + DBG (DBG_proc, "sane_get_parameters: exit\n"); + return SANE_STATUS_GOOD; +} + +/* Start scanning */ +SANE_Status +sane_start (SANE_Handle handle) +{ + SANE_Status status; + PKV_DEV dev = (PKV_DEV) handle; + SANE_Bool dev_ready; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "sane_start: enter\n"); + if (!dev->scanning) + { + /* open device */ + if (!kv_already_open (dev)) + { + DBG (DBG_proc, "sane_start: need to open device\n"); + status = kv_open (dev); + if (status) + { + return status; + } + } + /* Begin scan */ + DBG (DBG_proc, "sane_start: begin scan\n"); + + /* Get necessary parameters */ + sane_get_parameters (dev, NULL); + + dev->current_page = 0; + dev->current_side = SIDE_FRONT; + + /* The scanner must be ready. */ + status = CMD_test_unit_ready (dev, &dev_ready); + if (status || !dev_ready) + { + return SANE_STATUS_DEVICE_BUSY; + } + + if (!strcmp (dev->val[OPT_MANUALFEED].s, "off")) + { + status = CMD_get_document_existanse (dev); + if (status) + { + DBG (DBG_proc, "sane_start: exit with no more docs\n"); + return status; + } + } + + /* Set window */ + status = CMD_reset_window (dev); + if (status) + { + return status; + } + + status = CMD_set_window (dev, SIDE_FRONT, &rs); + if (status) + { + DBG (DBG_proc, "sane_start: error setting window\n"); + return status; + } + + if (rs.status) + { + DBG (DBG_proc, "sane_start: error setting window\n"); + DBG (DBG_proc, + "sane_start: sense_key=0x%x, ASC=0x%x, ASCQ=0x%x\n", + get_RS_sense_key (rs.sense), + get_RS_ASC (rs.sense), get_RS_ASCQ (rs.sense)); + return SANE_STATUS_DEVICE_BUSY; + } + + if (IS_DUPLEX (dev)) + { + status = CMD_set_window (dev, SIDE_BACK, &rs); + + if (status) + { + DBG (DBG_proc, "sane_start: error setting window\n"); + return status; + } + if (rs.status) + { + DBG (DBG_proc, "sane_start: error setting window\n"); + DBG (DBG_proc, + "sane_start: sense_key=0x%x, " + "ASC=0x%x, ASCQ=0x%x\n", + get_RS_sense_key (rs.sense), + get_RS_ASC (rs.sense), get_RS_ASCQ (rs.sense)); + return SANE_STATUS_INVAL; + } + } + + /* Scan */ + status = CMD_scan (dev); + if (status) + { + return status; + } + + status = AllocateImageBuffer (dev); + if (status) + { + return status; + } + dev->scanning = 1; + } + else + { + /* renew page */ + if (IS_DUPLEX (dev)) + { + if (dev->current_side == SIDE_FRONT) + { + dev->current_side = SIDE_BACK; + /* return; image data already read */ + DBG (DBG_proc, "sane_start: exit\n"); + + return SANE_STATUS_GOOD; + } + else + { + dev->current_side = SIDE_FRONT; + dev->current_page++; + } + } + else + { + dev->current_page++; + } + } + DBG (DBG_proc, "sane_start: NOW SCANNING page\n"); + + /* Read image data */ + status = ReadImageData (dev, dev->current_page); + if (status) + { + dev->scanning = 0; + return status; + } + + /* Get picture element size */ + { + int width, height; + status = CMD_read_pic_elements (dev, dev->current_page, + SIDE_FRONT, &width, &height); + if (status) + return status; + } + + if (IS_DUPLEX (dev)) + { + int width, height; + status = CMD_read_pic_elements (dev, dev->current_page, + SIDE_BACK, &width, &height); + if (status) + return status; + } + DBG (DBG_proc, "sane_start: exit\n"); + return status; +} + +SANE_Status +sane_read (SANE_Handle handle, SANE_Byte * buf, + SANE_Int max_len, SANE_Int * len) +{ + PKV_DEV dev = (PKV_DEV) handle; + int side = dev->current_side == SIDE_FRONT ? 0 : 1; + + int size = max_len; + if (!dev->scanning) + return SANE_STATUS_EOF; + + if (size > dev->img_size[side]) + size = dev->img_size[side]; + + if (size == 0) + { + *len = size; + return SANE_STATUS_EOF; + } + + if (dev->val[OPT_INVERSE].w && + (kv_get_mode (dev) == SM_BINARY || kv_get_mode (dev) == SM_DITHER)) + { + int i; + unsigned char *p = dev->img_pt[side]; + for (i = 0; i < size; i++) + { + buf[i] = ~p[i]; + } + } + else + { + memcpy (buf, dev->img_pt[side], size); + } + + /*hexdump(DBG_error, "img data", buf, 128); */ + + dev->img_pt[side] += size; + dev->img_size[side] -= size; + + DBG (DBG_proc, "sane_read: %d bytes to read, " + "%d bytes read, EOF=%s %d\n", + max_len, size, dev->img_size[side] == 0 ? "True" : "False", side); + + if (len) + { + *len = size; + } + if (dev->img_size[side] == 0) + { + if (!strcmp (dev->val[OPT_FEEDER_MODE].s, "single")) + if ((IS_DUPLEX (dev) && side) || !IS_DUPLEX (dev)) + dev->scanning = 0; + } + return SANE_STATUS_GOOD; +} + +void +sane_cancel (SANE_Handle handle) +{ + PKV_DEV dev = (PKV_DEV) handle; + DBG (DBG_proc, "sane_cancel: scan canceled.\n"); + dev->scanning = 0; + + kv_close (dev); +} + +SANE_Status +sane_set_io_mode (SANE_Handle h, SANE_Bool m) +{ + h=h; + m=m; + return SANE_STATUS_UNSUPPORTED; +} + +SANE_Status +sane_get_select_fd (SANE_Handle h, SANE_Int * fd) +{ + h=h; + fd=fd; + return SANE_STATUS_UNSUPPORTED; +} diff -Nru sane-backends-1.0.20/backend/kvs1025_cmds.h sane-backends-1.0.21/backend/kvs1025_cmds.h --- sane-backends-1.0.20/backend/kvs1025_cmds.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_cmds.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,74 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#ifndef KVS1025_CMDS_H +#define KVS1025_CMDS_H + +/* Commands supported by the KV-S1020C / KV-S1025C scanner. */ +#define SCSI_TEST_UNIT_READY 0x00 +#define SCSI_INQUIRY 0x12 +#define SCSI_SET_WINDOW 0x24 +#define SCSI_SCAN 0x1B +#define SCSI_SEND_10 0x2A +#define SCSI_READ_10 0x28 +#define SCSI_REQUEST_SENSE 0x03 +#define SCSI_GET_BUFFER_STATUS 0x34 +#define SCSI_SET_TIMEOUT 0xE1 + +typedef enum +{ + KV_CMD_NONE = 0, + KV_CMD_IN = 0x81, /* scanner to pc */ + KV_CMD_OUT = 0x02 /* pc to scanner */ +} KV_CMD_DIRECTION; /* equals to endpoint address */ + +typedef struct +{ + KV_CMD_DIRECTION direction; + unsigned char cdb[12]; + int cdb_size; + int data_size; + void *data; +} KV_CMD_HEADER, *PKV_CMD_HEADER; + +#define KV_CMD_TIMEOUT 10000 + +static inline int +getbitfield (unsigned char *pageaddr, int mask, int shift) +{ + return ((*pageaddr >> shift) & mask); +} + +/* 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) +#define get_RS_additional_length(b) b[0x07] +#define get_RS_ASC(b) b[0x0c] +#define get_RS_ASCQ(b) b[0x0d] +#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) + +typedef enum +{ + KV_SUCCESS = 0, + KV_FAILED = 1, + KV_CHK_CONDITION = 2 +} KV_STATUS; + +typedef struct +{ + KV_STATUS status; + unsigned char reserved[16]; + unsigned char sense[18]; +} KV_CMD_RESPONSE, *PKV_CMD_RESPONSE; + + +#endif /*#ifndef KVS1025_CMDS_H */ diff -Nru sane-backends-1.0.20/backend/kvs1025.h sane-backends-1.0.21/backend/kvs1025.h --- sane-backends-1.0.20/backend/kvs1025.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025.h 2010-04-26 10:52:48.000000000 +1000 @@ -0,0 +1,127 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#ifndef __KVS1025_H +#define __KVS1025_H + +/* SANE backend name */ +#ifdef BACKEND_NAME +#undef BACKEND_NAME +#endif + +#define BACKEND_NAME kvs1025 + +/* Build version */ +#define V_BUILD 3 + +/* Paper range supported -- MAX A4 */ +#define KV_MAX_X_RANGE 210 +#define KV_MAX_Y_RANGE 297 + +/* Round ULX, ULY, Width and Height to 16 Pixels */ +#define KV_PIXEL_ROUND 19200 +/* (XR * W / 1200) % 16 == 0 i.e. (XR * W) % 19200 == 0 */ + +/* MAX IULs per LINE */ +#define KV_PIXEL_MAX 14064 +/* Max 14064 pixels per line, 1/1200 inch each */ + +#define MM_PER_INCH 25.4 +#define mmToIlu(mm) (((mm) * 1200) / MM_PER_INCH) +#define iluToMm(ilu) (((ilu) * MM_PER_INCH) / 1200) + +/* Vendor defined options */ +#define SANE_NAME_DUPLEX "duplex" +#define SANE_NAME_PAPER_SIZE "paper-size" +#define SANE_NAME_AUTOSEP "autoseparation" +#define SANE_NAME_LANDSCAPE "landscape" +#define SANE_NAME_INVERSE "inverse" +#define SANE_NAME_MIRROR "mirror" +#define SANE_NAME_LONGPAPER "longpaper" +#define SANE_NAME_LENGTHCTL "length-control" +#define SANE_NAME_MANUALFEED "manual-feed" +#define SANE_NAME_FEED_TIMEOUT "feed-timeout" +#define SANE_NAME_DBLFEED "double-feed" + +#define SANE_TITLE_DUPLEX SANE_I18N("Duplex") +#define SANE_TITLE_PAPER_SIZE SANE_I18N("Paper size") +#define SANE_TITLE_AUTOSEP SANE_I18N("Automatic separation") +#define SANE_TITLE_LANDSCAPE SANE_I18N("Landscape") +#define SANE_TITLE_INVERSE SANE_I18N("Inverse Image") +#define SANE_TITLE_MIRROR SANE_I18N("Mirror image") +#define SANE_TITLE_LONGPAPER SANE_I18N("Long paper mode") +#define SANE_TITLE_LENGTHCTL SANE_I18N("Length control mode") +#define SANE_TITLE_MANUALFEED SANE_I18N("Manual feed mode") +#define SANE_TITLE_FEED_TIMEOUT SANE_I18N("Manual feed timeout") +#define SANE_TITLE_DBLFEED SANE_I18N("Double feed detection") + +#define SANE_DESC_DUPLEX \ +SANE_I18N("Enable Duplex (Dual-Sided) Scanning") +#define SANE_DESC_PAPER_SIZE \ +SANE_I18N("Physical size of the paper in the ADF"); +#define SANE_DESC_AUTOSEP \ +SANE_I18N("Automatic separation") + +#define SIDE_FRONT 0x00 +#define SIDE_BACK 0x80 + +/* Debug levels. + * Should be common to all backends. */ + +#define DBG_error0 0 +#define DBG_error 1 +#define DBG_sense 2 +#define DBG_warning 3 +#define DBG_inquiry 4 +#define DBG_info 5 +#define DBG_info2 6 +#define DBG_proc 7 +#define DBG_read 8 +#define DBG_sane_init 10 +#define DBG_sane_proc 11 +#define DBG_sane_info 12 +#define DBG_sane_option 13 +#define DBG_shortread 101 + +/* Prototypes of SANE backend functions, see kvs1025.c */ + +SANE_Status sane_init (SANE_Int * version_code, + SANE_Auth_Callback /* __sane_unused__ authorize */ ); + +void sane_exit (void); + +SANE_Status sane_get_devices (const SANE_Device *** device_list, + SANE_Bool /*__sane_unused__ local_only*/ ); + +SANE_Status sane_open (SANE_String_Const devicename, SANE_Handle * handle); + +void sane_close (SANE_Handle handle); + +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_get_parameters (SANE_Handle handle, + SANE_Parameters * params); + +SANE_Status sane_start (SANE_Handle handle); + +SANE_Status sane_read (SANE_Handle handle, SANE_Byte * buf, + SANE_Int max_len, SANE_Int * len); + +void sane_cancel (SANE_Handle handle); + +SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool m); + +SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd); + +SANE_String_Const sane_strstatus (SANE_Status status); + +#endif /* #ifndef __KVS1025_H */ diff -Nru sane-backends-1.0.20/backend/kvs1025_low.c sane-backends-1.0.21/backend/kvs1025_low.c --- sane-backends-1.0.20/backend/kvs1025_low.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_low.c 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,968 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#define DEBUG_DECLARE_ONLY + +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" +#include "../include/lassert.h" + +#include "kvs1025.h" +#include "kvs1025_low.h" +#include "kvs1025_usb.h" + +#include "../include/sane/sanei_debug.h" + +/* Global storage */ + +PKV_DEV g_devices = NULL; /* Chain of devices */ +const SANE_Device **g_devlist = NULL; + +/* Static functions */ + +/* Free one device */ +static void +kv_free (KV_DEV ** pdev) +{ + KV_DEV *dev; + + dev = *pdev; + + if (dev == NULL) + return; + + DBG (DBG_proc, "kv_free : enter\n"); + + kv_close (dev); + + DBG (DBG_proc, "kv_free : free image buffer 0 \n"); + if (dev->img_buffers[0]) + free (dev->img_buffers[0]); + DBG (DBG_proc, "kv_free : free image buffer 1 \n"); + if (dev->img_buffers[1]) + free (dev->img_buffers[1]); + DBG (DBG_proc, "kv_free : free scsi device name\n"); + if (dev->scsi_device_name) + free (dev->scsi_device_name); + + DBG (DBG_proc, "kv_free : free SCSI buffer\n"); + if (dev->buffer0) + free (dev->buffer0); + + DBG (DBG_proc, "kv_free : free dev \n"); + free (dev); + + *pdev = NULL; + + DBG (DBG_proc, "kv_free : exit\n"); +} + +/* Free all devices */ +static void +kv_free_devices () +{ + PKV_DEV dev; + while (g_devices) + { + dev = g_devices; + g_devices = dev->next; + kv_free (&dev); + } + if (g_devlist) + { + free (g_devlist); + g_devlist = NULL; + } +} + +/* Get all supported scanners, and store into g_scanners_supported */ +SANE_Status +kv_enum_devices () +{ + SANE_Status status; + kv_free_devices (); + status = kv_usb_enum_devices (); + if (status) + { + kv_free_devices (); + } + + return status; +} + +/* Return devices list to the front end */ +void +kv_get_devices_list (const SANE_Device *** devices_list) +{ + *devices_list = g_devlist; +} + +/* Close all open handles and clean up global storage */ +void +kv_exit () +{ + kv_free_devices (); /* Free all devices */ + kv_usb_cleanup (); /* Clean USB bus */ +} + +/* Open device by name */ +SANE_Status +kv_open_by_name (SANE_String_Const devicename, SANE_Handle * handle) +{ + + PKV_DEV pd = g_devices; + DBG (DBG_proc, "sane_open: enter (dev_name=%s)\n", devicename); + while (pd) + { + if (strcmp (pd->sane.name, devicename) == 0) + { + if (kv_open (pd) == 0) + { + *handle = (SANE_Handle) pd; + DBG (DBG_proc, "sane_open: leave\n"); + return SANE_STATUS_GOOD; + } + } + pd = pd->next; + } + DBG (DBG_proc, "sane_open: leave -- no device found\n"); + return SANE_STATUS_UNSUPPORTED; +} + +/* Open a device */ +SANE_Status +kv_open (PKV_DEV dev) +{ + SANE_Status status = SANE_STATUS_UNSUPPORTED; + int i; +#define RETRAY_NUM 3 + + + if (dev->bus_mode == KV_USB_BUS) + { + status = kv_usb_open (dev); + } + if (status) + return status; + for (i = 0; i < RETRAY_NUM; i++) + { + SANE_Bool dev_ready; + status = CMD_test_unit_ready (dev, &dev_ready); + if (!status && dev_ready) + break; + } + + if (status == 0) + { + /* Read device support info */ + status = CMD_read_support_info (dev); + + if (status == 0) + { + /* Init options */ + kv_init_options (dev); + status = CMD_set_timeout (dev, dev->val[OPT_FEED_TIMEOUT].w); + } + } + dev->scanning = 0; + return status; +} + +/* Check if device is already open */ + +SANE_Bool +kv_already_open (PKV_DEV dev) +{ + SANE_Bool status = 0; + + if (dev->bus_mode == KV_USB_BUS) + { + status = kv_usb_already_open (dev); + } + + return status; +} + +/* Close a device */ +void +kv_close (PKV_DEV dev) +{ + if (dev->bus_mode == KV_USB_BUS) + { + kv_usb_close (dev); + } + dev->scanning = 0; +} + +/* Send command to a device */ +SANE_Status +kv_send_command (PKV_DEV dev, + PKV_CMD_HEADER header, PKV_CMD_RESPONSE response) +{ + SANE_Status status = SANE_STATUS_UNSUPPORTED; + if (dev->bus_mode == KV_USB_BUS) + { + if (!kv_usb_already_open(dev)) + { + DBG (DBG_error, "kv_send_command error: device not open.\n"); + return SANE_STATUS_IO_ERROR; + } + + status = kv_usb_send_command (dev, header, response); + } + + return status; +} + +/* Commands */ + +SANE_Status +CMD_test_unit_ready (PKV_DEV dev, SANE_Bool * ready) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_test_unit_ready\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_NONE; + hdr.cdb[0] = SCSI_TEST_UNIT_READY; + hdr.cdb_size = 6; + + status = kv_send_command (dev, &hdr, &rs); + + if (status == 0) + { + *ready = (rs.status == KV_SUCCESS ? 1 : 0); + } + + return status; +} + +SANE_Status +CMD_set_timeout (PKV_DEV dev, SANE_Word timeout) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_set_timeout\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_OUT; + hdr.cdb[0] = SCSI_SET_TIMEOUT; + hdr.cdb[2] = 0x8D; + hdr.cdb[8] = 0x2; + hdr.cdb_size = 10; + hdr.data = dev->buffer; + dev->buffer[0] = 0; + dev->buffer[1] = (SANE_Byte) timeout; + hdr.data_size = 2; + + status = kv_send_command (dev, &hdr, &rs); + + return status; +} + +SANE_Status +CMD_read_support_info (PKV_DEV dev) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_read_support_info\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_READ_10; + hdr.cdb[2] = 0x93; + Ito24 (32, &hdr.cdb[6]); + hdr.data = dev->buffer; + hdr.data_size = 32; + + status = kv_send_command (dev, &hdr, &rs); + + DBG (DBG_error, "test.\n"); + + if (status == 0) + { + if (rs.status == 0) + { + int min_x_res, min_y_res, max_x_res, max_y_res; + int step_x_res, step_y_res; + + dev->support_info.memory_size + = (dev->buffer[2] << 8 | dev->buffer[3]); + min_x_res = (dev->buffer[4] << 8) | dev->buffer[5]; + min_y_res = (dev->buffer[6] << 8) | dev->buffer[7]; + max_x_res = (dev->buffer[8] << 8) | dev->buffer[9]; + max_y_res = (dev->buffer[10] << 8) | dev->buffer[11]; + step_x_res = (dev->buffer[12] << 8) | dev->buffer[13]; + step_y_res = (dev->buffer[14] << 8) | dev->buffer[15]; + + dev->support_info.min_resolution = + min_x_res > min_y_res ? min_x_res : min_y_res; + dev->support_info.max_resolution = + max_x_res < max_y_res ? max_x_res : max_y_res; + dev->support_info.step_resolution = + step_x_res > step_y_res ? step_x_res : step_y_res; + dev->support_info.support_duplex = + ((dev->buffer[0] & 0x08) == 0) ? 1 : 0; + dev->support_info.support_lamp = + ((dev->buffer[23] & 0x80) != 0) ? 1 : 0; + + dev->support_info.max_x_range = KV_MAX_X_RANGE; + dev->support_info.max_y_range = KV_MAX_Y_RANGE; + + dev->x_range.min = dev->y_range.min = 0; + dev->x_range.max = SANE_FIX (dev->support_info.max_x_range); + dev->y_range.max = SANE_FIX (dev->support_info.max_y_range); + dev->x_range.quant = dev->y_range.quant = 0; + + DBG (DBG_error, + "support_info.memory_size = %d (MB)\n", + dev->support_info.memory_size); + DBG (DBG_error, + "support_info.min_resolution = %d (DPI)\n", + dev->support_info.min_resolution); + DBG (DBG_error, + "support_info.max_resolution = %d (DPI)\n", + dev->support_info.max_resolution); + DBG (DBG_error, + "support_info.step_resolution = %d (DPI)\n", + dev->support_info.step_resolution); + DBG (DBG_error, + "support_info.support_duplex = %s\n", + dev->support_info.support_duplex ? "TRUE" : "FALSE"); + DBG (DBG_error, "support_info.support_lamp = %s\n", + dev->support_info.support_lamp ? "TRUE" : "FALSE"); + } + else + { + DBG (DBG_error, "Error in CMD_get_support_info, " + "sense_key=%d, ASC=%d, ASCQ=%d\n", + get_RS_sense_key (rs.sense), + get_RS_ASC (rs.sense), get_RS_ASCQ (rs.sense)); + + } + } + + return status; +} + +SANE_Status +CMD_scan (PKV_DEV dev) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_scan\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_NONE; + hdr.cdb[0] = SCSI_SCAN; + hdr.cdb_size = 6; + + status = kv_send_command (dev, &hdr, &rs); + + if (status == 0 && rs.status != 0) + { + DBG (DBG_error, + "Error in CMD_scan, sense_key=%d, ASC=%d, ASCQ=%d\n", + get_RS_sense_key (rs.sense), get_RS_ASC (rs.sense), + get_RS_ASCQ (rs.sense)); + } + + return status; +} + +SANE_Status +CMD_set_window (PKV_DEV dev, int side, PKV_CMD_RESPONSE rs) +{ + unsigned char *window; + unsigned char *windowdata; + int size = 74; + KV_SCAN_MODE scan_mode; + KV_CMD_HEADER hdr; + + DBG (DBG_proc, "CMD_set_window\n"); + + window = (unsigned char *) dev->buffer; + windowdata = window + 8; + + memset (&hdr, 0, sizeof (hdr)); + memset (window, 0, size); + + Ito16 (66, &window[6]); /* Window descriptor block length */ + + /* Set window data */ + + scan_mode = kv_get_mode (dev); + + kv_set_window_data (dev, scan_mode, side, windowdata); + + hdr.direction = KV_CMD_OUT; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_SET_WINDOW; + Ito24 (size, &hdr.cdb[6]); + hdr.data = window; + hdr.data_size = size; + + hexdump (DBG_error, "window", window, size); + + return kv_send_command (dev, &hdr, rs); +} + +SANE_Status +CMD_reset_window (PKV_DEV dev) +{ + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + SANE_Status status; + + DBG (DBG_proc, "CMD_reset_window\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_NONE; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_SET_WINDOW; + + status = kv_send_command (dev, &hdr, &rs); + if (rs.status != 0) + status = SANE_STATUS_INVAL; + + return status; +} + +SANE_Status +CMD_get_buff_status (PKV_DEV dev, int *front_size, int *back_size) +{ + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + SANE_Status status; + unsigned char *data = (unsigned char *) dev->buffer; + int size = 12; + memset (&hdr, 0, sizeof (hdr)); + memset (data, 0, size); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_GET_BUFFER_STATUS; + hdr.cdb[8] = size; + hdr.data = data; + hdr.data_size = size; + + status = kv_send_command (dev, &hdr, &rs); + if (status == 0) + { + if (rs.status == KV_CHK_CONDITION) + return SANE_STATUS_NO_DOCS; + else + { + unsigned char *p = data + 4; + if (p[0] == SIDE_FRONT) + { + *front_size = (p[5] << 16) | (p[6] << 8) | p[7]; + } + else + { + *back_size = (p[5] << 16) | (p[6] << 8) | p[7]; + } + return SANE_STATUS_GOOD; + } + } + return status; +} + +SANE_Status +CMD_wait_buff_status (PKV_DEV dev, int *front_size, int *back_size) +{ + SANE_Status status = SANE_STATUS_GOOD; + int cnt = 0; + *front_size = 0; + *back_size = 0; + + DBG (DBG_proc, "CMD_wait_buff_status: enter feed %s\n", + dev->val[OPT_MANUALFEED].s); + + do + { + DBG (DBG_proc, "CMD_wait_buff_status: tray #%d of %d\n", cnt, + dev->val[OPT_FEED_TIMEOUT].w); + status = CMD_get_buff_status (dev, front_size, back_size); + sleep (1); + } + while (status == SANE_STATUS_GOOD && (*front_size == 0) + && (*back_size == 0) && cnt++ < dev->val[OPT_FEED_TIMEOUT].w); + + if (cnt > dev->val[OPT_FEED_TIMEOUT].w) + status = SANE_STATUS_NO_DOCS; + + if (status == 0) + DBG (DBG_proc, "CMD_wait_buff_status: exit " + "front_size %d, back_size %d\n", *front_size, *back_size); + else + DBG (DBG_proc, "CMD_wait_buff_status: exit with no docs\n"); + return status; +} + + +SANE_Status +CMD_read_pic_elements (PKV_DEV dev, int page, int side, + int *width, int *height) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_read_pic_elements\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_READ_10; + hdr.cdb[2] = 0x80; + hdr.cdb[4] = page; + hdr.cdb[5] = side; + Ito24 (16, &hdr.cdb[6]); + hdr.data = dev->buffer; + hdr.data_size = 16; + + status = kv_send_command (dev, &hdr, &rs); + if (status == 0) + { + if (rs.status == 0) + { + int s = side == SIDE_FRONT ? 0 : 1; + int depth = kv_get_depth (kv_get_mode (dev)); + *width = B32TOI (dev->buffer); + *height = B32TOI (&dev->buffer[4]); + + assert ((*width) % 8 == 0); + + DBG (DBG_proc, "CMD_read_pic_elements: " + "Page %d, Side %s, W=%d, H=%d\n", + page, side == SIDE_FRONT ? "F" : "B", *width, *height); + + dev->params[s].format = kv_get_mode (dev) == SM_COLOR ? + SANE_FRAME_RGB : SANE_FRAME_GRAY; + dev->params[s].last_frame = SANE_TRUE; + dev->params[s].depth = depth > 8 ? 8 : depth; + dev->params[s].lines = *height ? *height + : dev->val[OPT_LANDSCAPE].w ? (*width * 3) / 4 : (*width * 4) / 3; + dev->params[s].pixels_per_line = *width; + dev->params[s].bytes_per_line = + (dev->params[s].pixels_per_line / 8) * depth; + } + else + { + DBG (DBG_proc, "CMD_read_pic_elements: failed\n"); + status = SANE_STATUS_INVAL; + } + } + + return status; +} + +SANE_Status +CMD_read_image (PKV_DEV dev, int page, int side, + unsigned char *buffer, int *psize, KV_CMD_RESPONSE * rs) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + int size = *psize; + + DBG (DBG_proc, "CMD_read_image\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_READ_10; + hdr.cdb[4] = page; + hdr.cdb[5] = side; + Ito24 (size, &hdr.cdb[6]); + hdr.data = buffer; + hdr.data_size = size; + + *psize = 0; + + status = kv_send_command (dev, &hdr, rs); + + if (status) + return status; + + *psize = size; + + if (rs->status == KV_CHK_CONDITION && get_RS_ILI (rs->sense)) + { + int delta = B32TOI (&rs->sense[3]); + DBG (DBG_error, "size=%d, delta=0x%x (%d)\n", size, delta, delta); + *psize = size - delta; + } + + DBG (DBG_error, "CMD_read_image: bytes requested=%d, read=%d\n", + size, *psize); + DBG (DBG_error, "CMD_read_image: ILI=%d, EOM=%d\n", + get_RS_ILI (rs->sense), get_RS_EOM (rs->sense)); + + return status; +} + +SANE_Status +CMD_get_document_existanse (PKV_DEV dev) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_get_document_existanse\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_READ_10; + hdr.cdb[2] = 0x81; + Ito24 (6, &hdr.cdb[6]); + hdr.data = dev->buffer; + hdr.data_size = 6; + + status = kv_send_command (dev, &hdr, &rs); + if (status) + return status; + if (rs.status) + return SANE_STATUS_NO_DOCS; + if ((dev->buffer[0] & 0x20) != 0) + { + return SANE_STATUS_GOOD; + } + + return SANE_STATUS_NO_DOCS; +} + +SANE_Status +CMD_wait_document_existanse (PKV_DEV dev) +{ + SANE_Status status; + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + int cnt; + + DBG (DBG_proc, "CMD_wait_document_existanse\n"); + + memset (&hdr, 0, sizeof (hdr)); + + hdr.direction = KV_CMD_IN; + hdr.cdb_size = 10; + hdr.cdb[0] = SCSI_READ_10; + hdr.cdb[2] = 0x81; + Ito24 (6, &hdr.cdb[6]); + hdr.data = dev->buffer; + hdr.data_size = 6; + + for (cnt = 0; cnt < dev->val[OPT_FEED_TIMEOUT].w; cnt++) + { + DBG (DBG_proc, "CMD_wait_document_existanse: tray #%d of %d\n", cnt, + dev->val[OPT_FEED_TIMEOUT].w); + status = kv_send_command (dev, &hdr, &rs); + if (status) + return status; + if (rs.status) + return SANE_STATUS_NO_DOCS; + if ((dev->buffer[0] & 0x20) != 0) + { + return SANE_STATUS_GOOD; + } + else if (strcmp (dev->val[OPT_MANUALFEED].s, "off") == 0) + { + return SANE_STATUS_NO_DOCS; + } + sleep (1); + } + + return SANE_STATUS_NO_DOCS; +} + +SANE_Status +CMD_request_sense (PKV_DEV dev) +{ + KV_CMD_HEADER hdr; + KV_CMD_RESPONSE rs; + + DBG (DBG_proc, "CMD_request_sense\n"); + memset (&hdr, 0, sizeof (hdr)); + hdr.direction = KV_CMD_IN; + hdr.cdb[0] = SCSI_REQUEST_SENSE; + hdr.cdb[4] = 0x12; + hdr.cdb_size = 6; + hdr.data_size = 0x12; + hdr.data = dev->buffer; + + return kv_send_command (dev, &hdr, &rs); +} + +/* Scan routines */ + +/* Allocate image buffer for one page (1 or 2 sides) */ + +SANE_Status +AllocateImageBuffer (PKV_DEV dev) +{ + int *size = dev->bytes_to_read; + int sides = IS_DUPLEX (dev) ? 2 : 1; + int i; + size[0] = dev->params[0].bytes_per_line * dev->params[0].lines; + size[1] = dev->params[1].bytes_per_line * dev->params[1].lines; + + DBG (DBG_proc, "AllocateImageBuffer: enter\n"); + + for (i = 0; i < sides; i++) + { + SANE_Byte *p; + DBG (DBG_proc, "AllocateImageBuffer: size(%c)=%d\n", + i ? 'B' : 'F', size[i]); + + if (dev->img_buffers[i] == NULL) + { + p = (SANE_Byte *) malloc (size[i]); + if (p == NULL) + { + return SANE_STATUS_NO_MEM; + } + dev->img_buffers[i] = p; + } + else + { + p = (SANE_Byte *) realloc (dev->img_buffers[i], size[i]); + if (p == NULL) + { + return SANE_STATUS_NO_MEM; + } + else + { + dev->img_buffers[i] = p; + } + } + } + DBG (DBG_proc, "AllocateImageBuffer: exit\n"); + + return SANE_STATUS_GOOD; +} + +/* Read image data from scanner dev->img_buffers[0], + for the simplex page */ +SANE_Status +ReadImageDataSimplex (PKV_DEV dev, int page) +{ + int bytes_to_read = dev->bytes_to_read[0]; + SANE_Byte *buffer = (SANE_Byte *) dev->buffer; + int buff_size = SCSI_BUFFER_SIZE; + SANE_Byte *pt = dev->img_buffers[0]; + KV_CMD_RESPONSE rs; + dev->img_size[0] = 0; + dev->img_size[1] = 0; + + /* read loop */ + do + { + int size = buff_size; + SANE_Status status; + DBG (DBG_error, "Bytes left = %d\n", bytes_to_read); + status = CMD_read_image (dev, page, SIDE_FRONT, buffer, &size, &rs); + if (status) + { + return status; + } + if (rs.status) + { + if (get_RS_sense_key (rs.sense)) + { + DBG (DBG_error, "Error reading image data, " + "sense_key=%d, ASC=%d, ASCQ=%d", + get_RS_sense_key (rs.sense), + get_RS_ASC (rs.sense), get_RS_ASCQ (rs.sense)); + + if (get_RS_sense_key (rs.sense) == 3) + { + if (!get_RS_ASCQ (rs.sense)) + return SANE_STATUS_NO_DOCS; + return SANE_STATUS_JAMMED; + } + return SANE_STATUS_IO_ERROR; + } + + } + /* copy data to image buffer */ + if (size > bytes_to_read) + { + size = bytes_to_read; + } + if (size > 0) + { + memcpy (pt, buffer, size); + bytes_to_read -= size; + pt += size; + dev->img_size[0] += size; + } + } + while (!get_RS_EOM (rs.sense)); + + assert (pt == dev->img_buffers[0] + dev->img_size[0]); + DBG (DBG_error, "Image size = %d\n", dev->img_size[0]); + return SANE_STATUS_GOOD; +} + +/* Read image data from scanner dev->img_buffers[0], + for the duplex page */ +SANE_Status +ReadImageDataDuplex (PKV_DEV dev, int page) +{ + int bytes_to_read[2]; + SANE_Byte *buffer = (SANE_Byte *) dev->buffer; + int buff_size[2]; + SANE_Byte *pt[2]; + KV_CMD_RESPONSE rs; + int sides[2]; + SANE_Bool eoms[2]; + int current_side = 1; + + bytes_to_read[0] = dev->bytes_to_read[0]; + bytes_to_read[1] = dev->bytes_to_read[1]; + + pt[0] = dev->img_buffers[0]; + pt[1] = dev->img_buffers[1]; + + sides[0] = SIDE_FRONT; + sides[1] = SIDE_BACK; + eoms[0] = eoms[1] = 0; + + buff_size[0] = SCSI_BUFFER_SIZE; + buff_size[1] = SCSI_BUFFER_SIZE; + dev->img_size[0] = 0; + dev->img_size[1] = 0; + + /* read loop */ + do + { + int size = buff_size[current_side]; + SANE_Status status; + DBG (DBG_error, "Bytes left (F) = %d\n", bytes_to_read[0]); + DBG (DBG_error, "Bytes left (B) = %d\n", bytes_to_read[1]); + + status = CMD_read_image (dev, page, sides[current_side], + buffer, &size, &rs); + if (status) + { + return status; + } + if (rs.status) + { + if (get_RS_sense_key (rs.sense)) + { + DBG (DBG_error, "Error reading image data, " + "sense_key=%d, ASC=%d, ASCQ=%d", + get_RS_sense_key (rs.sense), + get_RS_ASC (rs.sense), get_RS_ASCQ (rs.sense)); + + if (get_RS_sense_key (rs.sense) == 3) + { + if (!get_RS_ASCQ (rs.sense)) + return SANE_STATUS_NO_DOCS; + return SANE_STATUS_JAMMED; + } + return SANE_STATUS_IO_ERROR; + } + } + + /* copy data to image buffer */ + if (size > bytes_to_read[current_side]) + { + size = bytes_to_read[current_side]; + } + if (size > 0) + { + memcpy (pt[current_side], buffer, size); + bytes_to_read[current_side] -= size; + pt[current_side] += size; + dev->img_size[current_side] += size; + } + if (rs.status) + { + if (get_RS_EOM (rs.sense)) + { + eoms[current_side] = 1; + } + if (get_RS_ILI (rs.sense)) + { + current_side++; + current_side &= 1; + } + } + } + while (eoms[0] == 0 || eoms[1] == 0); + + DBG (DBG_error, "Image size (F) = %d\n", dev->img_size[0]); + DBG (DBG_error, "Image size (B) = %d\n", dev->img_size[1]); + + assert (pt[0] == dev->img_buffers[0] + dev->img_size[0]); + assert (pt[1] == dev->img_buffers[1] + dev->img_size[1]); + + return SANE_STATUS_GOOD; +} + +/* Read image data for one page */ +SANE_Status +ReadImageData (PKV_DEV dev, int page) +{ + SANE_Status status; + DBG (DBG_proc, "Reading image data for page %d\n", page); + + if (IS_DUPLEX (dev)) + { + DBG (DBG_proc, "ReadImageData: Duplex %d\n", page); + status = ReadImageDataDuplex (dev, page); + } + else + { + DBG (DBG_proc, "ReadImageData: Simplex %d\n", page); + status = ReadImageDataSimplex (dev, page); + } + dev->img_pt[0] = dev->img_buffers[0]; + dev->img_pt[1] = dev->img_buffers[1]; + + DBG (DBG_proc, "Reading image data for page %d, finished\n", page); + + return status; +} diff -Nru sane-backends-1.0.20/backend/kvs1025_low.h sane-backends-1.0.21/backend/kvs1025_low.h --- sane-backends-1.0.20/backend/kvs1025_low.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_low.h 2010-04-26 10:52:48.000000000 +1000 @@ -0,0 +1,267 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#ifndef __KVS1025_LOW_H +#define __KVS1025_LOW_H + +#include "kvs1025_cmds.h" + +#define VENDOR_ID 0x04DA + +typedef enum +{ + KV_S1020C = 0x1007, + KV_S1025C = 0x1006, + KV_S1045C = 0x1010 +} KV_MODEL_TYPE; + +/* Store an integer in 2, 3 or 4 byte in a big-endian array. */ +#define Ito16(val, buf) { \ + ((unsigned char *)buf)[0] = ((val) >> 8) & 0xff; \ + ((unsigned char *)buf)[1] = ((val) >> 0) & 0xff; \ +} + +#define Ito24(val, buf) { \ + ((unsigned char *)buf)[0] = ((val) >> 16) & 0xff; \ + ((unsigned char *)buf)[1] = ((val) >> 8) & 0xff; \ + ((unsigned char *)buf)[2] = ((val) >> 0) & 0xff; \ +} + +#define Ito32(val, buf) { \ + ((unsigned char *)buf)[0] = ((val) >> 24) & 0xff; \ + ((unsigned char *)buf)[1] = ((val) >> 16) & 0xff; \ + ((unsigned char *)buf)[2] = ((val) >> 8) & 0xff; \ + ((unsigned char *)buf)[3] = ((val) >> 0) & 0xff; \ +} + +/* 32 bits from an array to an integer (eg ntohl). */ +#define B32TOI(buf) \ + ((((unsigned char *)buf)[0] << 24) | \ + (((unsigned char *)buf)[1] << 16) | \ + (((unsigned char *)buf)[2] << 8) | \ + (((unsigned char *)buf)[3] << 0)) + +/* 24 bits from an array to an integer. */ +#define B24TOI(buf) \ + (((unsigned char *)buf)[0] << 16) | \ + (((unsigned char *)buf)[1] << 8) | \ + (((unsigned char *)buf)[2] << 0)) + +#define SCSI_FD int +#define SCSI_BUFFER_SIZE (0x40000-12) + +typedef enum +{ + KV_SCSI_BUS = 0x01, + KV_USB_BUS = 0x02 +} KV_BUS_MODE; + +typedef enum +{ + SM_BINARY = 0x00, + SM_DITHER = 0x01, + SM_GRAYSCALE = 0x02, + SM_COLOR = 0x05 +} KV_SCAN_MODE; + +typedef struct +{ + unsigned char data[16]; + int len; +} CDB; + +typedef struct +{ + int width; + int height; +} KV_PAPER_SIZE; + +/* remarked -- KV-S1020C / KV-S1025C supports ADF only +typedef enum +{ + TRUPER_ADF = 0, + TRUPER_FLATBED = 1 +} KV_SCAN_SOURCE; +*/ + +/* options */ +typedef enum +{ + OPT_NUM_OPTS = 0, + + /* General options */ + OPT_MODE_GROUP, + OPT_MODE, /* scanner modes */ + OPT_RESOLUTION, /* X and Y resolution */ + OPT_DUPLEX, /* Duplex mode */ + OPT_SCAN_SOURCE, /* Scan source, fixed to ADF */ + OPT_FEEDER_MODE, /* Feeder mode, fixed to Continous */ + OPT_LONGPAPER, /* Long paper mode */ + OPT_LENGTHCTL, /* Length control mode */ + OPT_MANUALFEED, /* Manual feed mode */ + OPT_FEED_TIMEOUT, /* Feed timeout */ + OPT_DBLFEED, /* Double feed detection mode */ + OPT_FIT_TO_PAGE, /* Scanner shrinks image to fit scanned page */ + + /* Geometry group */ + OPT_GEOMETRY_GROUP, + OPT_PAPER_SIZE, /* Paper size */ + OPT_LANDSCAPE, /* true if landscape; new for Truper 3200/3600 */ + OPT_TL_X, /* upper left X */ + OPT_TL_Y, /* upper left Y */ + OPT_BR_X, /* bottom right X */ + OPT_BR_Y, /* bottom right Y */ + + OPT_ENHANCEMENT_GROUP, + OPT_BRIGHTNESS, /* Brightness */ + OPT_CONTRAST, /* Contrast */ + OPT_AUTOMATIC_THRESHOLD, /* Binary threshold */ + OPT_HALFTONE_PATTERN, /* Halftone pattern */ + OPT_AUTOMATIC_SEPARATION, /* Automatic separation */ + OPT_WHITE_LEVEL, /* White level */ + OPT_NOISE_REDUCTION, /* Noise reduction */ + OPT_IMAGE_EMPHASIS, /* Image emphasis */ + OPT_GAMMA, /* Gamma */ + OPT_LAMP, /* Lamp -- color drop out */ + OPT_INVERSE, /* Inverse image */ + OPT_MIRROR, /* Mirror image */ + OPT_JPEG, /* JPEG Compression */ + /* must come last: */ + OPT_NUM_OPTIONS +} KV_OPTION; + +typedef struct +{ + int memory_size; /* in MB */ + int min_resolution; /* in DPI */ + int max_resolution; /* in DPI */ + int step_resolution; /* in DPI */ + int support_duplex; /* 1 if true */ + int support_lamp; /* 1 if true */ + int max_x_range; /* in mm */ + int max_y_range; /* in mm */ +} KV_SUPPORT_INFO; + +typedef struct kv_scanner_dev +{ + struct kv_scanner_dev *next; + + SANE_Device sane; + + /* Infos from inquiry. */ + char scsi_type; + char scsi_type_str[32]; + char scsi_vendor[12]; + char scsi_product[20]; + char scsi_version[8]; + + /* Bus info */ + KV_BUS_MODE bus_mode; + SANE_Int usb_fd; + char device_name[100]; + char *scsi_device_name; + SCSI_FD scsi_fd; + + KV_MODEL_TYPE model_type; + + SANE_Parameters params[2]; + + /* SCSI handling */ + SANE_Byte *buffer0; + SANE_Byte *buffer; /* buffer = buffer0 + 12 */ + /* for USB bulk transfer, a 12 bytes container + is required for each block */ + /* Scanning handling. */ + int scanning; /* TRUE if a scan is running. */ + int current_page; /* the current page number, 0 is page 1 */ + int current_side; /* the current side */ + int bytes_to_read[2]; /* bytes to read */ + /* Support info */ + + KV_SUPPORT_INFO support_info; + + SANE_Range x_range, y_range; + + /* Options */ + SANE_Option_Descriptor opt[OPT_NUM_OPTIONS]; + Option_Value val[OPT_NUM_OPTIONS]; + SANE_Bool option_set; + + /* Image buffer */ + SANE_Byte *img_buffers[2]; + SANE_Byte *img_pt[2]; + int img_size[2]; +} KV_DEV, *PKV_DEV; + +#define GET_OPT_VAL_W(dev, idx) ((dev)->val[idx].w) +#define GET_OPT_VAL_L(dev, idx, token) get_optval_list(dev, idx, \ + go_##token##_list, go_##token##_val) + +#define IS_DUPLEX(dev) GET_OPT_VAL_W(dev, OPT_DUPLEX) + +/* Prototypes in kvs1025_opt.c */ + +int get_optval_list (const PKV_DEV dev, int idx, + const SANE_String_Const * str_list, const int *val_list); +KV_SCAN_MODE kv_get_mode (const PKV_DEV dev); +int kv_get_depth (KV_SCAN_MODE mode); + +void kv_calc_paper_size (const PKV_DEV dev, int *w, int *h); + +const SANE_Option_Descriptor *kv_get_option_descriptor (PKV_DEV dev, + SANE_Int option); +void kv_init_options (PKV_DEV dev); +SANE_Status kv_control_option (PKV_DEV dev, SANE_Int option, + SANE_Action action, void *val, + SANE_Int * info); +void hexdump (int level, const char *comment, unsigned char *p, int l); +void kv_set_window_data (PKV_DEV dev, + KV_SCAN_MODE scan_mode, + int side, unsigned char *windowdata); + +/* Prototypes in kvs1025_low.c */ + +SANE_Status kv_enum_devices (void); +void kv_get_devices_list (const SANE_Device *** devices_list); +void kv_exit (void); +SANE_Status kv_open (PKV_DEV dev); +SANE_Bool kv_already_open (PKV_DEV dev); +SANE_Status kv_open_by_name (SANE_String_Const devicename, + SANE_Handle * handle); +void kv_close (PKV_DEV dev); +SANE_Status kv_send_command (PKV_DEV dev, + PKV_CMD_HEADER header, + PKV_CMD_RESPONSE response); + +/* Commands */ + +SANE_Status CMD_test_unit_ready (PKV_DEV dev, SANE_Bool * ready); +SANE_Status CMD_read_support_info (PKV_DEV dev); +SANE_Status CMD_scan (PKV_DEV dev); +SANE_Status CMD_set_window (PKV_DEV dev, int side, PKV_CMD_RESPONSE rs); +SANE_Status CMD_reset_window (PKV_DEV dev); +SANE_Status CMD_get_buff_status (PKV_DEV dev, int *front_size, + int *back_size); +SANE_Status CMD_wait_buff_status (PKV_DEV dev, int *front_size, + int *back_size); +SANE_Status CMD_read_pic_elements (PKV_DEV dev, int page, int side, + int *width, int *height); +SANE_Status CMD_read_image (PKV_DEV dev, int page, int side, + unsigned char *buffer, int *psize, + KV_CMD_RESPONSE * rs); +SANE_Status CMD_wait_document_existanse (PKV_DEV dev); +SANE_Status CMD_get_document_existanse (PKV_DEV dev); +SANE_Status CMD_set_timeout (PKV_DEV dev, SANE_Word timeout); +SANE_Status CMD_request_sense (PKV_DEV dev); +/* Scan routines */ + +SANE_Status AllocateImageBuffer (PKV_DEV dev); +SANE_Status ReadImageDataSimplex (PKV_DEV dev, int page); +SANE_Status ReadImageDataDuplex (PKV_DEV dev, int page); +SANE_Status ReadImageData (PKV_DEV dev, int page); + +#endif /* #ifndef __KVS1025_LOW_H */ diff -Nru sane-backends-1.0.20/backend/kvs1025_opt.c sane-backends-1.0.21/backend/kvs1025_opt.c --- sane-backends-1.0.20/backend/kvs1025_opt.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_opt.c 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,1496 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#define DEBUG_DECLARE_ONLY + +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" +#include "../include/lassert.h" + +#include "kvs1025.h" +#include "kvs1025_low.h" + +#include "../include/sane/sanei_debug.h" + +/* Option lists */ + +static SANE_String_Const go_scan_mode_list[] = { + SANE_I18N ("bw"), + SANE_I18N ("halftone"), + SANE_I18N ("gray"), + SANE_I18N ("color"), + NULL +}; + +/* +static int go_scan_mode_val[] = { + 0x00, + 0x01, + 0x02, + 0x05 +};*/ + +static const SANE_Word go_resolutions_list[] = { + 11, /* list size */ + 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600 +}; + +/* List of scan sources */ +static SANE_String_Const go_scan_source_list[] = { + SANE_I18N ("adf"), + SANE_I18N ("fb"), + NULL +}; +static const int go_scan_source_val[] = { + 0, + 0x1 +}; + +/* List of feeder modes */ +static SANE_String_Const go_feeder_mode_list[] = { + SANE_I18N ("single"), + SANE_I18N ("continuous"), + NULL +}; +static const int go_feeder_mode_val[] = { + 0x00, + 0xff +}; + +/* List of manual feed mode */ +static SANE_String_Const go_manual_feed_list[] = { + SANE_I18N ("off"), + SANE_I18N ("wait_doc"), + SANE_I18N ("wait_key"), + NULL +}; +static const int go_manual_feed_val[] = { + 0x00, + 0x01, + 0x02 +}; + +/* List of paper sizes */ +static SANE_String_Const go_paper_list[] = { + SANE_I18N ("user_def"), + SANE_I18N ("business_card"), + SANE_I18N ("Check"), + /*SANE_I18N ("A3"), */ + SANE_I18N ("A4"), + SANE_I18N ("A5"), + SANE_I18N ("A6"), + SANE_I18N ("Letter"), + /*SANE_I18N ("Double letter 11x17 in"), + SANE_I18N ("B4"), */ + SANE_I18N ("B5"), + SANE_I18N ("B6"), + SANE_I18N ("Legal"), + NULL +}; +static const int go_paper_val[] = { + 0x00, + 0x01, + 0x02, + /*0x03, *//* A3 : not supported */ + 0x04, + 0x05, + 0x06, + 0x07, + /*0x09, + 0x0C, *//* Dbl letter and B4 : not supported */ + 0x0D, + 0x0E, + 0x0F +}; + +static const KV_PAPER_SIZE go_paper_sizes[] = { + {210, 297}, /* User defined, default=A4 */ + {54, 90}, /* Business card */ + {80, 170}, /* Check (China business) */ + /*{297, 420}, *//* A3 */ + {210, 297}, /* A4 */ + {148, 210}, /* A5 */ + {105, 148}, /* A6 */ + {216, 280}, /* US Letter 8.5 x 11 in */ + /*{280, 432}, *//* Double Letter 11 x 17 in */ + /*{250, 353}, *//* B4 */ + {176, 250}, /* B5 */ + {125, 176}, /* B6 */ + {216, 356} /* US Legal */ +}; + +static const int default_paper_size_idx = 3; /* A4 */ +static const int go_paper_max_width = 216; /* US letter */ + +/* Lists of supported halftone. They are only valid with + * for the Black&White mode. */ +static SANE_String_Const go_halftone_pattern_list[] = { + SANE_I18N ("bayer_64"), + SANE_I18N ("bayer_16"), + SANE_I18N ("halftone_32"), + SANE_I18N ("halftone_64"), + SANE_I18N ("diffusion"), + NULL +}; +static const int go_halftone_pattern_val[] = { + 0x00, + 0x01, + 0x02, + 0x03, + 0x04 +}; + +/* List of automatic threshold options */ +static SANE_String_Const go_automatic_threshold_list[] = { + SANE_I18N ("normal"), + SANE_I18N ("light"), + SANE_I18N ("dark"), + NULL +}; +static const int go_automatic_threshold_val[] = { + 0, + 0x11, + 0x1f +}; + +/* List of white level base. */ +static SANE_String_Const go_white_level_list[] = { + SANE_I18N ("From scanner"), + SANE_I18N ("From paper"), + SANE_I18N ("Automatic"), + NULL +}; +static const int go_white_level_val[] = { + 0x00, + 0x80, + 0x81 +}; + +/* List of noise reduction options. */ +static SANE_String_Const go_noise_reduction_list[] = { + SANE_I18N ("default"), + "1x1", + "2x2", + "3x3", + "4x4", + "5x5", + NULL +}; +static const int go_noise_reduction_val[] = { + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05 +}; + +/* List of image emphasis options, 5 steps */ +static SANE_String_Const go_image_emphasis_list[] = { + SANE_I18N ("smooth"), + SANE_I18N ("none"), + SANE_I18N ("low"), + SANE_I18N ("medium"), /* default */ + SANE_I18N ("high"), + NULL +}; +static const int go_image_emphasis_val[] = { + 0x14, + 0x00, + 0x11, + 0x12, + 0x13 +}; + +/* List of gamma */ +static SANE_String_Const go_gamma_list[] = { + SANE_I18N ("normal"), + SANE_I18N ("crt"), + SANE_I18N ("linier"), + NULL +}; +static const int go_gamma_val[] = { + 0x00, + 0x01, + 0x02 +}; + +/* List of lamp color dropout */ +static SANE_String_Const go_lamp_list[] = { + SANE_I18N ("normal"), + SANE_I18N ("red"), + SANE_I18N ("green"), + SANE_I18N ("blue"), + NULL +}; +static const int go_lamp_val[] = { + 0x00, + 0x01, + 0x02, + 0x03 +}; + +static SANE_Range go_value_range = { 0, 255, 0 }; + +static SANE_Range go_jpeg_compression_range = { 0, 0x64, 0 }; + +static const char *go_option_name[] = { + "OPT_NUM_OPTS", + + /* General options */ + "OPT_MODE_GROUP", + "OPT_MODE", /* scanner modes */ + "OPT_RESOLUTION", /* X and Y resolution */ + "OPT_DUPLEX", /* Duplex mode */ + "OPT_SCAN_SOURCE", /* Scan source, fixed to ADF */ + "OPT_FEEDER_MODE", /* Feeder mode, fixed to Continous */ + "OPT_LONGPAPER", /* Long paper mode */ + "OPT_LENGTHCTL", /* Length control mode */ + "OPT_MANUALFEED", /* Manual feed mode */ + "OPT_FEED_TIMEOUT", /* Feed timeout */ + "OPT_DBLFEED", /* Double feed detection mode */ + "OPT_FIT_TO_PAGE", /* Scanner shrinks image to fit scanned page */ + + /* Geometry group */ + "OPT_GEOMETRY_GROUP", + "OPT_PAPER_SIZE", /* Paper size */ + "OPT_LANDSCAPE", /* true if landscape */ + "OPT_TL_X", /* upper left X */ + "OPT_TL_Y", /* upper left Y */ + "OPT_BR_X", /* bottom right X */ + "OPT_BR_Y", /* bottom right Y */ + + "OPT_ENHANCEMENT_GROUP", + "OPT_BRIGHTNESS", /* Brightness */ + "OPT_CONTRAST", /* Contrast */ + "OPT_AUTOMATIC_THRESHOLD", /* Binary threshold */ + "OPT_HALFTONE_PATTERN", /* Halftone pattern */ + "OPT_AUTOMATIC_SEPARATION", /* Automatic separation */ + "OPT_WHITE_LEVEL", /* White level */ + "OPT_NOISE_REDUCTION", /* Noise reduction */ + "OPT_IMAGE_EMPHASIS", /* Image emphasis */ + "OPT_GAMMA", /* Gamma */ + "OPT_LAMP", /* Lamp -- color drop out */ + "OPT_INVERSE", /* Inverse image */ + "OPT_MIRROR", /* Mirror image */ + "OPT_JPEG", /* */ + "OPT_SEPARATION_SHEET", /* Detect Separation Sheet */ + "OPT_CONTROL_SHEET", /* Detect Control Sheet */ + /* must come last: */ + "OPT_NUM_OPTIONS" +}; + + +/* Round to boundry, return 1 if value modified */ +static int +round_to_boundry (SANE_Word * pval, SANE_Word boundry, + SANE_Word minv, SANE_Word maxv) +{ + SANE_Word lower, upper, k, v; + + v = *pval; + k = v / boundry; + lower = k * boundry; + upper = (k + 1) * boundry; + + if (v - lower <= upper - v) + { + *pval = lower; + } + else + { + *pval = upper; + } + + if ((*pval) < minv) + *pval = minv; + if ((*pval) > maxv) + *pval = maxv; + + return ((*pval) != v); +} + +/* Returns the length of the longest string, including the terminating + * character. */ +static size_t +max_string_size (SANE_String_Const * strings) +{ + size_t size, max_size = 0; + int i; + + for (i = 0; strings[i]; ++i) + { + size = strlen (strings[i]) + 1; + if (size > max_size) + { + max_size = size; + } + } + + return max_size; +} + +/* Lookup a string list from one array and return its index. */ +static int +get_string_list_index (const SANE_String_Const * list, SANE_String_Const name) +{ + int index; + + index = 0; + while (list[index] != NULL) + { + if (strcmp (list[index], name) == 0) + { + return (index); + } + index++; + } + + DBG (DBG_error, "System bug: option %s not found in list\n", name); + + return (-1); /* not found */ +} + + +/* Lookup a string list from one array and return the correnpond value. */ +int +get_optval_list (const PKV_DEV dev, int idx, + const SANE_String_Const * str_list, const int *val_list) +{ + int index; + + index = get_string_list_index (str_list, dev->val[idx].s); + + if (index < 0) + index = 0; + + return val_list[index]; +} + + +/* Get device mode from device options */ +KV_SCAN_MODE +kv_get_mode (const PKV_DEV dev) +{ + int i; + + i = get_string_list_index (go_scan_mode_list, dev->val[OPT_MODE].s); + + switch (i) + { + case 0: + return SM_BINARY; + case 1: + return SM_DITHER; + case 2: + return SM_GRAYSCALE; + case 3: + return SM_COLOR; + default: + assert (0 == 1); + return 0; + } +} + +void +kv_calc_paper_size (const PKV_DEV dev, int *w, int *h) +{ + int i = get_string_list_index (go_paper_list, + dev->val[OPT_PAPER_SIZE].s); + if (i == 0) + { /* Non-standard document */ + int x_tl = mmToIlu (SANE_UNFIX (dev->val[OPT_TL_X].w)); + int y_tl = mmToIlu (SANE_UNFIX (dev->val[OPT_TL_Y].w)); + int x_br = mmToIlu (SANE_UNFIX (dev->val[OPT_BR_X].w)); + int y_br = mmToIlu (SANE_UNFIX (dev->val[OPT_BR_Y].w)); + *w = x_br - x_tl; + *h = y_br - y_tl; + } + else + { + if (dev->val[OPT_LANDSCAPE].s) + { + *h = mmToIlu (go_paper_sizes[i].width); + *w = mmToIlu (go_paper_sizes[i].height); + } + else + { + *w = mmToIlu (go_paper_sizes[i].width); + *h = mmToIlu (go_paper_sizes[i].height); + } + } +} + +/* Get bit depth from scan mode */ +int +kv_get_depth (KV_SCAN_MODE mode) +{ + switch (mode) + { + case SM_BINARY: + case SM_DITHER: + return 1; + case SM_GRAYSCALE: + return 8; + case SM_COLOR: + return 24; + default: + assert (0 == 1); + return 0; + } +} + +const SANE_Option_Descriptor * +kv_get_option_descriptor (PKV_DEV dev, SANE_Int option) +{ + DBG (DBG_proc, "sane_get_option_descriptor: enter, option %s\n", + go_option_name[option]); + + if ((unsigned) option >= OPT_NUM_OPTIONS) + { + return NULL; + } + + DBG (DBG_proc, "sane_get_option_descriptor: exit\n"); + + return dev->opt + option; +} + +/* Reset the options for that scanner. */ +void +kv_init_options (PKV_DEV dev) +{ + int i; + + if (dev->option_set) + return; + + DBG (DBG_proc, "kv_init_options: enter\n"); + + /* Pre-initialize the options. */ + memset (dev->opt, 0, sizeof (dev->opt)); + memset (dev->val, 0, sizeof (dev->val)); + + for (i = 0; i < OPT_NUM_OPTIONS; ++i) + { + dev->opt[i].size = sizeof (SANE_Word); + dev->opt[i].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* Number of options. */ + dev->opt[OPT_NUM_OPTS].name = ""; + dev->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; + dev->opt[OPT_NUM_OPTS].desc = SANE_DESC_NUM_OPTIONS; + dev->opt[OPT_NUM_OPTS].type = SANE_TYPE_INT; + dev->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT; + dev->val[OPT_NUM_OPTS].w = OPT_NUM_OPTIONS; + + /* Mode group */ + dev->opt[OPT_MODE_GROUP].title = SANE_I18N ("Scan Mode"); + dev->opt[OPT_MODE_GROUP].desc = ""; /* not valid for a group */ + dev->opt[OPT_MODE_GROUP].type = SANE_TYPE_GROUP; + dev->opt[OPT_MODE_GROUP].cap = 0; + dev->opt[OPT_MODE_GROUP].size = 0; + dev->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + /* Scanner supported modes */ + dev->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; + dev->opt[OPT_MODE].title = SANE_TITLE_SCAN_MODE; + dev->opt[OPT_MODE].desc = SANE_DESC_SCAN_MODE; + dev->opt[OPT_MODE].type = SANE_TYPE_STRING; + dev->opt[OPT_MODE].size = max_string_size (go_scan_mode_list); + dev->opt[OPT_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_MODE].constraint.string_list = go_scan_mode_list; + dev->val[OPT_MODE].s = strdup (""); /* will be set later */ + + /* X and Y resolution */ + dev->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; + dev->opt[OPT_RESOLUTION].title = SANE_TITLE_SCAN_RESOLUTION; + dev->opt[OPT_RESOLUTION].desc = SANE_DESC_SCAN_RESOLUTION; + dev->opt[OPT_RESOLUTION].type = SANE_TYPE_INT; + dev->opt[OPT_RESOLUTION].unit = SANE_UNIT_DPI; + dev->opt[OPT_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST; + dev->opt[OPT_RESOLUTION].constraint.word_list = go_resolutions_list; + dev->val[OPT_RESOLUTION].w = go_resolutions_list[3]; + + /* Duplex */ + dev->opt[OPT_DUPLEX].name = SANE_NAME_DUPLEX; + dev->opt[OPT_DUPLEX].title = SANE_TITLE_DUPLEX; + dev->opt[OPT_DUPLEX].desc = SANE_DESC_DUPLEX; + dev->opt[OPT_DUPLEX].type = SANE_TYPE_BOOL; + dev->opt[OPT_DUPLEX].unit = SANE_UNIT_NONE; + dev->val[OPT_DUPLEX].w = SANE_FALSE; + if (!dev->support_info.support_duplex) + dev->opt[OPT_DUPLEX].cap |= SANE_CAP_INACTIVE; + + /* Scan source */ + dev->opt[OPT_SCAN_SOURCE].name = SANE_NAME_SCAN_SOURCE; + dev->opt[OPT_SCAN_SOURCE].title = SANE_TITLE_SCAN_SOURCE; + dev->opt[OPT_SCAN_SOURCE].desc = SANE_I18N ("Sets the scan source"); + dev->opt[OPT_SCAN_SOURCE].type = SANE_TYPE_STRING; + dev->opt[OPT_SCAN_SOURCE].size = max_string_size (go_scan_source_list); + dev->opt[OPT_SCAN_SOURCE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_SCAN_SOURCE].constraint.string_list = go_scan_source_list; + dev->val[OPT_SCAN_SOURCE].s = strdup (go_scan_source_list[0]); + dev->opt[OPT_SCAN_SOURCE].cap &= ~SANE_CAP_SOFT_SELECT; + /* for KV-S1020C / KV-S1025C, scan source is fixed to ADF */ + + /* Feeder mode */ + dev->opt[OPT_FEEDER_MODE].name = "feeder-mode"; + dev->opt[OPT_FEEDER_MODE].title = SANE_I18N ("Feeder mode"); + dev->opt[OPT_FEEDER_MODE].desc = SANE_I18N ("Sets the feeding mode"); + dev->opt[OPT_FEEDER_MODE].type = SANE_TYPE_STRING; + dev->opt[OPT_FEEDER_MODE].size = max_string_size (go_feeder_mode_list); + dev->opt[OPT_FEEDER_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_FEEDER_MODE].constraint.string_list = go_feeder_mode_list; + dev->val[OPT_FEEDER_MODE].s = strdup (go_feeder_mode_list[1]); + + /* Long paper */ + dev->opt[OPT_LONGPAPER].name = SANE_NAME_LONGPAPER; + dev->opt[OPT_LONGPAPER].title = SANE_TITLE_LONGPAPER; + dev->opt[OPT_LONGPAPER].desc = SANE_I18N ("Enable/Disable long paper mode"); + dev->opt[OPT_LONGPAPER].type = SANE_TYPE_BOOL; + dev->opt[OPT_LONGPAPER].unit = SANE_UNIT_NONE; + dev->val[OPT_LONGPAPER].w = SANE_FALSE; + + /* Length control */ + dev->opt[OPT_LENGTHCTL].name = SANE_NAME_LENGTHCTL; + dev->opt[OPT_LENGTHCTL].title = SANE_TITLE_LENGTHCTL; + dev->opt[OPT_LENGTHCTL].desc = + SANE_I18N ("Enable/Disable length control mode"); + dev->opt[OPT_LENGTHCTL].type = SANE_TYPE_BOOL; + dev->opt[OPT_LENGTHCTL].unit = SANE_UNIT_NONE; + dev->val[OPT_LENGTHCTL].w = SANE_TRUE; + + /* Manual feed */ + dev->opt[OPT_MANUALFEED].name = SANE_NAME_MANUALFEED; + dev->opt[OPT_MANUALFEED].title = SANE_TITLE_MANUALFEED; + dev->opt[OPT_MANUALFEED].desc = SANE_I18N ("Sets the manual feed mode"); + dev->opt[OPT_MANUALFEED].type = SANE_TYPE_STRING; + dev->opt[OPT_MANUALFEED].size = max_string_size (go_manual_feed_list); + dev->opt[OPT_MANUALFEED].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_MANUALFEED].constraint.string_list = go_manual_feed_list; + dev->val[OPT_MANUALFEED].s = strdup (go_manual_feed_list[0]); + + /*Manual feed timeout */ + dev->opt[OPT_FEED_TIMEOUT].name = SANE_NAME_FEED_TIMEOUT; + dev->opt[OPT_FEED_TIMEOUT].title = SANE_TITLE_FEED_TIMEOUT; + dev->opt[OPT_FEED_TIMEOUT].desc = + SANE_I18N ("Sets the manual feed timeout in seconds"); + dev->opt[OPT_FEED_TIMEOUT].type = SANE_TYPE_INT; + dev->opt[OPT_FEED_TIMEOUT].unit = SANE_UNIT_NONE; + dev->opt[OPT_FEED_TIMEOUT].size = sizeof (SANE_Int); + dev->opt[OPT_FEED_TIMEOUT].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_FEED_TIMEOUT].constraint.range = &(go_value_range); + dev->opt[OPT_FEED_TIMEOUT].cap |= SANE_CAP_INACTIVE; + dev->val[OPT_FEED_TIMEOUT].w = 30; + + /* Double feed */ + dev->opt[OPT_DBLFEED].name = SANE_NAME_DBLFEED; + dev->opt[OPT_DBLFEED].title = SANE_TITLE_DBLFEED; + dev->opt[OPT_DBLFEED].desc = + SANE_I18N ("Enable/Disable double feed detection"); + dev->opt[OPT_DBLFEED].type = SANE_TYPE_BOOL; + dev->opt[OPT_DBLFEED].unit = SANE_UNIT_NONE; + dev->val[OPT_DBLFEED].w = SANE_FALSE; + + /* Fit to page */ + dev->opt[OPT_FIT_TO_PAGE].name = SANE_I18N ("fit-to-page"); + dev->opt[OPT_FIT_TO_PAGE].title = SANE_I18N ("Fit to page"); + dev->opt[OPT_FIT_TO_PAGE].desc = + SANE_I18N ("Scanner shrinks image to fit scanned page"); + dev->opt[OPT_FIT_TO_PAGE].type = SANE_TYPE_BOOL; + dev->opt[OPT_FIT_TO_PAGE].unit = SANE_UNIT_NONE; + dev->val[OPT_FIT_TO_PAGE].w = SANE_FALSE; + + /* Geometry group */ + dev->opt[OPT_GEOMETRY_GROUP].title = SANE_I18N ("Geometry"); + dev->opt[OPT_GEOMETRY_GROUP].desc = ""; /* not valid for a group */ + dev->opt[OPT_GEOMETRY_GROUP].type = SANE_TYPE_GROUP; + dev->opt[OPT_GEOMETRY_GROUP].cap = 0; + dev->opt[OPT_GEOMETRY_GROUP].size = 0; + dev->opt[OPT_GEOMETRY_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + /* Paper sizes list */ + dev->opt[OPT_PAPER_SIZE].name = SANE_NAME_PAPER_SIZE; + dev->opt[OPT_PAPER_SIZE].title = SANE_TITLE_PAPER_SIZE; + dev->opt[OPT_PAPER_SIZE].desc = SANE_DESC_PAPER_SIZE; + dev->opt[OPT_PAPER_SIZE].type = SANE_TYPE_STRING; + dev->opt[OPT_PAPER_SIZE].size = max_string_size (go_paper_list); + dev->opt[OPT_PAPER_SIZE].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_PAPER_SIZE].constraint.string_list = go_paper_list; + dev->val[OPT_PAPER_SIZE].s = strdup (""); /* will be set later */ + + /* Landscape */ + dev->opt[OPT_LANDSCAPE].name = SANE_NAME_LANDSCAPE; + dev->opt[OPT_LANDSCAPE].title = SANE_TITLE_LANDSCAPE; + dev->opt[OPT_LANDSCAPE].desc = + SANE_I18N ("Set paper position : " + "true for landscape, false for portrait"); + dev->opt[OPT_LANDSCAPE].type = SANE_TYPE_BOOL; + dev->opt[OPT_LANDSCAPE].unit = SANE_UNIT_NONE; + dev->val[OPT_LANDSCAPE].w = SANE_FALSE; + + /* Upper left X */ + dev->opt[OPT_TL_X].name = SANE_NAME_SCAN_TL_X; + dev->opt[OPT_TL_X].title = SANE_TITLE_SCAN_TL_X; + dev->opt[OPT_TL_X].desc = SANE_DESC_SCAN_TL_X; + dev->opt[OPT_TL_X].type = SANE_TYPE_FIXED; + dev->opt[OPT_TL_X].unit = SANE_UNIT_MM; + dev->opt[OPT_TL_X].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_TL_X].constraint.range = &(dev->x_range); + + /* Upper left Y */ + dev->opt[OPT_TL_Y].name = SANE_NAME_SCAN_TL_Y; + dev->opt[OPT_TL_Y].title = SANE_TITLE_SCAN_TL_Y; + dev->opt[OPT_TL_Y].desc = SANE_DESC_SCAN_TL_Y; + dev->opt[OPT_TL_Y].type = SANE_TYPE_FIXED; + dev->opt[OPT_TL_Y].unit = SANE_UNIT_MM; + dev->opt[OPT_TL_Y].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_TL_Y].constraint.range = &(dev->y_range); + + /* Bottom-right x */ + dev->opt[OPT_BR_X].name = SANE_NAME_SCAN_BR_X; + dev->opt[OPT_BR_X].title = SANE_TITLE_SCAN_BR_X; + dev->opt[OPT_BR_X].desc = SANE_DESC_SCAN_BR_X; + dev->opt[OPT_BR_X].type = SANE_TYPE_FIXED; + dev->opt[OPT_BR_X].unit = SANE_UNIT_MM; + dev->opt[OPT_BR_X].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_BR_X].constraint.range = &(dev->x_range); + + /* Bottom-right y */ + dev->opt[OPT_BR_Y].name = SANE_NAME_SCAN_BR_Y; + dev->opt[OPT_BR_Y].title = SANE_TITLE_SCAN_BR_Y; + dev->opt[OPT_BR_Y].desc = SANE_DESC_SCAN_BR_Y; + dev->opt[OPT_BR_Y].type = SANE_TYPE_FIXED; + dev->opt[OPT_BR_Y].unit = SANE_UNIT_MM; + dev->opt[OPT_BR_Y].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_BR_Y].constraint.range = &(dev->y_range); + + /* Enhancement group */ + dev->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N ("Enhancement"); + dev->opt[OPT_ENHANCEMENT_GROUP].desc = ""; /* not valid for a group */ + dev->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP; + dev->opt[OPT_ENHANCEMENT_GROUP].cap = SANE_CAP_ADVANCED; + dev->opt[OPT_ENHANCEMENT_GROUP].size = 0; + dev->opt[OPT_ENHANCEMENT_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + /* Brightness */ + dev->opt[OPT_BRIGHTNESS].name = SANE_NAME_BRIGHTNESS; + dev->opt[OPT_BRIGHTNESS].title = SANE_TITLE_BRIGHTNESS; + dev->opt[OPT_BRIGHTNESS].desc = SANE_DESC_BRIGHTNESS; + dev->opt[OPT_BRIGHTNESS].type = SANE_TYPE_INT; + dev->opt[OPT_BRIGHTNESS].unit = SANE_UNIT_NONE; + dev->opt[OPT_BRIGHTNESS].size = sizeof (SANE_Int); + dev->opt[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_BRIGHTNESS].constraint.range = &(go_value_range); + dev->val[OPT_BRIGHTNESS].w = 128; + + /* Contrast */ + dev->opt[OPT_CONTRAST].name = SANE_NAME_CONTRAST; + dev->opt[OPT_CONTRAST].title = SANE_TITLE_CONTRAST; + dev->opt[OPT_CONTRAST].desc = SANE_DESC_CONTRAST; + dev->opt[OPT_CONTRAST].type = SANE_TYPE_INT; + dev->opt[OPT_CONTRAST].unit = SANE_UNIT_NONE; + dev->opt[OPT_CONTRAST].size = sizeof (SANE_Int); + dev->opt[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_CONTRAST].constraint.range = &(go_value_range); + dev->val[OPT_CONTRAST].w = 128; + + /* Automatic threshold */ + dev->opt[OPT_AUTOMATIC_THRESHOLD].name = "automatic-threshold"; + dev->opt[OPT_AUTOMATIC_THRESHOLD].title = SANE_I18N ("Automatic threshold"); + dev->opt[OPT_AUTOMATIC_THRESHOLD].desc = + SANE_I18N + ("Automatically sets brightness, contrast, white level, " + "gamma, noise reduction and image emphasis"); + dev->opt[OPT_AUTOMATIC_THRESHOLD].type = SANE_TYPE_STRING; + dev->opt[OPT_AUTOMATIC_THRESHOLD].size = + max_string_size (go_automatic_threshold_list); + dev->opt[OPT_AUTOMATIC_THRESHOLD].constraint_type = + SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_AUTOMATIC_THRESHOLD].constraint.string_list = + go_automatic_threshold_list; + dev->val[OPT_AUTOMATIC_THRESHOLD].s = + strdup (go_automatic_threshold_list[0]); + + /* Halftone pattern */ + dev->opt[OPT_HALFTONE_PATTERN].name = SANE_NAME_HALFTONE_PATTERN; + dev->opt[OPT_HALFTONE_PATTERN].title = SANE_TITLE_HALFTONE_PATTERN; + dev->opt[OPT_HALFTONE_PATTERN].desc = SANE_DESC_HALFTONE_PATTERN; + dev->opt[OPT_HALFTONE_PATTERN].type = SANE_TYPE_STRING; + dev->opt[OPT_HALFTONE_PATTERN].size = + max_string_size (go_halftone_pattern_list); + dev->opt[OPT_HALFTONE_PATTERN].constraint_type = + SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_HALFTONE_PATTERN].constraint.string_list = + go_halftone_pattern_list; + dev->val[OPT_HALFTONE_PATTERN].s = strdup (go_halftone_pattern_list[0]); + + /* Automatic separation */ + dev->opt[OPT_AUTOMATIC_SEPARATION].name = SANE_NAME_AUTOSEP; + dev->opt[OPT_AUTOMATIC_SEPARATION].title = SANE_TITLE_AUTOSEP; + dev->opt[OPT_AUTOMATIC_SEPARATION].desc = SANE_DESC_AUTOSEP; + dev->opt[OPT_AUTOMATIC_SEPARATION].type = SANE_TYPE_BOOL; + dev->opt[OPT_AUTOMATIC_SEPARATION].unit = SANE_UNIT_NONE; + dev->val[OPT_AUTOMATIC_SEPARATION].w = SANE_FALSE; + + /* White level base */ + dev->opt[OPT_WHITE_LEVEL].name = SANE_NAME_WHITE_LEVEL; + dev->opt[OPT_WHITE_LEVEL].title = SANE_TITLE_WHITE_LEVEL; + dev->opt[OPT_WHITE_LEVEL].desc = SANE_DESC_WHITE_LEVEL; + dev->opt[OPT_WHITE_LEVEL].type = SANE_TYPE_STRING; + dev->opt[OPT_WHITE_LEVEL].size = max_string_size (go_white_level_list); + dev->opt[OPT_WHITE_LEVEL].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_WHITE_LEVEL].constraint.string_list = go_white_level_list; + dev->val[OPT_WHITE_LEVEL].s = strdup (go_white_level_list[0]); + + /* Noise reduction */ + dev->opt[OPT_NOISE_REDUCTION].name = "noise-reduction"; + dev->opt[OPT_NOISE_REDUCTION].title = SANE_I18N ("Noise reduction"); + dev->opt[OPT_NOISE_REDUCTION].desc = + SANE_I18N ("Reduce the isolated dot noise"); + dev->opt[OPT_NOISE_REDUCTION].type = SANE_TYPE_STRING; + dev->opt[OPT_NOISE_REDUCTION].size = + max_string_size (go_noise_reduction_list); + dev->opt[OPT_NOISE_REDUCTION].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_NOISE_REDUCTION].constraint.string_list = + go_noise_reduction_list; + dev->val[OPT_NOISE_REDUCTION].s = strdup (go_noise_reduction_list[0]); + + /* Image emphasis */ + dev->opt[OPT_IMAGE_EMPHASIS].name = "image-emphasis"; + dev->opt[OPT_IMAGE_EMPHASIS].title = SANE_I18N ("Image emphasis"); + dev->opt[OPT_IMAGE_EMPHASIS].desc = SANE_I18N ("Sets the image emphasis"); + dev->opt[OPT_IMAGE_EMPHASIS].type = SANE_TYPE_STRING; + dev->opt[OPT_IMAGE_EMPHASIS].size = + max_string_size (go_image_emphasis_list); + dev->opt[OPT_IMAGE_EMPHASIS].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_IMAGE_EMPHASIS].constraint.string_list = + go_image_emphasis_list; + dev->val[OPT_IMAGE_EMPHASIS].s = strdup (SANE_I18N ("medium")); + + /* Gamma */ + dev->opt[OPT_GAMMA].name = "gamma"; + dev->opt[OPT_GAMMA].title = SANE_I18N ("Gamma"); + dev->opt[OPT_GAMMA].desc = SANE_I18N ("Gamma"); + dev->opt[OPT_GAMMA].type = SANE_TYPE_STRING; + dev->opt[OPT_GAMMA].size = max_string_size (go_gamma_list); + dev->opt[OPT_GAMMA].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_GAMMA].constraint.string_list = go_gamma_list; + dev->val[OPT_GAMMA].s = strdup (go_gamma_list[0]); + + /* Lamp color dropout */ + dev->opt[OPT_LAMP].name = "lamp-color"; + dev->opt[OPT_LAMP].title = SANE_I18N ("Lamp color"); + dev->opt[OPT_LAMP].desc = SANE_I18N ("Sets the lamp color (color dropout)"); + dev->opt[OPT_LAMP].type = SANE_TYPE_STRING; + dev->opt[OPT_LAMP].size = max_string_size (go_lamp_list); + dev->opt[OPT_LAMP].constraint_type = SANE_CONSTRAINT_STRING_LIST; + dev->opt[OPT_LAMP].constraint.string_list = go_lamp_list; + dev->val[OPT_LAMP].s = strdup (go_lamp_list[0]); + if (!dev->support_info.support_lamp) + dev->opt[OPT_LAMP].cap |= SANE_CAP_INACTIVE; + + /* Inverse image */ + dev->opt[OPT_INVERSE].name = SANE_NAME_INVERSE; + dev->opt[OPT_INVERSE].title = SANE_TITLE_INVERSE; + dev->opt[OPT_INVERSE].desc = + SANE_I18N ("Inverse image in B/W or halftone mode"); + dev->opt[OPT_INVERSE].type = SANE_TYPE_BOOL; + dev->opt[OPT_INVERSE].unit = SANE_UNIT_NONE; + dev->val[OPT_INVERSE].w = SANE_FALSE; + + /* Mirror image (left/right flip) */ + dev->opt[OPT_MIRROR].name = SANE_NAME_MIRROR; + dev->opt[OPT_MIRROR].title = SANE_TITLE_MIRROR; + dev->opt[OPT_MIRROR].desc = SANE_I18N ("Mirror image (left/right flip)"); + dev->opt[OPT_MIRROR].type = SANE_TYPE_BOOL; + dev->opt[OPT_MIRROR].unit = SANE_UNIT_NONE; + dev->val[OPT_MIRROR].w = SANE_FALSE; + + /* JPEG Image Compression */ + dev->opt[OPT_JPEG].name = "jpeg"; + dev->opt[OPT_JPEG].title = SANE_I18N ("jpeg compression"); + dev->opt[OPT_JPEG].desc = + SANE_I18N + ("JPEG Image Compression with Q parameter, '0' - no compression"); + dev->opt[OPT_JPEG].type = SANE_TYPE_INT; + dev->opt[OPT_JPEG].unit = SANE_UNIT_NONE; + dev->opt[OPT_JPEG].size = sizeof (SANE_Int); + dev->opt[OPT_JPEG].constraint_type = SANE_CONSTRAINT_RANGE; + dev->opt[OPT_JPEG].constraint.range = &(go_jpeg_compression_range); + dev->val[OPT_JPEG].w = 0; + + /* Lastly, set the default scan mode. This might change some + * values previously set here. */ + sane_control_option (dev, OPT_PAPER_SIZE, SANE_ACTION_SET_VALUE, + (void *) go_paper_list[default_paper_size_idx], NULL); + sane_control_option (dev, OPT_MODE, SANE_ACTION_SET_VALUE, + (void *) go_scan_mode_list[0], NULL); + + DBG (DBG_proc, "kv_init_options: exit\n"); + + dev->option_set = 1; +} + + +SANE_Status +kv_control_option (PKV_DEV dev, SANE_Int option, + SANE_Action action, void *val, SANE_Int * info) +{ + SANE_Status status; + SANE_Word cap; + SANE_String_Const name; + int i; + SANE_Word value; + + DBG (DBG_proc, "sane_control_option: enter, option %s, action %s\n", + go_option_name[option], action == SANE_ACTION_GET_VALUE ? "R" : "W"); + + if (info) + { + *info = 0; + } + + if (dev->scanning) + { + return SANE_STATUS_DEVICE_BUSY; + } + + if (option < 0 || option >= OPT_NUM_OPTIONS) + { + return SANE_STATUS_UNSUPPORTED; + } + + cap = dev->opt[option].cap; + if (!SANE_OPTION_IS_ACTIVE (cap)) + { + return SANE_STATUS_UNSUPPORTED; + } + + name = dev->opt[option].name; + if (!name) + { + name = "(no name)"; + } + if (action == SANE_ACTION_GET_VALUE) + { + switch (option) + { + /* word options */ + case OPT_NUM_OPTS: + case OPT_LONGPAPER: + case OPT_LENGTHCTL: + case OPT_DBLFEED: + case OPT_RESOLUTION: + case OPT_TL_Y: + case OPT_BR_Y: + case OPT_TL_X: + case OPT_BR_X: + case OPT_BRIGHTNESS: + case OPT_CONTRAST: + case OPT_DUPLEX: + case OPT_LANDSCAPE: + case OPT_AUTOMATIC_SEPARATION: + case OPT_INVERSE: + case OPT_MIRROR: + case OPT_FEED_TIMEOUT: + case OPT_JPEG: + case OPT_FIT_TO_PAGE: + *(SANE_Word *) val = dev->val[option].w; + DBG (DBG_error, "opt value = %d\n", *(SANE_Word *) val); + return SANE_STATUS_GOOD; + + /* string options */ + case OPT_MODE: + case OPT_FEEDER_MODE: + case OPT_SCAN_SOURCE: + case OPT_MANUALFEED: + case OPT_HALFTONE_PATTERN: + case OPT_PAPER_SIZE: + case OPT_AUTOMATIC_THRESHOLD: + case OPT_WHITE_LEVEL: + case OPT_NOISE_REDUCTION: + case OPT_IMAGE_EMPHASIS: + case OPT_GAMMA: + case OPT_LAMP: + + strcpy (val, dev->val[option].s); + DBG (DBG_error, "opt value = %s\n", (char *) val); + return SANE_STATUS_GOOD; + + default: + return SANE_STATUS_UNSUPPORTED; + } + } + else if (action == SANE_ACTION_SET_VALUE) + { + if (!SANE_OPTION_IS_SETTABLE (cap)) + { + DBG (DBG_error, + "could not set option %s, not settable\n", + go_option_name[option]); + return SANE_STATUS_INVAL; + } + + status = sanei_constrain_value (dev->opt + option, val, info); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "could not set option, invalid value\n"); + return status; + } + + switch (option) + { + /* Side-effect options */ + case OPT_TL_Y: + case OPT_BR_Y: + case OPT_RESOLUTION: + if (info) + { + *info |= SANE_INFO_RELOAD_PARAMS; + } + + dev->val[option].w = *(SANE_Word *) val; + + if (option == OPT_RESOLUTION) + { + if (round_to_boundry (&(dev->val[option].w), + dev->support_info. + step_resolution, 100, 600)) + { + if (info) + { + *info |= SANE_INFO_INEXACT; + } + } + } + else if (option == OPT_TL_Y) + { + if (dev->val[option].w > dev->val[OPT_BR_Y].w) + { + dev->val[option].w = dev->val[OPT_BR_Y].w; + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; + } + } + } + else + { + if (dev->val[option].w < dev->val[OPT_TL_Y].w) + { + dev->val[option].w = dev->val[OPT_TL_Y].w; + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; + } + } + } + + DBG (DBG_error, + "option %s, input = %d, value = %d\n", + go_option_name[option], (*(SANE_Word *) val), + dev->val[option].w); + + return SANE_STATUS_GOOD; + + /* The length of X must be rounded (up). */ + case OPT_TL_X: + case OPT_BR_X: + { + SANE_Word xr = dev->val[OPT_RESOLUTION].w; + SANE_Word tl_x = mmToIlu (SANE_UNFIX (dev->val[OPT_TL_X].w)) * xr; + SANE_Word br_x = mmToIlu (SANE_UNFIX (dev->val[OPT_BR_X].w)) * xr; + value = mmToIlu (SANE_UNFIX (*(SANE_Word *) val)) * xr; /* XR * W */ + + if (option == OPT_TL_X) + { + SANE_Word max = KV_PIXEL_MAX * xr - KV_PIXEL_ROUND; + if (br_x < max) + max = br_x; + if (round_to_boundry (&value, KV_PIXEL_ROUND, 0, max)) + { + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; + } + } + } + else + { + if (round_to_boundry + (&value, KV_PIXEL_ROUND, tl_x, KV_PIXEL_MAX * xr)) + { + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; + } + } + } + + dev->val[option].w = SANE_FIX (iluToMm ((double) value / xr)); + + if (info) + { + *info |= SANE_INFO_RELOAD_PARAMS; + } + + DBG (DBG_error, + "option %s, input = %d, value = %d\n", + go_option_name[option], (*(SANE_Word *) val), + dev->val[option].w); + return SANE_STATUS_GOOD; + } + case OPT_LANDSCAPE: + dev->val[option].w = *(SANE_Word *) val; + if (info) + { + *info |= SANE_INFO_RELOAD_PARAMS; + } + return SANE_STATUS_GOOD; + + /* Side-effect free options */ + case OPT_CONTRAST: + case OPT_BRIGHTNESS: + case OPT_DUPLEX: + case OPT_LONGPAPER: + case OPT_LENGTHCTL: + case OPT_DBLFEED: + case OPT_INVERSE: + case OPT_MIRROR: + case OPT_AUTOMATIC_SEPARATION: + case OPT_JPEG: + case OPT_FIT_TO_PAGE: + dev->val[option].w = *(SANE_Word *) val; + return SANE_STATUS_GOOD; + + case OPT_FEED_TIMEOUT: + dev->val[option].w = *(SANE_Word *) val; + return CMD_set_timeout (dev, *(SANE_Word *) val); + + /* String mode */ + case OPT_SCAN_SOURCE: + case OPT_WHITE_LEVEL: + case OPT_NOISE_REDUCTION: + case OPT_IMAGE_EMPHASIS: + case OPT_GAMMA: + case OPT_LAMP: + case OPT_HALFTONE_PATTERN: + case OPT_FEEDER_MODE: + if (strcmp (dev->val[option].s, val) == 0) + return SANE_STATUS_GOOD; + free (dev->val[option].s); + dev->val[option].s = (SANE_String) strdup (val); + + if (option == OPT_FEEDER_MODE && + get_string_list_index (go_feeder_mode_list, + dev->val[option].s) == 1) + /* continuous mode */ + { + free (dev->val[OPT_SCAN_SOURCE].s); + dev->val[OPT_SCAN_SOURCE].s = strdup (go_scan_source_list[0]); + dev->opt[OPT_LONGPAPER].cap &= ~SANE_CAP_INACTIVE; + if (info) + *info |= SANE_INFO_RELOAD_OPTIONS; + } + else + { + dev->opt[OPT_LONGPAPER].cap |= SANE_CAP_INACTIVE; + if (info) + *info |= SANE_INFO_RELOAD_OPTIONS; + } + + if (option == OPT_SCAN_SOURCE && + get_string_list_index (go_scan_source_list, + dev->val[option].s) == 1) + /* flatbed */ + { + free (dev->val[OPT_FEEDER_MODE].s); + dev->val[OPT_FEEDER_MODE].s = strdup (go_feeder_mode_list[0]); + } + + return SANE_STATUS_GOOD; + + case OPT_MODE: + if (strcmp (dev->val[option].s, val) == 0) + return SANE_STATUS_GOOD; + free (dev->val[OPT_MODE].s); + dev->val[OPT_MODE].s = (SANE_String) strdup (val); + + /* Set default options for the scan modes. */ + dev->opt[OPT_HALFTONE_PATTERN].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_AUTOMATIC_THRESHOLD].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_AUTOMATIC_SEPARATION].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_GAMMA].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_INVERSE].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_JPEG].cap &= ~SANE_CAP_INACTIVE; + + if (strcmp (dev->val[OPT_MODE].s, go_scan_mode_list[0]) == 0) + /* binary */ + { + dev->opt[OPT_AUTOMATIC_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_INVERSE].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_JPEG].cap |= SANE_CAP_INACTIVE; + } + else if (strcmp (dev->val[OPT_MODE].s, go_scan_mode_list[1]) == 0) + /* halftone */ + { + dev->opt[OPT_HALFTONE_PATTERN].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_AUTOMATIC_SEPARATION].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_GAMMA].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_INVERSE].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_JPEG].cap |= SANE_CAP_INACTIVE; + } + else if (strcmp (dev->val[OPT_MODE].s, go_scan_mode_list[2]) == 0) + /* grayscale */ + { + dev->opt[OPT_GAMMA].cap &= ~SANE_CAP_INACTIVE; + } + + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; + } + + return SANE_STATUS_GOOD; + + case OPT_MANUALFEED: + if (strcmp (dev->val[option].s, val) == 0) + return SANE_STATUS_GOOD; + free (dev->val[option].s); + dev->val[option].s = (SANE_String) strdup (val); + + if (strcmp (dev->val[option].s, go_manual_feed_list[0]) == 0) /* off */ + dev->opt[OPT_FEED_TIMEOUT].cap |= SANE_CAP_INACTIVE; + else + dev->opt[OPT_FEED_TIMEOUT].cap &= ~SANE_CAP_INACTIVE; + if (info) + *info |= SANE_INFO_RELOAD_OPTIONS; + + return SANE_STATUS_GOOD; + + case OPT_PAPER_SIZE: + if (strcmp (dev->val[option].s, val) == 0) + return SANE_STATUS_GOOD; + + free (dev->val[OPT_PAPER_SIZE].s); + dev->val[OPT_PAPER_SIZE].s = (SANE_Char *) strdup (val); + + i = get_string_list_index (go_paper_list, + dev->val[OPT_PAPER_SIZE].s); + if (i == 0) + { /*user def */ + dev->opt[OPT_TL_X].cap &= + dev->opt[OPT_TL_Y].cap &= + dev->opt[OPT_BR_X].cap &= + dev->opt[OPT_BR_Y].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_LANDSCAPE].cap |= SANE_CAP_INACTIVE; + dev->val[OPT_LANDSCAPE].w = 0; + } + else + { + dev->opt[OPT_TL_X].cap |= + dev->opt[OPT_TL_Y].cap |= + dev->opt[OPT_BR_X].cap |= + dev->opt[OPT_BR_Y].cap |= SANE_CAP_INACTIVE; + if (i == 4 || i == 5 || i == 7) + { /*A5, A6 or B6 */ + dev->opt[OPT_LANDSCAPE].cap &= ~SANE_CAP_INACTIVE; + } + else + { + dev->opt[OPT_LANDSCAPE].cap |= SANE_CAP_INACTIVE; + dev->val[OPT_LANDSCAPE].w = 0; + } + } + + if (info) + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; + + return SANE_STATUS_GOOD; + + + case OPT_AUTOMATIC_THRESHOLD: + if (strcmp (dev->val[option].s, val) == 0) + return SANE_STATUS_GOOD; + + free (dev->val[option].s); + dev->val[option].s = (SANE_Char *) strdup (val); + + /* If the threshold is not set to none, some option must + * disappear. */ + + dev->opt[OPT_WHITE_LEVEL].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_NOISE_REDUCTION].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_IMAGE_EMPHASIS].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_AUTOMATIC_SEPARATION].cap |= SANE_CAP_INACTIVE; + dev->opt[OPT_HALFTONE_PATTERN].cap |= SANE_CAP_INACTIVE; + + if (strcmp (val, go_automatic_threshold_list[0]) == 0) + { + dev->opt[OPT_WHITE_LEVEL].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_NOISE_REDUCTION].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_IMAGE_EMPHASIS].cap &= ~SANE_CAP_INACTIVE; + dev->opt[OPT_AUTOMATIC_SEPARATION].cap &= ~SANE_CAP_INACTIVE; + if (strcmp (dev->val[OPT_MODE].s, go_scan_mode_list[1]) == 0) + { + dev->opt[OPT_HALFTONE_PATTERN].cap &= ~SANE_CAP_INACTIVE; + } + } + + if (info) + { + *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; + } + return SANE_STATUS_GOOD; + + default: + return SANE_STATUS_INVAL; + } + } + + DBG (DBG_proc, "sane_control_option: exit, bad\n"); + + return SANE_STATUS_UNSUPPORTED; +} + +/* Display a buffer in the log. */ +void +hexdump (int level, const char *comment, unsigned char *p, int l) +{ + int i; + char line[128]; + char *ptr; + + DBG (level, "%s\n", comment); + ptr = line; + for (i = 0; i < l; i++, p++) + { + if ((i % 16) == 0) + { + if (ptr != line) + { + *ptr = '\0'; + DBG (level, "%s\n", line); + ptr = line; + } + sprintf (ptr, "%3.3d:", i); + ptr += 4; + } + sprintf (ptr, " %2.2x", *p); + ptr += 3; + } + *ptr = '\0'; + DBG (level, "%s\n", line); +} + +/* Set window data */ +void +kv_set_window_data (PKV_DEV dev, + KV_SCAN_MODE scan_mode, + int side, unsigned char *windowdata) +{ + int paper = go_paper_val[get_string_list_index (go_paper_list, + dev->val[OPT_PAPER_SIZE]. + s)]; + + /* Page side */ + windowdata[0] = side; + + /* X and Y resolution */ + Ito16 (dev->val[OPT_RESOLUTION].w, &windowdata[2]); + Ito16 (dev->val[OPT_RESOLUTION].w, &windowdata[4]); + + /* Width and length */ + if (paper == 0) + { /* Non-standard document */ + int x_tl = mmToIlu (SANE_UNFIX (dev->val[OPT_TL_X].w)); + int y_tl = mmToIlu (SANE_UNFIX (dev->val[OPT_TL_Y].w)); + int x_br = mmToIlu (SANE_UNFIX (dev->val[OPT_BR_X].w)); + int y_br = mmToIlu (SANE_UNFIX (dev->val[OPT_BR_Y].w)); + int width = x_br - x_tl; + int length = y_br - y_tl; + /* Upper Left (X,Y) */ + Ito32 (x_tl, &windowdata[6]); + Ito32 (y_tl, &windowdata[10]); + + Ito32 (width, &windowdata[14]); + Ito32 (length, &windowdata[18]); + Ito32 (width, &windowdata[48]); /* device specific */ + Ito32 (length, &windowdata[52]); /* device specific */ + } + + /* Brightness */ + windowdata[22] = 255 - GET_OPT_VAL_W (dev, OPT_BRIGHTNESS); + windowdata[23] = windowdata[22]; /* threshold, same as brightness. */ + + /* Contrast */ + windowdata[24] = GET_OPT_VAL_W (dev, OPT_CONTRAST); + + /* Image Composition */ + windowdata[25] = (unsigned char) scan_mode; + + /* Depth */ + windowdata[26] = kv_get_depth (scan_mode); + + /* Halftone pattern. */ + if (scan_mode == SM_DITHER) + { + windowdata[28] = GET_OPT_VAL_L (dev, OPT_HALFTONE_PATTERN, + halftone_pattern); + } + + /* Inverse */ + if (scan_mode == SM_BINARY || scan_mode == SM_DITHER) + { + windowdata[29] = GET_OPT_VAL_W (dev, OPT_INVERSE); + } + + /* Bit ordering */ + windowdata[31] = 1; + + /*Compression Type */ + if (!(dev->opt[OPT_JPEG].cap & SANE_CAP_INACTIVE) + && GET_OPT_VAL_W (dev, OPT_JPEG)) + { + windowdata[32] = 0x81; /*jpeg */ + /*Compression Argument */ + windowdata[33] = GET_OPT_VAL_W (dev, OPT_JPEG); + } + + /* Gamma */ + if (scan_mode == SM_DITHER || scan_mode == SM_GRAYSCALE) + { + windowdata[44] = GET_OPT_VAL_L (dev, OPT_GAMMA, gamma); + } + + /* Feeder mode */ + windowdata[57] = GET_OPT_VAL_L (dev, OPT_FEEDER_MODE, feeder_mode); + + /* Stop skew -- disabled */ + windowdata[41] = 0; + + /* Scan source */ + if (GET_OPT_VAL_L (dev, OPT_SCAN_SOURCE, scan_source)) + { /* flatbed */ + windowdata[41] |= 0x80; + } + else + { + windowdata[41] &= 0x7f; + } + + /* Paper size */ + windowdata[47] = paper; + + if (paper) /* Standard Document */ + windowdata[47] |= 1 << 7; + + /* Long paper */ + if (GET_OPT_VAL_W (dev, OPT_LONGPAPER)) + { + windowdata[47] |= 0x20; + } + + /* Length control */ + if (GET_OPT_VAL_W (dev, OPT_LENGTHCTL)) + { + windowdata[47] |= 0x40; + } + + /* Landscape */ + if (GET_OPT_VAL_W (dev, OPT_LANDSCAPE)) + { + windowdata[47] |= 1 << 4; + } + /* Double feed */ + if (GET_OPT_VAL_W (dev, OPT_DBLFEED)) + { + windowdata[56] = 0x10; + } + + /* Fit to page */ + if (GET_OPT_VAL_W (dev, OPT_FIT_TO_PAGE)) + { + windowdata[56] |= 1 << 2; + } + + /* Manual feed */ + windowdata[62] = GET_OPT_VAL_L (dev, OPT_MANUALFEED, manual_feed) << 6; + + /* Mirror image */ + if (GET_OPT_VAL_W (dev, OPT_MIRROR)) + { + windowdata[42] = 0x80; + } + + /* Image emphasis */ + windowdata[43] = GET_OPT_VAL_L (dev, OPT_IMAGE_EMPHASIS, image_emphasis); + + /* White level */ + windowdata[60] = GET_OPT_VAL_L (dev, OPT_WHITE_LEVEL, white_level); + + if (scan_mode == SM_BINARY || scan_mode == SM_DITHER) + { + /* Noise reduction */ + windowdata[61] = GET_OPT_VAL_L (dev, OPT_NOISE_REDUCTION, + noise_reduction); + + /* Automatic separation */ + if (scan_mode == SM_DITHER && GET_OPT_VAL_W (dev, + OPT_AUTOMATIC_SEPARATION)) + { + windowdata[59] = 0x80; + } + } + + /* Automatic threshold. Must be last because it may override + * some previous options. */ + if (scan_mode == SM_BINARY) + { + windowdata[58] = + GET_OPT_VAL_L (dev, OPT_AUTOMATIC_THRESHOLD, automatic_threshold); + } + + if (windowdata[58] != 0) + { + /* Automatic threshold is enabled. */ + windowdata[22] = 0; /* brightness. */ + windowdata[23] = 0; /* threshold, same as brightness. */ + windowdata[24] = 0; /* contrast */ + windowdata[27] = windowdata[28] = 0; /* Halftone pattern. */ + windowdata[43] = 0; /* Image emphasis */ + windowdata[59] = 0; /* Automatic separation */ + windowdata[60] = 0; /* White level */ + windowdata[61] = 0; /* Noise reduction */ + } + + /* lamp -- color dropout */ + windowdata[45] = GET_OPT_VAL_L (dev, OPT_LAMP, lamp) << 4; + + /*Stop Mode: After 1 page */ + windowdata[63] = 1; +} diff -Nru sane-backends-1.0.20/backend/kvs1025_usb.c sane-backends-1.0.21/backend/kvs1025_usb.c --- sane-backends-1.0.20/backend/kvs1025_usb.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_usb.c 2010-04-26 10:52:48.000000000 +1000 @@ -0,0 +1,367 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#define DEBUG_DECLARE_ONLY + +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_backend.h" +#include "../include/sane/sanei_config.h" +#include "../include/lassert.h" + +#include "kvs1025.h" +#include "kvs1025_low.h" +#include "kvs1025_usb.h" +#include "kvs1025_cmds.h" + +#include "../include/sane/sanei_debug.h" + +extern PKV_DEV g_devices; /* Chain of devices */ +extern const SANE_Device **g_devlist; + +/* static functions */ + +/* Attach USB scanner */ +static SANE_Status +attach_scanner_usb (const char *device_name) +{ + PKV_DEV dev; + SANE_Word vendor, product; + + DBG (DBG_error, "attaching USB scanner %s\n", device_name); + + sanei_usb_get_vendor_product_byname(device_name,&vendor,&product); + + dev = (PKV_DEV) malloc (sizeof (KV_DEV)); + + if (dev == NULL) + return SANE_STATUS_NO_MEM; + + memset (dev, 0, sizeof (KV_DEV)); + + dev->bus_mode = KV_USB_BUS; + dev->usb_fd = -1; + dev->scsi_fd = -1; + strcpy (dev->device_name, device_name); + + dev->buffer0 = (unsigned char *) malloc (SCSI_BUFFER_SIZE + 12); + dev->buffer = dev->buffer0 + 12; + + if (dev->buffer0 == NULL) + { + free (dev); + return SANE_STATUS_NO_MEM; + } + + dev->scsi_type = 6; + strcpy (dev->scsi_type_str, "ADF Scanner"); + strcpy (dev->scsi_vendor, "Panasonic"); + strcpy (dev->scsi_product, + product == (int) KV_S1025C ? "KV-S1025C" : "KV-S1020C"); + strcpy (dev->scsi_version, "1.00"); + + /* Set SANE_Device */ + dev->sane.name = dev->device_name; + dev->sane.vendor = dev->scsi_vendor; + dev->sane.model = dev->scsi_product; + dev->sane.type = dev->scsi_type_str; + + /* Add into g_devices chain */ + dev->next = g_devices; + g_devices = dev; + + return SANE_STATUS_GOOD; +} + +/* Get all supported scanners, and store into g_devlist */ +SANE_Status +kv_usb_enum_devices () +{ + int cnt = 0; + int i; + PKV_DEV pd; + char usb_str[18]; + + DBG (DBG_proc, "kv_usb_enum_devices: enter\n"); + + sanei_usb_init(); + + sprintf(usb_str,"usb %#04x %#04x",VENDOR_ID,KV_S1020C); + sanei_usb_attach_matching_devices(usb_str, attach_scanner_usb); + + sprintf(usb_str,"usb %#04x %#04x",VENDOR_ID,KV_S1025C); + sanei_usb_attach_matching_devices(usb_str, attach_scanner_usb); + + sprintf(usb_str,"usb %#04x %#04x",VENDOR_ID,KV_S1045C); + sanei_usb_attach_matching_devices(usb_str, attach_scanner_usb); + + for (pd = g_devices; pd; pd=pd->next) { + cnt++; + } + + g_devlist = + (const SANE_Device **) malloc (sizeof (SANE_Device *) * (cnt + 1)); + if (g_devlist == NULL) + { + DBG (DBG_proc, + "kv_usb_enum_devices: leave on error " " --out of memory\n"); + return SANE_STATUS_NO_MEM; + } + + pd = g_devices; + for (i = 0; i < cnt; i++) + { + g_devlist[i] = (const SANE_Device *) &pd->sane; + pd = pd->next; + } + g_devlist[cnt] = 0; + + DBG (DBG_proc, "kv_usb_enum_devices: leave with %d devices.\n", cnt); + + return SANE_STATUS_GOOD; +} + +/* Check if device is already open */ +SANE_Bool +kv_usb_already_open (PKV_DEV dev) +{ + return (dev->usb_fd > -1); +} + +/* Open an USB device */ +SANE_Status +kv_usb_open (PKV_DEV dev) +{ + SANE_Status ret; + + DBG (DBG_proc, "kv_usb_open: enter\n"); + if (kv_usb_already_open(dev)) + { + DBG (DBG_proc, "kv_usb_open: leave -- already open\n"); + return SANE_STATUS_GOOD; + } + + ret = sanei_usb_open (dev->device_name, &(dev->usb_fd)); + if (ret) + { + DBG (DBG_error, "kv_usb_open: leave -- cannot open device\n"); + return SANE_STATUS_IO_ERROR; + } + + sanei_usb_clear_halt (dev->usb_fd); + + DBG (DBG_proc, "kv_usb_open: leave\n"); + return SANE_STATUS_GOOD; +} + +/* Close an USB device */ +void +kv_usb_close (PKV_DEV dev) +{ + DBG (DBG_proc, "kv_usb_close: enter\n"); + if (kv_usb_already_open(dev)) + { + sanei_usb_close(dev->usb_fd); + dev->usb_fd = -1; + } + DBG (DBG_proc, "kv_usb_close: leave\n"); +} + +/* Clean up the USB bus and release all resources allocated to devices */ +void +kv_usb_cleanup () +{ +} + +/* Send command via USB, and get response data */ +SANE_Status +kv_usb_escape (PKV_DEV dev, + PKV_CMD_HEADER header, unsigned char *status_byte) +{ + int got_response = 0; + size_t len; + unsigned char cmd_buff[24]; + memset (cmd_buff, 0, 24); + cmd_buff[3] = 0x18; /* container length */ + cmd_buff[5] = 1; /* container type: command block */ + cmd_buff[6] = 0x90; /* code */ + + if (!kv_usb_already_open(dev)) + { + DBG (DBG_error, "kv_usb_escape: error, device not open.\n"); + return SANE_STATUS_IO_ERROR; + } + memcpy (cmd_buff + 12, header->cdb, header->cdb_size); + + /* change timeout */ + sanei_usb_set_timeout(KV_CMD_TIMEOUT); + + /* Send command */ + len = 24; + if (sanei_usb_write_bulk (dev->usb_fd, (SANE_Byte *) cmd_buff, &len)) + { + DBG (DBG_error, "usb_bulk_write: Error writing command.\n"); + hexdump (DBG_error, "cmd block", cmd_buff, 24); + return SANE_STATUS_IO_ERROR; + } + + /* Send / Read data */ + if (header->direction == KV_CMD_IN) + { + size_t size = header->data_size + 12; + size_t size_read = size; + unsigned char *data = ((unsigned char *) header->data) - 12; + SANE_Status ret; + + ret = sanei_usb_read_bulk (dev->usb_fd, (SANE_Byte *) data, &size_read); + + /*empty read is ok?*/ + if (ret == SANE_STATUS_EOF){ + sanei_usb_clear_halt (dev->usb_fd); + ret = SANE_STATUS_GOOD; + } + + if (ret) { + sanei_usb_clear_halt (dev->usb_fd); + DBG (DBG_error, "usb_bulk_read: Error reading data.\n"); + return SANE_STATUS_IO_ERROR; + } + + if (size_read != size) + { + DBG (DBG_shortread, "usb_bulk_read: Warning - short read\n"); + DBG (DBG_shortread, "usb_bulk_read: bytes to read = %d\n", size); + DBG (DBG_shortread, + "usb_bulk_read: bytes actual read = %d\n", size_read); + /*hexdump (DBG_shortread, "data", data, size_read); */ + } + } + + if (header->direction == KV_CMD_OUT) + { + size_t size = header->data_size + 12; + size_t size_written = size; + unsigned char *data = ((unsigned char *) header->data) - 12; + SANE_Status ret; + + memset (data, 0, 12); + Ito32 (size, data); + data[5] = 0x02; /* container type: data block */ + data[6] = 0xb0; /* code */ + + ret = sanei_usb_write_bulk (dev->usb_fd, (SANE_Byte *) data, &size_written); + + /*empty write is ok?*/ + if (ret == SANE_STATUS_EOF){ + sanei_usb_clear_halt (dev->usb_fd); + ret = SANE_STATUS_GOOD; + } + + if (ret) { + sanei_usb_clear_halt (dev->usb_fd); + DBG (DBG_error, "usb_bulk_write: Error writing data.\n"); + return SANE_STATUS_IO_ERROR; + } + + if (size_written != size) + { + DBG (DBG_shortread, "usb_bulk_write: Warning - short written\n"); + DBG (DBG_shortread, "usb_bulk_write: bytes to write = %d\n", size); + DBG (DBG_shortread, + "usb_bulk_write: bytes actual written = %d\n", size_written); + hexdump (DBG_shortread, "data", data, size_written); + } + } + + /* Get response */ + if (!got_response) + { + SANE_Status ret; + size_t len = 16; + + ret = sanei_usb_read_bulk (dev->usb_fd, (SANE_Byte *) cmd_buff, &len); + + if (ret || len != 16) + { + DBG (DBG_error, "usb_bulk_read: Error reading response." + " read %d bytes\n", len); + sanei_usb_clear_halt (dev->usb_fd); + return SANE_STATUS_IO_ERROR; + } + } + + if (cmd_buff[5] != 3) + { + DBG (DBG_error, "usb_bulk_read: Invalid response block.\n"); + hexdump (DBG_error, "response", cmd_buff, 16); + return SANE_STATUS_IO_ERROR; + } + + *status_byte = cmd_buff[15] & 0x3E; + + return SANE_STATUS_GOOD; +} + +/* Send command via USB, and request sense on CHECK CONDITION status */ +SANE_Status +kv_usb_send_command (PKV_DEV dev, + PKV_CMD_HEADER header, PKV_CMD_RESPONSE response) +{ + unsigned char status = 0; + SANE_Status s; + memset (response, 0, sizeof (KV_CMD_RESPONSE)); + response->status = KV_FAILED; + + s = kv_usb_escape (dev, header, &status); + + if (s) + { + status = 0x02; + } + + if (status == 0x02) + { /* check condition */ + /* request sense */ + KV_CMD_HEADER hdr; + memset (&hdr, 0, sizeof (hdr)); + hdr.direction = KV_CMD_IN; + hdr.cdb[0] = SCSI_REQUEST_SENSE; + hdr.cdb[4] = 0x12; + hdr.cdb_size = 6; + hdr.data_size = 0x12; + hdr.data = &response->sense; + + if (kv_usb_escape (dev, &hdr, &status) != 0) + return SANE_STATUS_IO_ERROR; + + hexdump (DBG_error, "sense data", (unsigned char *) &response->sense, + 0x12); + + response->status = KV_CHK_CONDITION; + } + else + { + response->status = KV_SUCCESS; + } + return SANE_STATUS_GOOD; +} diff -Nru sane-backends-1.0.20/backend/kvs1025_usb.h sane-backends-1.0.21/backend/kvs1025_usb.h --- sane-backends-1.0.20/backend/kvs1025_usb.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/kvs1025_usb.h 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,23 @@ +/* + Copyright (C) 2008, Panasonic Russia Ltd. +*/ +/* sane - Scanner Access Now Easy. + Panasonic KV-S1020C / KV-S1025C USB scanners. +*/ + +#ifndef __KVS1025_USB_H +#define __KVS1025_USB_H + +#include "kvs1025_cmds.h" + +SANE_Status kv_usb_enum_devices (void); +SANE_Status kv_usb_open (PKV_DEV dev); +SANE_Bool kv_usb_already_open (PKV_DEV dev); +void kv_usb_close (PKV_DEV dev); +void kv_usb_cleanup (void); + +SANE_Status kv_usb_send_command (PKV_DEV dev, + PKV_CMD_HEADER header, + PKV_CMD_RESPONSE response); + +#endif /* #ifndef __KVS1025_USB_H */ diff -Nru sane-backends-1.0.20/backend/leo.c sane-backends-1.0.21/backend/leo.c --- sane-backends-1.0.20/backend/leo.c 2008-11-27 08:21:26.000000000 +1100 +++ sane-backends-1.0.21/backend/leo.c 2009-06-09 13:03:36.000000000 +1000 @@ -42,7 +42,7 @@ */ /* - $Id: leo.c,v 1.13 2008-11-26 21:21:26 kitno-guest Exp $ + $Id$ Across FS-1130 */ diff -Nru sane-backends-1.0.20/backend/leo.h sane-backends-1.0.21/backend/leo.h --- sane-backends-1.0.20/backend/leo.h 2005-07-07 21:55:42.000000000 +1000 +++ sane-backends-1.0.21/backend/leo.h 2010-04-05 23:18:04.000000000 +1000 @@ -42,7 +42,7 @@ */ /* - $Id: leo.h,v 1.4 2005-07-07 11:55:42 fzago-guest Exp $ + $Id$ */ /* Commands supported by the scanner. */ @@ -201,7 +201,6 @@ /*--------------------------------------------------------------------------*/ -#define MM_PER_INCH 25.4 #define mmToIlu(mm) (((mm) * dev->x_resolution) / MM_PER_INCH) #define iluToMm(ilu) (((ilu) * MM_PER_INCH) / dev->x_resolution) @@ -257,9 +256,9 @@ /*--------------------------------------------------------------------------*/ -#define BLACK_WHITE_STR SANE_I18N("Black & White") -#define GRAY_STR SANE_I18N("Grayscale") -#define COLOR_STR SANE_I18N("Color") +#define BLACK_WHITE_STR SANE_VALUE_SCAN_MODE_LINEART +#define GRAY_STR SANE_VALUE_SCAN_MODE_GRAY +#define COLOR_STR SANE_VALUE_SCAN_MODE_COLOR /*--------------------------------------------------------------------------*/ diff -Nru sane-backends-1.0.20/backend/lexmark.c sane-backends-1.0.21/backend/lexmark.c --- sane-backends-1.0.20/backend/lexmark.c 2008-11-27 08:21:26.000000000 +1100 +++ sane-backends-1.0.21/backend/lexmark.c 2010-04-05 23:18:04.000000000 +1000 @@ -2,7 +2,7 @@ (C) 2003-2004 Lexmark International, Inc. (Original Source code) (C) 2005 Fred Odendaal - (C) 2006-2007 Stéphane Voltz + (C) 2006-2009 Stéphane Voltz This file is part of the SANE package. @@ -44,34 +44,10 @@ **************************************************************************/ -#include "../include/sane/config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "../include/sane/sane.h" -#include "../include/sane/sanei.h" -#include "../include/sane/saneopts.h" -#include "../include/sane/sanei_config.h" -#include "../include/sane/sanei_usb.h" - #include "lexmark.h" -#include "../include/sane/sanei_backend.h" - #define LEXMARK_CONFIG_FILE "lexmark.conf" -#define BUILD 19 +#define BUILD 21 #define MAX_OPTION_STRING_SIZE 255 static Lexmark_Device *first_lexmark_device = 0; @@ -189,9 +165,9 @@ break; case X1100_B2_SENSOR: od->constraint.word_list = x1100_dpi_list; - od->constraint.word_list = x1100_dpi_list; break; case X1200_SENSOR: + case X1200_USB2_SENSOR: od->constraint.word_list = x1200_dpi_list; break; } @@ -359,7 +335,7 @@ attachLexmark (SANE_String_Const devname) { Lexmark_Device *lexmark_device; - SANE_Int dn, vendor, product; + SANE_Int dn, vendor, product, variant; SANE_Status status; DBG (2, "attachLexmark: devname=%s\n", devname); @@ -393,8 +369,10 @@ status = SANE_STATUS_GOOD; /* put the id of the model you want to fake here */ vendor = 0x043d; - product = 0x007d; /* X12xx */ + product = 0x007c; /* X11xx */ + variant = 0xb2; #else + variant = 0; status = sanei_usb_get_vendor_product (dn, &vendor, &product); #endif if (status != SANE_STATUS_GOOD) @@ -411,13 +389,13 @@ sanei_usb_close (dn); #endif - DBG (2, "attachLexmark: testing device `%s': 0x%04x:0x%04x, no variant\n", - devname, vendor, product); + DBG (2, "attachLexmark: testing device `%s': 0x%04x:0x%04x, variant=%d\n", + devname, vendor, product, variant); if (sanei_lexmark_low_assign_model (lexmark_device, devname, vendor, product, - 0) != SANE_STATUS_GOOD) + variant) != SANE_STATUS_GOOD) { DBG (2, "attachLexmark: unsupported device `%s': 0x%04x:0x%04x\n", devname, vendor, product); @@ -466,7 +444,7 @@ DBG_INIT (); - DBG (1, "SANE Lexmark backend version %d.%d-rc2-%d\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD); + DBG (1, "SANE Lexmark backend version %d.%d.%d-devel\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD); auth_callback = authorize; @@ -1082,6 +1060,7 @@ Lexmark_Device *lexmark_device; SANE_Int offset; SANE_Status status; + int resolution; DBG (2, "sane_start: handle=%p\n", (void *) handle); @@ -1133,8 +1112,13 @@ sanei_lexmark_low_search_home_bwd (lexmark_device); } - /* do calibration before offset detection */ - sanei_lexmark_low_set_scan_regs (lexmark_device, 0, SANE_FALSE); + /* do calibration before offset detection , use sensor max dpi, not motor's one */ + resolution = lexmark_device->val[OPT_RESOLUTION].w; + if(resolution > 600) + { + resolution = 600; + } + sanei_lexmark_low_set_scan_regs (lexmark_device, resolution, 0, SANE_FALSE); status = sanei_lexmark_low_calibration (lexmark_device); if (status != SANE_STATUS_GOOD) { @@ -1154,7 +1138,7 @@ /* Set the shadow registers for scan with the options (resolution, mode, size) set in the front end. Pass the offset so we can get the vert. start. */ - sanei_lexmark_low_set_scan_regs (lexmark_device, offset, SANE_TRUE); + sanei_lexmark_low_set_scan_regs (lexmark_device, lexmark_device->val[OPT_RESOLUTION].w, offset, SANE_TRUE); if (sanei_lexmark_low_start_scan (lexmark_device) == SANE_STATUS_GOOD) { diff -Nru sane-backends-1.0.20/backend/lexmark.h sane-backends-1.0.21/backend/lexmark.h --- sane-backends-1.0.20/backend/lexmark.h 2007-10-01 14:27:24.000000000 +1000 +++ sane-backends-1.0.21/backend/lexmark.h 2010-04-05 23:18:04.000000000 +1000 @@ -2,7 +2,7 @@ lexmark.h - SANE library for Lexmark scanners. Copyright (C) 2003-2004 Lexmark International, Inc. (original source) Copyright (C) 2005 Fred Odendaal - Copyright (C) 2006-2007 Stéphane Voltz + Copyright (C) 2006-2009 Stéphane Voltz This file is part of the SANE package. @@ -45,6 +45,31 @@ #ifndef LEXMARK_H #define LEXMARK_H +#undef DEEP_DEBUG + +#include "../include/sane/config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/_stdint.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_usb.h" +#include "../include/sane/sanei_backend.h" + typedef enum { OPT_NUM_OPTS = 0, @@ -226,13 +251,14 @@ SANE_Bool sanei_lexmark_low_search_home_bwd (Lexmark_Device * dev); SANE_Int sanei_lexmark_low_find_start_line (Lexmark_Device * dev); SANE_Status sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, + SANE_Int resolution, SANE_Int offset, SANE_Bool calibrated); SANE_Status sanei_lexmark_low_start_scan (Lexmark_Device * dev); long sanei_lexmark_low_read_scan_data (SANE_Byte * data, SANE_Int size, Lexmark_Device * dev); SANE_Status sanei_lexmark_low_assign_model (Lexmark_Device * dev, - char *devname, SANE_Int vendor, + SANE_String_Const devname, SANE_Int vendor, SANE_Int product, SANE_Byte mainboard); diff -Nru sane-backends-1.0.20/backend/lexmark_low.c sane-backends-1.0.21/backend/lexmark_low.c --- sane-backends-1.0.20/backend/lexmark_low.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/lexmark_low.c 2010-04-05 23:18:04.000000000 +1000 @@ -1,7 +1,7 @@ /* lexmark-low.c: scanner-interface file for low Lexmark scanners. (C) 2005 Fred Odendaal - (C) 2006-2007 Stéphane Voltz + (C) 2006-2009 Stéphane Voltz This file is part of the SANE package. @@ -46,24 +46,7 @@ #undef BACKEND_NAME #define BACKEND_NAME lexmark_low -#include "../include/sane/config.h" - -#include -#include -#include -#include -#include - -#include "_stdint.h" - -#include "../include/sane/sane.h" -#include "../include/sane/sanei.h" -#include "../include/sane/saneopts.h" - -#include "../include/sane/sanei_usb.h" - #include "lexmark.h" -#include "../include/sane/sanei_backend.h" #include "lexmark_sensors.c" #include "lexmark_models.c" @@ -91,34 +74,33 @@ /* Static low function proto-types */ static SANE_Status low_usb_bulk_write (SANE_Int devnum, - SANE_Byte * cmd, size_t * size); + SANE_Byte * cmd, size_t * size); static SANE_Status low_usb_bulk_read (SANE_Int devnum, - SANE_Byte * buf, size_t * size); + SANE_Byte * buf, size_t * size); static SANE_Status low_write_all_regs (SANE_Int devnum, SANE_Byte * regs); static SANE_Bool low_is_home_line (unsigned char *buffer); static SANE_Status low_get_start_loc (SANE_Int resolution, - SANE_Int * vert_start, - SANE_Int * hor_start, - SANE_Int offset, - Lexmark_Device * dev); + SANE_Int * vert_start, + SANE_Int * hor_start, + SANE_Int offset, Lexmark_Device * dev); static void low_rewind (Lexmark_Device * dev, SANE_Byte * regs); static SANE_Status low_start_mvmt (SANE_Int devnum); static SANE_Status low_stop_mvmt (SANE_Int devnum); static SANE_Status low_clr_c6 (SANE_Int devnum); static SANE_Status low_simple_scan (Lexmark_Device * dev, - SANE_Byte * regs, - int xoffset, - int pixels, - int yoffset, - int lines, SANE_Byte ** data); + SANE_Byte * regs, + int xoffset, + int pixels, + int yoffset, + int lines, SANE_Byte ** data); static void low_set_scan_area (SANE_Int res, - SANE_Int tlx, - SANE_Int tly, - SANE_Int brx, - SANE_Int bry, - SANE_Int offset, - SANE_Bool half_step, - SANE_Byte * regs, Lexmark_Device * dev); + SANE_Int tlx, + SANE_Int tly, + SANE_Int brx, + SANE_Int bry, + SANE_Int offset, + SANE_Bool half_step, + SANE_Byte * regs, Lexmark_Device * dev); /* Static Read Buffer Proto-types */ static SANE_Status read_buffer_init (Lexmark_Device * dev, int bytesperline); @@ -436,19 +418,21 @@ * */ #ifdef DEEP_DEBUG -static void write_pnm_file(char *title, int pixels, int lines, int color, unsigned char *data) +static void +write_pnm_file (char *title, int pixels, int lines, int color, + unsigned char *data) { -FILE * fdbg; -int x,y; + FILE *fdbg; + int x, y; - fdbg = fopen (title, "wb"); - if (fdbg == NULL) - return; + fdbg = fopen (title, "wb"); + if (fdbg == NULL) + return; - if (color) - { + if (color) + { fprintf (fdbg, "P6\n%d %d\n255\n", pixels, lines); - for (y = 0; y < lines; y++) + for (y = 0; y < lines; y++) { for (x = 0; x < pixels; x += 2) { @@ -460,13 +444,13 @@ fputc (data[y * pixels * 3 + x + pixels * 2], fdbg); } } - } - else - { - fprintf (fdbg, "P5\n%d %d\n255\n", pixels, lines); - fwrite (data, pixels, lines, fdbg); - } - fclose (fdbg); + } + else + { + fprintf (fdbg, "P5\n%d %d\n255\n", pixels, lines); + fwrite (data, pixels, lines, fdbg); + } + fclose (fdbg); } #endif @@ -482,7 +466,7 @@ int i; SANE_Status status; - DBG_INIT(); + DBG_INIT (); status = SANE_STATUS_UNSUPPORTED; DBG (2, "low_init: start\n"); @@ -494,6 +478,9 @@ } /* set up per model constant values */ + dev->shadow_regs[0xf3] = 0xf8; + dev->shadow_regs[0xf4] = 0x7f; + switch (dev->model.sensor_type) { case X1100_B2_SENSOR: @@ -536,8 +523,6 @@ dev->shadow_regs[0xc9] = 0x3b; dev->shadow_regs[0xed] = 0xc2; dev->shadow_regs[0xee] = 0x02; - dev->shadow_regs[0xf3] = 0xf8; - dev->shadow_regs[0xf4] = 0x7f; status = SANE_STATUS_GOOD; break; case X1100_2C_SENSOR: @@ -621,8 +606,6 @@ dev->shadow_regs[0xca] = 0x0a; dev->shadow_regs[0xe2] = 0xf8; dev->shadow_regs[0xe3] = 0x2a; - dev->shadow_regs[0xf3] = 0xf8; - dev->shadow_regs[0xf4] = 0x7f; status = SANE_STATUS_GOOD; break; case X1200_USB2_SENSOR: @@ -669,8 +652,6 @@ dev->shadow_regs[0xca] = 0x0a; dev->shadow_regs[0xe2] = 0xf8; dev->shadow_regs[0xe3] = 0x2a; - dev->shadow_regs[0xf3] = 0xf8; - dev->shadow_regs[0xf4] = 0x7f; status = SANE_STATUS_GOOD; break; case A920_SENSOR: @@ -719,8 +700,6 @@ dev->shadow_regs[0xc2] = 0x80; dev->shadow_regs[0xc4] = 0x20; dev->shadow_regs[0xc8] = 0x04; - dev->shadow_regs[0xf3] = 0xf8; - dev->shadow_regs[0xf4] = 0x7f; status = SANE_STATUS_GOOD; break; case X1200_SENSOR: @@ -832,7 +811,7 @@ { DBG (5, "low_usb_bulk_write: returned %s (size = %lu, expected %lu)\n", - sane_strstatus (status), (u_long) *size, (u_long) cmd_size); + sane_strstatus (status), (u_long) * size, (u_long) cmd_size); /* F.O. should reset the pipe here... */ } return status; @@ -854,11 +833,11 @@ { DBG (5, "low_usb_bulk_read: returned %s (size = %lu, expected %lu)\n", - sane_strstatus (status), (u_long) *size, (u_long) exp_size); + sane_strstatus (status), (u_long) * size, (u_long) exp_size); /* F.O. should reset the pipe here... */ } DBG (7, "low_usb_bulk_read: returned size = %lu (required %lu)\n", - (u_long) *size, (u_long) exp_size); + (u_long) * size, (u_long) exp_size); return status; } @@ -899,8 +878,8 @@ /* Clear register 0xC6 */ /* cmd_size = 0x05; - return low_usb_bulk_write (devnum, clearC6_command_block, &cmd_size);*/ - + return low_usb_bulk_write (devnum, clearC6_command_block, &cmd_size); */ + reg = 0x00; status = rts88xx_write_reg (devnum, 0xc6, ®); return status; @@ -942,8 +921,8 @@ /* Stop scanner - clear reg 0xb3: */ /* status = low_stop_mvmt (devnum); - if (status != SANE_STATUS_GOOD) - return status; */ + if (status != SANE_STATUS_GOOD) + return status; */ /* then start */ status = rts88xx_commit (devnum, regs[0x2c]); @@ -1004,7 +983,7 @@ */ static SANE_Status low_simple_scan (Lexmark_Device * dev, SANE_Byte * regs, int xoffset, - int pixels, int yoffset, int lines, SANE_Byte ** data) + int pixels, int yoffset, int lines, SANE_Byte ** data) { SANE_Status status = SANE_STATUS_GOOD; static SANE_Byte reg; @@ -1128,11 +1107,10 @@ size_t size; SANE_Byte variant = 0; SANE_Byte shadow_regs[255]; -#ifdef DEEP_DEBUG - int i; -#endif int sx, ex; int sy, ey; + int i; + char msg[2048]; #ifdef FAKE_USB @@ -1151,20 +1129,18 @@ size = 4; low_usb_bulk_write (dev->devnum, command_block, &size); size = 0xFF; + memset (shadow_regs, 0, sizeof (shadow_regs)); low_usb_bulk_read (dev->devnum, shadow_regs, &size); -#ifdef DEEP_DEBUG + if (DBG_LEVEL > 2) { - fprintf (stderr, - "sanei_lexmark_low_open_device: initial registers values\n"); - fprintf (stderr, "read_all(0x00,255)="); + DBG (2, "sanei_lexmark_low_open_device: initial registers values\n"); for (i = 0; i < 255; i++) { - fprintf (stderr, "0x%02x ", shadow_regs[i]); + sprintf (msg+i*5, "0x%02x ", shadow_regs[i]); } - fprintf (stderr, "\n"); + DBG (3, "%s\n",msg); } -#endif /* it seems that at first read after reset, registers hold information * about the scanner. Register 0x00 is overwritten with 0, so only first read @@ -1194,16 +1170,16 @@ } /* if find a case where default model given is inappropriate, reassign it - * since we have now the informations to get the real one. Such + * since we have now the informations to get the real one. * We could avoid this if attach() did open and read registers, not init */ if (variant != 0) { DBG (3, - "sanei_lexmark_low_open_device: reassign model/sensor for varaint 0x%02x\n", + "sanei_lexmark_low_open_device: reassign model/sensor for variant 0x%02x\n", variant); sanei_lexmark_low_assign_model (dev, dev->sane.name, - dev->model.vendor_id, - dev->model.product_id, variant); + dev->model.vendor_id, + dev->model.product_id, variant); /* since model has changed, run init again */ sanei_lexmark_low_init (dev); } @@ -1332,6 +1308,7 @@ numero++; #endif + DBG (15, "low_is_home_line: start\n"); /* Find the max and the min */ for (i = 0; i < 2500; i++) { @@ -1357,7 +1334,9 @@ transition_counter = 0; /* Go through the check region - bytes 5 to 2495 */ - for (i = 5; i <= 2495; i++) + /* XXX STEF XXX shrink the area to where the dot should be + * +-100 around the 1250 expected location */ + for (i = 1150; i <= 1350; i++) { /* Check for transition to black */ if ((region == white) && (*(buffer + i) == 0)) @@ -1370,6 +1349,7 @@ } else { + DBG (15, "low_is_home_line: no transition to black \n"); return SANE_FALSE; } } @@ -1384,6 +1364,7 @@ } else { + DBG (15, "low_is_home_line: no transition to white \n"); return SANE_FALSE; } } @@ -1392,6 +1373,7 @@ /* Check that the number of transitions is 2 */ if (transition_counter != 2) { + DBG (15, "low_is_home_line: transitions!=2 (%d)\n", transition_counter); return SANE_FALSE; } @@ -1401,6 +1383,7 @@ if ((index1 < low_range) || (index1 > high_range)) { + DBG (15, "low_is_home_line: index1=%d out of range\n", index1); return SANE_FALSE; } @@ -1410,17 +1393,18 @@ if ((index2 < low_range) || (index2 > high_range)) { + DBG (15, "low_is_home_line: index2=%d out of range\n", index2); return SANE_FALSE; } /* We made it this far, so its a good home line. Return True */ + DBG (15, "low_is_home_line: success\n"); return SANE_TRUE; - } void sanei_lexmark_low_move_fwd (SANE_Int distance, Lexmark_Device * dev, - SANE_Byte * regs) + SANE_Byte * regs) { /* This function moves the scan head forward with the highest vertical @@ -1594,6 +1578,7 @@ case X1100_B2_SENSOR: dev->shadow_regs[0x2c] = 0x0f; dev->shadow_regs[0x2d] = 0x51; + dev->shadow_regs[0x2f] = 0x21; dev->shadow_regs[0x34] = 0x04; dev->shadow_regs[0x35] = 0x04; dev->shadow_regs[0x36] = 0x08; @@ -1793,6 +1778,10 @@ /* create buffer for scan data */ buffer = calloc (2500, sizeof (char)); + if (buffer == NULL) + { + return SANE_FALSE; + } /* Tell the scanner to send the data */ /* Write: 91 00 09 c4 */ @@ -2009,6 +1998,10 @@ /* create buffer to hold up to 10 lines of scan data */ buffer = calloc (10 * 2500, sizeof (char)); + if (buffer == NULL) + { + return SANE_FALSE; + } home_line_count = 0; in_home_region = SANE_FALSE; @@ -2140,8 +2133,8 @@ SANE_Status low_get_start_loc (SANE_Int resolution, SANE_Int * vert_start, - SANE_Int * hor_start, SANE_Int offset, - Lexmark_Device * dev) + SANE_Int * hor_start, SANE_Int offset, + Lexmark_Device * dev) { SANE_Int start_600; @@ -2184,13 +2177,13 @@ void low_set_scan_area (SANE_Int res, - SANE_Int tlx, - SANE_Int tly, - SANE_Int brx, - SANE_Int bry, - SANE_Int offset, - SANE_Bool half_step, - SANE_Byte * regs, Lexmark_Device * dev) + SANE_Int tlx, + SANE_Int tly, + SANE_Int brx, + SANE_Int bry, + SANE_Int offset, + SANE_Bool half_step, + SANE_Byte * regs, Lexmark_Device * dev) { SANE_Status status; @@ -2348,8 +2341,6 @@ dev->shadow_regs[0x92] = 0x20; dev->shadow_regs[0xea] = 0x00; dev->shadow_regs[0xeb] = 0x00; - dev->shadow_regs[0xf3] = 0xf8; - dev->shadow_regs[0xf4] = 0x7f; break; case A920_SENSOR: dev->shadow_regs[0x2c] = 0x0d; @@ -2482,6 +2473,10 @@ /* create buffer for scan data */ buffer = calloc (5192, sizeof (char)); + if (buffer == NULL) + { + return -1; + } /* Tell the scanner to send the data */ /* Write: 91 00 14 48 */ @@ -2560,23 +2555,21 @@ } } /* end for buffer */ + free (buffer); DBG (2, "sanei_lexmark_low_find_start_line: end.\n"); return whiteLineCount; } SANE_Status -sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, SANE_Int offset, - SANE_Bool calibrated) +sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, SANE_Int resolution, + SANE_Int offset, SANE_Bool calibrated) { - SANE_Int yres; SANE_Bool isColourScan; DBG (2, "sanei_lexmark_low_set_scan_regs:\n"); - /* resolution */ - yres = dev->val[OPT_RESOLUTION].w; - DBG (7, "sanei_lexmark_low_set_scan_regs: yres=%d DPI\n", yres); + DBG (7, "sanei_lexmark_low_set_scan_regs: resolution=%d DPI\n", resolution); /* colour mode */ if (strcmp (dev->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) @@ -2609,14 +2602,14 @@ break; } - low_set_scan_area (yres, - dev->val[OPT_TL_X].w, - dev->val[OPT_TL_Y].w, - dev->val[OPT_BR_X].w, - dev->val[OPT_BR_Y].w, - offset, - dev->model.motor_type == A920_MOTOR && isColourScan - && (yres == 600), dev->shadow_regs, dev); + low_set_scan_area (resolution, + dev->val[OPT_TL_X].w, + dev->val[OPT_TL_Y].w, + dev->val[OPT_BR_X].w, + dev->val[OPT_BR_Y].w, + offset, + dev->model.motor_type == A920_MOTOR && isColourScan + && (resolution == 600), dev->shadow_regs, dev); /* may be we could use a sensor descriptor that would held the max horiz dpi */ if (dev->val[OPT_RESOLUTION].w < 600) @@ -2625,7 +2618,7 @@ dev->shadow_regs[0x7a] = 1; /* 75dpi x 75dpi */ - if (yres == 75) + if (resolution == 75) { DBG (5, "sanei_lexmark_low_set_scan_regs(): 75 DPI resolution\n"); @@ -2899,7 +2892,7 @@ } /* 150dpi x 150dpi */ - if (yres == 150) + if (resolution == 150) { DBG (5, "sanei_lexmark_low_set_scan_regs(): 150 DPI resolution\n"); @@ -2968,8 +2961,8 @@ dev->shadow_regs[0x36] = 0x05; dev->shadow_regs[0x38] = 0x02; /* data compression - dev->shadow_regs[0x40] = 0x90; - dev->shadow_regs[0x50] = 0x20; */ + dev->shadow_regs[0x40] = 0x90; + dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; dev->shadow_regs[0x50] = 0x00; @@ -2992,7 +2985,7 @@ dev->shadow_regs[0x34] = 0x04; dev->shadow_regs[0x36] = 0x05; dev->shadow_regs[0x38] = 0x02; - + dev->shadow_regs[0x40] = 0x80; dev->shadow_regs[0x50] = 0x00; @@ -3108,7 +3101,7 @@ dev->shadow_regs[0x38] = 0x03; /* dev->shadow_regs[0x40] = 0x90; - dev->shadow_regs[0x50] = 0x20;*/ + dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; dev->shadow_regs[0x50] = 0x00; @@ -3194,7 +3187,7 @@ } /*300dpi x 300dpi */ - if (yres == 300) + if (resolution == 300) { DBG (5, "sanei_lexmark_low_set_scan_regs(): 300 DPI resolution\n"); @@ -3265,8 +3258,8 @@ dev->shadow_regs[0x38] = 0x04; /* data compression - dev->shadow_regs[0x40] = 0x90; - dev->shadow_regs[0x50] = 0x20; */ + dev->shadow_regs[0x40] = 0x90; + dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; dev->shadow_regs[0x50] = 0x00; @@ -3448,7 +3441,7 @@ } /* 600dpi x 600dpi */ - if (yres == 600) + if (resolution == 600) { DBG (5, "sanei_lexmark_low_set_scan_regs(): 600 DPI resolution\n"); @@ -3521,8 +3514,8 @@ dev->shadow_regs[0x38] = 0x04; /* data compression - dev->shadow_regs[0x40] = 0x90; - dev->shadow_regs[0x50] = 0x20; */ + dev->shadow_regs[0x40] = 0x90; + dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; @@ -3657,8 +3650,8 @@ dev->shadow_regs[0x38] = 0x0b; /* data compression - dev->shadow_regs[0x40] = 0x90; - dev->shadow_regs[0x50] = 0x20; */ + dev->shadow_regs[0x40] = 0x90; + dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; dev->shadow_regs[0x50] = 0x00; @@ -3737,7 +3730,7 @@ dev->shadow_regs[0x79] = 0x40; } /*600dpi x 1200dpi */ - if (yres == 1200) + if (resolution == 1200) { DBG (5, "sanei_lexmark_low_set_scan_regs(): 1200 DPI resolution\n"); @@ -4012,7 +4005,7 @@ long sanei_lexmark_low_read_scan_data (SANE_Byte * data, SANE_Int size, - Lexmark_Device * dev) + Lexmark_Device * dev) { SANE_Bool isColourScan, isGrayScan; static SANE_Byte command1_block[] = { 0x91, 0x00, 0xff, 0xc0 }; @@ -4049,13 +4042,14 @@ command1_block[2] = (SANE_Byte) (xfer_request >> 8); command1_block[3] = (SANE_Byte) (xfer_request & 0xFF); - /* wait for data */ - status = low_poll_data (dev->devnum); - if (status != SANE_STATUS_GOOD) - { - DBG (1, "sanei_lexmark_low_read_scan_data: time-out while waiting for data.\n"); - return status; - } + /* wait for data */ + status = low_poll_data (dev->devnum); + if (status != SANE_STATUS_GOOD) + { + DBG (1, + "sanei_lexmark_low_read_scan_data: time-out while waiting for data.\n"); + return status; + } /* Create buffer to hold the amount we will request */ dev->transfer_buffer = (SANE_Byte *) malloc (MAX_XFER_SIZE); @@ -4596,7 +4590,7 @@ SANE_Status status = SANE_STATUS_GOOD; int i, lines = 8, yoffset = 2; int pixels; - int failed=0; + int failed = 0; /* offsets */ int ro = 0, go = 0, bo = 0; /* averages */ @@ -4656,7 +4650,7 @@ status = low_simple_scan (dev, regs, dev->sensor->offset_startx, pixels, - yoffset, lines, &data); + yoffset, lines, &data); if (status != SANE_STATUS_GOOD) { DBG (1, @@ -4667,14 +4661,14 @@ } #ifdef DEEP_DEBUG sprintf (title, "offset%02x.pnm", ro); - write_pnm_file(title,pixels,lines,rts88xx_is_color (regs),data); + write_pnm_file (title, pixels, lines, rts88xx_is_color (regs), data); #endif average = average_area (regs, data, pixels, lines, &ra, &ga, &ba); } if (i == 0) { DBG (2, "sanei_lexmark_low_offset_calibration: failed !\n"); - failed=1; + failed = 1; } /* increase gain and scan again */ @@ -4682,7 +4676,7 @@ rts88xx_set_gain (regs, 6, 6, 6); status = low_simple_scan (dev, regs, dev->sensor->offset_startx, pixels, yoffset, - lines, &data); + lines, &data); if (status != SANE_STATUS_GOOD) { DBG (1, @@ -4693,28 +4687,29 @@ } average = average_area (regs, data, pixels, lines, &ra, &ga, &ba); #ifdef DEEP_DEBUG - write_pnm_file("offset-final.pnm",pixels,lines,rts88xx_is_color (regs),data); + write_pnm_file ("offset-final.pnm", pixels, lines, rts88xx_is_color (regs), + data); #endif /* this "law" is a guess, may (should?) be changed ... */ - if(!failed) - { - if (ro > ra) - dev->offset.red = ro - ra; - if (go > ga) - { - dev->offset.green = go - ga; - dev->offset.gray = go - ga; - } - if (bo > ba) - dev->offset.blue = bo - ba; - } + if (!failed) + { + if (ro > ra) + dev->offset.red = ro - ra; + if (go > ga) + { + dev->offset.green = go - ga; + dev->offset.gray = go - ga; + } + if (bo > ba) + dev->offset.blue = bo - ba; + } else - { - dev->offset.red=dev->sensor->offset_fallback; - dev->offset.green=dev->sensor->offset_fallback; - dev->offset.blue=dev->sensor->offset_fallback; - } + { + dev->offset.red = dev->sensor->offset_fallback; + dev->offset.green = dev->sensor->offset_fallback; + dev->offset.blue = dev->sensor->offset_fallback; + } DBG (7, "sanei_lexmark_low_offset_calibration: offset=(0x%02x,0x%02x,0x%02x).\n", dev->offset.red, dev->offset.green, dev->offset.blue); @@ -4780,8 +4775,7 @@ || (!rts88xx_is_color (regs) && (ga < dev->sensor->gray_gain_target))) && (i < 25)) { - status = - low_simple_scan (dev, regs, sx, pixels, yoffset, lines, &data); + status = low_simple_scan (dev, regs, sx, pixels, yoffset, lines, &data); if (status != SANE_STATUS_GOOD) { DBG (1, @@ -4792,7 +4786,7 @@ } #ifdef DEEP_DEBUG sprintf (title, "gain%02d.pnm", i); - write_pnm_file(title,pixels,lines,rts88xx_is_color (regs),data); + write_pnm_file (title, pixels, lines, rts88xx_is_color (regs), data); #endif average = average_area (regs, data, pixels, lines, &ra, &ga, &ba); free (data); @@ -4935,7 +4929,8 @@ DBG (7, "sanei_lexmark_low_shading_calibration: yoffset=%d.\n", yoffset); #ifdef DEEP_DEBUG - write_pnm_file("shading.pnm",pixels,lines,rts88xx_is_color (regs),data); + write_pnm_file ("shading.pnm", pixels, lines, rts88xx_is_color (regs), + data); #endif /* computes coefficients */ @@ -5002,7 +4997,8 @@ } #ifdef DEEP_DEBUG - write_pnm_file("shading_bwd.pnm",pixels,lines,rts88xx_is_color (regs),data); + write_pnm_file ("shading_bwd.pnm", pixels, lines, rts88xx_is_color (regs), + data); #endif free (data); @@ -5098,16 +5094,18 @@ return SANE_STATUS_GOOD; } -/* assign model description, based on USB id, and register B0 when +/* assign model description, based on USB id, and register content when * available */ SANE_Status -sanei_lexmark_low_assign_model (Lexmark_Device * dev, char *devname, - SANE_Int vendor, SANE_Int product, - SANE_Byte mainboard) +sanei_lexmark_low_assign_model (Lexmark_Device * dev, + SANE_String_Const devname, SANE_Int vendor, + SANE_Int product, SANE_Byte mainboard) { int dn; SANE_Bool found = SANE_FALSE; + DBG_INIT (); + DBG (2, "sanei_lexmark_low_assign_model: start\n"); DBG (3, "sanei_lexmark_low_assign_model: assigning %04x:%04x, variant %d\n", @@ -5148,8 +5146,7 @@ dev->model = model_list[dn]; dev->sane.type = "flatbed scanner"; - DBG (3, "sanei_lexmark_low_assign_model: assigned %s\n", - dev->model.model); + DBG (3, "sanei_lexmark_low_assign_model: assigned %s\n", dev->model.model); /* init sensor data */ return sanei_lexmark_low_assign_sensor (dev); diff -Nru sane-backends-1.0.20/backend/ma1509.c sane-backends-1.0.21/backend/ma1509.c --- sane-backends-1.0.20/backend/ma1509.c 2008-11-27 08:21:26.000000000 +1100 +++ sane-backends-1.0.21/backend/ma1509.c 2010-04-05 23:18:04.000000000 +1000 @@ -98,7 +98,9 @@ static SANE_Int new_dev_alloced; static SANE_String_Const mode_list[] = { - SANE_I18N ("Lineart"), SANE_I18N ("Gray"), SANE_I18N ("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, 0 }; @@ -732,7 +734,7 @@ height = (SANE_UNFIX (s->val[OPT_BR_Y].w) - SANE_UNFIX (s->val[OPT_TL_Y].w)) * pixels_per_mm + 0.5 + offset; - if (strcmp (s->val[OPT_MODE].s, "Lineart") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) { width /= 64; width *= 64; @@ -772,7 +774,7 @@ *cp++ = 0x00; /* brightness, not impl. */ /* threshold */ - if (strcmp (s->val[OPT_MODE].s, "Lineart") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) *cp++ = (SANE_Byte) s->val[OPT_THRESHOLD].w; else *cp++ = 0x80; @@ -781,12 +783,12 @@ /* Note that 'image composition' has no meaning for the SE series */ /* Mode selection is accomplished solely by bits/pixel (1, 8, 24) */ - if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) { *cp++ = 24; /* 24 bits/pixel in color mode */ s->hw->bpl *= 3; } - else if (strcmp (s->val[OPT_MODE].s, "Gray") == 0) + else if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY) == 0) *cp++ = 8; /* 8 bits/pixel in gray mode */ else { @@ -796,7 +798,7 @@ cp += 13; /* skip reserved bytes */ *cp++ = 0x00; /* lamp mode */ - if (strcmp (s->val[OPT_MODE].s, "Lineart") != 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) != 0) *cp++ = 0x02; /* ??? */ status = ma1509_cmd (s, scsi_set_window, buffer, &size); @@ -1048,7 +1050,7 @@ SANE_Status status; SANE_Int total_size = s->hw->ppl * s->hw->lines; - if (strcmp (s->val[OPT_MODE].s, "Lineart") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) total_size /= 8; memset (cmd, 0, 8); @@ -1593,7 +1595,7 @@ s->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_INACTIVE; s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; - if (strcmp (s->val[option].s, "Lineart") == 0) + if (strcmp (s->val[option].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; } @@ -1651,7 +1653,7 @@ s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - if (w && strcmp (s->val[OPT_MODE].s, "Lineart") != 0) + if (w && strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) != 0) { s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap &= ~SANE_CAP_INACTIVE; @@ -1698,13 +1700,13 @@ s->params.lines = height * dots_per_mm; } mode = s->val[OPT_MODE].s; - if (strcmp (mode, "Lineart") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = (s->params.pixels_per_line + 7) / 8; s->params.depth = 1; } - else if (strcmp (mode, "Gray") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; @@ -1795,7 +1797,7 @@ goto stop_scanner_and_return; } - if (strcmp (s->val[OPT_MODE].s, "Lineart") != 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) != 0) { status = calibration (s); if (status != SANE_STATUS_GOOD) @@ -1835,9 +1837,9 @@ s->params.bytes_per_line = s->hw->bpl; s->params.pixels_per_line = s->params.bytes_per_line; - if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->params.pixels_per_line /= 3; - else if (strcmp (s->val[OPT_MODE].s, "Lineart") == 0) + else if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) s->params.pixels_per_line *= 8; s->params.lines = s->hw->lines; @@ -1935,7 +1937,7 @@ s->read_bytes += (*len); /* invert for lineart mode */ - if (strcmp (s->val[OPT_MODE].s, "Lineart") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) { for (i = 0; i < *len; i++) buf[i] = ~buf[i]; diff -Nru sane-backends-1.0.20/backend/ma1509.h sane-backends-1.0.21/backend/ma1509.h --- sane-backends-1.0.20/backend/ma1509.h 2003-09-13 02:10:33.000000000 +1000 +++ sane-backends-1.0.21/backend/ma1509.h 2010-04-05 23:18:04.000000000 +1000 @@ -63,7 +63,6 @@ #endif #define MA1509_CONFIG_FILE "ma1509.conf" -#define MM_PER_INCH 25.4 /* Convenience macros */ #if defined(MIN) diff -Nru sane-backends-1.0.20/backend/Makefile.am sane-backends-1.0.21/backend/Makefile.am --- sane-backends-1.0.20/backend/Makefile.am 2009-03-05 12:54:32.000000000 +1100 +++ sane-backends-1.0.21/backend/Makefile.am 2010-04-14 10:52:59.000000000 +1000 @@ -16,7 +16,8 @@ IEEE1284_LIBS = @IEEE1284_LIBS@ TIFF_LIBS = @TIFF_LIBS@ JPEG_LIBS = @JPEG_LIBS@ -GPHOTO2_LIBS = @GPHOTO2_LIBS@ +GPHOTO2_LIBS = @GPHOTO2_LIBS@ +GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ SOCKET_LIBS = @SOCKET_LIBS@ AVAHI_LIBS = @AVAHI_LIBS@ USB_LIBS = @USB_LIBS@ @@ -84,10 +85,11 @@ dell1600n_net.conf dmc.conf epjitsu.conf epson2.conf \ epson.conf fujitsu.conf genesys.conf gphoto2.conf \ gt68xx.conf hp3900.conf hp4200.conf hp5400.conf \ - hp.conf hpsj5s.conf hs2p.conf ibm.conf leo.conf \ - lexmark.conf ma1509.conf matsushita.conf \ + hp.conf hpsj5s.conf hs2p.conf ibm.conf kodak.conf \ + leo.conf lexmark.conf ma1509.conf matsushita.conf \ microtek2.conf microtek.conf mustek.conf \ mustek_pp.conf mustek_usb.conf nec.conf net.conf \ + p5.conf \ pie.conf pixma.conf plustek.conf plustek_pp.conf \ qcam.conf ricoh.conf rts8891.conf s9036.conf sceptre.conf \ sharp.conf sm3840.conf snapscan.conf sp15c.conf \ @@ -173,12 +175,14 @@ libgphoto2_i.la libgt68xx.la libhp.la \ libhp3500.la libhp3900.la libhp4200.la \ libhp5400.la libhp5590.la libhpljm1005.la \ - libhpsj5s.la libhs2p.la libibm.la \ + libhpsj5s.la libhs2p.la libibm.la libkodak.la \ + libkvs1025.la \ libleo.la liblexmark.la libma1509.la \ libmatsushita.la libmicrotek.la libmicrotek2.la \ libmustek.la libmustek_pp.la libmustek_usb.la \ libmustek_usb2.la libnec.la libnet.la \ - libniash.la libpie.la libpint.la libpixma.la \ + libniash.la libp5.la \ + libpie.la libpint.la libpixma.la \ libplustek.la libplustek_pp.la libpnm.la \ libqcam.la libricoh.la librts8891.la \ libs9036.la libsceptre.la libsharp.la \ @@ -204,12 +208,14 @@ libsane-gphoto2.la libsane-gt68xx.la libsane-hp.la \ libsane-hp3500.la libsane-hp3900.la libsane-hp4200.la \ libsane-hp5400.la libsane-hp5590.la libsane-hpljm1005.la \ - libsane-hpsj5s.la libsane-hs2p.la libsane-ibm.la \ + libsane-hpsj5s.la libsane-hs2p.la libsane-ibm.la libsane-kodak.la \ + libsane-kvs1025.la \ libsane-leo.la libsane-lexmark.la libsane-ma1509.la \ libsane-matsushita.la libsane-microtek.la libsane-microtek2.la \ libsane-mustek.la libsane-mustek_pp.la libsane-mustek_usb.la \ libsane-mustek_usb2.la libsane-nec.la libsane-net.la \ - libsane-niash.la libsane-pie.la libsane-pint.la libsane-pixma.la \ + libsane-niash.la libsane-p5.la \ + libsane-pie.la libsane-pint.la libsane-pixma.la \ libsane-plustek.la libsane-plustek_pp.la libsane-pnm.la \ libsane-qcam.la libsane-ricoh.la libsane-rts8891.la \ libsane-s9036.la libsane-sceptre.la libsane-sharp.la \ @@ -251,7 +257,7 @@ nodist_libsane_abaton_la_SOURCES = abaton-s.c libsane_abaton_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=abaton libsane_abaton_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_abaton_la_LIBADD = $(COMMON_LIBS) libabaton.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_abaton_la_LIBADD = $(COMMON_LIBS) libabaton.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += abaton.conf.in libagfafocus_la_SOURCES = agfafocus.c agfafocus.h @@ -260,7 +266,7 @@ nodist_libsane_agfafocus_la_SOURCES = agfafocus-s.c libsane_agfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus libsane_agfafocus_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_agfafocus_la_LIBADD = $(COMMON_LIBS) libagfafocus.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_agfafocus_la_LIBADD = $(COMMON_LIBS) libagfafocus.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += agfafocus.conf.in libapple_la_SOURCES = apple.c apple.h @@ -269,7 +275,7 @@ nodist_libsane_apple_la_SOURCES = apple-s.c libsane_apple_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=apple libsane_apple_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_apple_la_LIBADD = $(COMMON_LIBS) libapple.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_apple_la_LIBADD = $(COMMON_LIBS) libapple.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += apple.conf.in libartec_la_SOURCES = artec.c artec.h @@ -278,7 +284,7 @@ nodist_libsane_artec_la_SOURCES = artec-s.c libsane_artec_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_artec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec -libsane_artec_la_LIBADD = $(COMMON_LIBS) libartec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_artec_la_LIBADD = $(COMMON_LIBS) libartec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += artec.conf.in libartec_eplus48u_la_SOURCES = artec_eplus48u.c artec_eplus48u.h @@ -287,7 +293,7 @@ nodist_libsane_artec_eplus48u_la_SOURCES = artec_eplus48u-s.c libsane_artec_eplus48u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec_eplus48u libsane_artec_eplus48u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_artec_eplus48u_la_LIBADD = $(COMMON_LIBS) libartec_eplus48u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) +libsane_artec_eplus48u_la_LIBADD = $(COMMON_LIBS) libartec_eplus48u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMEG_LIBS) EXTRA_DIST += artec_eplus48u.conf.in libas6e_la_SOURCES = as6e.c as6e.h @@ -304,7 +310,7 @@ nodist_libsane_avision_la_SOURCES = avision-s.c libsane_avision_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=avision libsane_avision_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_avision_la_LIBADD = $(COMMON_LIBS) libavision.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_avision_la_LIBADD = $(COMMON_LIBS) libavision.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += avision.conf.in libbh_la_SOURCES = bh.c bh.h @@ -313,7 +319,7 @@ nodist_libsane_bh_la_SOURCES = bh-s.c libsane_bh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=bh libsane_bh_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_bh_la_LIBADD = $(COMMON_LIBS) libbh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_bh_la_LIBADD = $(COMMON_LIBS) libbh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += bh.conf.in libcanon_la_SOURCES = canon.c canon.h @@ -322,7 +328,7 @@ nodist_libsane_canon_la_SOURCES = canon-s.c libsane_canon_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon libsane_canon_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon_la_LIBADD = $(COMMON_LIBS) libcanon.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_canon_la_LIBADD = $(COMMON_LIBS) libcanon.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += canon.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += canon-sane.c canon-scsi.c @@ -333,7 +339,7 @@ nodist_libsane_canon630u_la_SOURCES = canon630u-s.c libsane_canon630u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon630u libsane_canon630u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon630u_la_LIBADD = $(COMMON_LIBS) libcanon630u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_canon630u_la_LIBADD = $(COMMON_LIBS) libcanon630u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += canon630u.conf.in # TODO: Why are this distributed but not compiled? EXTRA_DIST += canon630u-common.c lm9830.h @@ -344,7 +350,7 @@ nodist_libsane_canon_dr_la_SOURCES = canon_dr-s.c libsane_canon_dr_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_dr libsane_canon_dr_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon_dr_la_LIBADD = $(COMMON_LIBS) libcanon_dr.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_canon_dr_la_LIBADD = $(COMMON_LIBS) libcanon_dr.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += canon_dr.conf.in libcanon_pp_la_SOURCES = canon_pp.c canon_pp.h canon_pp-io.c canon_pp-io.h canon_pp-dev.c canon_pp-dev.h @@ -362,7 +368,7 @@ nodist_libsane_cardscan_la_SOURCES = cardscan-s.c libsane_cardscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=cardscan libsane_cardscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_cardscan_la_LIBADD = $(COMMON_LIBS) libcardscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_cardscan_la_LIBADD = $(COMMON_LIBS) libcardscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += cardscan.conf.in libcoolscan_la_SOURCES = coolscan.c coolscan.h coolscan-scsidef.h @@ -371,7 +377,7 @@ nodist_libsane_coolscan_la_SOURCES = coolscan-s.c libsane_coolscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan libsane_coolscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan_la_LIBADD = $(COMMON_LIBS) libcoolscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_coolscan_la_LIBADD = $(COMMON_LIBS) libcoolscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += coolscan.conf.in libcoolscan2_la_SOURCES = coolscan2.c @@ -380,7 +386,7 @@ nodist_libsane_coolscan2_la_SOURCES = coolscan2-s.c libsane_coolscan2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan2 libsane_coolscan2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan2_la_LIBADD = $(COMMON_LIBS) libcoolscan2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) +libsane_coolscan2_la_LIBADD = $(COMMON_LIBS) libcoolscan2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += coolscan2.conf.in libcoolscan3_la_SOURCES = coolscan3.c @@ -389,7 +395,7 @@ nodist_libsane_coolscan3_la_SOURCES = coolscan3-s.c libsane_coolscan3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan3 libsane_coolscan3_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan3_la_LIBADD = $(COMMON_LIBS) libcoolscan3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) +libsane_coolscan3_la_LIBADD = $(COMMON_LIBS) libcoolscan3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += coolscan3.conf.in libdc25_la_SOURCES = dc25.c dc25.h @@ -434,7 +440,7 @@ nodist_libsane_dmc_la_SOURCES = dmc-s.c libsane_dmc_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dmc libsane_dmc_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_dmc_la_LIBADD = $(COMMON_LIBS) libdmc.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_dmc_la_LIBADD = $(COMMON_LIBS) libdmc.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += dmc.conf.in libepjitsu_la_SOURCES = epjitsu.c epjitsu.h epjitsu-cmd.h @@ -443,7 +449,7 @@ nodist_libsane_epjitsu_la_SOURCES = epjitsu-s.c libsane_epjitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epjitsu libsane_epjitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epjitsu_la_LIBADD = $(COMMON_LIBS) libepjitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_epjitsu_la_LIBADD = $(COMMON_LIBS) libepjitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += epjitsu.conf.in libepson_la_SOURCES = epson.c epson.h epson_scsi.c epson_scsi.h epson_usb.c epson_usb.h @@ -452,16 +458,16 @@ nodist_libsane_epson_la_SOURCES = epson-s.c libsane_epson_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson libsane_epson_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epson_la_LIBADD = $(COMMON_LIBS) libepson.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_epson_la_LIBADD = $(COMMON_LIBS) libepson.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += epson.conf.in -libepson2_la_SOURCES = epson2.c epson2.h epson2_scsi.c epson2_scsi.h epson_usb.c epson2_net.c epson2_net.h epson2-io.c epson2-io.h epson2-commands.c epson2-commands.h +libepson2_la_SOURCES = epson2.c epson2.h epson2_scsi.c epson2_scsi.h epson_usb.c epson2_net.c epson2_net.h epson2-io.c epson2-io.h epson2-commands.c epson2-commands.h epson2-ops.c epson2-ops.h epson2-cct.c libepson2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson2 nodist_libsane_epson2_la_SOURCES = epson2-s.c libsane_epson2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson2 libsane_epson2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epson2_la_LIBADD = $(COMMON_LIBS) libepson2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(SCSI_LIBS) $(USB_LIBS) $(SOCKET_LIBS) +libsane_epson2_la_LIBADD = $(COMMON_LIBS) libepson2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(SCSI_LIBS) $(USB_LIBS) $(SOCKET_LIBS) $(MATH_LIB) $(RESMGR_LIBS) EXTRA_DIST += epson2.conf.in libfujitsu_la_SOURCES = fujitsu.c fujitsu.h fujitsu-scsi.h @@ -470,16 +476,16 @@ nodist_libsane_fujitsu_la_SOURCES = fujitsu-s.c libsane_fujitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=fujitsu libsane_fujitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_magic.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += fujitsu.conf.in -libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl841.c genesys_low.h +libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_low.h libgenesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys nodist_libsane_genesys_la_SOURCES = genesys-s.c libsane_genesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys libsane_genesys_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_genesys_la_LIBADD = $(COMMON_LIBS) libgenesys.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_genesys_la_LIBADD = $(COMMON_LIBS) libgenesys.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += genesys.conf.in # TODO: Why are this distributed but not compiled? EXTRA_DIST += genesys_conv.c genesys_conv_hlp.c genesys_devices.c @@ -490,7 +496,7 @@ nodist_libsane_gphoto2_la_SOURCES = gphoto2-s.c libsane_gphoto2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gphoto2 libsane_gphoto2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_gphoto2_la_LIBADD = $(COMMON_LIBS) libgphoto2_i.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(GPHOTO2_LIBS) $(JPEG_LIBS) +libsane_gphoto2_la_LIBADD = $(GPHOTO2_LDFLAGS) $(COMMON_LIBS) libgphoto2_i.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(GPHOTO2_LIBS) $(JPEG_LIBS) EXTRA_DIST += gphoto2.conf.in libgt68xx_la_SOURCES = gt68xx.c gt68xx.h @@ -499,7 +505,7 @@ nodist_libsane_gt68xx_la_SOURCES = gt68xx-s.c libsane_gt68xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gt68xx libsane_gt68xx_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_gt68xx_la_LIBADD = $(COMMON_LIBS) libgt68xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_gt68xx_la_LIBADD = $(COMMON_LIBS) libgt68xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += gt68xx.conf.in # TODO: Why are this distributed but not compiled? EXTRA_DIST += gt68xx_devices.c gt68xx_generic.c gt68xx_generic.h gt68xx_gt6801.c gt68xx_gt6801.h gt68xx_gt6816.c gt68xx_gt6816.h gt68xx_high.c gt68xx_high.h gt68xx_low.c gt68xx_low.h gt68xx_mid.c gt68xx_mid.h gt68xx_shm_channel.c gt68xx_shm_channel.h @@ -510,7 +516,7 @@ nodist_libsane_hp_la_SOURCES = hp-s.c libsane_hp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp libsane_hp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp_la_LIBADD = $(COMMON_LIBS) libhp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_hp_la_LIBADD = $(COMMON_LIBS) libhp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += hp.conf.in # TODO: These should be moved to ../docs/hp; don't belong here. EXTRA_DIST += hp.README hp.TODO @@ -521,7 +527,7 @@ nodist_libsane_hp3500_la_SOURCES = hp3500-s.c libsane_hp3500_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3500 libsane_hp3500_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp3500_la_LIBADD = $(COMMON_LIBS) libhp3500.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(USB_LIBS) +libsane_hp3500_la_LIBADD = $(COMMON_LIBS) libhp3500.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libhp3900_la_SOURCES = hp3900.c libhp3900_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3900 @@ -529,7 +535,7 @@ nodist_libsane_hp3900_la_SOURCES = hp3900-s.c libsane_hp3900_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3900 libsane_hp3900_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp3900_la_LIBADD = $(COMMON_LIBS) libhp3900.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(TIFF_LIBS) $(USB_LIBS) +libsane_hp3900_la_LIBADD = $(COMMON_LIBS) libhp3900.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(TIFF_LIBS) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += hp3900.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += hp3900_config.c hp3900_debug.c hp3900_rts8822.c hp3900_sane.c hp3900_types.c hp3900_usb.c @@ -540,7 +546,7 @@ nodist_libsane_hp4200_la_SOURCES = hp4200-s.c libsane_hp4200_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp4200 libsane_hp4200_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp4200_la_LIBADD = $(COMMON_LIBS) libhp4200.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) +libsane_hp4200_la_LIBADD = $(COMMON_LIBS) libhp4200.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += hp4200.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += hp4200_lm9830.c hp4200_lm9830.h @@ -551,7 +557,7 @@ nodist_libsane_hp5400_la_SOURCES = hp5400-s.c libsane_hp5400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5400 libsane_hp5400_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp5400_la_LIBADD = $(COMMON_LIBS) libhp5400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_hp5400_la_LIBADD = $(COMMON_LIBS) libhp5400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += hp5400.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += hp5400_debug.c hp5400_debug.h hp5400_internal.c hp5400_internal.h hp5400_sane.c hp5400_sanei.c hp5400_sanei.h hp5400_xfer.h @@ -562,7 +568,7 @@ nodist_libsane_hp5590_la_SOURCES = hp5590-s.c libsane_hp5590_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5590 libsane_hp5590_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp5590_la_LIBADD = $(COMMON_LIBS) libhp5590.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_hp5590_la_LIBADD = $(COMMON_LIBS) libhp5590.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) # TODO: Why are these distributed but not compiled? EXTRA_DIST += hp5590_cmds.c hp5590_cmds.h hp5590_low.c hp5590_low.h @@ -572,7 +578,7 @@ nodist_libsane_hpljm1005_la_SOURCES = hpljm1005-s.c libsane_hpljm1005_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpljm1005 libsane_hpljm1005_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hpljm1005_la_LIBADD = $(COMMON_LIBS) libhpljm1005.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_hpljm1005_la_LIBADD = $(COMMON_LIBS) libhpljm1005.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libhpsj5s_la_SOURCES = hpsj5s.c hpsj5s.h libhpsj5s_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpsj5s @@ -589,7 +595,7 @@ nodist_libsane_hs2p_la_SOURCES = hs2p-s.c libsane_hs2p_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hs2p libsane_hs2p_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hs2p_la_LIBADD = $(COMMON_LIBS) libhs2p.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_hs2p_la_LIBADD = $(COMMON_LIBS) libhs2p.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += hs2p.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += hs2p-scsi.c hs2p-scsi.h @@ -600,18 +606,36 @@ nodist_libsane_ibm_la_SOURCES = ibm-s.c libsane_ibm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ibm libsane_ibm_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ibm_la_LIBADD = $(COMMON_LIBS) libibm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_ibm_la_LIBADD = $(COMMON_LIBS) libibm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += ibm.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += ibm-scsi.c +libkodak_la_SOURCES = kodak.c kodak.h kodak-cmd.h +libkodak_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kodak + +nodist_libsane_kodak_la_SOURCES = kodak-s.c +libsane_kodak_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kodak +libsane_kodak_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_kodak_la_LIBADD = $(COMMON_LIBS) libkodak.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) +EXTRA_DIST += kodak.conf.in + +libkvs1025_la_SOURCES = kvs1025.c kvs1025_low.c kvs1025_opt.c kvs1025_usb.c \ + kvs1025.h kvs1025_low.h kvs1025_usb.h kvs1025_cmds.h +libkvs1025_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs1025 + +nodist_libsane_kvs1025_la_SOURCES = kvs1025-s.c +libsane_kvs1025_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs1025 +libsane_kvs1025_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_kvs1025_la_LIBADD = $(COMMON_LIBS) libkvs1025.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) + libleo_la_SOURCES = leo.c leo.h libleo_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=leo nodist_libsane_leo_la_SOURCES = leo-s.c libsane_leo_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=leo libsane_leo_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_leo_la_LIBADD = $(COMMON_LIBS) libleo.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_leo_la_LIBADD = $(COMMON_LIBS) libleo.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += leo.conf.in liblexmark_la_SOURCES = lexmark.c lexmark.h lexmark_low.c @@ -620,7 +644,7 @@ nodist_libsane_lexmark_la_SOURCES = lexmark-s.c libsane_lexmark_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark libsane_lexmark_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_lexmark_la_LIBADD = $(COMMON_LIBS) liblexmark.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_lexmark_la_LIBADD = $(COMMON_LIBS) liblexmark.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += lexmark.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += lexmark_models.c lexmark_sensors.c @@ -631,7 +655,7 @@ nodist_libsane_ma1509_la_SOURCES = ma1509-s.c libsane_ma1509_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ma1509 libsane_ma1509_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ma1509_la_LIBADD = $(COMMON_LIBS) libma1509.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_ma1509_la_LIBADD = $(COMMON_LIBS) libma1509.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += ma1509.conf.in libmatsushita_la_SOURCES = matsushita.c matsushita.h @@ -640,7 +664,7 @@ nodist_libsane_matsushita_la_SOURCES = matsushita-s.c libsane_matsushita_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=matsushita libsane_matsushita_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_matsushita_la_LIBADD = $(COMMON_LIBS) libmatsushita.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_matsushita_la_LIBADD = $(COMMON_LIBS) libmatsushita.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += matsushita.conf.in libmicrotek_la_SOURCES = microtek.c microtek.h @@ -649,7 +673,7 @@ nodist_libsane_microtek_la_SOURCES = microtek-s.c libsane_microtek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek libsane_microtek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_microtek_la_LIBADD = $(COMMON_LIBS) libmicrotek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_microtek_la_LIBADD = $(COMMON_LIBS) libmicrotek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += microtek.conf.in libmicrotek2_la_SOURCES = microtek2.c microtek2.h @@ -658,7 +682,7 @@ nodist_libsane_microtek2_la_SOURCES = microtek2-s.c libsane_microtek2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek2 libsane_microtek2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_microtek2_la_LIBADD = $(COMMON_LIBS) libmicrotek2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_microtek2_la_LIBADD = $(COMMON_LIBS) libmicrotek2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += microtek2.conf.in libmustek_la_SOURCES = mustek.c mustek.h @@ -667,7 +691,7 @@ nodist_libsane_mustek_la_SOURCES = mustek-s.c libsane_mustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek libsane_mustek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_la_LIBADD = $(COMMON_LIBS) libmustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pa4s2.lo $(IEEE1284_LIBS) $(SCSI_LIBS) +libsane_mustek_la_LIBADD = $(COMMON_LIBS) libmustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pa4s2.lo $(IEEE1284_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += mustek.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += mustek_scsi_pp.c mustek_scsi_pp.h @@ -689,7 +713,7 @@ nodist_libsane_mustek_usb_la_SOURCES = mustek_usb-s.c libsane_mustek_usb_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb libsane_mustek_usb_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += mustek_usb.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += mustek_usb_high.c mustek_usb_high.h mustek_usb_low.c mustek_usb_low.h mustek_usb_mid.c mustek_usb_mid.h @@ -700,7 +724,7 @@ nodist_libsane_mustek_usb2_la_SOURCES = mustek_usb2-s.c libsane_mustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2 libsane_mustek_usb2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_usb2_la_LIBADD = $(COMMON_LIBS) libmustek_usb2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(PTHREAD_LIBS) $(USB_LIBS) +libsane_mustek_usb2_la_LIBADD = $(COMMON_LIBS) libmustek_usb2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(PTHREAD_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) # TODO: Why are these distributed but not compiled? EXTRA_DIST += mustek_usb2_asic.c mustek_usb2_asic.h mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_reflective.c mustek_usb2_transparent.c @@ -710,7 +734,7 @@ nodist_libsane_nec_la_SOURCES = nec-s.c libsane_nec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=nec libsane_nec_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_nec_la_LIBADD = $(COMMON_LIBS) libnec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_nec_la_LIBADD = $(COMMON_LIBS) libnec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += nec.conf.in libnet_la_SOURCES = net.c net.h @@ -728,7 +752,7 @@ nodist_libsane_niash_la_SOURCES = niash-s.c libsane_niash_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=niash libsane_niash_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_niash_la_LIBADD = $(COMMON_LIBS) libniash.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_niash_la_LIBADD = $(COMMON_LIBS) libniash.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) # TODO: Why are these distributed but not compiled? EXTRA_DIST += niash_core.c niash_core.h niash_xfer.c niash_xfer.h @@ -738,9 +762,18 @@ nodist_libsane_pie_la_SOURCES = pie-s.c libsane_pie_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pie libsane_pie_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pie_la_LIBADD = $(COMMON_LIBS) libpie.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) +libsane_pie_la_LIBADD = $(COMMON_LIBS) libpie.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += pie.conf.in +libp5_la_SOURCES = p5.c p5.h p5_device.h +libp5_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=p5 + +nodist_libsane_p5_la_SOURCES = p5-s.c +libsane_p5_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=p5 +libsane_p5_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_p5_la_LIBADD = $(COMMON_LIBS) libp5.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +EXTRA_DIST += p5.conf.in p5_device.c + libpint_la_SOURCES = pint.c pint.h libpint_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pint @@ -755,7 +788,7 @@ nodist_libsane_pixma_la_SOURCES = pixma-s.c libsane_pixma_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pixma libsane_pixma_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pixma_la_LIBADD = $(COMMON_LIBS) libpixma.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) +libsane_pixma_la_LIBADD = $(COMMON_LIBS) libpixma.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += pixma.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += pixma_sane_options.c pixma_sane_options.h @@ -766,7 +799,7 @@ nodist_libsane_plustek_la_SOURCES = plustek-s.c libsane_plustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek libsane_plustek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_plustek_la_LIBADD = $(COMMON_LIBS) libplustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo $(MATH_LIB) $(USB_LIBS) +libsane_plustek_la_LIBADD = $(COMMON_LIBS) libplustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += plustek.conf.in EXTRA_DIST += plustek-usb.c plustek-usb.h plustek-usbcal.c plustek-usbcalfile.c plustek-usbdevs.c plustek-usbhw.c plustek-usbimg.c plustek-usbio.c plustek-usbmap.c plustek-usbscan.c plustek-usbshading.c @@ -776,7 +809,7 @@ nodist_libsane_plustek_pp_la_SOURCES = plustek_pp-s.c libsane_plustek_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek_pp libsane_plustek_pp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_plustek_pp_la_LIBADD = $(COMMON_LIBS) libplustek_pp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(IEEE1284_LIBS) +libsane_plustek_pp_la_LIBADD = $(COMMON_LIBS) libplustek_pp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(IEEE1284_LIBS) $(PTHREAD_LIBS) EXTRA_DIST += plustek_pp.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += plustek-pp_dac.c plustek-pp_dbg.h plustek-pp_detect.c plustek-pp_genericio.c plustek-pp_hwdefs.h plustek-pp_image.c plustek-pp_io.c plustek-pp_map.c plustek-pp_misc.c plustek-pp_models.c plustek-pp_motor.c plustek-pp_p12.c plustek-pp_p12ccd.c plustek-pp_p48xx.c plustek-pp_p9636.c plustek-pp_procfs.c plustek-pp_procs.h plustek-pp_ptdrv.c plustek-pp_scale.c plustek-pp_scan.h plustek-pp_scandata.h plustek-pp_sysdep.h plustek-pp_tpa.c plustek-pp_types.h plustek-pp_wrapper.c @@ -795,7 +828,7 @@ nodist_libsane_qcam_la_SOURCES = qcam-s.c libsane_qcam_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=qcam libsane_qcam_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_qcam_la_LIBADD = $(COMMON_LIBS) libqcam.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +libsane_qcam_la_LIBADD = $(COMMON_LIBS) libqcam.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pio.lo EXTRA_DIST += qcam.conf.in libricoh_la_SOURCES = ricoh.c ricoh.h @@ -804,7 +837,7 @@ nodist_libsane_ricoh_la_SOURCES = ricoh-s.c libsane_ricoh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ricoh libsane_ricoh_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ricoh_la_LIBADD = $(COMMON_LIBS) libricoh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_ricoh_la_LIBADD = $(COMMON_LIBS) libricoh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += ricoh.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += ricoh-scsi.c @@ -815,7 +848,7 @@ nodist_libsane_rts8891_la_SOURCES = rts8891-s.c libsane_rts8891_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=rts8891 libsane_rts8891_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_rts8891_la_LIBADD = $(COMMON_LIBS) librts8891.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_rts8891_la_LIBADD = $(COMMON_LIBS) librts8891.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) $(RESMGR_LIBS) EXTRA_DIST += rts8891.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += rts8891_devices.c rts8891_low.c rts8891_low.h @@ -826,7 +859,7 @@ nodist_libsane_s9036_la_SOURCES = s9036-s.c libsane_s9036_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=s9036 libsane_s9036_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_s9036_la_LIBADD = $(COMMON_LIBS) libs9036.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_s9036_la_LIBADD = $(COMMON_LIBS) libs9036.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += s9036.conf.in libsceptre_la_SOURCES = sceptre.c sceptre.h @@ -835,7 +868,7 @@ nodist_libsane_sceptre_la_SOURCES = sceptre-s.c libsane_sceptre_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sceptre libsane_sceptre_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sceptre_la_LIBADD = $(COMMON_LIBS) libsceptre.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_sceptre_la_LIBADD = $(COMMON_LIBS) libsceptre.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += sceptre.conf.in libsharp_la_SOURCES = sharp.c sharp.h @@ -844,7 +877,7 @@ nodist_libsane_sharp_la_SOURCES = sharp-s.c libsane_sharp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sharp libsane_sharp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sharp_la_LIBADD = $(COMMON_LIBS) libsharp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_sharp_la_LIBADD = $(COMMON_LIBS) libsharp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += sharp.conf.in libsm3600_la_SOURCES = sm3600.c sm3600.h @@ -853,7 +886,7 @@ nodist_libsane_sm3600_la_SOURCES = sm3600-s.c libsane_sm3600_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3600 libsane_sm3600_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sm3600_la_LIBADD = $(COMMON_LIBS) libsm3600.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_sm3600_la_LIBADD = $(COMMON_LIBS) libsm3600.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) # TODO: Why are these distributed but not compiled? EXTRA_DIST += sm3600-color.c sm3600-gray.c sm3600-homerun.c sm3600-scanmtek.c sm3600-scantool.h sm3600-scanusb.c sm3600-scanutil.c @@ -863,7 +896,7 @@ nodist_libsane_sm3840_la_SOURCES = sm3840-s.c libsane_sm3840_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3840 libsane_sm3840_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sm3840_la_LIBADD = $(COMMON_LIBS) libsm3840.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_sm3840_la_LIBADD = $(COMMON_LIBS) libsm3840.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += sm3840.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += sm3840_lib.c sm3840_lib.h sm3840_scan.c @@ -874,7 +907,7 @@ nodist_libsane_snapscan_la_SOURCES = snapscan-s.c libsane_snapscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=snapscan libsane_snapscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_snapscan_la_LIBADD = $(COMMON_LIBS) libsnapscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_snapscan_la_LIBADD = $(COMMON_LIBS) libsnapscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += snapscan.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += snapscan-data.c snapscan-mutex.c snapscan-options.c snapscan-scsi.c snapscan-sources.c snapscan-sources.h snapscan-usb.c snapscan-usb.h @@ -885,7 +918,7 @@ nodist_libsane_sp15c_la_SOURCES = sp15c-s.c libsane_sp15c_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sp15c libsane_sp15c_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sp15c_la_LIBADD = $(COMMON_LIBS) libsp15c.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_sp15c_la_LIBADD = $(COMMON_LIBS) libsp15c.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += sp15c.conf.in libst400_la_SOURCES = st400.c st400.h @@ -894,7 +927,7 @@ nodist_libsane_st400_la_SOURCES = st400-s.c ../sanei/sanei_scsi.lo libsane_st400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=st400 libsane_st400_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_st400_la_LIBADD = $(COMMON_LIBS) libst400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_st400_la_LIBADD = $(COMMON_LIBS) libst400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += st400.conf.in libstv680_la_SOURCES = stv680.c stv680.h @@ -903,7 +936,7 @@ nodist_libsane_stv680_la_SOURCES = stv680-s.c libsane_stv680_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=stv680 libsane_stv680_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_stv680_la_LIBADD = $(COMMON_LIBS) libstv680.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_stv680_la_LIBADD = $(COMMON_LIBS) libstv680.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += stv680.conf.in libtamarack_la_SOURCES = tamarack.c tamarack.h @@ -912,7 +945,7 @@ nodist_libsane_tamarack_la_SOURCES = tamarack-s.c libsane_tamarack_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=tamarack libsane_tamarack_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_tamarack_la_LIBADD = $(COMMON_LIBS) libtamarack.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_tamarack_la_LIBADD = $(COMMON_LIBS) libtamarack.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += tamarack.conf.in libtest_la_SOURCES = test.c test.h @@ -921,7 +954,7 @@ nodist_libsane_test_la_SOURCES = test-s.c libsane_test_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=test libsane_test_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_test_la_LIBADD = $(COMMON_LIBS) libtest.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_thread.lo +libsane_test_la_LIBADD = $(COMMON_LIBS) libtest.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_thread.lo $(PTHREAD_LIBS) EXTRA_DIST += test.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += test-picture.c @@ -932,7 +965,7 @@ nodist_libsane_teco1_la_SOURCES = teco1-s.c libsane_teco1_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco1 libsane_teco1_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco1_la_LIBADD = $(COMMON_LIBS) libteco1.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco1_la_LIBADD = $(COMMON_LIBS) libteco1.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += teco1.conf.in libteco2_la_SOURCES = teco2.c teco2.h @@ -941,7 +974,7 @@ nodist_libsane_teco2_la_SOURCES = teco2-s.c libsane_teco2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco2 libsane_teco2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco2_la_LIBADD = $(COMMON_LIBS) libteco2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco2_la_LIBADD = $(COMMON_LIBS) libteco2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += teco2.conf.in libteco3_la_SOURCES = teco3.c teco3.h @@ -950,7 +983,7 @@ nodist_libsane_teco3_la_SOURCES = teco3-s.c libsane_teco3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco3 libsane_teco3_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco3_la_LIBADD = $(COMMON_LIBS) libteco3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco3_la_LIBADD = $(COMMON_LIBS) libteco3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) EXTRA_DIST += teco3.conf.in libu12_la_SOURCES = u12.c u12.h @@ -959,7 +992,7 @@ nodist_libsane_u12_la_SOURCES = u12-s.c libsane_u12_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=u12 libsane_u12_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_u12_la_LIBADD = $(COMMON_LIBS) libu12.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) +libsane_u12_la_LIBADD = $(COMMON_LIBS) libu12.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += u12.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += u12-ccd.c u12-hw.c u12-hwdef.h u12-if.c u12-image.c u12-io.c u12-map.c u12-motor.c u12-scanner.h u12-shading.c u12-tpa.c @@ -970,7 +1003,7 @@ nodist_libsane_umax_la_SOURCES = umax-s.c libsane_umax_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax libsane_umax_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_umax_la_LIBADD = $(COMMON_LIBS) libumax.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_umax_la_LIBADD = $(COMMON_LIBS) libumax.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += umax.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += umax-scanner.c umax-scanner.h umax-scsidef.h umax-uc1200s.c umax-uc1200se.c umax-uc1260.c umax-uc630.c umax-uc840.c umax-ug630.c umax-ug80.c umax-usb.c @@ -981,7 +1014,7 @@ nodist_libsane_umax1220u_la_SOURCES = umax1220u-s.c libsane_umax1220u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax1220u libsane_umax1220u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_umax1220u_la_LIBADD = $(COMMON_LIBS) libumax1220u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) +libsane_umax1220u_la_LIBADD = $(COMMON_LIBS) libumax1220u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += umax1220u.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += umax1220u-common.c @@ -1010,7 +1043,7 @@ nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) EXTRA_DIST += xerox_mfp.conf.in libdll_la_SOURCES = dll.c @@ -1048,7 +1081,7 @@ nodist_libsane_la_SOURCES = dll-s.c libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS) -libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) +libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) # WARNING: Automake is getting this wrong so have to do it ourselves. libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo @SANEI_SANEI_JPEG_LO@ diff -Nru sane-backends-1.0.20/backend/Makefile.in sane-backends-1.0.21/backend/Makefile.in --- sane-backends-1.0.20/backend/Makefile.in 2009-04-30 23:41:18.000000000 +1000 +++ sane-backends-1.0.21/backend/Makefile.in 2010-04-14 10:52:59.000000000 +1000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -43,15 +45,29 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sanelibdir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -sanelibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(sanelib_LTLIBRARIES) libabaton_la_LIBADD = am_libabaton_la_OBJECTS = libabaton_la-abaton.lo @@ -132,7 +148,8 @@ am_libepson2_la_OBJECTS = libepson2_la-epson2.lo \ libepson2_la-epson2_scsi.lo libepson2_la-epson_usb.lo \ libepson2_la-epson2_net.lo libepson2_la-epson2-io.lo \ - libepson2_la-epson2-commands.lo + libepson2_la-epson2-commands.lo libepson2_la-epson2-ops.lo \ + libepson2_la-epson2-cct.lo libepson2_la_OBJECTS = $(am_libepson2_la_OBJECTS) libfujitsu_la_LIBADD = am_libfujitsu_la_OBJECTS = libfujitsu_la-fujitsu.lo @@ -179,6 +196,14 @@ libibm_la_LIBADD = am_libibm_la_OBJECTS = libibm_la-ibm.lo libibm_la_OBJECTS = $(am_libibm_la_OBJECTS) +libkodak_la_LIBADD = +am_libkodak_la_OBJECTS = libkodak_la-kodak.lo +libkodak_la_OBJECTS = $(am_libkodak_la_OBJECTS) +libkvs1025_la_LIBADD = +am_libkvs1025_la_OBJECTS = libkvs1025_la-kvs1025.lo \ + libkvs1025_la-kvs1025_low.lo libkvs1025_la-kvs1025_opt.lo \ + libkvs1025_la-kvs1025_usb.lo +libkvs1025_la_OBJECTS = $(am_libkvs1025_la_OBJECTS) libleo_la_LIBADD = am_libleo_la_OBJECTS = libleo_la-leo.lo libleo_la_OBJECTS = $(am_libleo_la_OBJECTS) @@ -219,6 +244,9 @@ libniash_la_LIBADD = am_libniash_la_OBJECTS = libniash_la-niash.lo libniash_la_OBJECTS = $(am_libniash_la_OBJECTS) +libp5_la_LIBADD = +am_libp5_la_OBJECTS = libp5_la-p5.lo +libp5_la_OBJECTS = $(am_libp5_la_OBJECTS) libpie_la_LIBADD = am_libpie_la_OBJECTS = libpie_la-pie.lo libpie_la_OBJECTS = $(am_libpie_la_OBJECTS) @@ -258,7 +286,8 @@ libsane_abaton_la_DEPENDENCIES = $(COMMON_LIBS) libabaton.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_abaton_la_OBJECTS = libsane_abaton_la-abaton-s.lo libsane_abaton_la_OBJECTS = $(nodist_libsane_abaton_la_OBJECTS) libsane_abaton_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -268,7 +297,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_thread.lo \ - ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_agfafocus_la_OBJECTS = \ libsane_agfafocus_la-agfafocus-s.lo libsane_agfafocus_la_OBJECTS = $(nodist_libsane_agfafocus_la_OBJECTS) @@ -278,7 +308,8 @@ libsane_apple_la_DEPENDENCIES = $(COMMON_LIBS) libapple.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_apple_la_OBJECTS = libsane_apple_la-apple-s.lo libsane_apple_la_OBJECTS = $(nodist_libsane_apple_la_OBJECTS) libsane_apple_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -287,7 +318,8 @@ libsane_artec_la_DEPENDENCIES = $(COMMON_LIBS) libartec.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_artec_la_OBJECTS = libsane_artec_la-artec-s.lo libsane_artec_la_OBJECTS = $(nodist_libsane_artec_la_OBJECTS) libsane_artec_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -298,7 +330,7 @@ ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo \ ../sanei/sanei_thread.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_artec_eplus48u_la_OBJECTS = \ libsane_artec_eplus48u_la-artec_eplus48u-s.lo libsane_artec_eplus48u_la_OBJECTS = \ @@ -321,6 +353,7 @@ sane_strstatus.lo ../sanei/sanei_usb.lo \ ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_avision_la_OBJECTS = libsane_avision_la-avision-s.lo libsane_avision_la_OBJECTS = $(nodist_libsane_avision_la_OBJECTS) @@ -330,7 +363,8 @@ libsane_bh_la_DEPENDENCIES = $(COMMON_LIBS) libbh.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_bh_la_OBJECTS = libsane_bh_la-bh-s.lo libsane_bh_la_OBJECTS = $(nodist_libsane_bh_la_OBJECTS) libsane_bh_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -340,7 +374,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_canon_la_OBJECTS = libsane_canon_la-canon-s.lo libsane_canon_la_OBJECTS = $(nodist_libsane_canon_la_OBJECTS) libsane_canon_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -350,7 +384,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_canon630u_la_OBJECTS = \ libsane_canon630u_la-canon630u-s.lo libsane_canon630u_la_OBJECTS = $(nodist_libsane_canon630u_la_OBJECTS) @@ -361,6 +395,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_canon_dr_la_OBJECTS = \ libsane_canon_dr_la-canon_dr-s.lo @@ -381,7 +416,8 @@ libsane_cardscan_la_DEPENDENCIES = $(COMMON_LIBS) libcardscan.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_cardscan_la_OBJECTS = \ libsane_cardscan_la-cardscan-s.lo libsane_cardscan_la_OBJECTS = $(nodist_libsane_cardscan_la_OBJECTS) @@ -394,6 +430,7 @@ sane_strstatus.lo ../sanei/sanei_thread.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_coolscan_la_OBJECTS = \ libsane_coolscan_la-coolscan-s.lo @@ -406,7 +443,7 @@ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_coolscan2_la_OBJECTS = \ libsane_coolscan2_la-coolscan2-s.lo libsane_coolscan2_la_OBJECTS = $(nodist_libsane_coolscan2_la_OBJECTS) @@ -418,7 +455,7 @@ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_coolscan3_la_OBJECTS = \ libsane_coolscan3_la-coolscan3-s.lo libsane_coolscan3_la_OBJECTS = $(nodist_libsane_coolscan3_la_OBJECTS) @@ -476,7 +513,8 @@ libsane_dmc_la_DEPENDENCIES = $(COMMON_LIBS) libdmc.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_dmc_la_OBJECTS = libsane_dmc_la-dmc-s.lo libsane_dmc_la_OBJECTS = $(nodist_libsane_dmc_la_OBJECTS) libsane_dmc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -486,7 +524,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_epjitsu_la_OBJECTS = libsane_epjitsu_la-epjitsu-s.lo libsane_epjitsu_la_OBJECTS = $(nodist_libsane_epjitsu_la_OBJECTS) libsane_epjitsu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -497,7 +535,7 @@ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_pio.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_epson_la_OBJECTS = libsane_epson_la-epson-s.lo libsane_epson_la_OBJECTS = $(nodist_libsane_epson_la_OBJECTS) libsane_epson_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -509,6 +547,7 @@ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo \ ../sanei/sanei_udp.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_epson2_la_OBJECTS = libsane_epson2_la-epson2-s.lo libsane_epson2_la_OBJECTS = $(nodist_libsane_epson2_la_OBJECTS) @@ -519,6 +558,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ + ../sanei/sanei_magic.lo $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_fujitsu_la_OBJECTS = libsane_fujitsu_la-fujitsu-s.lo @@ -530,16 +570,16 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_genesys_la_OBJECTS = libsane_genesys_la-genesys-s.lo libsane_genesys_la_OBJECTS = $(nodist_libsane_genesys_la_OBJECTS) libsane_genesys_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsane_genesys_la_LDFLAGS) $(LDFLAGS) -o $@ -libsane_gphoto2_la_DEPENDENCIES = $(COMMON_LIBS) libgphoto2_i.la \ - ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ - ../sanei/sanei_config.lo sane_strstatus.lo \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +libsane_gphoto2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(COMMON_LIBS) \ + libgphoto2_i.la ../sanei/sanei_init_debug.lo \ + ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo \ + sane_strstatus.lo $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_gphoto2_la_OBJECTS = libsane_gphoto2_la-gphoto2-s.lo libsane_gphoto2_la_OBJECTS = $(nodist_libsane_gphoto2_la_OBJECTS) libsane_gphoto2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -549,7 +589,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_gt68xx_la_OBJECTS = libsane_gt68xx_la-gt68xx-s.lo libsane_gt68xx_la_OBJECTS = $(nodist_libsane_gt68xx_la_OBJECTS) libsane_gt68xx_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -560,6 +600,7 @@ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_pio.lo ../sanei/sanei_thread.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_hp_la_OBJECTS = libsane_hp_la-hp-s.lo libsane_hp_la_OBJECTS = $(nodist_libsane_hp_la_OBJECTS) @@ -570,6 +611,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_hp3500_la_OBJECTS = libsane_hp3500_la-hp3500-s.lo libsane_hp3500_la_OBJECTS = $(nodist_libsane_hp3500_la_OBJECTS) @@ -580,7 +622,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_hp3900_la_OBJECTS = libsane_hp3900_la-hp3900-s.lo libsane_hp3900_la_OBJECTS = $(nodist_libsane_hp3900_la_OBJECTS) libsane_hp3900_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -590,7 +633,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_hp4200_la_OBJECTS = libsane_hp4200_la-hp4200-s.lo libsane_hp4200_la_OBJECTS = $(nodist_libsane_hp4200_la_OBJECTS) libsane_hp4200_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -599,7 +643,8 @@ libsane_hp5400_la_DEPENDENCIES = $(COMMON_LIBS) libhp5400.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_hp5400_la_OBJECTS = libsane_hp5400_la-hp5400-s.lo libsane_hp5400_la_OBJECTS = $(nodist_libsane_hp5400_la_OBJECTS) libsane_hp5400_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -608,7 +653,8 @@ libsane_hp5590_la_DEPENDENCIES = $(COMMON_LIBS) libhp5590.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_hp5590_la_OBJECTS = libsane_hp5590_la-hp5590-s.lo libsane_hp5590_la_OBJECTS = $(nodist_libsane_hp5590_la_OBJECTS) libsane_hp5590_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -618,7 +664,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_hpljm1005_la_OBJECTS = \ libsane_hpljm1005_la-hpljm1005-s.lo libsane_hpljm1005_la_OBJECTS = $(nodist_libsane_hpljm1005_la_OBJECTS) @@ -637,7 +683,8 @@ libsane_hs2p_la_DEPENDENCIES = $(COMMON_LIBS) libhs2p.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_hs2p_la_OBJECTS = libsane_hs2p_la-hs2p-s.lo libsane_hs2p_la_OBJECTS = $(nodist_libsane_hs2p_la_OBJECTS) libsane_hs2p_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -646,16 +693,39 @@ libsane_ibm_la_DEPENDENCIES = $(COMMON_LIBS) libibm.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_ibm_la_OBJECTS = libsane_ibm_la-ibm-s.lo libsane_ibm_la_OBJECTS = $(nodist_libsane_ibm_la_OBJECTS) libsane_ibm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsane_ibm_la_LDFLAGS) $(LDFLAGS) -o $@ +libsane_kodak_la_DEPENDENCIES = $(COMMON_LIBS) libkodak.la \ + ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ + ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +nodist_libsane_kodak_la_OBJECTS = libsane_kodak_la-kodak-s.lo +libsane_kodak_la_OBJECTS = $(nodist_libsane_kodak_la_OBJECTS) +libsane_kodak_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsane_kodak_la_LDFLAGS) $(LDFLAGS) -o $@ +libsane_kvs1025_la_DEPENDENCIES = $(COMMON_LIBS) libkvs1025.la \ + ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ + ../sanei/sanei_config.lo sane_strstatus.lo \ + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +nodist_libsane_kvs1025_la_OBJECTS = libsane_kvs1025_la-kvs1025-s.lo +libsane_kvs1025_la_OBJECTS = $(nodist_libsane_kvs1025_la_OBJECTS) +libsane_kvs1025_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsane_kvs1025_la_LDFLAGS) $(LDFLAGS) -o $@ libsane_leo_la_DEPENDENCIES = $(COMMON_LIBS) libleo.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_leo_la_OBJECTS = libsane_leo_la-leo-s.lo libsane_leo_la_OBJECTS = $(nodist_libsane_leo_la_OBJECTS) libsane_leo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -664,7 +734,8 @@ libsane_lexmark_la_DEPENDENCIES = $(COMMON_LIBS) liblexmark.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_lexmark_la_OBJECTS = libsane_lexmark_la-lexmark-s.lo libsane_lexmark_la_OBJECTS = $(nodist_libsane_lexmark_la_OBJECTS) libsane_lexmark_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -673,7 +744,8 @@ libsane_ma1509_la_DEPENDENCIES = $(COMMON_LIBS) libma1509.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_ma1509_la_OBJECTS = libsane_ma1509_la-ma1509-s.lo libsane_ma1509_la_OBJECTS = $(nodist_libsane_ma1509_la_OBJECTS) libsane_ma1509_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -682,7 +754,8 @@ libsane_matsushita_la_DEPENDENCIES = $(COMMON_LIBS) libmatsushita.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_matsushita_la_OBJECTS = \ libsane_matsushita_la-matsushita-s.lo libsane_matsushita_la_OBJECTS = \ @@ -694,7 +767,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_microtek_la_OBJECTS = \ libsane_microtek_la-microtek-s.lo libsane_microtek_la_OBJECTS = $(nodist_libsane_microtek_la_OBJECTS) @@ -706,6 +779,7 @@ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_thread.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_microtek2_la_OBJECTS = \ libsane_microtek2_la-microtek2-s.lo @@ -719,6 +793,7 @@ sane_strstatus.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_thread.lo ../sanei/sanei_ab306.lo \ ../sanei/sanei_pa4s2.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_mustek_la_OBJECTS = libsane_mustek_la-mustek-s.lo libsane_mustek_la_OBJECTS = $(nodist_libsane_mustek_la_OBJECTS) @@ -739,7 +814,8 @@ libsane_mustek_usb_la_DEPENDENCIES = $(COMMON_LIBS) libmustek_usb.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_mustek_usb_la_OBJECTS = \ libsane_mustek_usb_la-mustek_usb-s.lo libsane_mustek_usb_la_OBJECTS = \ @@ -752,6 +828,7 @@ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_mustek_usb2_la_OBJECTS = \ libsane_mustek_usb2_la-mustek_usb2-s.lo @@ -764,7 +841,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_nec_la_OBJECTS = libsane_nec_la-nec-s.lo libsane_nec_la_OBJECTS = $(nodist_libsane_nec_la_OBJECTS) libsane_nec_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -785,17 +862,26 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_niash_la_OBJECTS = libsane_niash_la-niash-s.lo libsane_niash_la_OBJECTS = $(nodist_libsane_niash_la_OBJECTS) libsane_niash_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsane_niash_la_LDFLAGS) $(LDFLAGS) -o $@ +libsane_p5_la_DEPENDENCIES = $(COMMON_LIBS) libp5.la \ + ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ + ../sanei/sanei_config.lo sane_strstatus.lo +nodist_libsane_p5_la_OBJECTS = libsane_p5_la-p5-s.lo +libsane_p5_la_OBJECTS = $(nodist_libsane_p5_la_OBJECTS) +libsane_p5_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsane_p5_la_LDFLAGS) $(LDFLAGS) -o $@ libsane_pie_la_DEPENDENCIES = $(COMMON_LIBS) libpie.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo \ - ../sanei/sanei_thread.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_thread.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_pie_la_OBJECTS = libsane_pie_la-pie-s.lo libsane_pie_la_OBJECTS = $(nodist_libsane_pie_la_OBJECTS) libsane_pie_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -814,6 +900,7 @@ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_pixma_la_OBJECTS = libsane_pixma_la-pixma-s.lo libsane_pixma_la_OBJECTS = $(nodist_libsane_pixma_la_OBJECTS) @@ -825,6 +912,7 @@ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo \ ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_plustek_la_OBJECTS = libsane_plustek_la-plustek-s.lo libsane_plustek_la_OBJECTS = $(nodist_libsane_plustek_la_OBJECTS) @@ -835,7 +923,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_plustek_pp_la_OBJECTS = \ libsane_plustek_pp_la-plustek_pp-s.lo libsane_plustek_pp_la_OBJECTS = \ @@ -853,7 +942,8 @@ $(libsane_pnm_la_LDFLAGS) $(LDFLAGS) -o $@ libsane_qcam_la_DEPENDENCIES = $(COMMON_LIBS) libqcam.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ - ../sanei/sanei_config.lo sane_strstatus.lo + ../sanei/sanei_config.lo sane_strstatus.lo \ + ../sanei/sanei_pio.lo nodist_libsane_qcam_la_OBJECTS = libsane_qcam_la-qcam-s.lo libsane_qcam_la_OBJECTS = $(nodist_libsane_qcam_la_OBJECTS) libsane_qcam_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -862,7 +952,8 @@ libsane_ricoh_la_DEPENDENCIES = $(COMMON_LIBS) libricoh.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_ricoh_la_OBJECTS = libsane_ricoh_la-ricoh-s.lo libsane_ricoh_la_OBJECTS = $(nodist_libsane_ricoh_la_OBJECTS) libsane_ricoh_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -872,6 +963,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_rts8891_la_OBJECTS = libsane_rts8891_la-rts8891-s.lo libsane_rts8891_la_OBJECTS = $(nodist_libsane_rts8891_la_OBJECTS) @@ -881,7 +973,8 @@ libsane_s9036_la_DEPENDENCIES = $(COMMON_LIBS) libs9036.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_s9036_la_OBJECTS = libsane_s9036_la-s9036-s.lo libsane_s9036_la_OBJECTS = $(nodist_libsane_s9036_la_OBJECTS) libsane_s9036_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -890,7 +983,8 @@ libsane_sceptre_la_DEPENDENCIES = $(COMMON_LIBS) libsceptre.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_sceptre_la_OBJECTS = libsane_sceptre_la-sceptre-s.lo libsane_sceptre_la_OBJECTS = $(nodist_libsane_sceptre_la_OBJECTS) libsane_sceptre_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -900,7 +994,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_sharp_la_OBJECTS = libsane_sharp_la-sharp-s.lo libsane_sharp_la_OBJECTS = $(nodist_libsane_sharp_la_OBJECTS) libsane_sharp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -909,7 +1003,8 @@ libsane_sm3600_la_DEPENDENCIES = $(COMMON_LIBS) libsm3600.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_sm3600_la_OBJECTS = libsane_sm3600_la-sm3600-s.lo libsane_sm3600_la_OBJECTS = $(nodist_libsane_sm3600_la_OBJECTS) libsane_sm3600_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -919,7 +1014,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_sm3840_la_OBJECTS = libsane_sm3840_la-sm3840-s.lo libsane_sm3840_la_OBJECTS = $(nodist_libsane_sm3840_la_OBJECTS) libsane_sm3840_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -931,6 +1026,7 @@ sane_strstatus.lo ../sanei/sanei_usb.lo \ ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nodist_libsane_snapscan_la_OBJECTS = \ libsane_snapscan_la-snapscan-s.lo @@ -942,7 +1038,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_thread.lo \ - ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_sp15c_la_OBJECTS = libsane_sp15c_la-sp15c-s.lo libsane_sp15c_la_OBJECTS = $(nodist_libsane_sp15c_la_OBJECTS) libsane_sp15c_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -951,7 +1048,8 @@ libsane_st400_la_DEPENDENCIES = $(COMMON_LIBS) libst400.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_st400_la_OBJECTS = libsane_st400_la-st400-s.lo libsane_st400_la_OBJECTS = $(nodist_libsane_st400_la_OBJECTS) libsane_st400_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -960,7 +1058,8 @@ libsane_stv680_la_DEPENDENCIES = $(COMMON_LIBS) libstv680.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_stv680_la_OBJECTS = libsane_stv680_la-stv680-s.lo libsane_stv680_la_OBJECTS = $(nodist_libsane_stv680_la_OBJECTS) libsane_stv680_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -970,7 +1069,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ sane_strstatus.lo ../sanei/sanei_thread.lo \ - ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_tamarack_la_OBJECTS = \ libsane_tamarack_la-tamarack-s.lo libsane_tamarack_la_OBJECTS = $(nodist_libsane_tamarack_la_OBJECTS) @@ -980,7 +1080,8 @@ libsane_teco1_la_DEPENDENCIES = $(COMMON_LIBS) libteco1.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_teco1_la_OBJECTS = libsane_teco1_la-teco1-s.lo libsane_teco1_la_OBJECTS = $(nodist_libsane_teco1_la_OBJECTS) libsane_teco1_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -989,7 +1090,8 @@ libsane_teco2_la_DEPENDENCIES = $(COMMON_LIBS) libteco2.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_teco2_la_OBJECTS = libsane_teco2_la-teco2-s.lo libsane_teco2_la_OBJECTS = $(nodist_libsane_teco2_la_OBJECTS) libsane_teco2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -998,7 +1100,8 @@ libsane_teco3_la_DEPENDENCIES = $(COMMON_LIBS) libteco3.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo ../sanei/sanei_config2.lo \ - sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) + sane_strstatus.lo ../sanei/sanei_scsi.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_teco3_la_OBJECTS = libsane_teco3_la-teco3-s.lo libsane_teco3_la_OBJECTS = $(nodist_libsane_teco3_la_OBJECTS) libsane_teco3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -1007,7 +1110,7 @@ libsane_test_la_DEPENDENCIES = $(COMMON_LIBS) libtest.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ - ../sanei/sanei_thread.lo + ../sanei/sanei_thread.lo $(am__DEPENDENCIES_1) nodist_libsane_test_la_OBJECTS = libsane_test_la-test-s.lo libsane_test_la_OBJECTS = $(nodist_libsane_test_la_OBJECTS) libsane_test_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -1017,6 +1120,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_u12_la_OBJECTS = libsane_u12_la-u12-s.lo libsane_u12_la_OBJECTS = $(nodist_libsane_u12_la_OBJECTS) @@ -1029,6 +1133,7 @@ sane_strstatus.lo ../sanei/sanei_usb.lo \ ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo \ ../sanei/sanei_pv8630.lo $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_umax_la_OBJECTS = libsane_umax_la-umax-s.lo libsane_umax_la_OBJECTS = $(nodist_libsane_umax_la_OBJECTS) @@ -1039,7 +1144,8 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) nodist_libsane_umax1220u_la_OBJECTS = \ libsane_umax1220u_la-umax1220u-s.lo libsane_umax1220u_la_OBJECTS = $(nodist_libsane_umax1220u_la_OBJECTS) @@ -1068,7 +1174,7 @@ ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo sane_strstatus.lo \ ../sanei/sanei_usb.lo $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_xerox_mfp_la_OBJECTS = \ libsane_xerox_mfp_la-xerox_mfp-s.lo libsane_xerox_mfp_la_OBJECTS = $(nodist_libsane_xerox_mfp_la_OBJECTS) @@ -1141,6 +1247,7 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/sane depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -1169,14 +1276,15 @@ $(libhp4200_la_SOURCES) $(libhp5400_la_SOURCES) \ $(libhp5590_la_SOURCES) $(libhpljm1005_la_SOURCES) \ $(libhpsj5s_la_SOURCES) $(libhs2p_la_SOURCES) \ - $(libibm_la_SOURCES) $(libleo_la_SOURCES) \ + $(libibm_la_SOURCES) $(libkodak_la_SOURCES) \ + $(libkvs1025_la_SOURCES) $(libleo_la_SOURCES) \ $(liblexmark_la_SOURCES) $(libma1509_la_SOURCES) \ $(libmatsushita_la_SOURCES) $(libmicrotek_la_SOURCES) \ $(libmicrotek2_la_SOURCES) $(libmustek_la_SOURCES) \ $(libmustek_pp_la_SOURCES) $(libmustek_usb_la_SOURCES) \ $(libmustek_usb2_la_SOURCES) $(libnec_la_SOURCES) \ $(libnet_la_SOURCES) $(libniash_la_SOURCES) \ - $(libpie_la_SOURCES) $(libpint_la_SOURCES) \ + $(libp5_la_SOURCES) $(libpie_la_SOURCES) $(libpint_la_SOURCES) \ $(libpixma_la_SOURCES) $(libplustek_la_SOURCES) \ $(libplustek_pp_la_SOURCES) $(libpnm_la_SOURCES) \ $(libqcam_la_SOURCES) $(libricoh_la_SOURCES) \ @@ -1220,6 +1328,8 @@ $(nodist_libsane_hpsj5s_la_SOURCES) \ $(nodist_libsane_hs2p_la_SOURCES) \ $(nodist_libsane_ibm_la_SOURCES) \ + $(nodist_libsane_kodak_la_SOURCES) \ + $(nodist_libsane_kvs1025_la_SOURCES) \ $(nodist_libsane_leo_la_SOURCES) \ $(nodist_libsane_lexmark_la_SOURCES) \ $(nodist_libsane_ma1509_la_SOURCES) \ @@ -1233,6 +1343,7 @@ $(nodist_libsane_nec_la_SOURCES) \ $(nodist_libsane_net_la_SOURCES) \ $(nodist_libsane_niash_la_SOURCES) \ + $(nodist_libsane_p5_la_SOURCES) \ $(nodist_libsane_pie_la_SOURCES) \ $(nodist_libsane_pint_la_SOURCES) \ $(nodist_libsane_pixma_la_SOURCES) \ @@ -1291,14 +1402,15 @@ $(libhp4200_la_SOURCES) $(libhp5400_la_SOURCES) \ $(libhp5590_la_SOURCES) $(libhpljm1005_la_SOURCES) \ $(libhpsj5s_la_SOURCES) $(libhs2p_la_SOURCES) \ - $(libibm_la_SOURCES) $(libleo_la_SOURCES) \ + $(libibm_la_SOURCES) $(libkodak_la_SOURCES) \ + $(libkvs1025_la_SOURCES) $(libleo_la_SOURCES) \ $(liblexmark_la_SOURCES) $(libma1509_la_SOURCES) \ $(libmatsushita_la_SOURCES) $(libmicrotek_la_SOURCES) \ $(libmicrotek2_la_SOURCES) $(libmustek_la_SOURCES) \ $(libmustek_pp_la_SOURCES) $(libmustek_usb_la_SOURCES) \ $(libmustek_usb2_la_SOURCES) $(libnec_la_SOURCES) \ $(libnet_la_SOURCES) $(libniash_la_SOURCES) \ - $(libpie_la_SOURCES) $(libpint_la_SOURCES) \ + $(libp5_la_SOURCES) $(libpie_la_SOURCES) $(libpint_la_SOURCES) \ $(libpixma_la_SOURCES) $(libplustek_la_SOURCES) \ $(libplustek_pp_la_SOURCES) $(libpnm_la_SOURCES) \ $(libqcam_la_SOURCES) $(libricoh_la_SOURCES) \ @@ -1358,7 +1470,7 @@ FFLAGS = @FFLAGS@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ -GPHOTO2_LIBS = @GPHOTO2_LIBS@ +GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ @@ -1408,6 +1520,7 @@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ +RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ @@ -1542,20 +1655,21 @@ hp5400_internal.h hp5400_sane.c hp5400_sanei.c hp5400_sanei.h \ hp5400_xfer.h hp5590_cmds.c hp5590_cmds.h hp5590_low.c \ hp5590_low.h hpsj5s.conf.in hs2p.conf.in hs2p-scsi.c \ - hs2p-scsi.h ibm.conf.in ibm-scsi.c leo.conf.in lexmark.conf.in \ - lexmark_models.c lexmark_sensors.c ma1509.conf.in \ - matsushita.conf.in microtek.conf.in microtek2.conf.in \ - mustek.conf.in mustek_scsi_pp.c mustek_scsi_pp.h \ - mustek_pp.conf.in mustek_pp_ccd300.c mustek_pp_ccd300.h \ - mustek_pp_cis.c mustek_pp_cis.h mustek_pp_null.c \ - mustek_usb.conf.in mustek_usb_high.c mustek_usb_high.h \ - mustek_usb_low.c mustek_usb_low.h mustek_usb_mid.c \ - mustek_usb_mid.h mustek_usb2_asic.c mustek_usb2_asic.h \ - mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_reflective.c \ - mustek_usb2_transparent.c nec.conf.in net.conf.in niash_core.c \ - niash_core.h niash_xfer.c niash_xfer.h pie.conf.in \ - pixma.conf.in pixma_sane_options.c pixma_sane_options.h \ - plustek.conf.in plustek-usb.c plustek-usb.h plustek-usbcal.c \ + hs2p-scsi.h ibm.conf.in ibm-scsi.c kodak.conf.in leo.conf.in \ + lexmark.conf.in lexmark_models.c lexmark_sensors.c \ + ma1509.conf.in matsushita.conf.in microtek.conf.in \ + microtek2.conf.in mustek.conf.in mustek_scsi_pp.c \ + mustek_scsi_pp.h mustek_pp.conf.in mustek_pp_ccd300.c \ + mustek_pp_ccd300.h mustek_pp_cis.c mustek_pp_cis.h \ + mustek_pp_null.c mustek_usb.conf.in mustek_usb_high.c \ + mustek_usb_high.h mustek_usb_low.c mustek_usb_low.h \ + mustek_usb_mid.c mustek_usb_mid.h mustek_usb2_asic.c \ + mustek_usb2_asic.h mustek_usb2_high.c mustek_usb2_high.h \ + mustek_usb2_reflective.c mustek_usb2_transparent.c nec.conf.in \ + net.conf.in niash_core.c niash_core.h niash_xfer.c \ + niash_xfer.h pie.conf.in p5.conf.in p5_device.c pixma.conf.in \ + pixma_sane_options.c pixma_sane_options.h plustek.conf.in \ + plustek-usb.c plustek-usb.h plustek-usbcal.c \ plustek-usbcalfile.c plustek-usbdevs.c plustek-usbhw.c \ plustek-usbimg.c plustek-usbio.c plustek-usbmap.c \ plustek-usbscan.c plustek-usbshading.c plustek_pp.conf.in \ @@ -1597,10 +1711,11 @@ dell1600n_net.conf dmc.conf epjitsu.conf epson2.conf \ epson.conf fujitsu.conf genesys.conf gphoto2.conf \ gt68xx.conf hp3900.conf hp4200.conf hp5400.conf \ - hp.conf hpsj5s.conf hs2p.conf ibm.conf leo.conf \ - lexmark.conf ma1509.conf matsushita.conf \ + hp.conf hpsj5s.conf hs2p.conf ibm.conf kodak.conf \ + leo.conf lexmark.conf ma1509.conf matsushita.conf \ microtek2.conf microtek.conf mustek.conf \ mustek_pp.conf mustek_usb.conf nec.conf net.conf \ + p5.conf \ pie.conf pixma.conf plustek.conf plustek_pp.conf \ qcam.conf ricoh.conf rts8891.conf s9036.conf sceptre.conf \ sharp.conf sm3840.conf snapscan.conf sp15c.conf \ @@ -1634,12 +1749,14 @@ libgphoto2_i.la libgt68xx.la libhp.la \ libhp3500.la libhp3900.la libhp4200.la \ libhp5400.la libhp5590.la libhpljm1005.la \ - libhpsj5s.la libhs2p.la libibm.la \ + libhpsj5s.la libhs2p.la libibm.la libkodak.la \ + libkvs1025.la \ libleo.la liblexmark.la libma1509.la \ libmatsushita.la libmicrotek.la libmicrotek2.la \ libmustek.la libmustek_pp.la libmustek_usb.la \ libmustek_usb2.la libnec.la libnet.la \ - libniash.la libpie.la libpint.la libpixma.la \ + libniash.la libp5.la \ + libpie.la libpint.la libpixma.la \ libplustek.la libplustek_pp.la libpnm.la \ libqcam.la libricoh.la librts8891.la \ libs9036.la libsceptre.la libsharp.la \ @@ -1666,12 +1783,14 @@ libsane-gphoto2.la libsane-gt68xx.la libsane-hp.la \ libsane-hp3500.la libsane-hp3900.la libsane-hp4200.la \ libsane-hp5400.la libsane-hp5590.la libsane-hpljm1005.la \ - libsane-hpsj5s.la libsane-hs2p.la libsane-ibm.la \ + libsane-hpsj5s.la libsane-hs2p.la libsane-ibm.la libsane-kodak.la \ + libsane-kvs1025.la \ libsane-leo.la libsane-lexmark.la libsane-ma1509.la \ libsane-matsushita.la libsane-microtek.la libsane-microtek2.la \ libsane-mustek.la libsane-mustek_pp.la libsane-mustek_usb.la \ libsane-mustek_usb2.la libsane-nec.la libsane-net.la \ - libsane-niash.la libsane-pie.la libsane-pint.la libsane-pixma.la \ + libsane-niash.la libsane-p5.la \ + libsane-pie.la libsane-pint.la libsane-pixma.la \ libsane-plustek.la libsane-plustek_pp.la libsane-pnm.la \ libsane-qcam.la libsane-ricoh.la libsane-rts8891.la \ libsane-s9036.la libsane-sceptre.la libsane-sharp.la \ @@ -1710,31 +1829,31 @@ nodist_libsane_abaton_la_SOURCES = abaton-s.c libsane_abaton_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=abaton libsane_abaton_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_abaton_la_LIBADD = $(COMMON_LIBS) libabaton.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_abaton_la_LIBADD = $(COMMON_LIBS) libabaton.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libagfafocus_la_SOURCES = agfafocus.c agfafocus.h libagfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus nodist_libsane_agfafocus_la_SOURCES = agfafocus-s.c libsane_agfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus libsane_agfafocus_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_agfafocus_la_LIBADD = $(COMMON_LIBS) libagfafocus.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_agfafocus_la_LIBADD = $(COMMON_LIBS) libagfafocus.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libapple_la_SOURCES = apple.c apple.h libapple_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=apple nodist_libsane_apple_la_SOURCES = apple-s.c libsane_apple_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=apple libsane_apple_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_apple_la_LIBADD = $(COMMON_LIBS) libapple.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_apple_la_LIBADD = $(COMMON_LIBS) libapple.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libartec_la_SOURCES = artec.c artec.h libartec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec nodist_libsane_artec_la_SOURCES = artec-s.c libsane_artec_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_artec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec -libsane_artec_la_LIBADD = $(COMMON_LIBS) libartec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_artec_la_LIBADD = $(COMMON_LIBS) libartec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libartec_eplus48u_la_SOURCES = artec_eplus48u.c artec_eplus48u.h libartec_eplus48u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec_eplus48u nodist_libsane_artec_eplus48u_la_SOURCES = artec_eplus48u-s.c libsane_artec_eplus48u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=artec_eplus48u libsane_artec_eplus48u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_artec_eplus48u_la_LIBADD = $(COMMON_LIBS) libartec_eplus48u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) +libsane_artec_eplus48u_la_LIBADD = $(COMMON_LIBS) libartec_eplus48u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMEG_LIBS) libas6e_la_SOURCES = as6e.c as6e.h libas6e_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=as6e nodist_libsane_as6e_la_SOURCES = as6e-s.c @@ -1746,31 +1865,31 @@ nodist_libsane_avision_la_SOURCES = avision-s.c libsane_avision_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=avision libsane_avision_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_avision_la_LIBADD = $(COMMON_LIBS) libavision.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_avision_la_LIBADD = $(COMMON_LIBS) libavision.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libbh_la_SOURCES = bh.c bh.h libbh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=bh nodist_libsane_bh_la_SOURCES = bh-s.c libsane_bh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=bh libsane_bh_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_bh_la_LIBADD = $(COMMON_LIBS) libbh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_bh_la_LIBADD = $(COMMON_LIBS) libbh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libcanon_la_SOURCES = canon.c canon.h libcanon_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon nodist_libsane_canon_la_SOURCES = canon-s.c libsane_canon_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon libsane_canon_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon_la_LIBADD = $(COMMON_LIBS) libcanon.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_canon_la_LIBADD = $(COMMON_LIBS) libcanon.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) libcanon630u_la_SOURCES = canon630u.c libcanon630u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon630u nodist_libsane_canon630u_la_SOURCES = canon630u-s.c libsane_canon630u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon630u libsane_canon630u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon630u_la_LIBADD = $(COMMON_LIBS) libcanon630u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_canon630u_la_LIBADD = $(COMMON_LIBS) libcanon630u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libcanon_dr_la_SOURCES = canon_dr.c canon_dr.h canon_dr-cmd.h libcanon_dr_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_dr nodist_libsane_canon_dr_la_SOURCES = canon_dr-s.c libsane_canon_dr_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_dr libsane_canon_dr_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_canon_dr_la_LIBADD = $(COMMON_LIBS) libcanon_dr.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_canon_dr_la_LIBADD = $(COMMON_LIBS) libcanon_dr.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) libcanon_pp_la_SOURCES = canon_pp.c canon_pp.h canon_pp-io.c canon_pp-io.h canon_pp-dev.c canon_pp-dev.h libcanon_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_pp nodist_libsane_canon_pp_la_SOURCES = canon_pp-s.c @@ -1782,25 +1901,25 @@ nodist_libsane_cardscan_la_SOURCES = cardscan-s.c libsane_cardscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=cardscan libsane_cardscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_cardscan_la_LIBADD = $(COMMON_LIBS) libcardscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_cardscan_la_LIBADD = $(COMMON_LIBS) libcardscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libcoolscan_la_SOURCES = coolscan.c coolscan.h coolscan-scsidef.h libcoolscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan nodist_libsane_coolscan_la_SOURCES = coolscan-s.c libsane_coolscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan libsane_coolscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan_la_LIBADD = $(COMMON_LIBS) libcoolscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_coolscan_la_LIBADD = $(COMMON_LIBS) libcoolscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libcoolscan2_la_SOURCES = coolscan2.c libcoolscan2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan2 nodist_libsane_coolscan2_la_SOURCES = coolscan2-s.c libsane_coolscan2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan2 libsane_coolscan2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan2_la_LIBADD = $(COMMON_LIBS) libcoolscan2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) +libsane_coolscan2_la_LIBADD = $(COMMON_LIBS) libcoolscan2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libcoolscan3_la_SOURCES = coolscan3.c libcoolscan3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan3 nodist_libsane_coolscan3_la_SOURCES = coolscan3-s.c libsane_coolscan3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=coolscan3 libsane_coolscan3_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_coolscan3_la_LIBADD = $(COMMON_LIBS) libcoolscan3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) +libsane_coolscan3_la_LIBADD = $(COMMON_LIBS) libcoolscan3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libdc25_la_SOURCES = dc25.c dc25.h libdc25_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dc25 nodist_libsane_dc25_la_SOURCES = dc25-s.c @@ -1830,91 +1949,91 @@ nodist_libsane_dmc_la_SOURCES = dmc-s.c libsane_dmc_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dmc libsane_dmc_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_dmc_la_LIBADD = $(COMMON_LIBS) libdmc.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_dmc_la_LIBADD = $(COMMON_LIBS) libdmc.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libepjitsu_la_SOURCES = epjitsu.c epjitsu.h epjitsu-cmd.h libepjitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epjitsu nodist_libsane_epjitsu_la_SOURCES = epjitsu-s.c libsane_epjitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epjitsu libsane_epjitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epjitsu_la_LIBADD = $(COMMON_LIBS) libepjitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_epjitsu_la_LIBADD = $(COMMON_LIBS) libepjitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libepson_la_SOURCES = epson.c epson.h epson_scsi.c epson_scsi.h epson_usb.c epson_usb.h libepson_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson nodist_libsane_epson_la_SOURCES = epson-s.c libsane_epson_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson libsane_epson_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epson_la_LIBADD = $(COMMON_LIBS) libepson.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo $(SCSI_LIBS) $(USB_LIBS) -libepson2_la_SOURCES = epson2.c epson2.h epson2_scsi.c epson2_scsi.h epson_usb.c epson2_net.c epson2_net.h epson2-io.c epson2-io.h epson2-commands.c epson2-commands.h +libsane_epson_la_LIBADD = $(COMMON_LIBS) libepson.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) +libepson2_la_SOURCES = epson2.c epson2.h epson2_scsi.c epson2_scsi.h epson_usb.c epson2_net.c epson2_net.h epson2-io.c epson2-io.h epson2-commands.c epson2-commands.h epson2-ops.c epson2-ops.h epson2-cct.c libepson2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson2 nodist_libsane_epson2_la_SOURCES = epson2-s.c libsane_epson2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=epson2 libsane_epson2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_epson2_la_LIBADD = $(COMMON_LIBS) libepson2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(SCSI_LIBS) $(USB_LIBS) $(SOCKET_LIBS) +libsane_epson2_la_LIBADD = $(COMMON_LIBS) libepson2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(SCSI_LIBS) $(USB_LIBS) $(SOCKET_LIBS) $(MATH_LIB) $(RESMGR_LIBS) libfujitsu_la_SOURCES = fujitsu.c fujitsu.h fujitsu-scsi.h libfujitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=fujitsu nodist_libsane_fujitsu_la_SOURCES = fujitsu-s.c libsane_fujitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=fujitsu libsane_fujitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) -libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl841.c genesys_low.h +libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_magic.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) +libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_low.h libgenesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys nodist_libsane_genesys_la_SOURCES = genesys-s.c libsane_genesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys libsane_genesys_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_genesys_la_LIBADD = $(COMMON_LIBS) libgenesys.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_genesys_la_LIBADD = $(COMMON_LIBS) libgenesys.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libgphoto2_i_la_SOURCES = gphoto2.c gphoto2.h libgphoto2_i_la_CPPFLAGS = $(AM_CPPFLAGS) @GPHOTO2_CPPFLAGS@ -DBACKEND_NAME=gphoto2 nodist_libsane_gphoto2_la_SOURCES = gphoto2-s.c libsane_gphoto2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gphoto2 libsane_gphoto2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_gphoto2_la_LIBADD = $(COMMON_LIBS) libgphoto2_i.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(GPHOTO2_LIBS) $(JPEG_LIBS) +libsane_gphoto2_la_LIBADD = $(GPHOTO2_LDFLAGS) $(COMMON_LIBS) libgphoto2_i.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(GPHOTO2_LIBS) $(JPEG_LIBS) libgt68xx_la_SOURCES = gt68xx.c gt68xx.h libgt68xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gt68xx nodist_libsane_gt68xx_la_SOURCES = gt68xx-s.c libsane_gt68xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gt68xx libsane_gt68xx_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_gt68xx_la_LIBADD = $(COMMON_LIBS) libgt68xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_gt68xx_la_LIBADD = $(COMMON_LIBS) libgt68xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libhp_la_SOURCES = hp.c hp.h hp-accessor.c hp-accessor.h hp-device.c hp-device.h hp-handle.c hp-handle.h hp-hpmem.c hp-option.c hp-option.h hp-scl.c hp-scl.h hp-scsi.h libhp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp nodist_libsane_hp_la_SOURCES = hp-s.c libsane_hp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp libsane_hp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp_la_LIBADD = $(COMMON_LIBS) libhp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_hp_la_LIBADD = $(COMMON_LIBS) libhp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pio.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libhp3500_la_SOURCES = hp3500.c libhp3500_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3500 nodist_libsane_hp3500_la_SOURCES = hp3500-s.c libsane_hp3500_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3500 libsane_hp3500_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp3500_la_LIBADD = $(COMMON_LIBS) libhp3500.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(USB_LIBS) +libsane_hp3500_la_LIBADD = $(COMMON_LIBS) libhp3500.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libhp3900_la_SOURCES = hp3900.c libhp3900_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3900 nodist_libsane_hp3900_la_SOURCES = hp3900-s.c libsane_hp3900_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp3900 libsane_hp3900_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp3900_la_LIBADD = $(COMMON_LIBS) libhp3900.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(TIFF_LIBS) $(USB_LIBS) +libsane_hp3900_la_LIBADD = $(COMMON_LIBS) libhp3900.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(TIFF_LIBS) $(USB_LIBS) $(RESMGR_LIBS) libhp4200_la_SOURCES = hp4200.c hp4200.h libhp4200_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp4200 nodist_libsane_hp4200_la_SOURCES = hp4200-s.c libsane_hp4200_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp4200 libsane_hp4200_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp4200_la_LIBADD = $(COMMON_LIBS) libhp4200.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) +libsane_hp4200_la_LIBADD = $(COMMON_LIBS) libhp4200.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libhp5400_la_SOURCES = hp5400.c hp5400.h libhp5400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5400 nodist_libsane_hp5400_la_SOURCES = hp5400-s.c libsane_hp5400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5400 libsane_hp5400_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp5400_la_LIBADD = $(COMMON_LIBS) libhp5400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_hp5400_la_LIBADD = $(COMMON_LIBS) libhp5400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libhp5590_la_SOURCES = hp5590.c libhp5590_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5590 nodist_libsane_hp5590_la_SOURCES = hp5590-s.c libsane_hp5590_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp5590 libsane_hp5590_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hp5590_la_LIBADD = $(COMMON_LIBS) libhp5590.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_hp5590_la_LIBADD = $(COMMON_LIBS) libhp5590.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libhpljm1005_la_SOURCES = hpljm1005.c libhpljm1005_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpljm1005 nodist_libsane_hpljm1005_la_SOURCES = hpljm1005-s.c libsane_hpljm1005_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpljm1005 libsane_hpljm1005_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hpljm1005_la_LIBADD = $(COMMON_LIBS) libhpljm1005.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_hpljm1005_la_LIBADD = $(COMMON_LIBS) libhpljm1005.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libhpsj5s_la_SOURCES = hpsj5s.c hpsj5s.h libhpsj5s_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpsj5s nodist_libsane_hpsj5s_la_SOURCES = hpsj5s-s.c @@ -1926,55 +2045,69 @@ nodist_libsane_hs2p_la_SOURCES = hs2p-s.c libsane_hs2p_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hs2p libsane_hs2p_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_hs2p_la_LIBADD = $(COMMON_LIBS) libhs2p.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_hs2p_la_LIBADD = $(COMMON_LIBS) libhs2p.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libibm_la_SOURCES = ibm.c ibm.h libibm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ibm nodist_libsane_ibm_la_SOURCES = ibm-s.c libsane_ibm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ibm libsane_ibm_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ibm_la_LIBADD = $(COMMON_LIBS) libibm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_ibm_la_LIBADD = $(COMMON_LIBS) libibm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) +libkodak_la_SOURCES = kodak.c kodak.h kodak-cmd.h +libkodak_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kodak +nodist_libsane_kodak_la_SOURCES = kodak-s.c +libsane_kodak_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kodak +libsane_kodak_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_kodak_la_LIBADD = $(COMMON_LIBS) libkodak.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) +libkvs1025_la_SOURCES = kvs1025.c kvs1025_low.c kvs1025_opt.c kvs1025_usb.c \ + kvs1025.h kvs1025_low.h kvs1025_usb.h kvs1025_cmds.h + +libkvs1025_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs1025 +nodist_libsane_kvs1025_la_SOURCES = kvs1025-s.c +libsane_kvs1025_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs1025 +libsane_kvs1025_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_kvs1025_la_LIBADD = $(COMMON_LIBS) libkvs1025.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libleo_la_SOURCES = leo.c leo.h libleo_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=leo nodist_libsane_leo_la_SOURCES = leo-s.c libsane_leo_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=leo libsane_leo_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_leo_la_LIBADD = $(COMMON_LIBS) libleo.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_leo_la_LIBADD = $(COMMON_LIBS) libleo.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) liblexmark_la_SOURCES = lexmark.c lexmark.h lexmark_low.c liblexmark_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark nodist_libsane_lexmark_la_SOURCES = lexmark-s.c libsane_lexmark_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark libsane_lexmark_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_lexmark_la_LIBADD = $(COMMON_LIBS) liblexmark.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_lexmark_la_LIBADD = $(COMMON_LIBS) liblexmark.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libma1509_la_SOURCES = ma1509.c ma1509.h libma1509_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ma1509 nodist_libsane_ma1509_la_SOURCES = ma1509-s.c libsane_ma1509_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ma1509 libsane_ma1509_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ma1509_la_LIBADD = $(COMMON_LIBS) libma1509.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_ma1509_la_LIBADD = $(COMMON_LIBS) libma1509.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libmatsushita_la_SOURCES = matsushita.c matsushita.h libmatsushita_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=matsushita nodist_libsane_matsushita_la_SOURCES = matsushita-s.c libsane_matsushita_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=matsushita libsane_matsushita_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_matsushita_la_LIBADD = $(COMMON_LIBS) libmatsushita.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_matsushita_la_LIBADD = $(COMMON_LIBS) libmatsushita.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libmicrotek_la_SOURCES = microtek.c microtek.h libmicrotek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek nodist_libsane_microtek_la_SOURCES = microtek-s.c libsane_microtek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek libsane_microtek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_microtek_la_LIBADD = $(COMMON_LIBS) libmicrotek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_microtek_la_LIBADD = $(COMMON_LIBS) libmicrotek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) libmicrotek2_la_SOURCES = microtek2.c microtek2.h libmicrotek2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek2 nodist_libsane_microtek2_la_SOURCES = microtek2-s.c libsane_microtek2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=microtek2 libsane_microtek2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_microtek2_la_LIBADD = $(COMMON_LIBS) libmicrotek2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_microtek2_la_LIBADD = $(COMMON_LIBS) libmicrotek2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libmustek_la_SOURCES = mustek.c mustek.h libmustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek nodist_libsane_mustek_la_SOURCES = mustek-s.c libsane_mustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek libsane_mustek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_la_LIBADD = $(COMMON_LIBS) libmustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pa4s2.lo $(IEEE1284_LIBS) $(SCSI_LIBS) +libsane_mustek_la_LIBADD = $(COMMON_LIBS) libmustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pa4s2.lo $(IEEE1284_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libmustek_pp_la_SOURCES = mustek_pp.c mustek_pp.h mustek_pp_decl.h mustek_pp_drivers.h libmustek_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_pp nodist_libsane_mustek_pp_la_SOURCES = mustek_pp-s.c @@ -1986,19 +2119,19 @@ nodist_libsane_mustek_usb_la_SOURCES = mustek_usb-s.c libsane_mustek_usb_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb libsane_mustek_usb_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libmustek_usb2_la_SOURCES = mustek_usb2.c mustek_usb2.h libmustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2 nodist_libsane_mustek_usb2_la_SOURCES = mustek_usb2-s.c libsane_mustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2 libsane_mustek_usb2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_mustek_usb2_la_LIBADD = $(COMMON_LIBS) libmustek_usb2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(PTHREAD_LIBS) $(USB_LIBS) +libsane_mustek_usb2_la_LIBADD = $(COMMON_LIBS) libmustek_usb2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(PTHREAD_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libnec_la_SOURCES = nec.c nec.h libnec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=nec nodist_libsane_nec_la_SOURCES = nec-s.c libsane_nec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=nec libsane_nec_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_nec_la_LIBADD = $(COMMON_LIBS) libnec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_nec_la_LIBADD = $(COMMON_LIBS) libnec.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) libnet_la_SOURCES = net.c net.h libnet_la_CPPFLAGS = $(AM_CPPFLAGS) @AVAHI_CFLAGS@ -DBACKEND_NAME=net nodist_libsane_net_la_SOURCES = net-s.c @@ -2010,13 +2143,19 @@ nodist_libsane_niash_la_SOURCES = niash-s.c libsane_niash_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=niash libsane_niash_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_niash_la_LIBADD = $(COMMON_LIBS) libniash.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_niash_la_LIBADD = $(COMMON_LIBS) libniash.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libpie_la_SOURCES = pie.c pie-scsidef.h libpie_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pie nodist_libsane_pie_la_SOURCES = pie-s.c libsane_pie_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pie libsane_pie_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pie_la_LIBADD = $(COMMON_LIBS) libpie.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) +libsane_pie_la_LIBADD = $(COMMON_LIBS) libpie.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) +libp5_la_SOURCES = p5.c p5.h p5_device.h +libp5_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=p5 +nodist_libsane_p5_la_SOURCES = p5-s.c +libsane_p5_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=p5 +libsane_p5_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_p5_la_LIBADD = $(COMMON_LIBS) libp5.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo libpint_la_SOURCES = pint.c pint.h libpint_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pint nodist_libsane_pint_la_SOURCES = pint-s.c @@ -2028,19 +2167,19 @@ nodist_libsane_pixma_la_SOURCES = pixma-s.c libsane_pixma_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pixma libsane_pixma_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pixma_la_LIBADD = $(COMMON_LIBS) libpixma.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) +libsane_pixma_la_LIBADD = $(COMMON_LIBS) libpixma.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libplustek_la_SOURCES = plustek.c plustek.h libplustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek nodist_libsane_plustek_la_SOURCES = plustek-s.c libsane_plustek_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek libsane_plustek_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_plustek_la_LIBADD = $(COMMON_LIBS) libplustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo $(MATH_LIB) $(USB_LIBS) +libsane_plustek_la_LIBADD = $(COMMON_LIBS) libplustek.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libplustek_pp_la_SOURCES = plustek_pp.c plustek-pp.h libplustek_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek_pp nodist_libsane_plustek_pp_la_SOURCES = plustek_pp-s.c libsane_plustek_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=plustek_pp libsane_plustek_pp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_plustek_pp_la_LIBADD = $(COMMON_LIBS) libplustek_pp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(IEEE1284_LIBS) +libsane_plustek_pp_la_LIBADD = $(COMMON_LIBS) libplustek_pp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(IEEE1284_LIBS) $(PTHREAD_LIBS) libpnm_la_SOURCES = pnm.c libpnm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pnm nodist_libsane_pnm_la_SOURCES = pnm-s.c @@ -2052,121 +2191,121 @@ nodist_libsane_qcam_la_SOURCES = qcam-s.c libsane_qcam_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=qcam libsane_qcam_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_qcam_la_LIBADD = $(COMMON_LIBS) libqcam.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +libsane_qcam_la_LIBADD = $(COMMON_LIBS) libqcam.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pio.lo libricoh_la_SOURCES = ricoh.c ricoh.h libricoh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ricoh nodist_libsane_ricoh_la_SOURCES = ricoh-s.c libsane_ricoh_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ricoh libsane_ricoh_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_ricoh_la_LIBADD = $(COMMON_LIBS) libricoh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_ricoh_la_LIBADD = $(COMMON_LIBS) libricoh.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) librts8891_la_SOURCES = rts8891.c rts8891.h rts88xx_lib.c rts88xx_lib.h librts8891_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=rts8891 nodist_libsane_rts8891_la_SOURCES = rts8891-s.c libsane_rts8891_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=rts8891 libsane_rts8891_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_rts8891_la_LIBADD = $(COMMON_LIBS) librts8891.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo $(SCSI_LIBS) $(USB_LIBS) +libsane_rts8891_la_LIBADD = $(COMMON_LIBS) librts8891.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) $(RESMGR_LIBS) libs9036_la_SOURCES = s9036.c s9036.h libs9036_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=s9036 nodist_libsane_s9036_la_SOURCES = s9036-s.c libsane_s9036_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=s9036 libsane_s9036_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_s9036_la_LIBADD = $(COMMON_LIBS) libs9036.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_s9036_la_LIBADD = $(COMMON_LIBS) libs9036.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libsceptre_la_SOURCES = sceptre.c sceptre.h libsceptre_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sceptre nodist_libsane_sceptre_la_SOURCES = sceptre-s.c libsane_sceptre_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sceptre libsane_sceptre_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sceptre_la_LIBADD = $(COMMON_LIBS) libsceptre.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_sceptre_la_LIBADD = $(COMMON_LIBS) libsceptre.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libsharp_la_SOURCES = sharp.c sharp.h libsharp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sharp nodist_libsane_sharp_la_SOURCES = sharp-s.c libsane_sharp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sharp libsane_sharp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sharp_la_LIBADD = $(COMMON_LIBS) libsharp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) +libsane_sharp_la_LIBADD = $(COMMON_LIBS) libsharp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) libsm3600_la_SOURCES = sm3600.c sm3600.h libsm3600_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3600 nodist_libsane_sm3600_la_SOURCES = sm3600-s.c libsane_sm3600_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3600 libsane_sm3600_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sm3600_la_LIBADD = $(COMMON_LIBS) libsm3600.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_sm3600_la_LIBADD = $(COMMON_LIBS) libsm3600.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libsm3840_la_SOURCES = sm3840.c sm3840.h sm3840_params.h libsm3840_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3840 nodist_libsane_sm3840_la_SOURCES = sm3840-s.c libsane_sm3840_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sm3840 libsane_sm3840_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sm3840_la_LIBADD = $(COMMON_LIBS) libsm3840.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_sm3840_la_LIBADD = $(COMMON_LIBS) libsm3840.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libsnapscan_la_SOURCES = snapscan.c snapscan.h libsnapscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=snapscan nodist_libsane_snapscan_la_SOURCES = snapscan-s.c libsane_snapscan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=snapscan libsane_snapscan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_snapscan_la_LIBADD = $(COMMON_LIBS) libsnapscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_snapscan_la_LIBADD = $(COMMON_LIBS) libsnapscan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libsp15c_la_SOURCES = sp15c.c sp15c.h sp15c-scsi.h libsp15c_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sp15c nodist_libsane_sp15c_la_SOURCES = sp15c-s.c libsane_sp15c_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=sp15c libsane_sp15c_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_sp15c_la_LIBADD = $(COMMON_LIBS) libsp15c.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_sp15c_la_LIBADD = $(COMMON_LIBS) libsp15c.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libst400_la_SOURCES = st400.c st400.h libst400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=st400 nodist_libsane_st400_la_SOURCES = st400-s.c ../sanei/sanei_scsi.lo libsane_st400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=st400 libsane_st400_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_st400_la_LIBADD = $(COMMON_LIBS) libst400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_st400_la_LIBADD = $(COMMON_LIBS) libst400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libstv680_la_SOURCES = stv680.c stv680.h libstv680_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=stv680 nodist_libsane_stv680_la_SOURCES = stv680-s.c libsane_stv680_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=stv680 libsane_stv680_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_stv680_la_LIBADD = $(COMMON_LIBS) libstv680.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) +libsane_stv680_la_LIBADD = $(COMMON_LIBS) libstv680.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) libtamarack_la_SOURCES = tamarack.c tamarack.h libtamarack_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=tamarack nodist_libsane_tamarack_la_SOURCES = tamarack-s.c libsane_tamarack_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=tamarack libsane_tamarack_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_tamarack_la_LIBADD = $(COMMON_LIBS) libtamarack.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_tamarack_la_LIBADD = $(COMMON_LIBS) libtamarack.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libtest_la_SOURCES = test.c test.h libtest_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=test nodist_libsane_test_la_SOURCES = test-s.c libsane_test_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=test libsane_test_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_test_la_LIBADD = $(COMMON_LIBS) libtest.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_thread.lo +libsane_test_la_LIBADD = $(COMMON_LIBS) libtest.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_thread.lo $(PTHREAD_LIBS) libteco1_la_SOURCES = teco1.c teco1.h libteco1_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco1 nodist_libsane_teco1_la_SOURCES = teco1-s.c libsane_teco1_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco1 libsane_teco1_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco1_la_LIBADD = $(COMMON_LIBS) libteco1.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco1_la_LIBADD = $(COMMON_LIBS) libteco1.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libteco2_la_SOURCES = teco2.c teco2.h libteco2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco2 nodist_libsane_teco2_la_SOURCES = teco2-s.c libsane_teco2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco2 libsane_teco2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco2_la_LIBADD = $(COMMON_LIBS) libteco2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco2_la_LIBADD = $(COMMON_LIBS) libteco2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libteco3_la_SOURCES = teco3.c teco3.h libteco3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco3 nodist_libsane_teco3_la_SOURCES = teco3-s.c libsane_teco3_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=teco3 libsane_teco3_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_teco3_la_LIBADD = $(COMMON_LIBS) libteco3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) +libsane_teco3_la_LIBADD = $(COMMON_LIBS) libteco3.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) libu12_la_SOURCES = u12.c u12.h libu12_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=u12 nodist_libsane_u12_la_SOURCES = u12-s.c libsane_u12_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=u12 libsane_u12_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_u12_la_LIBADD = $(COMMON_LIBS) libu12.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) +libsane_u12_la_LIBADD = $(COMMON_LIBS) libu12.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libumax_la_SOURCES = umax.c umax.h libumax_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax nodist_libsane_umax_la_SOURCES = umax-s.c libsane_umax_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax libsane_umax_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_umax_la_LIBADD = $(COMMON_LIBS) libumax.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) +libsane_umax_la_LIBADD = $(COMMON_LIBS) libumax.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) libumax1220u_la_SOURCES = umax1220u.c libumax1220u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax1220u nodist_libsane_umax1220u_la_SOURCES = umax1220u-s.c libsane_umax1220u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax1220u libsane_umax1220u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_umax1220u_la_LIBADD = $(COMMON_LIBS) libumax1220u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) +libsane_umax1220u_la_LIBADD = $(COMMON_LIBS) libumax1220u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libumax_pp_la_SOURCES = umax_pp.c umax_pp.h umax_pp_low.c umax_pp_low.h umax_pp_mid.c umax_pp_mid.h libumax_pp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax_pp nodist_libsane_umax_pp_la_SOURCES = umax_pp-s.c @@ -2184,7 +2323,7 @@ nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) +libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) libdll_la_SOURCES = dll.c BUILT_SOURCES = dll-preload.h libdll_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll @@ -2215,7 +2354,7 @@ nodist_libsane_la_SOURCES = dll-s.c libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS) -libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) +libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) # WARNING: Automake is getting this wrong so have to do it ourselves. libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo @SANEI_SANEI_JPEG_LO@ @@ -2228,14 +2367,14 @@ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu backend/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu backend/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu backend/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu backend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -2253,23 +2392,28 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: @@ -2283,20 +2427,24 @@ install-sanelibLTLIBRARIES: $(sanelib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(sanelibdir)" || $(MKDIR_P) "$(DESTDIR)$(sanelibdir)" - @list='$(sanelib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(sanelib_LTLIBRARIES)'; test -n "$(sanelibdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sanelibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(sanelibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sanelibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(sanelibdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(sanelibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(sanelibdir)"; \ + } uninstall-sanelibLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(sanelib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(sanelibdir)/$$p'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(sanelibdir)/$$p"; \ + @list='$(sanelib_LTLIBRARIES)'; test -n "$(sanelibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(sanelibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(sanelibdir)/$$f"; \ done clean-sanelibLTLIBRARIES: @@ -2385,6 +2533,10 @@ $(LINK) $(libhs2p_la_OBJECTS) $(libhs2p_la_LIBADD) $(LIBS) libibm.la: $(libibm_la_OBJECTS) $(libibm_la_DEPENDENCIES) $(LINK) $(libibm_la_OBJECTS) $(libibm_la_LIBADD) $(LIBS) +libkodak.la: $(libkodak_la_OBJECTS) $(libkodak_la_DEPENDENCIES) + $(LINK) $(libkodak_la_OBJECTS) $(libkodak_la_LIBADD) $(LIBS) +libkvs1025.la: $(libkvs1025_la_OBJECTS) $(libkvs1025_la_DEPENDENCIES) + $(LINK) $(libkvs1025_la_OBJECTS) $(libkvs1025_la_LIBADD) $(LIBS) libleo.la: $(libleo_la_OBJECTS) $(libleo_la_DEPENDENCIES) $(LINK) $(libleo_la_OBJECTS) $(libleo_la_LIBADD) $(LIBS) liblexmark.la: $(liblexmark_la_OBJECTS) $(liblexmark_la_DEPENDENCIES) @@ -2411,6 +2563,8 @@ $(LINK) $(libnet_la_OBJECTS) $(libnet_la_LIBADD) $(LIBS) libniash.la: $(libniash_la_OBJECTS) $(libniash_la_DEPENDENCIES) $(LINK) $(libniash_la_OBJECTS) $(libniash_la_LIBADD) $(LIBS) +libp5.la: $(libp5_la_OBJECTS) $(libp5_la_DEPENDENCIES) + $(LINK) $(libp5_la_OBJECTS) $(libp5_la_LIBADD) $(LIBS) libpie.la: $(libpie_la_OBJECTS) $(libpie_la_DEPENDENCIES) $(LINK) $(libpie_la_OBJECTS) $(libpie_la_LIBADD) $(LIBS) libpint.la: $(libpint_la_OBJECTS) $(libpint_la_DEPENDENCIES) @@ -2509,6 +2663,10 @@ $(libsane_hs2p_la_LINK) $(libsane_hs2p_la_OBJECTS) $(libsane_hs2p_la_LIBADD) $(LIBS) libsane-ibm.la: $(libsane_ibm_la_OBJECTS) $(libsane_ibm_la_DEPENDENCIES) $(libsane_ibm_la_LINK) $(libsane_ibm_la_OBJECTS) $(libsane_ibm_la_LIBADD) $(LIBS) +libsane-kodak.la: $(libsane_kodak_la_OBJECTS) $(libsane_kodak_la_DEPENDENCIES) + $(libsane_kodak_la_LINK) $(libsane_kodak_la_OBJECTS) $(libsane_kodak_la_LIBADD) $(LIBS) +libsane-kvs1025.la: $(libsane_kvs1025_la_OBJECTS) $(libsane_kvs1025_la_DEPENDENCIES) + $(libsane_kvs1025_la_LINK) $(libsane_kvs1025_la_OBJECTS) $(libsane_kvs1025_la_LIBADD) $(LIBS) libsane-leo.la: $(libsane_leo_la_OBJECTS) $(libsane_leo_la_DEPENDENCIES) $(libsane_leo_la_LINK) $(libsane_leo_la_OBJECTS) $(libsane_leo_la_LIBADD) $(LIBS) libsane-lexmark.la: $(libsane_lexmark_la_OBJECTS) $(libsane_lexmark_la_DEPENDENCIES) @@ -2535,6 +2693,8 @@ $(libsane_net_la_LINK) $(libsane_net_la_OBJECTS) $(libsane_net_la_LIBADD) $(LIBS) libsane-niash.la: $(libsane_niash_la_OBJECTS) $(libsane_niash_la_DEPENDENCIES) $(libsane_niash_la_LINK) $(libsane_niash_la_OBJECTS) $(libsane_niash_la_LIBADD) $(LIBS) +libsane-p5.la: $(libsane_p5_la_OBJECTS) $(libsane_p5_la_DEPENDENCIES) + $(libsane_p5_la_LINK) $(libsane_p5_la_OBJECTS) $(libsane_p5_la_LIBADD) $(LIBS) libsane-pie.la: $(libsane_pie_la_OBJECTS) $(libsane_pie_la_DEPENDENCIES) $(libsane_pie_la_LINK) $(libsane_pie_la_OBJECTS) $(libsane_pie_la_LIBADD) $(LIBS) libsane-pint.la: $(libsane_pint_la_OBJECTS) $(libsane_pint_la_DEPENDENCIES) @@ -2665,8 +2825,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdll_la-dll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdmc_la-dmc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepjitsu_la-epjitsu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2-cct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2-commands.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2-io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2-ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2_net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libepson2_la-epson2_scsi.Plo@am__quote@ @@ -2696,6 +2858,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhpsj5s_la-hpsj5s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhs2p_la-hs2p.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libibm_la-ibm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkodak_la-kodak.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkvs1025_la-kvs1025.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkvs1025_la-kvs1025_low.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkvs1025_la-kvs1025_opt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkvs1025_la-kvs1025_usb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libleo_la-leo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblexmark_la-lexmark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblexmark_la-lexmark_low.Plo@am__quote@ @@ -2710,6 +2877,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnec_la-nec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnet_la-net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libniash_la-niash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp5_la-p5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpie_la-pie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpint_la-pint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixma_la-pixma.Plo@am__quote@ @@ -2767,6 +2935,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_hs2p_la-hs2p-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_ibm_la-ibm-s.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_kodak_la-kodak-s.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_kvs1025_la-kvs1025-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_la-dll-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_leo_la-leo-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_lexmark_la-lexmark-s.Plo@am__quote@ @@ -2781,6 +2951,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_nec_la-nec-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_net_la-net-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_niash_la-niash-s.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_p5_la-p5-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_pie_la-pie-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_pint_la-pint-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_pixma_la-pixma-s.Plo@am__quote@ @@ -2834,1361 +3005,1438 @@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libabaton_la-abaton.lo: abaton.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libabaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libabaton_la-abaton.lo -MD -MP -MF $(DEPDIR)/libabaton_la-abaton.Tpo -c -o libabaton_la-abaton.lo `test -f 'abaton.c' || echo '$(srcdir)/'`abaton.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libabaton_la-abaton.Tpo $(DEPDIR)/libabaton_la-abaton.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libabaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libabaton_la-abaton.lo -MD -MP -MF $(DEPDIR)/libabaton_la-abaton.Tpo -c -o libabaton_la-abaton.lo `test -f 'abaton.c' || echo '$(srcdir)/'`abaton.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libabaton_la-abaton.Tpo $(DEPDIR)/libabaton_la-abaton.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='abaton.c' object='libabaton_la-abaton.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libabaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libabaton_la-abaton.lo `test -f 'abaton.c' || echo '$(srcdir)/'`abaton.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libabaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libabaton_la-abaton.lo `test -f 'abaton.c' || echo '$(srcdir)/'`abaton.c libagfafocus_la-agfafocus.lo: agfafocus.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libagfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libagfafocus_la-agfafocus.lo -MD -MP -MF $(DEPDIR)/libagfafocus_la-agfafocus.Tpo -c -o libagfafocus_la-agfafocus.lo `test -f 'agfafocus.c' || echo '$(srcdir)/'`agfafocus.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libagfafocus_la-agfafocus.Tpo $(DEPDIR)/libagfafocus_la-agfafocus.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libagfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libagfafocus_la-agfafocus.lo -MD -MP -MF $(DEPDIR)/libagfafocus_la-agfafocus.Tpo -c -o libagfafocus_la-agfafocus.lo `test -f 'agfafocus.c' || echo '$(srcdir)/'`agfafocus.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libagfafocus_la-agfafocus.Tpo $(DEPDIR)/libagfafocus_la-agfafocus.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='agfafocus.c' object='libagfafocus_la-agfafocus.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libagfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libagfafocus_la-agfafocus.lo `test -f 'agfafocus.c' || echo '$(srcdir)/'`agfafocus.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libagfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libagfafocus_la-agfafocus.lo `test -f 'agfafocus.c' || echo '$(srcdir)/'`agfafocus.c libapple_la-apple.lo: apple.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libapple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libapple_la-apple.lo -MD -MP -MF $(DEPDIR)/libapple_la-apple.Tpo -c -o libapple_la-apple.lo `test -f 'apple.c' || echo '$(srcdir)/'`apple.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libapple_la-apple.Tpo $(DEPDIR)/libapple_la-apple.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libapple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libapple_la-apple.lo -MD -MP -MF $(DEPDIR)/libapple_la-apple.Tpo -c -o libapple_la-apple.lo `test -f 'apple.c' || echo '$(srcdir)/'`apple.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libapple_la-apple.Tpo $(DEPDIR)/libapple_la-apple.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='apple.c' object='libapple_la-apple.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libapple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libapple_la-apple.lo `test -f 'apple.c' || echo '$(srcdir)/'`apple.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libapple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libapple_la-apple.lo `test -f 'apple.c' || echo '$(srcdir)/'`apple.c libartec_la-artec.lo: artec.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libartec_la-artec.lo -MD -MP -MF $(DEPDIR)/libartec_la-artec.Tpo -c -o libartec_la-artec.lo `test -f 'artec.c' || echo '$(srcdir)/'`artec.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libartec_la-artec.Tpo $(DEPDIR)/libartec_la-artec.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libartec_la-artec.lo -MD -MP -MF $(DEPDIR)/libartec_la-artec.Tpo -c -o libartec_la-artec.lo `test -f 'artec.c' || echo '$(srcdir)/'`artec.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libartec_la-artec.Tpo $(DEPDIR)/libartec_la-artec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='artec.c' object='libartec_la-artec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libartec_la-artec.lo `test -f 'artec.c' || echo '$(srcdir)/'`artec.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libartec_la-artec.lo `test -f 'artec.c' || echo '$(srcdir)/'`artec.c libartec_eplus48u_la-artec_eplus48u.lo: artec_eplus48u.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libartec_eplus48u_la-artec_eplus48u.lo -MD -MP -MF $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Tpo -c -o libartec_eplus48u_la-artec_eplus48u.lo `test -f 'artec_eplus48u.c' || echo '$(srcdir)/'`artec_eplus48u.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Tpo $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libartec_eplus48u_la-artec_eplus48u.lo -MD -MP -MF $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Tpo -c -o libartec_eplus48u_la-artec_eplus48u.lo `test -f 'artec_eplus48u.c' || echo '$(srcdir)/'`artec_eplus48u.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Tpo $(DEPDIR)/libartec_eplus48u_la-artec_eplus48u.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='artec_eplus48u.c' object='libartec_eplus48u_la-artec_eplus48u.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libartec_eplus48u_la-artec_eplus48u.lo `test -f 'artec_eplus48u.c' || echo '$(srcdir)/'`artec_eplus48u.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libartec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libartec_eplus48u_la-artec_eplus48u.lo `test -f 'artec_eplus48u.c' || echo '$(srcdir)/'`artec_eplus48u.c libas6e_la-as6e.lo: as6e.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libas6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libas6e_la-as6e.lo -MD -MP -MF $(DEPDIR)/libas6e_la-as6e.Tpo -c -o libas6e_la-as6e.lo `test -f 'as6e.c' || echo '$(srcdir)/'`as6e.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libas6e_la-as6e.Tpo $(DEPDIR)/libas6e_la-as6e.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libas6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libas6e_la-as6e.lo -MD -MP -MF $(DEPDIR)/libas6e_la-as6e.Tpo -c -o libas6e_la-as6e.lo `test -f 'as6e.c' || echo '$(srcdir)/'`as6e.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libas6e_la-as6e.Tpo $(DEPDIR)/libas6e_la-as6e.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='as6e.c' object='libas6e_la-as6e.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libas6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libas6e_la-as6e.lo `test -f 'as6e.c' || echo '$(srcdir)/'`as6e.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libas6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libas6e_la-as6e.lo `test -f 'as6e.c' || echo '$(srcdir)/'`as6e.c libavision_la-avision.lo: avision.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libavision_la-avision.lo -MD -MP -MF $(DEPDIR)/libavision_la-avision.Tpo -c -o libavision_la-avision.lo `test -f 'avision.c' || echo '$(srcdir)/'`avision.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libavision_la-avision.Tpo $(DEPDIR)/libavision_la-avision.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libavision_la-avision.lo -MD -MP -MF $(DEPDIR)/libavision_la-avision.Tpo -c -o libavision_la-avision.lo `test -f 'avision.c' || echo '$(srcdir)/'`avision.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libavision_la-avision.Tpo $(DEPDIR)/libavision_la-avision.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='avision.c' object='libavision_la-avision.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libavision_la-avision.lo `test -f 'avision.c' || echo '$(srcdir)/'`avision.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libavision_la-avision.lo `test -f 'avision.c' || echo '$(srcdir)/'`avision.c libbh_la-bh.lo: bh.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libbh_la-bh.lo -MD -MP -MF $(DEPDIR)/libbh_la-bh.Tpo -c -o libbh_la-bh.lo `test -f 'bh.c' || echo '$(srcdir)/'`bh.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libbh_la-bh.Tpo $(DEPDIR)/libbh_la-bh.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libbh_la-bh.lo -MD -MP -MF $(DEPDIR)/libbh_la-bh.Tpo -c -o libbh_la-bh.lo `test -f 'bh.c' || echo '$(srcdir)/'`bh.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbh_la-bh.Tpo $(DEPDIR)/libbh_la-bh.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bh.c' object='libbh_la-bh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libbh_la-bh.lo `test -f 'bh.c' || echo '$(srcdir)/'`bh.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libbh_la-bh.lo `test -f 'bh.c' || echo '$(srcdir)/'`bh.c libcanon_la-canon.lo: canon.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_la-canon.lo -MD -MP -MF $(DEPDIR)/libcanon_la-canon.Tpo -c -o libcanon_la-canon.lo `test -f 'canon.c' || echo '$(srcdir)/'`canon.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon_la-canon.Tpo $(DEPDIR)/libcanon_la-canon.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_la-canon.lo -MD -MP -MF $(DEPDIR)/libcanon_la-canon.Tpo -c -o libcanon_la-canon.lo `test -f 'canon.c' || echo '$(srcdir)/'`canon.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon_la-canon.Tpo $(DEPDIR)/libcanon_la-canon.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon.c' object='libcanon_la-canon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_la-canon.lo `test -f 'canon.c' || echo '$(srcdir)/'`canon.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_la-canon.lo `test -f 'canon.c' || echo '$(srcdir)/'`canon.c libcanon630u_la-canon630u.lo: canon630u.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon630u_la-canon630u.lo -MD -MP -MF $(DEPDIR)/libcanon630u_la-canon630u.Tpo -c -o libcanon630u_la-canon630u.lo `test -f 'canon630u.c' || echo '$(srcdir)/'`canon630u.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon630u_la-canon630u.Tpo $(DEPDIR)/libcanon630u_la-canon630u.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon630u_la-canon630u.lo -MD -MP -MF $(DEPDIR)/libcanon630u_la-canon630u.Tpo -c -o libcanon630u_la-canon630u.lo `test -f 'canon630u.c' || echo '$(srcdir)/'`canon630u.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon630u_la-canon630u.Tpo $(DEPDIR)/libcanon630u_la-canon630u.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon630u.c' object='libcanon630u_la-canon630u.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon630u_la-canon630u.lo `test -f 'canon630u.c' || echo '$(srcdir)/'`canon630u.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon630u_la-canon630u.lo `test -f 'canon630u.c' || echo '$(srcdir)/'`canon630u.c libcanon_dr_la-canon_dr.lo: canon_dr.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_dr_la-canon_dr.lo -MD -MP -MF $(DEPDIR)/libcanon_dr_la-canon_dr.Tpo -c -o libcanon_dr_la-canon_dr.lo `test -f 'canon_dr.c' || echo '$(srcdir)/'`canon_dr.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon_dr_la-canon_dr.Tpo $(DEPDIR)/libcanon_dr_la-canon_dr.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_dr_la-canon_dr.lo -MD -MP -MF $(DEPDIR)/libcanon_dr_la-canon_dr.Tpo -c -o libcanon_dr_la-canon_dr.lo `test -f 'canon_dr.c' || echo '$(srcdir)/'`canon_dr.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon_dr_la-canon_dr.Tpo $(DEPDIR)/libcanon_dr_la-canon_dr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_dr.c' object='libcanon_dr_la-canon_dr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_dr_la-canon_dr.lo `test -f 'canon_dr.c' || echo '$(srcdir)/'`canon_dr.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_dr_la-canon_dr.lo `test -f 'canon_dr.c' || echo '$(srcdir)/'`canon_dr.c libcanon_pp_la-canon_pp.lo: canon_pp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp.Tpo -c -o libcanon_pp_la-canon_pp.lo `test -f 'canon_pp.c' || echo '$(srcdir)/'`canon_pp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon_pp_la-canon_pp.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp.Tpo -c -o libcanon_pp_la-canon_pp.lo `test -f 'canon_pp.c' || echo '$(srcdir)/'`canon_pp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon_pp_la-canon_pp.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_pp.c' object='libcanon_pp_la-canon_pp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp.lo `test -f 'canon_pp.c' || echo '$(srcdir)/'`canon_pp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp.lo `test -f 'canon_pp.c' || echo '$(srcdir)/'`canon_pp.c libcanon_pp_la-canon_pp-io.lo: canon_pp-io.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp-io.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp-io.Tpo -c -o libcanon_pp_la-canon_pp-io.lo `test -f 'canon_pp-io.c' || echo '$(srcdir)/'`canon_pp-io.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon_pp_la-canon_pp-io.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp-io.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp-io.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp-io.Tpo -c -o libcanon_pp_la-canon_pp-io.lo `test -f 'canon_pp-io.c' || echo '$(srcdir)/'`canon_pp-io.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon_pp_la-canon_pp-io.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_pp-io.c' object='libcanon_pp_la-canon_pp-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp-io.lo `test -f 'canon_pp-io.c' || echo '$(srcdir)/'`canon_pp-io.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp-io.lo `test -f 'canon_pp-io.c' || echo '$(srcdir)/'`canon_pp-io.c libcanon_pp_la-canon_pp-dev.lo: canon_pp-dev.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp-dev.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Tpo -c -o libcanon_pp_la-canon_pp-dev.lo `test -f 'canon_pp-dev.c' || echo '$(srcdir)/'`canon_pp-dev.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcanon_pp_la-canon_pp-dev.lo -MD -MP -MF $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Tpo -c -o libcanon_pp_la-canon_pp-dev.lo `test -f 'canon_pp-dev.c' || echo '$(srcdir)/'`canon_pp-dev.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Tpo $(DEPDIR)/libcanon_pp_la-canon_pp-dev.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_pp-dev.c' object='libcanon_pp_la-canon_pp-dev.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp-dev.lo `test -f 'canon_pp-dev.c' || echo '$(srcdir)/'`canon_pp-dev.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcanon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcanon_pp_la-canon_pp-dev.lo `test -f 'canon_pp-dev.c' || echo '$(srcdir)/'`canon_pp-dev.c libcardscan_la-cardscan.lo: cardscan.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcardscan_la-cardscan.lo -MD -MP -MF $(DEPDIR)/libcardscan_la-cardscan.Tpo -c -o libcardscan_la-cardscan.lo `test -f 'cardscan.c' || echo '$(srcdir)/'`cardscan.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcardscan_la-cardscan.Tpo $(DEPDIR)/libcardscan_la-cardscan.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcardscan_la-cardscan.lo -MD -MP -MF $(DEPDIR)/libcardscan_la-cardscan.Tpo -c -o libcardscan_la-cardscan.lo `test -f 'cardscan.c' || echo '$(srcdir)/'`cardscan.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcardscan_la-cardscan.Tpo $(DEPDIR)/libcardscan_la-cardscan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cardscan.c' object='libcardscan_la-cardscan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcardscan_la-cardscan.lo `test -f 'cardscan.c' || echo '$(srcdir)/'`cardscan.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcardscan_la-cardscan.lo `test -f 'cardscan.c' || echo '$(srcdir)/'`cardscan.c libcoolscan_la-coolscan.lo: coolscan.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan_la-coolscan.lo -MD -MP -MF $(DEPDIR)/libcoolscan_la-coolscan.Tpo -c -o libcoolscan_la-coolscan.lo `test -f 'coolscan.c' || echo '$(srcdir)/'`coolscan.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcoolscan_la-coolscan.Tpo $(DEPDIR)/libcoolscan_la-coolscan.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan_la-coolscan.lo -MD -MP -MF $(DEPDIR)/libcoolscan_la-coolscan.Tpo -c -o libcoolscan_la-coolscan.lo `test -f 'coolscan.c' || echo '$(srcdir)/'`coolscan.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcoolscan_la-coolscan.Tpo $(DEPDIR)/libcoolscan_la-coolscan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan.c' object='libcoolscan_la-coolscan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan_la-coolscan.lo `test -f 'coolscan.c' || echo '$(srcdir)/'`coolscan.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan_la-coolscan.lo `test -f 'coolscan.c' || echo '$(srcdir)/'`coolscan.c libcoolscan2_la-coolscan2.lo: coolscan2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan2_la-coolscan2.lo -MD -MP -MF $(DEPDIR)/libcoolscan2_la-coolscan2.Tpo -c -o libcoolscan2_la-coolscan2.lo `test -f 'coolscan2.c' || echo '$(srcdir)/'`coolscan2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcoolscan2_la-coolscan2.Tpo $(DEPDIR)/libcoolscan2_la-coolscan2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan2_la-coolscan2.lo -MD -MP -MF $(DEPDIR)/libcoolscan2_la-coolscan2.Tpo -c -o libcoolscan2_la-coolscan2.lo `test -f 'coolscan2.c' || echo '$(srcdir)/'`coolscan2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcoolscan2_la-coolscan2.Tpo $(DEPDIR)/libcoolscan2_la-coolscan2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan2.c' object='libcoolscan2_la-coolscan2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan2_la-coolscan2.lo `test -f 'coolscan2.c' || echo '$(srcdir)/'`coolscan2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan2_la-coolscan2.lo `test -f 'coolscan2.c' || echo '$(srcdir)/'`coolscan2.c libcoolscan3_la-coolscan3.lo: coolscan3.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan3_la-coolscan3.lo -MD -MP -MF $(DEPDIR)/libcoolscan3_la-coolscan3.Tpo -c -o libcoolscan3_la-coolscan3.lo `test -f 'coolscan3.c' || echo '$(srcdir)/'`coolscan3.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcoolscan3_la-coolscan3.Tpo $(DEPDIR)/libcoolscan3_la-coolscan3.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcoolscan3_la-coolscan3.lo -MD -MP -MF $(DEPDIR)/libcoolscan3_la-coolscan3.Tpo -c -o libcoolscan3_la-coolscan3.lo `test -f 'coolscan3.c' || echo '$(srcdir)/'`coolscan3.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcoolscan3_la-coolscan3.Tpo $(DEPDIR)/libcoolscan3_la-coolscan3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan3.c' object='libcoolscan3_la-coolscan3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan3_la-coolscan3.lo `test -f 'coolscan3.c' || echo '$(srcdir)/'`coolscan3.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcoolscan3_la-coolscan3.lo `test -f 'coolscan3.c' || echo '$(srcdir)/'`coolscan3.c libdc210_la-dc210.lo: dc210.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc210_la-dc210.lo -MD -MP -MF $(DEPDIR)/libdc210_la-dc210.Tpo -c -o libdc210_la-dc210.lo `test -f 'dc210.c' || echo '$(srcdir)/'`dc210.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdc210_la-dc210.Tpo $(DEPDIR)/libdc210_la-dc210.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc210_la-dc210.lo -MD -MP -MF $(DEPDIR)/libdc210_la-dc210.Tpo -c -o libdc210_la-dc210.lo `test -f 'dc210.c' || echo '$(srcdir)/'`dc210.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdc210_la-dc210.Tpo $(DEPDIR)/libdc210_la-dc210.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc210.c' object='libdc210_la-dc210.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc210_la-dc210.lo `test -f 'dc210.c' || echo '$(srcdir)/'`dc210.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc210_la-dc210.lo `test -f 'dc210.c' || echo '$(srcdir)/'`dc210.c libdc240_la-dc240.lo: dc240.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc240_la-dc240.lo -MD -MP -MF $(DEPDIR)/libdc240_la-dc240.Tpo -c -o libdc240_la-dc240.lo `test -f 'dc240.c' || echo '$(srcdir)/'`dc240.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdc240_la-dc240.Tpo $(DEPDIR)/libdc240_la-dc240.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc240_la-dc240.lo -MD -MP -MF $(DEPDIR)/libdc240_la-dc240.Tpo -c -o libdc240_la-dc240.lo `test -f 'dc240.c' || echo '$(srcdir)/'`dc240.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdc240_la-dc240.Tpo $(DEPDIR)/libdc240_la-dc240.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc240.c' object='libdc240_la-dc240.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc240_la-dc240.lo `test -f 'dc240.c' || echo '$(srcdir)/'`dc240.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc240_la-dc240.lo `test -f 'dc240.c' || echo '$(srcdir)/'`dc240.c libdc25_la-dc25.lo: dc25.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc25_la-dc25.lo -MD -MP -MF $(DEPDIR)/libdc25_la-dc25.Tpo -c -o libdc25_la-dc25.lo `test -f 'dc25.c' || echo '$(srcdir)/'`dc25.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdc25_la-dc25.Tpo $(DEPDIR)/libdc25_la-dc25.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdc25_la-dc25.lo -MD -MP -MF $(DEPDIR)/libdc25_la-dc25.Tpo -c -o libdc25_la-dc25.lo `test -f 'dc25.c' || echo '$(srcdir)/'`dc25.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdc25_la-dc25.Tpo $(DEPDIR)/libdc25_la-dc25.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc25.c' object='libdc25_la-dc25.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc25_la-dc25.lo `test -f 'dc25.c' || echo '$(srcdir)/'`dc25.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdc25_la-dc25.lo `test -f 'dc25.c' || echo '$(srcdir)/'`dc25.c libdell1600n_net_la-dell1600n_net.lo: dell1600n_net.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdell1600n_net_la-dell1600n_net.lo -MD -MP -MF $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Tpo -c -o libdell1600n_net_la-dell1600n_net.lo `test -f 'dell1600n_net.c' || echo '$(srcdir)/'`dell1600n_net.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Tpo $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdell1600n_net_la-dell1600n_net.lo -MD -MP -MF $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Tpo -c -o libdell1600n_net_la-dell1600n_net.lo `test -f 'dell1600n_net.c' || echo '$(srcdir)/'`dell1600n_net.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Tpo $(DEPDIR)/libdell1600n_net_la-dell1600n_net.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dell1600n_net.c' object='libdell1600n_net_la-dell1600n_net.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdell1600n_net_la-dell1600n_net.lo `test -f 'dell1600n_net.c' || echo '$(srcdir)/'`dell1600n_net.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdell1600n_net_la-dell1600n_net.lo `test -f 'dell1600n_net.c' || echo '$(srcdir)/'`dell1600n_net.c libdll_la-dll.lo: dll.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdll_la-dll.lo -MD -MP -MF $(DEPDIR)/libdll_la-dll.Tpo -c -o libdll_la-dll.lo `test -f 'dll.c' || echo '$(srcdir)/'`dll.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdll_la-dll.Tpo $(DEPDIR)/libdll_la-dll.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdll_la-dll.lo -MD -MP -MF $(DEPDIR)/libdll_la-dll.Tpo -c -o libdll_la-dll.lo `test -f 'dll.c' || echo '$(srcdir)/'`dll.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdll_la-dll.Tpo $(DEPDIR)/libdll_la-dll.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dll.c' object='libdll_la-dll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdll_la-dll.lo `test -f 'dll.c' || echo '$(srcdir)/'`dll.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdll_la-dll.lo `test -f 'dll.c' || echo '$(srcdir)/'`dll.c libdmc_la-dmc.lo: dmc.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdmc_la-dmc.lo -MD -MP -MF $(DEPDIR)/libdmc_la-dmc.Tpo -c -o libdmc_la-dmc.lo `test -f 'dmc.c' || echo '$(srcdir)/'`dmc.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdmc_la-dmc.Tpo $(DEPDIR)/libdmc_la-dmc.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdmc_la-dmc.lo -MD -MP -MF $(DEPDIR)/libdmc_la-dmc.Tpo -c -o libdmc_la-dmc.lo `test -f 'dmc.c' || echo '$(srcdir)/'`dmc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdmc_la-dmc.Tpo $(DEPDIR)/libdmc_la-dmc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dmc.c' object='libdmc_la-dmc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdmc_la-dmc.lo `test -f 'dmc.c' || echo '$(srcdir)/'`dmc.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdmc_la-dmc.lo `test -f 'dmc.c' || echo '$(srcdir)/'`dmc.c libepjitsu_la-epjitsu.lo: epjitsu.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepjitsu_la-epjitsu.lo -MD -MP -MF $(DEPDIR)/libepjitsu_la-epjitsu.Tpo -c -o libepjitsu_la-epjitsu.lo `test -f 'epjitsu.c' || echo '$(srcdir)/'`epjitsu.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepjitsu_la-epjitsu.Tpo $(DEPDIR)/libepjitsu_la-epjitsu.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepjitsu_la-epjitsu.lo -MD -MP -MF $(DEPDIR)/libepjitsu_la-epjitsu.Tpo -c -o libepjitsu_la-epjitsu.lo `test -f 'epjitsu.c' || echo '$(srcdir)/'`epjitsu.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepjitsu_la-epjitsu.Tpo $(DEPDIR)/libepjitsu_la-epjitsu.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epjitsu.c' object='libepjitsu_la-epjitsu.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepjitsu_la-epjitsu.lo `test -f 'epjitsu.c' || echo '$(srcdir)/'`epjitsu.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepjitsu_la-epjitsu.lo `test -f 'epjitsu.c' || echo '$(srcdir)/'`epjitsu.c libepson_la-epson.lo: epson.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson.Tpo -c -o libepson_la-epson.lo `test -f 'epson.c' || echo '$(srcdir)/'`epson.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson_la-epson.Tpo $(DEPDIR)/libepson_la-epson.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson.Tpo -c -o libepson_la-epson.lo `test -f 'epson.c' || echo '$(srcdir)/'`epson.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson_la-epson.Tpo $(DEPDIR)/libepson_la-epson.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson.c' object='libepson_la-epson.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson.lo `test -f 'epson.c' || echo '$(srcdir)/'`epson.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson.lo `test -f 'epson.c' || echo '$(srcdir)/'`epson.c libepson_la-epson_scsi.lo: epson_scsi.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson_scsi.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson_scsi.Tpo -c -o libepson_la-epson_scsi.lo `test -f 'epson_scsi.c' || echo '$(srcdir)/'`epson_scsi.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson_la-epson_scsi.Tpo $(DEPDIR)/libepson_la-epson_scsi.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson_scsi.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson_scsi.Tpo -c -o libepson_la-epson_scsi.lo `test -f 'epson_scsi.c' || echo '$(srcdir)/'`epson_scsi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson_la-epson_scsi.Tpo $(DEPDIR)/libepson_la-epson_scsi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson_scsi.c' object='libepson_la-epson_scsi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson_scsi.lo `test -f 'epson_scsi.c' || echo '$(srcdir)/'`epson_scsi.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson_scsi.lo `test -f 'epson_scsi.c' || echo '$(srcdir)/'`epson_scsi.c libepson_la-epson_usb.lo: epson_usb.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson_usb.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson_usb.Tpo -c -o libepson_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson_la-epson_usb.Tpo $(DEPDIR)/libepson_la-epson_usb.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson_la-epson_usb.lo -MD -MP -MF $(DEPDIR)/libepson_la-epson_usb.Tpo -c -o libepson_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson_la-epson_usb.Tpo $(DEPDIR)/libepson_la-epson_usb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson_usb.c' object='libepson_la-epson_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c libepson2_la-epson2.lo: epson2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2.Tpo -c -o libepson2_la-epson2.lo `test -f 'epson2.c' || echo '$(srcdir)/'`epson2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson2.Tpo $(DEPDIR)/libepson2_la-epson2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2.Tpo -c -o libepson2_la-epson2.lo `test -f 'epson2.c' || echo '$(srcdir)/'`epson2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2.Tpo $(DEPDIR)/libepson2_la-epson2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2.c' object='libepson2_la-epson2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2.lo `test -f 'epson2.c' || echo '$(srcdir)/'`epson2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2.lo `test -f 'epson2.c' || echo '$(srcdir)/'`epson2.c libepson2_la-epson2_scsi.lo: epson2_scsi.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2_scsi.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2_scsi.Tpo -c -o libepson2_la-epson2_scsi.lo `test -f 'epson2_scsi.c' || echo '$(srcdir)/'`epson2_scsi.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson2_scsi.Tpo $(DEPDIR)/libepson2_la-epson2_scsi.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2_scsi.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2_scsi.Tpo -c -o libepson2_la-epson2_scsi.lo `test -f 'epson2_scsi.c' || echo '$(srcdir)/'`epson2_scsi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2_scsi.Tpo $(DEPDIR)/libepson2_la-epson2_scsi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2_scsi.c' object='libepson2_la-epson2_scsi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2_scsi.lo `test -f 'epson2_scsi.c' || echo '$(srcdir)/'`epson2_scsi.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2_scsi.lo `test -f 'epson2_scsi.c' || echo '$(srcdir)/'`epson2_scsi.c libepson2_la-epson_usb.lo: epson_usb.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson_usb.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson_usb.Tpo -c -o libepson2_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson_usb.Tpo $(DEPDIR)/libepson2_la-epson_usb.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson_usb.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson_usb.Tpo -c -o libepson2_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson_usb.Tpo $(DEPDIR)/libepson2_la-epson_usb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson_usb.c' object='libepson2_la-epson_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson_usb.lo `test -f 'epson_usb.c' || echo '$(srcdir)/'`epson_usb.c libepson2_la-epson2_net.lo: epson2_net.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2_net.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2_net.Tpo -c -o libepson2_la-epson2_net.lo `test -f 'epson2_net.c' || echo '$(srcdir)/'`epson2_net.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson2_net.Tpo $(DEPDIR)/libepson2_la-epson2_net.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2_net.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2_net.Tpo -c -o libepson2_la-epson2_net.lo `test -f 'epson2_net.c' || echo '$(srcdir)/'`epson2_net.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2_net.Tpo $(DEPDIR)/libepson2_la-epson2_net.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2_net.c' object='libepson2_la-epson2_net.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2_net.lo `test -f 'epson2_net.c' || echo '$(srcdir)/'`epson2_net.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2_net.lo `test -f 'epson2_net.c' || echo '$(srcdir)/'`epson2_net.c libepson2_la-epson2-io.lo: epson2-io.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-io.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-io.Tpo -c -o libepson2_la-epson2-io.lo `test -f 'epson2-io.c' || echo '$(srcdir)/'`epson2-io.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson2-io.Tpo $(DEPDIR)/libepson2_la-epson2-io.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-io.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-io.Tpo -c -o libepson2_la-epson2-io.lo `test -f 'epson2-io.c' || echo '$(srcdir)/'`epson2-io.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2-io.Tpo $(DEPDIR)/libepson2_la-epson2-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2-io.c' object='libepson2_la-epson2-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-io.lo `test -f 'epson2-io.c' || echo '$(srcdir)/'`epson2-io.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-io.lo `test -f 'epson2-io.c' || echo '$(srcdir)/'`epson2-io.c libepson2_la-epson2-commands.lo: epson2-commands.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-commands.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-commands.Tpo -c -o libepson2_la-epson2-commands.lo `test -f 'epson2-commands.c' || echo '$(srcdir)/'`epson2-commands.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libepson2_la-epson2-commands.Tpo $(DEPDIR)/libepson2_la-epson2-commands.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-commands.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-commands.Tpo -c -o libepson2_la-epson2-commands.lo `test -f 'epson2-commands.c' || echo '$(srcdir)/'`epson2-commands.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2-commands.Tpo $(DEPDIR)/libepson2_la-epson2-commands.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2-commands.c' object='libepson2_la-epson2-commands.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-commands.lo `test -f 'epson2-commands.c' || echo '$(srcdir)/'`epson2-commands.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-commands.lo `test -f 'epson2-commands.c' || echo '$(srcdir)/'`epson2-commands.c + +libepson2_la-epson2-ops.lo: epson2-ops.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-ops.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-ops.Tpo -c -o libepson2_la-epson2-ops.lo `test -f 'epson2-ops.c' || echo '$(srcdir)/'`epson2-ops.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2-ops.Tpo $(DEPDIR)/libepson2_la-epson2-ops.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2-ops.c' object='libepson2_la-epson2-ops.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-ops.lo `test -f 'epson2-ops.c' || echo '$(srcdir)/'`epson2-ops.c + +libepson2_la-epson2-cct.lo: epson2-cct.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libepson2_la-epson2-cct.lo -MD -MP -MF $(DEPDIR)/libepson2_la-epson2-cct.Tpo -c -o libepson2_la-epson2-cct.lo `test -f 'epson2-cct.c' || echo '$(srcdir)/'`epson2-cct.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libepson2_la-epson2-cct.Tpo $(DEPDIR)/libepson2_la-epson2-cct.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2-cct.c' object='libepson2_la-epson2-cct.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libepson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libepson2_la-epson2-cct.lo `test -f 'epson2-cct.c' || echo '$(srcdir)/'`epson2-cct.c libfujitsu_la-fujitsu.lo: fujitsu.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libfujitsu_la-fujitsu.lo -MD -MP -MF $(DEPDIR)/libfujitsu_la-fujitsu.Tpo -c -o libfujitsu_la-fujitsu.lo `test -f 'fujitsu.c' || echo '$(srcdir)/'`fujitsu.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libfujitsu_la-fujitsu.Tpo $(DEPDIR)/libfujitsu_la-fujitsu.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libfujitsu_la-fujitsu.lo -MD -MP -MF $(DEPDIR)/libfujitsu_la-fujitsu.Tpo -c -o libfujitsu_la-fujitsu.lo `test -f 'fujitsu.c' || echo '$(srcdir)/'`fujitsu.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfujitsu_la-fujitsu.Tpo $(DEPDIR)/libfujitsu_la-fujitsu.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fujitsu.c' object='libfujitsu_la-fujitsu.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libfujitsu_la-fujitsu.lo `test -f 'fujitsu.c' || echo '$(srcdir)/'`fujitsu.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libfujitsu_la-fujitsu.lo `test -f 'fujitsu.c' || echo '$(srcdir)/'`fujitsu.c libgenesys_la-genesys.lo: genesys.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys.Tpo -c -o libgenesys_la-genesys.lo `test -f 'genesys.c' || echo '$(srcdir)/'`genesys.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libgenesys_la-genesys.Tpo $(DEPDIR)/libgenesys_la-genesys.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys.Tpo -c -o libgenesys_la-genesys.lo `test -f 'genesys.c' || echo '$(srcdir)/'`genesys.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgenesys_la-genesys.Tpo $(DEPDIR)/libgenesys_la-genesys.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genesys.c' object='libgenesys_la-genesys.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys.lo `test -f 'genesys.c' || echo '$(srcdir)/'`genesys.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys.lo `test -f 'genesys.c' || echo '$(srcdir)/'`genesys.c libgenesys_la-genesys_gl646.lo: genesys_gl646.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl646.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl646.Tpo -c -o libgenesys_la-genesys_gl646.lo `test -f 'genesys_gl646.c' || echo '$(srcdir)/'`genesys_gl646.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libgenesys_la-genesys_gl646.Tpo $(DEPDIR)/libgenesys_la-genesys_gl646.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl646.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl646.Tpo -c -o libgenesys_la-genesys_gl646.lo `test -f 'genesys_gl646.c' || echo '$(srcdir)/'`genesys_gl646.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgenesys_la-genesys_gl646.Tpo $(DEPDIR)/libgenesys_la-genesys_gl646.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genesys_gl646.c' object='libgenesys_la-genesys_gl646.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl646.lo `test -f 'genesys_gl646.c' || echo '$(srcdir)/'`genesys_gl646.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl646.lo `test -f 'genesys_gl646.c' || echo '$(srcdir)/'`genesys_gl646.c libgenesys_la-genesys_gl841.lo: genesys_gl841.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl841.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl841.Tpo -c -o libgenesys_la-genesys_gl841.lo `test -f 'genesys_gl841.c' || echo '$(srcdir)/'`genesys_gl841.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libgenesys_la-genesys_gl841.Tpo $(DEPDIR)/libgenesys_la-genesys_gl841.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl841.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl841.Tpo -c -o libgenesys_la-genesys_gl841.lo `test -f 'genesys_gl841.c' || echo '$(srcdir)/'`genesys_gl841.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgenesys_la-genesys_gl841.Tpo $(DEPDIR)/libgenesys_la-genesys_gl841.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genesys_gl841.c' object='libgenesys_la-genesys_gl841.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl841.lo `test -f 'genesys_gl841.c' || echo '$(srcdir)/'`genesys_gl841.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl841.lo `test -f 'genesys_gl841.c' || echo '$(srcdir)/'`genesys_gl841.c libgphoto2_i_la-gphoto2.lo: gphoto2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgphoto2_i_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgphoto2_i_la-gphoto2.lo -MD -MP -MF $(DEPDIR)/libgphoto2_i_la-gphoto2.Tpo -c -o libgphoto2_i_la-gphoto2.lo `test -f 'gphoto2.c' || echo '$(srcdir)/'`gphoto2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libgphoto2_i_la-gphoto2.Tpo $(DEPDIR)/libgphoto2_i_la-gphoto2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgphoto2_i_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgphoto2_i_la-gphoto2.lo -MD -MP -MF $(DEPDIR)/libgphoto2_i_la-gphoto2.Tpo -c -o libgphoto2_i_la-gphoto2.lo `test -f 'gphoto2.c' || echo '$(srcdir)/'`gphoto2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgphoto2_i_la-gphoto2.Tpo $(DEPDIR)/libgphoto2_i_la-gphoto2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gphoto2.c' object='libgphoto2_i_la-gphoto2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgphoto2_i_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgphoto2_i_la-gphoto2.lo `test -f 'gphoto2.c' || echo '$(srcdir)/'`gphoto2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgphoto2_i_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgphoto2_i_la-gphoto2.lo `test -f 'gphoto2.c' || echo '$(srcdir)/'`gphoto2.c libgt68xx_la-gt68xx.lo: gt68xx.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgt68xx_la-gt68xx.lo -MD -MP -MF $(DEPDIR)/libgt68xx_la-gt68xx.Tpo -c -o libgt68xx_la-gt68xx.lo `test -f 'gt68xx.c' || echo '$(srcdir)/'`gt68xx.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libgt68xx_la-gt68xx.Tpo $(DEPDIR)/libgt68xx_la-gt68xx.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgt68xx_la-gt68xx.lo -MD -MP -MF $(DEPDIR)/libgt68xx_la-gt68xx.Tpo -c -o libgt68xx_la-gt68xx.lo `test -f 'gt68xx.c' || echo '$(srcdir)/'`gt68xx.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgt68xx_la-gt68xx.Tpo $(DEPDIR)/libgt68xx_la-gt68xx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gt68xx.c' object='libgt68xx_la-gt68xx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgt68xx_la-gt68xx.lo `test -f 'gt68xx.c' || echo '$(srcdir)/'`gt68xx.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgt68xx_la-gt68xx.lo `test -f 'gt68xx.c' || echo '$(srcdir)/'`gt68xx.c libhp_la-hp.lo: hp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp.Tpo -c -o libhp_la-hp.lo `test -f 'hp.c' || echo '$(srcdir)/'`hp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp.Tpo $(DEPDIR)/libhp_la-hp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp.Tpo -c -o libhp_la-hp.lo `test -f 'hp.c' || echo '$(srcdir)/'`hp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp.Tpo $(DEPDIR)/libhp_la-hp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp.c' object='libhp_la-hp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp.lo `test -f 'hp.c' || echo '$(srcdir)/'`hp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp.lo `test -f 'hp.c' || echo '$(srcdir)/'`hp.c libhp_la-hp-accessor.lo: hp-accessor.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-accessor.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-accessor.Tpo -c -o libhp_la-hp-accessor.lo `test -f 'hp-accessor.c' || echo '$(srcdir)/'`hp-accessor.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-accessor.Tpo $(DEPDIR)/libhp_la-hp-accessor.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-accessor.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-accessor.Tpo -c -o libhp_la-hp-accessor.lo `test -f 'hp-accessor.c' || echo '$(srcdir)/'`hp-accessor.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-accessor.Tpo $(DEPDIR)/libhp_la-hp-accessor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-accessor.c' object='libhp_la-hp-accessor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-accessor.lo `test -f 'hp-accessor.c' || echo '$(srcdir)/'`hp-accessor.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-accessor.lo `test -f 'hp-accessor.c' || echo '$(srcdir)/'`hp-accessor.c libhp_la-hp-device.lo: hp-device.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-device.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-device.Tpo -c -o libhp_la-hp-device.lo `test -f 'hp-device.c' || echo '$(srcdir)/'`hp-device.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-device.Tpo $(DEPDIR)/libhp_la-hp-device.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-device.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-device.Tpo -c -o libhp_la-hp-device.lo `test -f 'hp-device.c' || echo '$(srcdir)/'`hp-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-device.Tpo $(DEPDIR)/libhp_la-hp-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-device.c' object='libhp_la-hp-device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-device.lo `test -f 'hp-device.c' || echo '$(srcdir)/'`hp-device.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-device.lo `test -f 'hp-device.c' || echo '$(srcdir)/'`hp-device.c libhp_la-hp-handle.lo: hp-handle.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-handle.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-handle.Tpo -c -o libhp_la-hp-handle.lo `test -f 'hp-handle.c' || echo '$(srcdir)/'`hp-handle.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-handle.Tpo $(DEPDIR)/libhp_la-hp-handle.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-handle.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-handle.Tpo -c -o libhp_la-hp-handle.lo `test -f 'hp-handle.c' || echo '$(srcdir)/'`hp-handle.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-handle.Tpo $(DEPDIR)/libhp_la-hp-handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-handle.c' object='libhp_la-hp-handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-handle.lo `test -f 'hp-handle.c' || echo '$(srcdir)/'`hp-handle.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-handle.lo `test -f 'hp-handle.c' || echo '$(srcdir)/'`hp-handle.c libhp_la-hp-hpmem.lo: hp-hpmem.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-hpmem.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-hpmem.Tpo -c -o libhp_la-hp-hpmem.lo `test -f 'hp-hpmem.c' || echo '$(srcdir)/'`hp-hpmem.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-hpmem.Tpo $(DEPDIR)/libhp_la-hp-hpmem.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-hpmem.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-hpmem.Tpo -c -o libhp_la-hp-hpmem.lo `test -f 'hp-hpmem.c' || echo '$(srcdir)/'`hp-hpmem.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-hpmem.Tpo $(DEPDIR)/libhp_la-hp-hpmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-hpmem.c' object='libhp_la-hp-hpmem.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-hpmem.lo `test -f 'hp-hpmem.c' || echo '$(srcdir)/'`hp-hpmem.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-hpmem.lo `test -f 'hp-hpmem.c' || echo '$(srcdir)/'`hp-hpmem.c libhp_la-hp-option.lo: hp-option.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-option.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-option.Tpo -c -o libhp_la-hp-option.lo `test -f 'hp-option.c' || echo '$(srcdir)/'`hp-option.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-option.Tpo $(DEPDIR)/libhp_la-hp-option.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-option.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-option.Tpo -c -o libhp_la-hp-option.lo `test -f 'hp-option.c' || echo '$(srcdir)/'`hp-option.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-option.Tpo $(DEPDIR)/libhp_la-hp-option.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-option.c' object='libhp_la-hp-option.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-option.lo `test -f 'hp-option.c' || echo '$(srcdir)/'`hp-option.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-option.lo `test -f 'hp-option.c' || echo '$(srcdir)/'`hp-option.c libhp_la-hp-scl.lo: hp-scl.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-scl.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-scl.Tpo -c -o libhp_la-hp-scl.lo `test -f 'hp-scl.c' || echo '$(srcdir)/'`hp-scl.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp_la-hp-scl.Tpo $(DEPDIR)/libhp_la-hp-scl.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp_la-hp-scl.lo -MD -MP -MF $(DEPDIR)/libhp_la-hp-scl.Tpo -c -o libhp_la-hp-scl.lo `test -f 'hp-scl.c' || echo '$(srcdir)/'`hp-scl.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp_la-hp-scl.Tpo $(DEPDIR)/libhp_la-hp-scl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-scl.c' object='libhp_la-hp-scl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-scl.lo `test -f 'hp-scl.c' || echo '$(srcdir)/'`hp-scl.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp_la-hp-scl.lo `test -f 'hp-scl.c' || echo '$(srcdir)/'`hp-scl.c libhp3500_la-hp3500.lo: hp3500.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp3500_la-hp3500.lo -MD -MP -MF $(DEPDIR)/libhp3500_la-hp3500.Tpo -c -o libhp3500_la-hp3500.lo `test -f 'hp3500.c' || echo '$(srcdir)/'`hp3500.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp3500_la-hp3500.Tpo $(DEPDIR)/libhp3500_la-hp3500.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp3500_la-hp3500.lo -MD -MP -MF $(DEPDIR)/libhp3500_la-hp3500.Tpo -c -o libhp3500_la-hp3500.lo `test -f 'hp3500.c' || echo '$(srcdir)/'`hp3500.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp3500_la-hp3500.Tpo $(DEPDIR)/libhp3500_la-hp3500.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp3500.c' object='libhp3500_la-hp3500.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp3500_la-hp3500.lo `test -f 'hp3500.c' || echo '$(srcdir)/'`hp3500.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp3500_la-hp3500.lo `test -f 'hp3500.c' || echo '$(srcdir)/'`hp3500.c libhp3900_la-hp3900.lo: hp3900.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp3900_la-hp3900.lo -MD -MP -MF $(DEPDIR)/libhp3900_la-hp3900.Tpo -c -o libhp3900_la-hp3900.lo `test -f 'hp3900.c' || echo '$(srcdir)/'`hp3900.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp3900_la-hp3900.Tpo $(DEPDIR)/libhp3900_la-hp3900.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp3900_la-hp3900.lo -MD -MP -MF $(DEPDIR)/libhp3900_la-hp3900.Tpo -c -o libhp3900_la-hp3900.lo `test -f 'hp3900.c' || echo '$(srcdir)/'`hp3900.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp3900_la-hp3900.Tpo $(DEPDIR)/libhp3900_la-hp3900.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp3900.c' object='libhp3900_la-hp3900.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp3900_la-hp3900.lo `test -f 'hp3900.c' || echo '$(srcdir)/'`hp3900.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp3900_la-hp3900.lo `test -f 'hp3900.c' || echo '$(srcdir)/'`hp3900.c libhp4200_la-hp4200.lo: hp4200.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp4200_la-hp4200.lo -MD -MP -MF $(DEPDIR)/libhp4200_la-hp4200.Tpo -c -o libhp4200_la-hp4200.lo `test -f 'hp4200.c' || echo '$(srcdir)/'`hp4200.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp4200_la-hp4200.Tpo $(DEPDIR)/libhp4200_la-hp4200.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp4200_la-hp4200.lo -MD -MP -MF $(DEPDIR)/libhp4200_la-hp4200.Tpo -c -o libhp4200_la-hp4200.lo `test -f 'hp4200.c' || echo '$(srcdir)/'`hp4200.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp4200_la-hp4200.Tpo $(DEPDIR)/libhp4200_la-hp4200.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp4200.c' object='libhp4200_la-hp4200.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp4200_la-hp4200.lo `test -f 'hp4200.c' || echo '$(srcdir)/'`hp4200.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp4200_la-hp4200.lo `test -f 'hp4200.c' || echo '$(srcdir)/'`hp4200.c libhp5400_la-hp5400.lo: hp5400.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp5400_la-hp5400.lo -MD -MP -MF $(DEPDIR)/libhp5400_la-hp5400.Tpo -c -o libhp5400_la-hp5400.lo `test -f 'hp5400.c' || echo '$(srcdir)/'`hp5400.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp5400_la-hp5400.Tpo $(DEPDIR)/libhp5400_la-hp5400.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp5400_la-hp5400.lo -MD -MP -MF $(DEPDIR)/libhp5400_la-hp5400.Tpo -c -o libhp5400_la-hp5400.lo `test -f 'hp5400.c' || echo '$(srcdir)/'`hp5400.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp5400_la-hp5400.Tpo $(DEPDIR)/libhp5400_la-hp5400.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp5400.c' object='libhp5400_la-hp5400.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp5400_la-hp5400.lo `test -f 'hp5400.c' || echo '$(srcdir)/'`hp5400.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp5400_la-hp5400.lo `test -f 'hp5400.c' || echo '$(srcdir)/'`hp5400.c libhp5590_la-hp5590.lo: hp5590.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp5590_la-hp5590.lo -MD -MP -MF $(DEPDIR)/libhp5590_la-hp5590.Tpo -c -o libhp5590_la-hp5590.lo `test -f 'hp5590.c' || echo '$(srcdir)/'`hp5590.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhp5590_la-hp5590.Tpo $(DEPDIR)/libhp5590_la-hp5590.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhp5590_la-hp5590.lo -MD -MP -MF $(DEPDIR)/libhp5590_la-hp5590.Tpo -c -o libhp5590_la-hp5590.lo `test -f 'hp5590.c' || echo '$(srcdir)/'`hp5590.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhp5590_la-hp5590.Tpo $(DEPDIR)/libhp5590_la-hp5590.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp5590.c' object='libhp5590_la-hp5590.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp5590_la-hp5590.lo `test -f 'hp5590.c' || echo '$(srcdir)/'`hp5590.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhp5590_la-hp5590.lo `test -f 'hp5590.c' || echo '$(srcdir)/'`hp5590.c libhpljm1005_la-hpljm1005.lo: hpljm1005.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhpljm1005_la-hpljm1005.lo -MD -MP -MF $(DEPDIR)/libhpljm1005_la-hpljm1005.Tpo -c -o libhpljm1005_la-hpljm1005.lo `test -f 'hpljm1005.c' || echo '$(srcdir)/'`hpljm1005.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhpljm1005_la-hpljm1005.Tpo $(DEPDIR)/libhpljm1005_la-hpljm1005.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhpljm1005_la-hpljm1005.lo -MD -MP -MF $(DEPDIR)/libhpljm1005_la-hpljm1005.Tpo -c -o libhpljm1005_la-hpljm1005.lo `test -f 'hpljm1005.c' || echo '$(srcdir)/'`hpljm1005.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhpljm1005_la-hpljm1005.Tpo $(DEPDIR)/libhpljm1005_la-hpljm1005.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hpljm1005.c' object='libhpljm1005_la-hpljm1005.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhpljm1005_la-hpljm1005.lo `test -f 'hpljm1005.c' || echo '$(srcdir)/'`hpljm1005.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhpljm1005_la-hpljm1005.lo `test -f 'hpljm1005.c' || echo '$(srcdir)/'`hpljm1005.c libhpsj5s_la-hpsj5s.lo: hpsj5s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhpsj5s_la-hpsj5s.lo -MD -MP -MF $(DEPDIR)/libhpsj5s_la-hpsj5s.Tpo -c -o libhpsj5s_la-hpsj5s.lo `test -f 'hpsj5s.c' || echo '$(srcdir)/'`hpsj5s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhpsj5s_la-hpsj5s.Tpo $(DEPDIR)/libhpsj5s_la-hpsj5s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhpsj5s_la-hpsj5s.lo -MD -MP -MF $(DEPDIR)/libhpsj5s_la-hpsj5s.Tpo -c -o libhpsj5s_la-hpsj5s.lo `test -f 'hpsj5s.c' || echo '$(srcdir)/'`hpsj5s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhpsj5s_la-hpsj5s.Tpo $(DEPDIR)/libhpsj5s_la-hpsj5s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hpsj5s.c' object='libhpsj5s_la-hpsj5s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhpsj5s_la-hpsj5s.lo `test -f 'hpsj5s.c' || echo '$(srcdir)/'`hpsj5s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhpsj5s_la-hpsj5s.lo `test -f 'hpsj5s.c' || echo '$(srcdir)/'`hpsj5s.c libhs2p_la-hs2p.lo: hs2p.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhs2p_la-hs2p.lo -MD -MP -MF $(DEPDIR)/libhs2p_la-hs2p.Tpo -c -o libhs2p_la-hs2p.lo `test -f 'hs2p.c' || echo '$(srcdir)/'`hs2p.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libhs2p_la-hs2p.Tpo $(DEPDIR)/libhs2p_la-hs2p.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhs2p_la-hs2p.lo -MD -MP -MF $(DEPDIR)/libhs2p_la-hs2p.Tpo -c -o libhs2p_la-hs2p.lo `test -f 'hs2p.c' || echo '$(srcdir)/'`hs2p.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhs2p_la-hs2p.Tpo $(DEPDIR)/libhs2p_la-hs2p.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hs2p.c' object='libhs2p_la-hs2p.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhs2p_la-hs2p.lo `test -f 'hs2p.c' || echo '$(srcdir)/'`hs2p.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhs2p_la-hs2p.lo `test -f 'hs2p.c' || echo '$(srcdir)/'`hs2p.c libibm_la-ibm.lo: ibm.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libibm_la-ibm.lo -MD -MP -MF $(DEPDIR)/libibm_la-ibm.Tpo -c -o libibm_la-ibm.lo `test -f 'ibm.c' || echo '$(srcdir)/'`ibm.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libibm_la-ibm.Tpo $(DEPDIR)/libibm_la-ibm.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libibm_la-ibm.lo -MD -MP -MF $(DEPDIR)/libibm_la-ibm.Tpo -c -o libibm_la-ibm.lo `test -f 'ibm.c' || echo '$(srcdir)/'`ibm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libibm_la-ibm.Tpo $(DEPDIR)/libibm_la-ibm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ibm.c' object='libibm_la-ibm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libibm_la-ibm.lo `test -f 'ibm.c' || echo '$(srcdir)/'`ibm.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libibm_la-ibm.lo `test -f 'ibm.c' || echo '$(srcdir)/'`ibm.c + +libkodak_la-kodak.lo: kodak.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkodak_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkodak_la-kodak.lo -MD -MP -MF $(DEPDIR)/libkodak_la-kodak.Tpo -c -o libkodak_la-kodak.lo `test -f 'kodak.c' || echo '$(srcdir)/'`kodak.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkodak_la-kodak.Tpo $(DEPDIR)/libkodak_la-kodak.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kodak.c' object='libkodak_la-kodak.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkodak_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkodak_la-kodak.lo `test -f 'kodak.c' || echo '$(srcdir)/'`kodak.c + +libkvs1025_la-kvs1025.lo: kvs1025.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkvs1025_la-kvs1025.lo -MD -MP -MF $(DEPDIR)/libkvs1025_la-kvs1025.Tpo -c -o libkvs1025_la-kvs1025.lo `test -f 'kvs1025.c' || echo '$(srcdir)/'`kvs1025.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkvs1025_la-kvs1025.Tpo $(DEPDIR)/libkvs1025_la-kvs1025.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kvs1025.c' object='libkvs1025_la-kvs1025.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkvs1025_la-kvs1025.lo `test -f 'kvs1025.c' || echo '$(srcdir)/'`kvs1025.c + +libkvs1025_la-kvs1025_low.lo: kvs1025_low.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkvs1025_la-kvs1025_low.lo -MD -MP -MF $(DEPDIR)/libkvs1025_la-kvs1025_low.Tpo -c -o libkvs1025_la-kvs1025_low.lo `test -f 'kvs1025_low.c' || echo '$(srcdir)/'`kvs1025_low.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkvs1025_la-kvs1025_low.Tpo $(DEPDIR)/libkvs1025_la-kvs1025_low.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kvs1025_low.c' object='libkvs1025_la-kvs1025_low.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkvs1025_la-kvs1025_low.lo `test -f 'kvs1025_low.c' || echo '$(srcdir)/'`kvs1025_low.c + +libkvs1025_la-kvs1025_opt.lo: kvs1025_opt.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkvs1025_la-kvs1025_opt.lo -MD -MP -MF $(DEPDIR)/libkvs1025_la-kvs1025_opt.Tpo -c -o libkvs1025_la-kvs1025_opt.lo `test -f 'kvs1025_opt.c' || echo '$(srcdir)/'`kvs1025_opt.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkvs1025_la-kvs1025_opt.Tpo $(DEPDIR)/libkvs1025_la-kvs1025_opt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kvs1025_opt.c' object='libkvs1025_la-kvs1025_opt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkvs1025_la-kvs1025_opt.lo `test -f 'kvs1025_opt.c' || echo '$(srcdir)/'`kvs1025_opt.c + +libkvs1025_la-kvs1025_usb.lo: kvs1025_usb.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkvs1025_la-kvs1025_usb.lo -MD -MP -MF $(DEPDIR)/libkvs1025_la-kvs1025_usb.Tpo -c -o libkvs1025_la-kvs1025_usb.lo `test -f 'kvs1025_usb.c' || echo '$(srcdir)/'`kvs1025_usb.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkvs1025_la-kvs1025_usb.Tpo $(DEPDIR)/libkvs1025_la-kvs1025_usb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kvs1025_usb.c' object='libkvs1025_la-kvs1025_usb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkvs1025_la-kvs1025_usb.lo `test -f 'kvs1025_usb.c' || echo '$(srcdir)/'`kvs1025_usb.c libleo_la-leo.lo: leo.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libleo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libleo_la-leo.lo -MD -MP -MF $(DEPDIR)/libleo_la-leo.Tpo -c -o libleo_la-leo.lo `test -f 'leo.c' || echo '$(srcdir)/'`leo.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libleo_la-leo.Tpo $(DEPDIR)/libleo_la-leo.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libleo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libleo_la-leo.lo -MD -MP -MF $(DEPDIR)/libleo_la-leo.Tpo -c -o libleo_la-leo.lo `test -f 'leo.c' || echo '$(srcdir)/'`leo.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libleo_la-leo.Tpo $(DEPDIR)/libleo_la-leo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='leo.c' object='libleo_la-leo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libleo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libleo_la-leo.lo `test -f 'leo.c' || echo '$(srcdir)/'`leo.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libleo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libleo_la-leo.lo `test -f 'leo.c' || echo '$(srcdir)/'`leo.c liblexmark_la-lexmark.lo: lexmark.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblexmark_la-lexmark.lo -MD -MP -MF $(DEPDIR)/liblexmark_la-lexmark.Tpo -c -o liblexmark_la-lexmark.lo `test -f 'lexmark.c' || echo '$(srcdir)/'`lexmark.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblexmark_la-lexmark.Tpo $(DEPDIR)/liblexmark_la-lexmark.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblexmark_la-lexmark.lo -MD -MP -MF $(DEPDIR)/liblexmark_la-lexmark.Tpo -c -o liblexmark_la-lexmark.lo `test -f 'lexmark.c' || echo '$(srcdir)/'`lexmark.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblexmark_la-lexmark.Tpo $(DEPDIR)/liblexmark_la-lexmark.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lexmark.c' object='liblexmark_la-lexmark.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblexmark_la-lexmark.lo `test -f 'lexmark.c' || echo '$(srcdir)/'`lexmark.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblexmark_la-lexmark.lo `test -f 'lexmark.c' || echo '$(srcdir)/'`lexmark.c liblexmark_la-lexmark_low.lo: lexmark_low.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblexmark_la-lexmark_low.lo -MD -MP -MF $(DEPDIR)/liblexmark_la-lexmark_low.Tpo -c -o liblexmark_la-lexmark_low.lo `test -f 'lexmark_low.c' || echo '$(srcdir)/'`lexmark_low.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblexmark_la-lexmark_low.Tpo $(DEPDIR)/liblexmark_la-lexmark_low.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblexmark_la-lexmark_low.lo -MD -MP -MF $(DEPDIR)/liblexmark_la-lexmark_low.Tpo -c -o liblexmark_la-lexmark_low.lo `test -f 'lexmark_low.c' || echo '$(srcdir)/'`lexmark_low.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblexmark_la-lexmark_low.Tpo $(DEPDIR)/liblexmark_la-lexmark_low.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lexmark_low.c' object='liblexmark_la-lexmark_low.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblexmark_la-lexmark_low.lo `test -f 'lexmark_low.c' || echo '$(srcdir)/'`lexmark_low.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblexmark_la-lexmark_low.lo `test -f 'lexmark_low.c' || echo '$(srcdir)/'`lexmark_low.c libma1509_la-ma1509.lo: ma1509.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libma1509_la-ma1509.lo -MD -MP -MF $(DEPDIR)/libma1509_la-ma1509.Tpo -c -o libma1509_la-ma1509.lo `test -f 'ma1509.c' || echo '$(srcdir)/'`ma1509.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libma1509_la-ma1509.Tpo $(DEPDIR)/libma1509_la-ma1509.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libma1509_la-ma1509.lo -MD -MP -MF $(DEPDIR)/libma1509_la-ma1509.Tpo -c -o libma1509_la-ma1509.lo `test -f 'ma1509.c' || echo '$(srcdir)/'`ma1509.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libma1509_la-ma1509.Tpo $(DEPDIR)/libma1509_la-ma1509.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ma1509.c' object='libma1509_la-ma1509.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libma1509_la-ma1509.lo `test -f 'ma1509.c' || echo '$(srcdir)/'`ma1509.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libma1509_la-ma1509.lo `test -f 'ma1509.c' || echo '$(srcdir)/'`ma1509.c libmatsushita_la-matsushita.lo: matsushita.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmatsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmatsushita_la-matsushita.lo -MD -MP -MF $(DEPDIR)/libmatsushita_la-matsushita.Tpo -c -o libmatsushita_la-matsushita.lo `test -f 'matsushita.c' || echo '$(srcdir)/'`matsushita.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmatsushita_la-matsushita.Tpo $(DEPDIR)/libmatsushita_la-matsushita.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmatsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmatsushita_la-matsushita.lo -MD -MP -MF $(DEPDIR)/libmatsushita_la-matsushita.Tpo -c -o libmatsushita_la-matsushita.lo `test -f 'matsushita.c' || echo '$(srcdir)/'`matsushita.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmatsushita_la-matsushita.Tpo $(DEPDIR)/libmatsushita_la-matsushita.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matsushita.c' object='libmatsushita_la-matsushita.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmatsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmatsushita_la-matsushita.lo `test -f 'matsushita.c' || echo '$(srcdir)/'`matsushita.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmatsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmatsushita_la-matsushita.lo `test -f 'matsushita.c' || echo '$(srcdir)/'`matsushita.c libmicrotek_la-microtek.lo: microtek.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmicrotek_la-microtek.lo -MD -MP -MF $(DEPDIR)/libmicrotek_la-microtek.Tpo -c -o libmicrotek_la-microtek.lo `test -f 'microtek.c' || echo '$(srcdir)/'`microtek.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmicrotek_la-microtek.Tpo $(DEPDIR)/libmicrotek_la-microtek.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmicrotek_la-microtek.lo -MD -MP -MF $(DEPDIR)/libmicrotek_la-microtek.Tpo -c -o libmicrotek_la-microtek.lo `test -f 'microtek.c' || echo '$(srcdir)/'`microtek.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmicrotek_la-microtek.Tpo $(DEPDIR)/libmicrotek_la-microtek.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='microtek.c' object='libmicrotek_la-microtek.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmicrotek_la-microtek.lo `test -f 'microtek.c' || echo '$(srcdir)/'`microtek.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmicrotek_la-microtek.lo `test -f 'microtek.c' || echo '$(srcdir)/'`microtek.c libmicrotek2_la-microtek2.lo: microtek2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmicrotek2_la-microtek2.lo -MD -MP -MF $(DEPDIR)/libmicrotek2_la-microtek2.Tpo -c -o libmicrotek2_la-microtek2.lo `test -f 'microtek2.c' || echo '$(srcdir)/'`microtek2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmicrotek2_la-microtek2.Tpo $(DEPDIR)/libmicrotek2_la-microtek2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmicrotek2_la-microtek2.lo -MD -MP -MF $(DEPDIR)/libmicrotek2_la-microtek2.Tpo -c -o libmicrotek2_la-microtek2.lo `test -f 'microtek2.c' || echo '$(srcdir)/'`microtek2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmicrotek2_la-microtek2.Tpo $(DEPDIR)/libmicrotek2_la-microtek2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='microtek2.c' object='libmicrotek2_la-microtek2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmicrotek2_la-microtek2.lo `test -f 'microtek2.c' || echo '$(srcdir)/'`microtek2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrotek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmicrotek2_la-microtek2.lo `test -f 'microtek2.c' || echo '$(srcdir)/'`microtek2.c libmustek_la-mustek.lo: mustek.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_la-mustek.lo -MD -MP -MF $(DEPDIR)/libmustek_la-mustek.Tpo -c -o libmustek_la-mustek.lo `test -f 'mustek.c' || echo '$(srcdir)/'`mustek.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmustek_la-mustek.Tpo $(DEPDIR)/libmustek_la-mustek.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_la-mustek.lo -MD -MP -MF $(DEPDIR)/libmustek_la-mustek.Tpo -c -o libmustek_la-mustek.lo `test -f 'mustek.c' || echo '$(srcdir)/'`mustek.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmustek_la-mustek.Tpo $(DEPDIR)/libmustek_la-mustek.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek.c' object='libmustek_la-mustek.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_la-mustek.lo `test -f 'mustek.c' || echo '$(srcdir)/'`mustek.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_la-mustek.lo `test -f 'mustek.c' || echo '$(srcdir)/'`mustek.c libmustek_pp_la-mustek_pp.lo: mustek_pp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_pp_la-mustek_pp.lo -MD -MP -MF $(DEPDIR)/libmustek_pp_la-mustek_pp.Tpo -c -o libmustek_pp_la-mustek_pp.lo `test -f 'mustek_pp.c' || echo '$(srcdir)/'`mustek_pp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmustek_pp_la-mustek_pp.Tpo $(DEPDIR)/libmustek_pp_la-mustek_pp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_pp_la-mustek_pp.lo -MD -MP -MF $(DEPDIR)/libmustek_pp_la-mustek_pp.Tpo -c -o libmustek_pp_la-mustek_pp.lo `test -f 'mustek_pp.c' || echo '$(srcdir)/'`mustek_pp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmustek_pp_la-mustek_pp.Tpo $(DEPDIR)/libmustek_pp_la-mustek_pp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_pp.c' object='libmustek_pp_la-mustek_pp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_pp_la-mustek_pp.lo `test -f 'mustek_pp.c' || echo '$(srcdir)/'`mustek_pp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_pp_la-mustek_pp.lo `test -f 'mustek_pp.c' || echo '$(srcdir)/'`mustek_pp.c libmustek_usb_la-mustek_usb.lo: mustek_usb.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb_la-mustek_usb.lo -MD -MP -MF $(DEPDIR)/libmustek_usb_la-mustek_usb.Tpo -c -o libmustek_usb_la-mustek_usb.lo `test -f 'mustek_usb.c' || echo '$(srcdir)/'`mustek_usb.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmustek_usb_la-mustek_usb.Tpo $(DEPDIR)/libmustek_usb_la-mustek_usb.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb_la-mustek_usb.lo -MD -MP -MF $(DEPDIR)/libmustek_usb_la-mustek_usb.Tpo -c -o libmustek_usb_la-mustek_usb.lo `test -f 'mustek_usb.c' || echo '$(srcdir)/'`mustek_usb.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmustek_usb_la-mustek_usb.Tpo $(DEPDIR)/libmustek_usb_la-mustek_usb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_usb.c' object='libmustek_usb_la-mustek_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb_la-mustek_usb.lo `test -f 'mustek_usb.c' || echo '$(srcdir)/'`mustek_usb.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb_la-mustek_usb.lo `test -f 'mustek_usb.c' || echo '$(srcdir)/'`mustek_usb.c libmustek_usb2_la-mustek_usb2.lo: mustek_usb2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb2_la-mustek_usb2.lo -MD -MP -MF $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Tpo -c -o libmustek_usb2_la-mustek_usb2.lo `test -f 'mustek_usb2.c' || echo '$(srcdir)/'`mustek_usb2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Tpo $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb2_la-mustek_usb2.lo -MD -MP -MF $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Tpo -c -o libmustek_usb2_la-mustek_usb2.lo `test -f 'mustek_usb2.c' || echo '$(srcdir)/'`mustek_usb2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Tpo $(DEPDIR)/libmustek_usb2_la-mustek_usb2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_usb2.c' object='libmustek_usb2_la-mustek_usb2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb2_la-mustek_usb2.lo `test -f 'mustek_usb2.c' || echo '$(srcdir)/'`mustek_usb2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb2_la-mustek_usb2.lo `test -f 'mustek_usb2.c' || echo '$(srcdir)/'`mustek_usb2.c libnec_la-nec.lo: nec.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnec_la-nec.lo -MD -MP -MF $(DEPDIR)/libnec_la-nec.Tpo -c -o libnec_la-nec.lo `test -f 'nec.c' || echo '$(srcdir)/'`nec.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libnec_la-nec.Tpo $(DEPDIR)/libnec_la-nec.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnec_la-nec.lo -MD -MP -MF $(DEPDIR)/libnec_la-nec.Tpo -c -o libnec_la-nec.lo `test -f 'nec.c' || echo '$(srcdir)/'`nec.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnec_la-nec.Tpo $(DEPDIR)/libnec_la-nec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nec.c' object='libnec_la-nec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnec_la-nec.lo `test -f 'nec.c' || echo '$(srcdir)/'`nec.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnec_la-nec.lo `test -f 'nec.c' || echo '$(srcdir)/'`nec.c libnet_la-net.lo: net.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnet_la-net.lo -MD -MP -MF $(DEPDIR)/libnet_la-net.Tpo -c -o libnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libnet_la-net.Tpo $(DEPDIR)/libnet_la-net.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnet_la-net.lo -MD -MP -MF $(DEPDIR)/libnet_la-net.Tpo -c -o libnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnet_la-net.Tpo $(DEPDIR)/libnet_la-net.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='net.c' object='libnet_la-net.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c libniash_la-niash.lo: niash.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libniash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libniash_la-niash.lo -MD -MP -MF $(DEPDIR)/libniash_la-niash.Tpo -c -o libniash_la-niash.lo `test -f 'niash.c' || echo '$(srcdir)/'`niash.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libniash_la-niash.Tpo $(DEPDIR)/libniash_la-niash.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libniash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libniash_la-niash.lo -MD -MP -MF $(DEPDIR)/libniash_la-niash.Tpo -c -o libniash_la-niash.lo `test -f 'niash.c' || echo '$(srcdir)/'`niash.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libniash_la-niash.Tpo $(DEPDIR)/libniash_la-niash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='niash.c' object='libniash_la-niash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libniash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libniash_la-niash.lo `test -f 'niash.c' || echo '$(srcdir)/'`niash.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libniash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libniash_la-niash.lo `test -f 'niash.c' || echo '$(srcdir)/'`niash.c + +libp5_la-p5.lo: p5.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libp5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libp5_la-p5.lo -MD -MP -MF $(DEPDIR)/libp5_la-p5.Tpo -c -o libp5_la-p5.lo `test -f 'p5.c' || echo '$(srcdir)/'`p5.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libp5_la-p5.Tpo $(DEPDIR)/libp5_la-p5.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='p5.c' object='libp5_la-p5.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libp5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libp5_la-p5.lo `test -f 'p5.c' || echo '$(srcdir)/'`p5.c libpie_la-pie.lo: pie.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpie_la-pie.lo -MD -MP -MF $(DEPDIR)/libpie_la-pie.Tpo -c -o libpie_la-pie.lo `test -f 'pie.c' || echo '$(srcdir)/'`pie.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpie_la-pie.Tpo $(DEPDIR)/libpie_la-pie.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpie_la-pie.lo -MD -MP -MF $(DEPDIR)/libpie_la-pie.Tpo -c -o libpie_la-pie.lo `test -f 'pie.c' || echo '$(srcdir)/'`pie.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpie_la-pie.Tpo $(DEPDIR)/libpie_la-pie.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pie.c' object='libpie_la-pie.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpie_la-pie.lo `test -f 'pie.c' || echo '$(srcdir)/'`pie.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpie_la-pie.lo `test -f 'pie.c' || echo '$(srcdir)/'`pie.c libpint_la-pint.lo: pint.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpint_la-pint.lo -MD -MP -MF $(DEPDIR)/libpint_la-pint.Tpo -c -o libpint_la-pint.lo `test -f 'pint.c' || echo '$(srcdir)/'`pint.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpint_la-pint.Tpo $(DEPDIR)/libpint_la-pint.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpint_la-pint.lo -MD -MP -MF $(DEPDIR)/libpint_la-pint.Tpo -c -o libpint_la-pint.lo `test -f 'pint.c' || echo '$(srcdir)/'`pint.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpint_la-pint.Tpo $(DEPDIR)/libpint_la-pint.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pint.c' object='libpint_la-pint.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpint_la-pint.lo `test -f 'pint.c' || echo '$(srcdir)/'`pint.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpint_la-pint.lo `test -f 'pint.c' || echo '$(srcdir)/'`pint.c libpixma_la-pixma.lo: pixma.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma.Tpo -c -o libpixma_la-pixma.lo `test -f 'pixma.c' || echo '$(srcdir)/'`pixma.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma.Tpo $(DEPDIR)/libpixma_la-pixma.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma.Tpo -c -o libpixma_la-pixma.lo `test -f 'pixma.c' || echo '$(srcdir)/'`pixma.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma.Tpo $(DEPDIR)/libpixma_la-pixma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma.c' object='libpixma_la-pixma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma.lo `test -f 'pixma.c' || echo '$(srcdir)/'`pixma.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma.lo `test -f 'pixma.c' || echo '$(srcdir)/'`pixma.c libpixma_la-pixma_io_sanei.lo: pixma_io_sanei.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_io_sanei.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_io_sanei.Tpo -c -o libpixma_la-pixma_io_sanei.lo `test -f 'pixma_io_sanei.c' || echo '$(srcdir)/'`pixma_io_sanei.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_io_sanei.Tpo $(DEPDIR)/libpixma_la-pixma_io_sanei.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_io_sanei.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_io_sanei.Tpo -c -o libpixma_la-pixma_io_sanei.lo `test -f 'pixma_io_sanei.c' || echo '$(srcdir)/'`pixma_io_sanei.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_io_sanei.Tpo $(DEPDIR)/libpixma_la-pixma_io_sanei.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_io_sanei.c' object='libpixma_la-pixma_io_sanei.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_io_sanei.lo `test -f 'pixma_io_sanei.c' || echo '$(srcdir)/'`pixma_io_sanei.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_io_sanei.lo `test -f 'pixma_io_sanei.c' || echo '$(srcdir)/'`pixma_io_sanei.c libpixma_la-pixma_common.lo: pixma_common.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_common.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_common.Tpo -c -o libpixma_la-pixma_common.lo `test -f 'pixma_common.c' || echo '$(srcdir)/'`pixma_common.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_common.Tpo $(DEPDIR)/libpixma_la-pixma_common.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_common.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_common.Tpo -c -o libpixma_la-pixma_common.lo `test -f 'pixma_common.c' || echo '$(srcdir)/'`pixma_common.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_common.Tpo $(DEPDIR)/libpixma_la-pixma_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_common.c' object='libpixma_la-pixma_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_common.lo `test -f 'pixma_common.c' || echo '$(srcdir)/'`pixma_common.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_common.lo `test -f 'pixma_common.c' || echo '$(srcdir)/'`pixma_common.c libpixma_la-pixma_mp150.lo: pixma_mp150.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp150.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp150.Tpo -c -o libpixma_la-pixma_mp150.lo `test -f 'pixma_mp150.c' || echo '$(srcdir)/'`pixma_mp150.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_mp150.Tpo $(DEPDIR)/libpixma_la-pixma_mp150.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp150.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp150.Tpo -c -o libpixma_la-pixma_mp150.lo `test -f 'pixma_mp150.c' || echo '$(srcdir)/'`pixma_mp150.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_mp150.Tpo $(DEPDIR)/libpixma_la-pixma_mp150.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_mp150.c' object='libpixma_la-pixma_mp150.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp150.lo `test -f 'pixma_mp150.c' || echo '$(srcdir)/'`pixma_mp150.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp150.lo `test -f 'pixma_mp150.c' || echo '$(srcdir)/'`pixma_mp150.c libpixma_la-pixma_mp730.lo: pixma_mp730.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp730.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp730.Tpo -c -o libpixma_la-pixma_mp730.lo `test -f 'pixma_mp730.c' || echo '$(srcdir)/'`pixma_mp730.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_mp730.Tpo $(DEPDIR)/libpixma_la-pixma_mp730.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp730.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp730.Tpo -c -o libpixma_la-pixma_mp730.lo `test -f 'pixma_mp730.c' || echo '$(srcdir)/'`pixma_mp730.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_mp730.Tpo $(DEPDIR)/libpixma_la-pixma_mp730.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_mp730.c' object='libpixma_la-pixma_mp730.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp730.lo `test -f 'pixma_mp730.c' || echo '$(srcdir)/'`pixma_mp730.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp730.lo `test -f 'pixma_mp730.c' || echo '$(srcdir)/'`pixma_mp730.c libpixma_la-pixma_mp750.lo: pixma_mp750.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp750.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp750.Tpo -c -o libpixma_la-pixma_mp750.lo `test -f 'pixma_mp750.c' || echo '$(srcdir)/'`pixma_mp750.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_mp750.Tpo $(DEPDIR)/libpixma_la-pixma_mp750.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_mp750.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_mp750.Tpo -c -o libpixma_la-pixma_mp750.lo `test -f 'pixma_mp750.c' || echo '$(srcdir)/'`pixma_mp750.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_mp750.Tpo $(DEPDIR)/libpixma_la-pixma_mp750.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_mp750.c' object='libpixma_la-pixma_mp750.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp750.lo `test -f 'pixma_mp750.c' || echo '$(srcdir)/'`pixma_mp750.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_mp750.lo `test -f 'pixma_mp750.c' || echo '$(srcdir)/'`pixma_mp750.c libpixma_la-pixma_imageclass.lo: pixma_imageclass.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_imageclass.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_imageclass.Tpo -c -o libpixma_la-pixma_imageclass.lo `test -f 'pixma_imageclass.c' || echo '$(srcdir)/'`pixma_imageclass.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_imageclass.Tpo $(DEPDIR)/libpixma_la-pixma_imageclass.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_imageclass.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_imageclass.Tpo -c -o libpixma_la-pixma_imageclass.lo `test -f 'pixma_imageclass.c' || echo '$(srcdir)/'`pixma_imageclass.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_imageclass.Tpo $(DEPDIR)/libpixma_la-pixma_imageclass.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_imageclass.c' object='libpixma_la-pixma_imageclass.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_imageclass.lo `test -f 'pixma_imageclass.c' || echo '$(srcdir)/'`pixma_imageclass.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_imageclass.lo `test -f 'pixma_imageclass.c' || echo '$(srcdir)/'`pixma_imageclass.c libpixma_la-pixma_bjnp.lo: pixma_bjnp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_bjnp.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_bjnp.Tpo -c -o libpixma_la-pixma_bjnp.lo `test -f 'pixma_bjnp.c' || echo '$(srcdir)/'`pixma_bjnp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixma_la-pixma_bjnp.Tpo $(DEPDIR)/libpixma_la-pixma_bjnp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpixma_la-pixma_bjnp.lo -MD -MP -MF $(DEPDIR)/libpixma_la-pixma_bjnp.Tpo -c -o libpixma_la-pixma_bjnp.lo `test -f 'pixma_bjnp.c' || echo '$(srcdir)/'`pixma_bjnp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpixma_la-pixma_bjnp.Tpo $(DEPDIR)/libpixma_la-pixma_bjnp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma_bjnp.c' object='libpixma_la-pixma_bjnp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_bjnp.lo `test -f 'pixma_bjnp.c' || echo '$(srcdir)/'`pixma_bjnp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpixma_la-pixma_bjnp.lo `test -f 'pixma_bjnp.c' || echo '$(srcdir)/'`pixma_bjnp.c libplustek_la-plustek.lo: plustek.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libplustek_la-plustek.lo -MD -MP -MF $(DEPDIR)/libplustek_la-plustek.Tpo -c -o libplustek_la-plustek.lo `test -f 'plustek.c' || echo '$(srcdir)/'`plustek.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libplustek_la-plustek.Tpo $(DEPDIR)/libplustek_la-plustek.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libplustek_la-plustek.lo -MD -MP -MF $(DEPDIR)/libplustek_la-plustek.Tpo -c -o libplustek_la-plustek.lo `test -f 'plustek.c' || echo '$(srcdir)/'`plustek.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libplustek_la-plustek.Tpo $(DEPDIR)/libplustek_la-plustek.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plustek.c' object='libplustek_la-plustek.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libplustek_la-plustek.lo `test -f 'plustek.c' || echo '$(srcdir)/'`plustek.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libplustek_la-plustek.lo `test -f 'plustek.c' || echo '$(srcdir)/'`plustek.c libplustek_pp_la-plustek_pp.lo: plustek_pp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libplustek_pp_la-plustek_pp.lo -MD -MP -MF $(DEPDIR)/libplustek_pp_la-plustek_pp.Tpo -c -o libplustek_pp_la-plustek_pp.lo `test -f 'plustek_pp.c' || echo '$(srcdir)/'`plustek_pp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libplustek_pp_la-plustek_pp.Tpo $(DEPDIR)/libplustek_pp_la-plustek_pp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libplustek_pp_la-plustek_pp.lo -MD -MP -MF $(DEPDIR)/libplustek_pp_la-plustek_pp.Tpo -c -o libplustek_pp_la-plustek_pp.lo `test -f 'plustek_pp.c' || echo '$(srcdir)/'`plustek_pp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libplustek_pp_la-plustek_pp.Tpo $(DEPDIR)/libplustek_pp_la-plustek_pp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plustek_pp.c' object='libplustek_pp_la-plustek_pp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libplustek_pp_la-plustek_pp.lo `test -f 'plustek_pp.c' || echo '$(srcdir)/'`plustek_pp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libplustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libplustek_pp_la-plustek_pp.lo `test -f 'plustek_pp.c' || echo '$(srcdir)/'`plustek_pp.c libpnm_la-pnm.lo: pnm.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpnm_la-pnm.lo -MD -MP -MF $(DEPDIR)/libpnm_la-pnm.Tpo -c -o libpnm_la-pnm.lo `test -f 'pnm.c' || echo '$(srcdir)/'`pnm.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpnm_la-pnm.Tpo $(DEPDIR)/libpnm_la-pnm.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpnm_la-pnm.lo -MD -MP -MF $(DEPDIR)/libpnm_la-pnm.Tpo -c -o libpnm_la-pnm.lo `test -f 'pnm.c' || echo '$(srcdir)/'`pnm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpnm_la-pnm.Tpo $(DEPDIR)/libpnm_la-pnm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pnm.c' object='libpnm_la-pnm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpnm_la-pnm.lo `test -f 'pnm.c' || echo '$(srcdir)/'`pnm.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpnm_la-pnm.lo `test -f 'pnm.c' || echo '$(srcdir)/'`pnm.c libqcam_la-qcam.lo: qcam.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqcam_la-qcam.lo -MD -MP -MF $(DEPDIR)/libqcam_la-qcam.Tpo -c -o libqcam_la-qcam.lo `test -f 'qcam.c' || echo '$(srcdir)/'`qcam.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libqcam_la-qcam.Tpo $(DEPDIR)/libqcam_la-qcam.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqcam_la-qcam.lo -MD -MP -MF $(DEPDIR)/libqcam_la-qcam.Tpo -c -o libqcam_la-qcam.lo `test -f 'qcam.c' || echo '$(srcdir)/'`qcam.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libqcam_la-qcam.Tpo $(DEPDIR)/libqcam_la-qcam.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qcam.c' object='libqcam_la-qcam.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqcam_la-qcam.lo `test -f 'qcam.c' || echo '$(srcdir)/'`qcam.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqcam_la-qcam.lo `test -f 'qcam.c' || echo '$(srcdir)/'`qcam.c libricoh_la-ricoh.lo: ricoh.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libricoh_la-ricoh.lo -MD -MP -MF $(DEPDIR)/libricoh_la-ricoh.Tpo -c -o libricoh_la-ricoh.lo `test -f 'ricoh.c' || echo '$(srcdir)/'`ricoh.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libricoh_la-ricoh.Tpo $(DEPDIR)/libricoh_la-ricoh.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libricoh_la-ricoh.lo -MD -MP -MF $(DEPDIR)/libricoh_la-ricoh.Tpo -c -o libricoh_la-ricoh.lo `test -f 'ricoh.c' || echo '$(srcdir)/'`ricoh.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libricoh_la-ricoh.Tpo $(DEPDIR)/libricoh_la-ricoh.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ricoh.c' object='libricoh_la-ricoh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libricoh_la-ricoh.lo `test -f 'ricoh.c' || echo '$(srcdir)/'`ricoh.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libricoh_la-ricoh.lo `test -f 'ricoh.c' || echo '$(srcdir)/'`ricoh.c librts8891_la-rts8891.lo: rts8891.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librts8891_la-rts8891.lo -MD -MP -MF $(DEPDIR)/librts8891_la-rts8891.Tpo -c -o librts8891_la-rts8891.lo `test -f 'rts8891.c' || echo '$(srcdir)/'`rts8891.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/librts8891_la-rts8891.Tpo $(DEPDIR)/librts8891_la-rts8891.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librts8891_la-rts8891.lo -MD -MP -MF $(DEPDIR)/librts8891_la-rts8891.Tpo -c -o librts8891_la-rts8891.lo `test -f 'rts8891.c' || echo '$(srcdir)/'`rts8891.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librts8891_la-rts8891.Tpo $(DEPDIR)/librts8891_la-rts8891.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rts8891.c' object='librts8891_la-rts8891.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librts8891_la-rts8891.lo `test -f 'rts8891.c' || echo '$(srcdir)/'`rts8891.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librts8891_la-rts8891.lo `test -f 'rts8891.c' || echo '$(srcdir)/'`rts8891.c librts8891_la-rts88xx_lib.lo: rts88xx_lib.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librts8891_la-rts88xx_lib.lo -MD -MP -MF $(DEPDIR)/librts8891_la-rts88xx_lib.Tpo -c -o librts8891_la-rts88xx_lib.lo `test -f 'rts88xx_lib.c' || echo '$(srcdir)/'`rts88xx_lib.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/librts8891_la-rts88xx_lib.Tpo $(DEPDIR)/librts8891_la-rts88xx_lib.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librts8891_la-rts88xx_lib.lo -MD -MP -MF $(DEPDIR)/librts8891_la-rts88xx_lib.Tpo -c -o librts8891_la-rts88xx_lib.lo `test -f 'rts88xx_lib.c' || echo '$(srcdir)/'`rts88xx_lib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librts8891_la-rts88xx_lib.Tpo $(DEPDIR)/librts8891_la-rts88xx_lib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rts88xx_lib.c' object='librts8891_la-rts88xx_lib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librts8891_la-rts88xx_lib.lo `test -f 'rts88xx_lib.c' || echo '$(srcdir)/'`rts88xx_lib.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librts8891_la-rts88xx_lib.lo `test -f 'rts88xx_lib.c' || echo '$(srcdir)/'`rts88xx_lib.c libs9036_la-s9036.lo: s9036.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libs9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libs9036_la-s9036.lo -MD -MP -MF $(DEPDIR)/libs9036_la-s9036.Tpo -c -o libs9036_la-s9036.lo `test -f 's9036.c' || echo '$(srcdir)/'`s9036.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libs9036_la-s9036.Tpo $(DEPDIR)/libs9036_la-s9036.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libs9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libs9036_la-s9036.lo -MD -MP -MF $(DEPDIR)/libs9036_la-s9036.Tpo -c -o libs9036_la-s9036.lo `test -f 's9036.c' || echo '$(srcdir)/'`s9036.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libs9036_la-s9036.Tpo $(DEPDIR)/libs9036_la-s9036.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='s9036.c' object='libs9036_la-s9036.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libs9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libs9036_la-s9036.lo `test -f 's9036.c' || echo '$(srcdir)/'`s9036.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libs9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libs9036_la-s9036.lo `test -f 's9036.c' || echo '$(srcdir)/'`s9036.c libsane_abaton_la-abaton-s.lo: abaton-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_abaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_abaton_la-abaton-s.lo -MD -MP -MF $(DEPDIR)/libsane_abaton_la-abaton-s.Tpo -c -o libsane_abaton_la-abaton-s.lo `test -f 'abaton-s.c' || echo '$(srcdir)/'`abaton-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_abaton_la-abaton-s.Tpo $(DEPDIR)/libsane_abaton_la-abaton-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_abaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_abaton_la-abaton-s.lo -MD -MP -MF $(DEPDIR)/libsane_abaton_la-abaton-s.Tpo -c -o libsane_abaton_la-abaton-s.lo `test -f 'abaton-s.c' || echo '$(srcdir)/'`abaton-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_abaton_la-abaton-s.Tpo $(DEPDIR)/libsane_abaton_la-abaton-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='abaton-s.c' object='libsane_abaton_la-abaton-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_abaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_abaton_la-abaton-s.lo `test -f 'abaton-s.c' || echo '$(srcdir)/'`abaton-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_abaton_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_abaton_la-abaton-s.lo `test -f 'abaton-s.c' || echo '$(srcdir)/'`abaton-s.c libsane_agfafocus_la-agfafocus-s.lo: agfafocus-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_agfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_agfafocus_la-agfafocus-s.lo -MD -MP -MF $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Tpo -c -o libsane_agfafocus_la-agfafocus-s.lo `test -f 'agfafocus-s.c' || echo '$(srcdir)/'`agfafocus-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Tpo $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_agfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_agfafocus_la-agfafocus-s.lo -MD -MP -MF $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Tpo -c -o libsane_agfafocus_la-agfafocus-s.lo `test -f 'agfafocus-s.c' || echo '$(srcdir)/'`agfafocus-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Tpo $(DEPDIR)/libsane_agfafocus_la-agfafocus-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='agfafocus-s.c' object='libsane_agfafocus_la-agfafocus-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_agfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_agfafocus_la-agfafocus-s.lo `test -f 'agfafocus-s.c' || echo '$(srcdir)/'`agfafocus-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_agfafocus_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_agfafocus_la-agfafocus-s.lo `test -f 'agfafocus-s.c' || echo '$(srcdir)/'`agfafocus-s.c libsane_apple_la-apple-s.lo: apple-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_apple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_apple_la-apple-s.lo -MD -MP -MF $(DEPDIR)/libsane_apple_la-apple-s.Tpo -c -o libsane_apple_la-apple-s.lo `test -f 'apple-s.c' || echo '$(srcdir)/'`apple-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_apple_la-apple-s.Tpo $(DEPDIR)/libsane_apple_la-apple-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_apple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_apple_la-apple-s.lo -MD -MP -MF $(DEPDIR)/libsane_apple_la-apple-s.Tpo -c -o libsane_apple_la-apple-s.lo `test -f 'apple-s.c' || echo '$(srcdir)/'`apple-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_apple_la-apple-s.Tpo $(DEPDIR)/libsane_apple_la-apple-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='apple-s.c' object='libsane_apple_la-apple-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_apple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_apple_la-apple-s.lo `test -f 'apple-s.c' || echo '$(srcdir)/'`apple-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_apple_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_apple_la-apple-s.lo `test -f 'apple-s.c' || echo '$(srcdir)/'`apple-s.c libsane_artec_la-artec-s.lo: artec-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_artec_la-artec-s.lo -MD -MP -MF $(DEPDIR)/libsane_artec_la-artec-s.Tpo -c -o libsane_artec_la-artec-s.lo `test -f 'artec-s.c' || echo '$(srcdir)/'`artec-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_artec_la-artec-s.Tpo $(DEPDIR)/libsane_artec_la-artec-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_artec_la-artec-s.lo -MD -MP -MF $(DEPDIR)/libsane_artec_la-artec-s.Tpo -c -o libsane_artec_la-artec-s.lo `test -f 'artec-s.c' || echo '$(srcdir)/'`artec-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_artec_la-artec-s.Tpo $(DEPDIR)/libsane_artec_la-artec-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='artec-s.c' object='libsane_artec_la-artec-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_artec_la-artec-s.lo `test -f 'artec-s.c' || echo '$(srcdir)/'`artec-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_artec_la-artec-s.lo `test -f 'artec-s.c' || echo '$(srcdir)/'`artec-s.c libsane_artec_eplus48u_la-artec_eplus48u-s.lo: artec_eplus48u-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_artec_eplus48u_la-artec_eplus48u-s.lo -MD -MP -MF $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Tpo -c -o libsane_artec_eplus48u_la-artec_eplus48u-s.lo `test -f 'artec_eplus48u-s.c' || echo '$(srcdir)/'`artec_eplus48u-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Tpo $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_artec_eplus48u_la-artec_eplus48u-s.lo -MD -MP -MF $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Tpo -c -o libsane_artec_eplus48u_la-artec_eplus48u-s.lo `test -f 'artec_eplus48u-s.c' || echo '$(srcdir)/'`artec_eplus48u-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Tpo $(DEPDIR)/libsane_artec_eplus48u_la-artec_eplus48u-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='artec_eplus48u-s.c' object='libsane_artec_eplus48u_la-artec_eplus48u-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_artec_eplus48u_la-artec_eplus48u-s.lo `test -f 'artec_eplus48u-s.c' || echo '$(srcdir)/'`artec_eplus48u-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_artec_eplus48u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_artec_eplus48u_la-artec_eplus48u-s.lo `test -f 'artec_eplus48u-s.c' || echo '$(srcdir)/'`artec_eplus48u-s.c libsane_as6e_la-as6e-s.lo: as6e-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_as6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_as6e_la-as6e-s.lo -MD -MP -MF $(DEPDIR)/libsane_as6e_la-as6e-s.Tpo -c -o libsane_as6e_la-as6e-s.lo `test -f 'as6e-s.c' || echo '$(srcdir)/'`as6e-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_as6e_la-as6e-s.Tpo $(DEPDIR)/libsane_as6e_la-as6e-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_as6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_as6e_la-as6e-s.lo -MD -MP -MF $(DEPDIR)/libsane_as6e_la-as6e-s.Tpo -c -o libsane_as6e_la-as6e-s.lo `test -f 'as6e-s.c' || echo '$(srcdir)/'`as6e-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_as6e_la-as6e-s.Tpo $(DEPDIR)/libsane_as6e_la-as6e-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='as6e-s.c' object='libsane_as6e_la-as6e-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_as6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_as6e_la-as6e-s.lo `test -f 'as6e-s.c' || echo '$(srcdir)/'`as6e-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_as6e_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_as6e_la-as6e-s.lo `test -f 'as6e-s.c' || echo '$(srcdir)/'`as6e-s.c libsane_avision_la-avision-s.lo: avision-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_avision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_avision_la-avision-s.lo -MD -MP -MF $(DEPDIR)/libsane_avision_la-avision-s.Tpo -c -o libsane_avision_la-avision-s.lo `test -f 'avision-s.c' || echo '$(srcdir)/'`avision-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_avision_la-avision-s.Tpo $(DEPDIR)/libsane_avision_la-avision-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_avision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_avision_la-avision-s.lo -MD -MP -MF $(DEPDIR)/libsane_avision_la-avision-s.Tpo -c -o libsane_avision_la-avision-s.lo `test -f 'avision-s.c' || echo '$(srcdir)/'`avision-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_avision_la-avision-s.Tpo $(DEPDIR)/libsane_avision_la-avision-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='avision-s.c' object='libsane_avision_la-avision-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_avision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_avision_la-avision-s.lo `test -f 'avision-s.c' || echo '$(srcdir)/'`avision-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_avision_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_avision_la-avision-s.lo `test -f 'avision-s.c' || echo '$(srcdir)/'`avision-s.c libsane_bh_la-bh-s.lo: bh-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_bh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_bh_la-bh-s.lo -MD -MP -MF $(DEPDIR)/libsane_bh_la-bh-s.Tpo -c -o libsane_bh_la-bh-s.lo `test -f 'bh-s.c' || echo '$(srcdir)/'`bh-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_bh_la-bh-s.Tpo $(DEPDIR)/libsane_bh_la-bh-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_bh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_bh_la-bh-s.lo -MD -MP -MF $(DEPDIR)/libsane_bh_la-bh-s.Tpo -c -o libsane_bh_la-bh-s.lo `test -f 'bh-s.c' || echo '$(srcdir)/'`bh-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_bh_la-bh-s.Tpo $(DEPDIR)/libsane_bh_la-bh-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bh-s.c' object='libsane_bh_la-bh-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_bh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_bh_la-bh-s.lo `test -f 'bh-s.c' || echo '$(srcdir)/'`bh-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_bh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_bh_la-bh-s.lo `test -f 'bh-s.c' || echo '$(srcdir)/'`bh-s.c libsane_canon_la-canon-s.lo: canon-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_la-canon-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_la-canon-s.Tpo -c -o libsane_canon_la-canon-s.lo `test -f 'canon-s.c' || echo '$(srcdir)/'`canon-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_canon_la-canon-s.Tpo $(DEPDIR)/libsane_canon_la-canon-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_la-canon-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_la-canon-s.Tpo -c -o libsane_canon_la-canon-s.lo `test -f 'canon-s.c' || echo '$(srcdir)/'`canon-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_canon_la-canon-s.Tpo $(DEPDIR)/libsane_canon_la-canon-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon-s.c' object='libsane_canon_la-canon-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_la-canon-s.lo `test -f 'canon-s.c' || echo '$(srcdir)/'`canon-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_la-canon-s.lo `test -f 'canon-s.c' || echo '$(srcdir)/'`canon-s.c libsane_canon630u_la-canon630u-s.lo: canon630u-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon630u_la-canon630u-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon630u_la-canon630u-s.Tpo -c -o libsane_canon630u_la-canon630u-s.lo `test -f 'canon630u-s.c' || echo '$(srcdir)/'`canon630u-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_canon630u_la-canon630u-s.Tpo $(DEPDIR)/libsane_canon630u_la-canon630u-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon630u_la-canon630u-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon630u_la-canon630u-s.Tpo -c -o libsane_canon630u_la-canon630u-s.lo `test -f 'canon630u-s.c' || echo '$(srcdir)/'`canon630u-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_canon630u_la-canon630u-s.Tpo $(DEPDIR)/libsane_canon630u_la-canon630u-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon630u-s.c' object='libsane_canon630u_la-canon630u-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon630u_la-canon630u-s.lo `test -f 'canon630u-s.c' || echo '$(srcdir)/'`canon630u-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon630u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon630u_la-canon630u-s.lo `test -f 'canon630u-s.c' || echo '$(srcdir)/'`canon630u-s.c libsane_canon_dr_la-canon_dr-s.lo: canon_dr-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_dr_la-canon_dr-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Tpo -c -o libsane_canon_dr_la-canon_dr-s.lo `test -f 'canon_dr-s.c' || echo '$(srcdir)/'`canon_dr-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Tpo $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_dr_la-canon_dr-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Tpo -c -o libsane_canon_dr_la-canon_dr-s.lo `test -f 'canon_dr-s.c' || echo '$(srcdir)/'`canon_dr-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Tpo $(DEPDIR)/libsane_canon_dr_la-canon_dr-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_dr-s.c' object='libsane_canon_dr_la-canon_dr-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_dr_la-canon_dr-s.lo `test -f 'canon_dr-s.c' || echo '$(srcdir)/'`canon_dr-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_dr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_dr_la-canon_dr-s.lo `test -f 'canon_dr-s.c' || echo '$(srcdir)/'`canon_dr-s.c libsane_canon_pp_la-canon_pp-s.lo: canon_pp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_pp_la-canon_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Tpo -c -o libsane_canon_pp_la-canon_pp-s.lo `test -f 'canon_pp-s.c' || echo '$(srcdir)/'`canon_pp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Tpo $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_canon_pp_la-canon_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Tpo -c -o libsane_canon_pp_la-canon_pp-s.lo `test -f 'canon_pp-s.c' || echo '$(srcdir)/'`canon_pp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Tpo $(DEPDIR)/libsane_canon_pp_la-canon_pp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='canon_pp-s.c' object='libsane_canon_pp_la-canon_pp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_pp_la-canon_pp-s.lo `test -f 'canon_pp-s.c' || echo '$(srcdir)/'`canon_pp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_canon_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_canon_pp_la-canon_pp-s.lo `test -f 'canon_pp-s.c' || echo '$(srcdir)/'`canon_pp-s.c libsane_cardscan_la-cardscan-s.lo: cardscan-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_cardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_cardscan_la-cardscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_cardscan_la-cardscan-s.Tpo -c -o libsane_cardscan_la-cardscan-s.lo `test -f 'cardscan-s.c' || echo '$(srcdir)/'`cardscan-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_cardscan_la-cardscan-s.Tpo $(DEPDIR)/libsane_cardscan_la-cardscan-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_cardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_cardscan_la-cardscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_cardscan_la-cardscan-s.Tpo -c -o libsane_cardscan_la-cardscan-s.lo `test -f 'cardscan-s.c' || echo '$(srcdir)/'`cardscan-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_cardscan_la-cardscan-s.Tpo $(DEPDIR)/libsane_cardscan_la-cardscan-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cardscan-s.c' object='libsane_cardscan_la-cardscan-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_cardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_cardscan_la-cardscan-s.lo `test -f 'cardscan-s.c' || echo '$(srcdir)/'`cardscan-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_cardscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_cardscan_la-cardscan-s.lo `test -f 'cardscan-s.c' || echo '$(srcdir)/'`cardscan-s.c libsane_coolscan_la-coolscan-s.lo: coolscan-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan_la-coolscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan_la-coolscan-s.Tpo -c -o libsane_coolscan_la-coolscan-s.lo `test -f 'coolscan-s.c' || echo '$(srcdir)/'`coolscan-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_coolscan_la-coolscan-s.Tpo $(DEPDIR)/libsane_coolscan_la-coolscan-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan_la-coolscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan_la-coolscan-s.Tpo -c -o libsane_coolscan_la-coolscan-s.lo `test -f 'coolscan-s.c' || echo '$(srcdir)/'`coolscan-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_coolscan_la-coolscan-s.Tpo $(DEPDIR)/libsane_coolscan_la-coolscan-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan-s.c' object='libsane_coolscan_la-coolscan-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan_la-coolscan-s.lo `test -f 'coolscan-s.c' || echo '$(srcdir)/'`coolscan-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan_la-coolscan-s.lo `test -f 'coolscan-s.c' || echo '$(srcdir)/'`coolscan-s.c libsane_coolscan2_la-coolscan2-s.lo: coolscan2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan2_la-coolscan2-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Tpo -c -o libsane_coolscan2_la-coolscan2-s.lo `test -f 'coolscan2-s.c' || echo '$(srcdir)/'`coolscan2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Tpo $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan2_la-coolscan2-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Tpo -c -o libsane_coolscan2_la-coolscan2-s.lo `test -f 'coolscan2-s.c' || echo '$(srcdir)/'`coolscan2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Tpo $(DEPDIR)/libsane_coolscan2_la-coolscan2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan2-s.c' object='libsane_coolscan2_la-coolscan2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan2_la-coolscan2-s.lo `test -f 'coolscan2-s.c' || echo '$(srcdir)/'`coolscan2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan2_la-coolscan2-s.lo `test -f 'coolscan2-s.c' || echo '$(srcdir)/'`coolscan2-s.c libsane_coolscan3_la-coolscan3-s.lo: coolscan3-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan3_la-coolscan3-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Tpo -c -o libsane_coolscan3_la-coolscan3-s.lo `test -f 'coolscan3-s.c' || echo '$(srcdir)/'`coolscan3-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Tpo $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_coolscan3_la-coolscan3-s.lo -MD -MP -MF $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Tpo -c -o libsane_coolscan3_la-coolscan3-s.lo `test -f 'coolscan3-s.c' || echo '$(srcdir)/'`coolscan3-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Tpo $(DEPDIR)/libsane_coolscan3_la-coolscan3-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coolscan3-s.c' object='libsane_coolscan3_la-coolscan3-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan3_la-coolscan3-s.lo `test -f 'coolscan3-s.c' || echo '$(srcdir)/'`coolscan3-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_coolscan3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_coolscan3_la-coolscan3-s.lo `test -f 'coolscan3-s.c' || echo '$(srcdir)/'`coolscan3-s.c libsane_dc210_la-dc210-s.lo: dc210-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc210_la-dc210-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc210_la-dc210-s.Tpo -c -o libsane_dc210_la-dc210-s.lo `test -f 'dc210-s.c' || echo '$(srcdir)/'`dc210-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dc210_la-dc210-s.Tpo $(DEPDIR)/libsane_dc210_la-dc210-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc210_la-dc210-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc210_la-dc210-s.Tpo -c -o libsane_dc210_la-dc210-s.lo `test -f 'dc210-s.c' || echo '$(srcdir)/'`dc210-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dc210_la-dc210-s.Tpo $(DEPDIR)/libsane_dc210_la-dc210-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc210-s.c' object='libsane_dc210_la-dc210-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc210_la-dc210-s.lo `test -f 'dc210-s.c' || echo '$(srcdir)/'`dc210-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc210_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc210_la-dc210-s.lo `test -f 'dc210-s.c' || echo '$(srcdir)/'`dc210-s.c libsane_dc240_la-dc240-s.lo: dc240-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc240_la-dc240-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc240_la-dc240-s.Tpo -c -o libsane_dc240_la-dc240-s.lo `test -f 'dc240-s.c' || echo '$(srcdir)/'`dc240-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dc240_la-dc240-s.Tpo $(DEPDIR)/libsane_dc240_la-dc240-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc240_la-dc240-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc240_la-dc240-s.Tpo -c -o libsane_dc240_la-dc240-s.lo `test -f 'dc240-s.c' || echo '$(srcdir)/'`dc240-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dc240_la-dc240-s.Tpo $(DEPDIR)/libsane_dc240_la-dc240-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc240-s.c' object='libsane_dc240_la-dc240-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc240_la-dc240-s.lo `test -f 'dc240-s.c' || echo '$(srcdir)/'`dc240-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc240_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc240_la-dc240-s.lo `test -f 'dc240-s.c' || echo '$(srcdir)/'`dc240-s.c libsane_dc25_la-dc25-s.lo: dc25-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc25_la-dc25-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc25_la-dc25-s.Tpo -c -o libsane_dc25_la-dc25-s.lo `test -f 'dc25-s.c' || echo '$(srcdir)/'`dc25-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dc25_la-dc25-s.Tpo $(DEPDIR)/libsane_dc25_la-dc25-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dc25_la-dc25-s.lo -MD -MP -MF $(DEPDIR)/libsane_dc25_la-dc25-s.Tpo -c -o libsane_dc25_la-dc25-s.lo `test -f 'dc25-s.c' || echo '$(srcdir)/'`dc25-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dc25_la-dc25-s.Tpo $(DEPDIR)/libsane_dc25_la-dc25-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dc25-s.c' object='libsane_dc25_la-dc25-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc25_la-dc25-s.lo `test -f 'dc25-s.c' || echo '$(srcdir)/'`dc25-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dc25_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dc25_la-dc25-s.lo `test -f 'dc25-s.c' || echo '$(srcdir)/'`dc25-s.c libsane_dell1600n_net_la-dell1600n_net-s.lo: dell1600n_net-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dell1600n_net_la-dell1600n_net-s.lo -MD -MP -MF $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Tpo -c -o libsane_dell1600n_net_la-dell1600n_net-s.lo `test -f 'dell1600n_net-s.c' || echo '$(srcdir)/'`dell1600n_net-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Tpo $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dell1600n_net_la-dell1600n_net-s.lo -MD -MP -MF $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Tpo -c -o libsane_dell1600n_net_la-dell1600n_net-s.lo `test -f 'dell1600n_net-s.c' || echo '$(srcdir)/'`dell1600n_net-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Tpo $(DEPDIR)/libsane_dell1600n_net_la-dell1600n_net-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dell1600n_net-s.c' object='libsane_dell1600n_net_la-dell1600n_net-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dell1600n_net_la-dell1600n_net-s.lo `test -f 'dell1600n_net-s.c' || echo '$(srcdir)/'`dell1600n_net-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dell1600n_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dell1600n_net_la-dell1600n_net-s.lo `test -f 'dell1600n_net-s.c' || echo '$(srcdir)/'`dell1600n_net-s.c libsane_dll_la-dll-s.lo: dll-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dll_la-dll-s.lo -MD -MP -MF $(DEPDIR)/libsane_dll_la-dll-s.Tpo -c -o libsane_dll_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dll_la-dll-s.Tpo $(DEPDIR)/libsane_dll_la-dll-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dll_la-dll-s.lo -MD -MP -MF $(DEPDIR)/libsane_dll_la-dll-s.Tpo -c -o libsane_dll_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dll_la-dll-s.Tpo $(DEPDIR)/libsane_dll_la-dll-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dll-s.c' object='libsane_dll_la-dll-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dll_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dll_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dll_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c libsane_dmc_la-dmc-s.lo: dmc-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dmc_la-dmc-s.lo -MD -MP -MF $(DEPDIR)/libsane_dmc_la-dmc-s.Tpo -c -o libsane_dmc_la-dmc-s.lo `test -f 'dmc-s.c' || echo '$(srcdir)/'`dmc-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_dmc_la-dmc-s.Tpo $(DEPDIR)/libsane_dmc_la-dmc-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_dmc_la-dmc-s.lo -MD -MP -MF $(DEPDIR)/libsane_dmc_la-dmc-s.Tpo -c -o libsane_dmc_la-dmc-s.lo `test -f 'dmc-s.c' || echo '$(srcdir)/'`dmc-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_dmc_la-dmc-s.Tpo $(DEPDIR)/libsane_dmc_la-dmc-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dmc-s.c' object='libsane_dmc_la-dmc-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dmc_la-dmc-s.lo `test -f 'dmc-s.c' || echo '$(srcdir)/'`dmc-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_dmc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_dmc_la-dmc-s.lo `test -f 'dmc-s.c' || echo '$(srcdir)/'`dmc-s.c libsane_epjitsu_la-epjitsu-s.lo: epjitsu-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epjitsu_la-epjitsu-s.lo -MD -MP -MF $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Tpo -c -o libsane_epjitsu_la-epjitsu-s.lo `test -f 'epjitsu-s.c' || echo '$(srcdir)/'`epjitsu-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Tpo $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epjitsu_la-epjitsu-s.lo -MD -MP -MF $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Tpo -c -o libsane_epjitsu_la-epjitsu-s.lo `test -f 'epjitsu-s.c' || echo '$(srcdir)/'`epjitsu-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Tpo $(DEPDIR)/libsane_epjitsu_la-epjitsu-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epjitsu-s.c' object='libsane_epjitsu_la-epjitsu-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epjitsu_la-epjitsu-s.lo `test -f 'epjitsu-s.c' || echo '$(srcdir)/'`epjitsu-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epjitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epjitsu_la-epjitsu-s.lo `test -f 'epjitsu-s.c' || echo '$(srcdir)/'`epjitsu-s.c libsane_epson_la-epson-s.lo: epson-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epson_la-epson-s.lo -MD -MP -MF $(DEPDIR)/libsane_epson_la-epson-s.Tpo -c -o libsane_epson_la-epson-s.lo `test -f 'epson-s.c' || echo '$(srcdir)/'`epson-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_epson_la-epson-s.Tpo $(DEPDIR)/libsane_epson_la-epson-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epson_la-epson-s.lo -MD -MP -MF $(DEPDIR)/libsane_epson_la-epson-s.Tpo -c -o libsane_epson_la-epson-s.lo `test -f 'epson-s.c' || echo '$(srcdir)/'`epson-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_epson_la-epson-s.Tpo $(DEPDIR)/libsane_epson_la-epson-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson-s.c' object='libsane_epson_la-epson-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epson_la-epson-s.lo `test -f 'epson-s.c' || echo '$(srcdir)/'`epson-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epson_la-epson-s.lo `test -f 'epson-s.c' || echo '$(srcdir)/'`epson-s.c libsane_epson2_la-epson2-s.lo: epson2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epson2_la-epson2-s.lo -MD -MP -MF $(DEPDIR)/libsane_epson2_la-epson2-s.Tpo -c -o libsane_epson2_la-epson2-s.lo `test -f 'epson2-s.c' || echo '$(srcdir)/'`epson2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_epson2_la-epson2-s.Tpo $(DEPDIR)/libsane_epson2_la-epson2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_epson2_la-epson2-s.lo -MD -MP -MF $(DEPDIR)/libsane_epson2_la-epson2-s.Tpo -c -o libsane_epson2_la-epson2-s.lo `test -f 'epson2-s.c' || echo '$(srcdir)/'`epson2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_epson2_la-epson2-s.Tpo $(DEPDIR)/libsane_epson2_la-epson2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='epson2-s.c' object='libsane_epson2_la-epson2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epson2_la-epson2-s.lo `test -f 'epson2-s.c' || echo '$(srcdir)/'`epson2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_epson2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_epson2_la-epson2-s.lo `test -f 'epson2-s.c' || echo '$(srcdir)/'`epson2-s.c libsane_fujitsu_la-fujitsu-s.lo: fujitsu-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_fujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_fujitsu_la-fujitsu-s.lo -MD -MP -MF $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Tpo -c -o libsane_fujitsu_la-fujitsu-s.lo `test -f 'fujitsu-s.c' || echo '$(srcdir)/'`fujitsu-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Tpo $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_fujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_fujitsu_la-fujitsu-s.lo -MD -MP -MF $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Tpo -c -o libsane_fujitsu_la-fujitsu-s.lo `test -f 'fujitsu-s.c' || echo '$(srcdir)/'`fujitsu-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Tpo $(DEPDIR)/libsane_fujitsu_la-fujitsu-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fujitsu-s.c' object='libsane_fujitsu_la-fujitsu-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_fujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_fujitsu_la-fujitsu-s.lo `test -f 'fujitsu-s.c' || echo '$(srcdir)/'`fujitsu-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_fujitsu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_fujitsu_la-fujitsu-s.lo `test -f 'fujitsu-s.c' || echo '$(srcdir)/'`fujitsu-s.c libsane_genesys_la-genesys-s.lo: genesys-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_genesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_genesys_la-genesys-s.lo -MD -MP -MF $(DEPDIR)/libsane_genesys_la-genesys-s.Tpo -c -o libsane_genesys_la-genesys-s.lo `test -f 'genesys-s.c' || echo '$(srcdir)/'`genesys-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_genesys_la-genesys-s.Tpo $(DEPDIR)/libsane_genesys_la-genesys-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_genesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_genesys_la-genesys-s.lo -MD -MP -MF $(DEPDIR)/libsane_genesys_la-genesys-s.Tpo -c -o libsane_genesys_la-genesys-s.lo `test -f 'genesys-s.c' || echo '$(srcdir)/'`genesys-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_genesys_la-genesys-s.Tpo $(DEPDIR)/libsane_genesys_la-genesys-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genesys-s.c' object='libsane_genesys_la-genesys-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_genesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_genesys_la-genesys-s.lo `test -f 'genesys-s.c' || echo '$(srcdir)/'`genesys-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_genesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_genesys_la-genesys-s.lo `test -f 'genesys-s.c' || echo '$(srcdir)/'`genesys-s.c libsane_gphoto2_la-gphoto2-s.lo: gphoto2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gphoto2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_gphoto2_la-gphoto2-s.lo -MD -MP -MF $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Tpo -c -o libsane_gphoto2_la-gphoto2-s.lo `test -f 'gphoto2-s.c' || echo '$(srcdir)/'`gphoto2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Tpo $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gphoto2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_gphoto2_la-gphoto2-s.lo -MD -MP -MF $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Tpo -c -o libsane_gphoto2_la-gphoto2-s.lo `test -f 'gphoto2-s.c' || echo '$(srcdir)/'`gphoto2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Tpo $(DEPDIR)/libsane_gphoto2_la-gphoto2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gphoto2-s.c' object='libsane_gphoto2_la-gphoto2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gphoto2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_gphoto2_la-gphoto2-s.lo `test -f 'gphoto2-s.c' || echo '$(srcdir)/'`gphoto2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gphoto2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_gphoto2_la-gphoto2-s.lo `test -f 'gphoto2-s.c' || echo '$(srcdir)/'`gphoto2-s.c libsane_gt68xx_la-gt68xx-s.lo: gt68xx-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_gt68xx_la-gt68xx-s.lo -MD -MP -MF $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Tpo -c -o libsane_gt68xx_la-gt68xx-s.lo `test -f 'gt68xx-s.c' || echo '$(srcdir)/'`gt68xx-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Tpo $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_gt68xx_la-gt68xx-s.lo -MD -MP -MF $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Tpo -c -o libsane_gt68xx_la-gt68xx-s.lo `test -f 'gt68xx-s.c' || echo '$(srcdir)/'`gt68xx-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Tpo $(DEPDIR)/libsane_gt68xx_la-gt68xx-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gt68xx-s.c' object='libsane_gt68xx_la-gt68xx-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_gt68xx_la-gt68xx-s.lo `test -f 'gt68xx-s.c' || echo '$(srcdir)/'`gt68xx-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_gt68xx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_gt68xx_la-gt68xx-s.lo `test -f 'gt68xx-s.c' || echo '$(srcdir)/'`gt68xx-s.c libsane_hp_la-hp-s.lo: hp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp_la-hp-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp_la-hp-s.Tpo -c -o libsane_hp_la-hp-s.lo `test -f 'hp-s.c' || echo '$(srcdir)/'`hp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp_la-hp-s.Tpo $(DEPDIR)/libsane_hp_la-hp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp_la-hp-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp_la-hp-s.Tpo -c -o libsane_hp_la-hp-s.lo `test -f 'hp-s.c' || echo '$(srcdir)/'`hp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp_la-hp-s.Tpo $(DEPDIR)/libsane_hp_la-hp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp-s.c' object='libsane_hp_la-hp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp_la-hp-s.lo `test -f 'hp-s.c' || echo '$(srcdir)/'`hp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp_la-hp-s.lo `test -f 'hp-s.c' || echo '$(srcdir)/'`hp-s.c libsane_hp3500_la-hp3500-s.lo: hp3500-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp3500_la-hp3500-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp3500_la-hp3500-s.Tpo -c -o libsane_hp3500_la-hp3500-s.lo `test -f 'hp3500-s.c' || echo '$(srcdir)/'`hp3500-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp3500_la-hp3500-s.Tpo $(DEPDIR)/libsane_hp3500_la-hp3500-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp3500_la-hp3500-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp3500_la-hp3500-s.Tpo -c -o libsane_hp3500_la-hp3500-s.lo `test -f 'hp3500-s.c' || echo '$(srcdir)/'`hp3500-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp3500_la-hp3500-s.Tpo $(DEPDIR)/libsane_hp3500_la-hp3500-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp3500-s.c' object='libsane_hp3500_la-hp3500-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp3500_la-hp3500-s.lo `test -f 'hp3500-s.c' || echo '$(srcdir)/'`hp3500-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3500_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp3500_la-hp3500-s.lo `test -f 'hp3500-s.c' || echo '$(srcdir)/'`hp3500-s.c libsane_hp3900_la-hp3900-s.lo: hp3900-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp3900_la-hp3900-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp3900_la-hp3900-s.Tpo -c -o libsane_hp3900_la-hp3900-s.lo `test -f 'hp3900-s.c' || echo '$(srcdir)/'`hp3900-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp3900_la-hp3900-s.Tpo $(DEPDIR)/libsane_hp3900_la-hp3900-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp3900_la-hp3900-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp3900_la-hp3900-s.Tpo -c -o libsane_hp3900_la-hp3900-s.lo `test -f 'hp3900-s.c' || echo '$(srcdir)/'`hp3900-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp3900_la-hp3900-s.Tpo $(DEPDIR)/libsane_hp3900_la-hp3900-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp3900-s.c' object='libsane_hp3900_la-hp3900-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp3900_la-hp3900-s.lo `test -f 'hp3900-s.c' || echo '$(srcdir)/'`hp3900-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp3900_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp3900_la-hp3900-s.lo `test -f 'hp3900-s.c' || echo '$(srcdir)/'`hp3900-s.c libsane_hp4200_la-hp4200-s.lo: hp4200-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp4200_la-hp4200-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp4200_la-hp4200-s.Tpo -c -o libsane_hp4200_la-hp4200-s.lo `test -f 'hp4200-s.c' || echo '$(srcdir)/'`hp4200-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp4200_la-hp4200-s.Tpo $(DEPDIR)/libsane_hp4200_la-hp4200-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp4200_la-hp4200-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp4200_la-hp4200-s.Tpo -c -o libsane_hp4200_la-hp4200-s.lo `test -f 'hp4200-s.c' || echo '$(srcdir)/'`hp4200-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp4200_la-hp4200-s.Tpo $(DEPDIR)/libsane_hp4200_la-hp4200-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp4200-s.c' object='libsane_hp4200_la-hp4200-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp4200_la-hp4200-s.lo `test -f 'hp4200-s.c' || echo '$(srcdir)/'`hp4200-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp4200_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp4200_la-hp4200-s.lo `test -f 'hp4200-s.c' || echo '$(srcdir)/'`hp4200-s.c libsane_hp5400_la-hp5400-s.lo: hp5400-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp5400_la-hp5400-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp5400_la-hp5400-s.Tpo -c -o libsane_hp5400_la-hp5400-s.lo `test -f 'hp5400-s.c' || echo '$(srcdir)/'`hp5400-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp5400_la-hp5400-s.Tpo $(DEPDIR)/libsane_hp5400_la-hp5400-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp5400_la-hp5400-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp5400_la-hp5400-s.Tpo -c -o libsane_hp5400_la-hp5400-s.lo `test -f 'hp5400-s.c' || echo '$(srcdir)/'`hp5400-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp5400_la-hp5400-s.Tpo $(DEPDIR)/libsane_hp5400_la-hp5400-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp5400-s.c' object='libsane_hp5400_la-hp5400-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp5400_la-hp5400-s.lo `test -f 'hp5400-s.c' || echo '$(srcdir)/'`hp5400-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp5400_la-hp5400-s.lo `test -f 'hp5400-s.c' || echo '$(srcdir)/'`hp5400-s.c libsane_hp5590_la-hp5590-s.lo: hp5590-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp5590_la-hp5590-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp5590_la-hp5590-s.Tpo -c -o libsane_hp5590_la-hp5590-s.lo `test -f 'hp5590-s.c' || echo '$(srcdir)/'`hp5590-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hp5590_la-hp5590-s.Tpo $(DEPDIR)/libsane_hp5590_la-hp5590-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hp5590_la-hp5590-s.lo -MD -MP -MF $(DEPDIR)/libsane_hp5590_la-hp5590-s.Tpo -c -o libsane_hp5590_la-hp5590-s.lo `test -f 'hp5590-s.c' || echo '$(srcdir)/'`hp5590-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hp5590_la-hp5590-s.Tpo $(DEPDIR)/libsane_hp5590_la-hp5590-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hp5590-s.c' object='libsane_hp5590_la-hp5590-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp5590_la-hp5590-s.lo `test -f 'hp5590-s.c' || echo '$(srcdir)/'`hp5590-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hp5590_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hp5590_la-hp5590-s.lo `test -f 'hp5590-s.c' || echo '$(srcdir)/'`hp5590-s.c libsane_hpljm1005_la-hpljm1005-s.lo: hpljm1005-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hpljm1005_la-hpljm1005-s.lo -MD -MP -MF $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Tpo -c -o libsane_hpljm1005_la-hpljm1005-s.lo `test -f 'hpljm1005-s.c' || echo '$(srcdir)/'`hpljm1005-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Tpo $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hpljm1005_la-hpljm1005-s.lo -MD -MP -MF $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Tpo -c -o libsane_hpljm1005_la-hpljm1005-s.lo `test -f 'hpljm1005-s.c' || echo '$(srcdir)/'`hpljm1005-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Tpo $(DEPDIR)/libsane_hpljm1005_la-hpljm1005-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hpljm1005-s.c' object='libsane_hpljm1005_la-hpljm1005-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hpljm1005_la-hpljm1005-s.lo `test -f 'hpljm1005-s.c' || echo '$(srcdir)/'`hpljm1005-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpljm1005_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hpljm1005_la-hpljm1005-s.lo `test -f 'hpljm1005-s.c' || echo '$(srcdir)/'`hpljm1005-s.c libsane_hpsj5s_la-hpsj5s-s.lo: hpsj5s-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hpsj5s_la-hpsj5s-s.lo -MD -MP -MF $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Tpo -c -o libsane_hpsj5s_la-hpsj5s-s.lo `test -f 'hpsj5s-s.c' || echo '$(srcdir)/'`hpsj5s-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Tpo $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hpsj5s_la-hpsj5s-s.lo -MD -MP -MF $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Tpo -c -o libsane_hpsj5s_la-hpsj5s-s.lo `test -f 'hpsj5s-s.c' || echo '$(srcdir)/'`hpsj5s-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Tpo $(DEPDIR)/libsane_hpsj5s_la-hpsj5s-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hpsj5s-s.c' object='libsane_hpsj5s_la-hpsj5s-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hpsj5s_la-hpsj5s-s.lo `test -f 'hpsj5s-s.c' || echo '$(srcdir)/'`hpsj5s-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hpsj5s_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hpsj5s_la-hpsj5s-s.lo `test -f 'hpsj5s-s.c' || echo '$(srcdir)/'`hpsj5s-s.c libsane_hs2p_la-hs2p-s.lo: hs2p-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hs2p_la-hs2p-s.lo -MD -MP -MF $(DEPDIR)/libsane_hs2p_la-hs2p-s.Tpo -c -o libsane_hs2p_la-hs2p-s.lo `test -f 'hs2p-s.c' || echo '$(srcdir)/'`hs2p-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_hs2p_la-hs2p-s.Tpo $(DEPDIR)/libsane_hs2p_la-hs2p-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_hs2p_la-hs2p-s.lo -MD -MP -MF $(DEPDIR)/libsane_hs2p_la-hs2p-s.Tpo -c -o libsane_hs2p_la-hs2p-s.lo `test -f 'hs2p-s.c' || echo '$(srcdir)/'`hs2p-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_hs2p_la-hs2p-s.Tpo $(DEPDIR)/libsane_hs2p_la-hs2p-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hs2p-s.c' object='libsane_hs2p_la-hs2p-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hs2p_la-hs2p-s.lo `test -f 'hs2p-s.c' || echo '$(srcdir)/'`hs2p-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_hs2p_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_hs2p_la-hs2p-s.lo `test -f 'hs2p-s.c' || echo '$(srcdir)/'`hs2p-s.c libsane_ibm_la-ibm-s.lo: ibm-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ibm_la-ibm-s.lo -MD -MP -MF $(DEPDIR)/libsane_ibm_la-ibm-s.Tpo -c -o libsane_ibm_la-ibm-s.lo `test -f 'ibm-s.c' || echo '$(srcdir)/'`ibm-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_ibm_la-ibm-s.Tpo $(DEPDIR)/libsane_ibm_la-ibm-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ibm_la-ibm-s.lo -MD -MP -MF $(DEPDIR)/libsane_ibm_la-ibm-s.Tpo -c -o libsane_ibm_la-ibm-s.lo `test -f 'ibm-s.c' || echo '$(srcdir)/'`ibm-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_ibm_la-ibm-s.Tpo $(DEPDIR)/libsane_ibm_la-ibm-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ibm-s.c' object='libsane_ibm_la-ibm-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ibm_la-ibm-s.lo `test -f 'ibm-s.c' || echo '$(srcdir)/'`ibm-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ibm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ibm_la-ibm-s.lo `test -f 'ibm-s.c' || echo '$(srcdir)/'`ibm-s.c + +libsane_kodak_la-kodak-s.lo: kodak-s.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_kodak_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_kodak_la-kodak-s.lo -MD -MP -MF $(DEPDIR)/libsane_kodak_la-kodak-s.Tpo -c -o libsane_kodak_la-kodak-s.lo `test -f 'kodak-s.c' || echo '$(srcdir)/'`kodak-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_kodak_la-kodak-s.Tpo $(DEPDIR)/libsane_kodak_la-kodak-s.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kodak-s.c' object='libsane_kodak_la-kodak-s.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_kodak_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_kodak_la-kodak-s.lo `test -f 'kodak-s.c' || echo '$(srcdir)/'`kodak-s.c + +libsane_kvs1025_la-kvs1025-s.lo: kvs1025-s.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_kvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_kvs1025_la-kvs1025-s.lo -MD -MP -MF $(DEPDIR)/libsane_kvs1025_la-kvs1025-s.Tpo -c -o libsane_kvs1025_la-kvs1025-s.lo `test -f 'kvs1025-s.c' || echo '$(srcdir)/'`kvs1025-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_kvs1025_la-kvs1025-s.Tpo $(DEPDIR)/libsane_kvs1025_la-kvs1025-s.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kvs1025-s.c' object='libsane_kvs1025_la-kvs1025-s.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_kvs1025_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_kvs1025_la-kvs1025-s.lo `test -f 'kvs1025-s.c' || echo '$(srcdir)/'`kvs1025-s.c libsane_leo_la-leo-s.lo: leo-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_leo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_leo_la-leo-s.lo -MD -MP -MF $(DEPDIR)/libsane_leo_la-leo-s.Tpo -c -o libsane_leo_la-leo-s.lo `test -f 'leo-s.c' || echo '$(srcdir)/'`leo-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_leo_la-leo-s.Tpo $(DEPDIR)/libsane_leo_la-leo-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_leo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_leo_la-leo-s.lo -MD -MP -MF $(DEPDIR)/libsane_leo_la-leo-s.Tpo -c -o libsane_leo_la-leo-s.lo `test -f 'leo-s.c' || echo '$(srcdir)/'`leo-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_leo_la-leo-s.Tpo $(DEPDIR)/libsane_leo_la-leo-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='leo-s.c' object='libsane_leo_la-leo-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_leo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_leo_la-leo-s.lo `test -f 'leo-s.c' || echo '$(srcdir)/'`leo-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_leo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_leo_la-leo-s.lo `test -f 'leo-s.c' || echo '$(srcdir)/'`leo-s.c libsane_lexmark_la-lexmark-s.lo: lexmark-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_lexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_lexmark_la-lexmark-s.lo -MD -MP -MF $(DEPDIR)/libsane_lexmark_la-lexmark-s.Tpo -c -o libsane_lexmark_la-lexmark-s.lo `test -f 'lexmark-s.c' || echo '$(srcdir)/'`lexmark-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_lexmark_la-lexmark-s.Tpo $(DEPDIR)/libsane_lexmark_la-lexmark-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_lexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_lexmark_la-lexmark-s.lo -MD -MP -MF $(DEPDIR)/libsane_lexmark_la-lexmark-s.Tpo -c -o libsane_lexmark_la-lexmark-s.lo `test -f 'lexmark-s.c' || echo '$(srcdir)/'`lexmark-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_lexmark_la-lexmark-s.Tpo $(DEPDIR)/libsane_lexmark_la-lexmark-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lexmark-s.c' object='libsane_lexmark_la-lexmark-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_lexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_lexmark_la-lexmark-s.lo `test -f 'lexmark-s.c' || echo '$(srcdir)/'`lexmark-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_lexmark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_lexmark_la-lexmark-s.lo `test -f 'lexmark-s.c' || echo '$(srcdir)/'`lexmark-s.c libsane_ma1509_la-ma1509-s.lo: ma1509-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ma1509_la-ma1509-s.lo -MD -MP -MF $(DEPDIR)/libsane_ma1509_la-ma1509-s.Tpo -c -o libsane_ma1509_la-ma1509-s.lo `test -f 'ma1509-s.c' || echo '$(srcdir)/'`ma1509-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_ma1509_la-ma1509-s.Tpo $(DEPDIR)/libsane_ma1509_la-ma1509-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ma1509_la-ma1509-s.lo -MD -MP -MF $(DEPDIR)/libsane_ma1509_la-ma1509-s.Tpo -c -o libsane_ma1509_la-ma1509-s.lo `test -f 'ma1509-s.c' || echo '$(srcdir)/'`ma1509-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_ma1509_la-ma1509-s.Tpo $(DEPDIR)/libsane_ma1509_la-ma1509-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ma1509-s.c' object='libsane_ma1509_la-ma1509-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ma1509_la-ma1509-s.lo `test -f 'ma1509-s.c' || echo '$(srcdir)/'`ma1509-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ma1509_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ma1509_la-ma1509-s.lo `test -f 'ma1509-s.c' || echo '$(srcdir)/'`ma1509-s.c libsane_matsushita_la-matsushita-s.lo: matsushita-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_matsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_matsushita_la-matsushita-s.lo -MD -MP -MF $(DEPDIR)/libsane_matsushita_la-matsushita-s.Tpo -c -o libsane_matsushita_la-matsushita-s.lo `test -f 'matsushita-s.c' || echo '$(srcdir)/'`matsushita-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_matsushita_la-matsushita-s.Tpo $(DEPDIR)/libsane_matsushita_la-matsushita-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_matsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_matsushita_la-matsushita-s.lo -MD -MP -MF $(DEPDIR)/libsane_matsushita_la-matsushita-s.Tpo -c -o libsane_matsushita_la-matsushita-s.lo `test -f 'matsushita-s.c' || echo '$(srcdir)/'`matsushita-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_matsushita_la-matsushita-s.Tpo $(DEPDIR)/libsane_matsushita_la-matsushita-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matsushita-s.c' object='libsane_matsushita_la-matsushita-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_matsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_matsushita_la-matsushita-s.lo `test -f 'matsushita-s.c' || echo '$(srcdir)/'`matsushita-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_matsushita_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_matsushita_la-matsushita-s.lo `test -f 'matsushita-s.c' || echo '$(srcdir)/'`matsushita-s.c libsane_microtek_la-microtek-s.lo: microtek-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_microtek_la-microtek-s.lo -MD -MP -MF $(DEPDIR)/libsane_microtek_la-microtek-s.Tpo -c -o libsane_microtek_la-microtek-s.lo `test -f 'microtek-s.c' || echo '$(srcdir)/'`microtek-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_microtek_la-microtek-s.Tpo $(DEPDIR)/libsane_microtek_la-microtek-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_microtek_la-microtek-s.lo -MD -MP -MF $(DEPDIR)/libsane_microtek_la-microtek-s.Tpo -c -o libsane_microtek_la-microtek-s.lo `test -f 'microtek-s.c' || echo '$(srcdir)/'`microtek-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_microtek_la-microtek-s.Tpo $(DEPDIR)/libsane_microtek_la-microtek-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='microtek-s.c' object='libsane_microtek_la-microtek-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_microtek_la-microtek-s.lo `test -f 'microtek-s.c' || echo '$(srcdir)/'`microtek-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_microtek_la-microtek-s.lo `test -f 'microtek-s.c' || echo '$(srcdir)/'`microtek-s.c libsane_microtek2_la-microtek2-s.lo: microtek2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_microtek2_la-microtek2-s.lo -MD -MP -MF $(DEPDIR)/libsane_microtek2_la-microtek2-s.Tpo -c -o libsane_microtek2_la-microtek2-s.lo `test -f 'microtek2-s.c' || echo '$(srcdir)/'`microtek2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_microtek2_la-microtek2-s.Tpo $(DEPDIR)/libsane_microtek2_la-microtek2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_microtek2_la-microtek2-s.lo -MD -MP -MF $(DEPDIR)/libsane_microtek2_la-microtek2-s.Tpo -c -o libsane_microtek2_la-microtek2-s.lo `test -f 'microtek2-s.c' || echo '$(srcdir)/'`microtek2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_microtek2_la-microtek2-s.Tpo $(DEPDIR)/libsane_microtek2_la-microtek2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='microtek2-s.c' object='libsane_microtek2_la-microtek2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_microtek2_la-microtek2-s.lo `test -f 'microtek2-s.c' || echo '$(srcdir)/'`microtek2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_microtek2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_microtek2_la-microtek2-s.lo `test -f 'microtek2-s.c' || echo '$(srcdir)/'`microtek2-s.c libsane_mustek_la-mustek-s.lo: mustek-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_la-mustek-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_la-mustek-s.Tpo -c -o libsane_mustek_la-mustek-s.lo `test -f 'mustek-s.c' || echo '$(srcdir)/'`mustek-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_mustek_la-mustek-s.Tpo $(DEPDIR)/libsane_mustek_la-mustek-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_la-mustek-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_la-mustek-s.Tpo -c -o libsane_mustek_la-mustek-s.lo `test -f 'mustek-s.c' || echo '$(srcdir)/'`mustek-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_mustek_la-mustek-s.Tpo $(DEPDIR)/libsane_mustek_la-mustek-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek-s.c' object='libsane_mustek_la-mustek-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_la-mustek-s.lo `test -f 'mustek-s.c' || echo '$(srcdir)/'`mustek-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_la-mustek-s.lo `test -f 'mustek-s.c' || echo '$(srcdir)/'`mustek-s.c libsane_mustek_pp_la-mustek_pp-s.lo: mustek_pp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_pp_la-mustek_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Tpo -c -o libsane_mustek_pp_la-mustek_pp-s.lo `test -f 'mustek_pp-s.c' || echo '$(srcdir)/'`mustek_pp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Tpo $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_pp_la-mustek_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Tpo -c -o libsane_mustek_pp_la-mustek_pp-s.lo `test -f 'mustek_pp-s.c' || echo '$(srcdir)/'`mustek_pp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Tpo $(DEPDIR)/libsane_mustek_pp_la-mustek_pp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_pp-s.c' object='libsane_mustek_pp_la-mustek_pp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_pp_la-mustek_pp-s.lo `test -f 'mustek_pp-s.c' || echo '$(srcdir)/'`mustek_pp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_pp_la-mustek_pp-s.lo `test -f 'mustek_pp-s.c' || echo '$(srcdir)/'`mustek_pp-s.c libsane_mustek_usb_la-mustek_usb-s.lo: mustek_usb-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_usb_la-mustek_usb-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Tpo -c -o libsane_mustek_usb_la-mustek_usb-s.lo `test -f 'mustek_usb-s.c' || echo '$(srcdir)/'`mustek_usb-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Tpo $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_usb_la-mustek_usb-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Tpo -c -o libsane_mustek_usb_la-mustek_usb-s.lo `test -f 'mustek_usb-s.c' || echo '$(srcdir)/'`mustek_usb-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Tpo $(DEPDIR)/libsane_mustek_usb_la-mustek_usb-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_usb-s.c' object='libsane_mustek_usb_la-mustek_usb-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_usb_la-mustek_usb-s.lo `test -f 'mustek_usb-s.c' || echo '$(srcdir)/'`mustek_usb-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_usb_la-mustek_usb-s.lo `test -f 'mustek_usb-s.c' || echo '$(srcdir)/'`mustek_usb-s.c libsane_mustek_usb2_la-mustek_usb2-s.lo: mustek_usb2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_usb2_la-mustek_usb2-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Tpo -c -o libsane_mustek_usb2_la-mustek_usb2-s.lo `test -f 'mustek_usb2-s.c' || echo '$(srcdir)/'`mustek_usb2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Tpo $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_mustek_usb2_la-mustek_usb2-s.lo -MD -MP -MF $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Tpo -c -o libsane_mustek_usb2_la-mustek_usb2-s.lo `test -f 'mustek_usb2-s.c' || echo '$(srcdir)/'`mustek_usb2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Tpo $(DEPDIR)/libsane_mustek_usb2_la-mustek_usb2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mustek_usb2-s.c' object='libsane_mustek_usb2_la-mustek_usb2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_usb2_la-mustek_usb2-s.lo `test -f 'mustek_usb2-s.c' || echo '$(srcdir)/'`mustek_usb2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_mustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_mustek_usb2_la-mustek_usb2-s.lo `test -f 'mustek_usb2-s.c' || echo '$(srcdir)/'`mustek_usb2-s.c libsane_nec_la-nec-s.lo: nec-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_nec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_nec_la-nec-s.lo -MD -MP -MF $(DEPDIR)/libsane_nec_la-nec-s.Tpo -c -o libsane_nec_la-nec-s.lo `test -f 'nec-s.c' || echo '$(srcdir)/'`nec-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_nec_la-nec-s.Tpo $(DEPDIR)/libsane_nec_la-nec-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_nec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_nec_la-nec-s.lo -MD -MP -MF $(DEPDIR)/libsane_nec_la-nec-s.Tpo -c -o libsane_nec_la-nec-s.lo `test -f 'nec-s.c' || echo '$(srcdir)/'`nec-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_nec_la-nec-s.Tpo $(DEPDIR)/libsane_nec_la-nec-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nec-s.c' object='libsane_nec_la-nec-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_nec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_nec_la-nec-s.lo `test -f 'nec-s.c' || echo '$(srcdir)/'`nec-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_nec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_nec_la-nec-s.lo `test -f 'nec-s.c' || echo '$(srcdir)/'`nec-s.c libsane_net_la-net-s.lo: net-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_net_la-net-s.lo -MD -MP -MF $(DEPDIR)/libsane_net_la-net-s.Tpo -c -o libsane_net_la-net-s.lo `test -f 'net-s.c' || echo '$(srcdir)/'`net-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_net_la-net-s.Tpo $(DEPDIR)/libsane_net_la-net-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_net_la-net-s.lo -MD -MP -MF $(DEPDIR)/libsane_net_la-net-s.Tpo -c -o libsane_net_la-net-s.lo `test -f 'net-s.c' || echo '$(srcdir)/'`net-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_net_la-net-s.Tpo $(DEPDIR)/libsane_net_la-net-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='net-s.c' object='libsane_net_la-net-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_net_la-net-s.lo `test -f 'net-s.c' || echo '$(srcdir)/'`net-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_net_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_net_la-net-s.lo `test -f 'net-s.c' || echo '$(srcdir)/'`net-s.c libsane_niash_la-niash-s.lo: niash-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_niash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_niash_la-niash-s.lo -MD -MP -MF $(DEPDIR)/libsane_niash_la-niash-s.Tpo -c -o libsane_niash_la-niash-s.lo `test -f 'niash-s.c' || echo '$(srcdir)/'`niash-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_niash_la-niash-s.Tpo $(DEPDIR)/libsane_niash_la-niash-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_niash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_niash_la-niash-s.lo -MD -MP -MF $(DEPDIR)/libsane_niash_la-niash-s.Tpo -c -o libsane_niash_la-niash-s.lo `test -f 'niash-s.c' || echo '$(srcdir)/'`niash-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_niash_la-niash-s.Tpo $(DEPDIR)/libsane_niash_la-niash-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='niash-s.c' object='libsane_niash_la-niash-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_niash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_niash_la-niash-s.lo `test -f 'niash-s.c' || echo '$(srcdir)/'`niash-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_niash_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_niash_la-niash-s.lo `test -f 'niash-s.c' || echo '$(srcdir)/'`niash-s.c + +libsane_p5_la-p5-s.lo: p5-s.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_p5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_p5_la-p5-s.lo -MD -MP -MF $(DEPDIR)/libsane_p5_la-p5-s.Tpo -c -o libsane_p5_la-p5-s.lo `test -f 'p5-s.c' || echo '$(srcdir)/'`p5-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_p5_la-p5-s.Tpo $(DEPDIR)/libsane_p5_la-p5-s.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='p5-s.c' object='libsane_p5_la-p5-s.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_p5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_p5_la-p5-s.lo `test -f 'p5-s.c' || echo '$(srcdir)/'`p5-s.c libsane_pie_la-pie-s.lo: pie-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pie_la-pie-s.lo -MD -MP -MF $(DEPDIR)/libsane_pie_la-pie-s.Tpo -c -o libsane_pie_la-pie-s.lo `test -f 'pie-s.c' || echo '$(srcdir)/'`pie-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_pie_la-pie-s.Tpo $(DEPDIR)/libsane_pie_la-pie-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pie_la-pie-s.lo -MD -MP -MF $(DEPDIR)/libsane_pie_la-pie-s.Tpo -c -o libsane_pie_la-pie-s.lo `test -f 'pie-s.c' || echo '$(srcdir)/'`pie-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_pie_la-pie-s.Tpo $(DEPDIR)/libsane_pie_la-pie-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pie-s.c' object='libsane_pie_la-pie-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pie_la-pie-s.lo `test -f 'pie-s.c' || echo '$(srcdir)/'`pie-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pie_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pie_la-pie-s.lo `test -f 'pie-s.c' || echo '$(srcdir)/'`pie-s.c libsane_pint_la-pint-s.lo: pint-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pint_la-pint-s.lo -MD -MP -MF $(DEPDIR)/libsane_pint_la-pint-s.Tpo -c -o libsane_pint_la-pint-s.lo `test -f 'pint-s.c' || echo '$(srcdir)/'`pint-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_pint_la-pint-s.Tpo $(DEPDIR)/libsane_pint_la-pint-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pint_la-pint-s.lo -MD -MP -MF $(DEPDIR)/libsane_pint_la-pint-s.Tpo -c -o libsane_pint_la-pint-s.lo `test -f 'pint-s.c' || echo '$(srcdir)/'`pint-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_pint_la-pint-s.Tpo $(DEPDIR)/libsane_pint_la-pint-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pint-s.c' object='libsane_pint_la-pint-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pint_la-pint-s.lo `test -f 'pint-s.c' || echo '$(srcdir)/'`pint-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pint_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pint_la-pint-s.lo `test -f 'pint-s.c' || echo '$(srcdir)/'`pint-s.c libsane_pixma_la-pixma-s.lo: pixma-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pixma_la-pixma-s.lo -MD -MP -MF $(DEPDIR)/libsane_pixma_la-pixma-s.Tpo -c -o libsane_pixma_la-pixma-s.lo `test -f 'pixma-s.c' || echo '$(srcdir)/'`pixma-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_pixma_la-pixma-s.Tpo $(DEPDIR)/libsane_pixma_la-pixma-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pixma_la-pixma-s.lo -MD -MP -MF $(DEPDIR)/libsane_pixma_la-pixma-s.Tpo -c -o libsane_pixma_la-pixma-s.lo `test -f 'pixma-s.c' || echo '$(srcdir)/'`pixma-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_pixma_la-pixma-s.Tpo $(DEPDIR)/libsane_pixma_la-pixma-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixma-s.c' object='libsane_pixma_la-pixma-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pixma_la-pixma-s.lo `test -f 'pixma-s.c' || echo '$(srcdir)/'`pixma-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pixma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pixma_la-pixma-s.lo `test -f 'pixma-s.c' || echo '$(srcdir)/'`pixma-s.c libsane_plustek_la-plustek-s.lo: plustek-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_plustek_la-plustek-s.lo -MD -MP -MF $(DEPDIR)/libsane_plustek_la-plustek-s.Tpo -c -o libsane_plustek_la-plustek-s.lo `test -f 'plustek-s.c' || echo '$(srcdir)/'`plustek-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_plustek_la-plustek-s.Tpo $(DEPDIR)/libsane_plustek_la-plustek-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_plustek_la-plustek-s.lo -MD -MP -MF $(DEPDIR)/libsane_plustek_la-plustek-s.Tpo -c -o libsane_plustek_la-plustek-s.lo `test -f 'plustek-s.c' || echo '$(srcdir)/'`plustek-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_plustek_la-plustek-s.Tpo $(DEPDIR)/libsane_plustek_la-plustek-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plustek-s.c' object='libsane_plustek_la-plustek-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_plustek_la-plustek-s.lo `test -f 'plustek-s.c' || echo '$(srcdir)/'`plustek-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_plustek_la-plustek-s.lo `test -f 'plustek-s.c' || echo '$(srcdir)/'`plustek-s.c libsane_plustek_pp_la-plustek_pp-s.lo: plustek_pp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_plustek_pp_la-plustek_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Tpo -c -o libsane_plustek_pp_la-plustek_pp-s.lo `test -f 'plustek_pp-s.c' || echo '$(srcdir)/'`plustek_pp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Tpo $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_plustek_pp_la-plustek_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Tpo -c -o libsane_plustek_pp_la-plustek_pp-s.lo `test -f 'plustek_pp-s.c' || echo '$(srcdir)/'`plustek_pp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Tpo $(DEPDIR)/libsane_plustek_pp_la-plustek_pp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plustek_pp-s.c' object='libsane_plustek_pp_la-plustek_pp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_plustek_pp_la-plustek_pp-s.lo `test -f 'plustek_pp-s.c' || echo '$(srcdir)/'`plustek_pp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_plustek_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_plustek_pp_la-plustek_pp-s.lo `test -f 'plustek_pp-s.c' || echo '$(srcdir)/'`plustek_pp-s.c libsane_pnm_la-pnm-s.lo: pnm-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pnm_la-pnm-s.lo -MD -MP -MF $(DEPDIR)/libsane_pnm_la-pnm-s.Tpo -c -o libsane_pnm_la-pnm-s.lo `test -f 'pnm-s.c' || echo '$(srcdir)/'`pnm-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_pnm_la-pnm-s.Tpo $(DEPDIR)/libsane_pnm_la-pnm-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_pnm_la-pnm-s.lo -MD -MP -MF $(DEPDIR)/libsane_pnm_la-pnm-s.Tpo -c -o libsane_pnm_la-pnm-s.lo `test -f 'pnm-s.c' || echo '$(srcdir)/'`pnm-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_pnm_la-pnm-s.Tpo $(DEPDIR)/libsane_pnm_la-pnm-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pnm-s.c' object='libsane_pnm_la-pnm-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pnm_la-pnm-s.lo `test -f 'pnm-s.c' || echo '$(srcdir)/'`pnm-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_pnm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_pnm_la-pnm-s.lo `test -f 'pnm-s.c' || echo '$(srcdir)/'`pnm-s.c libsane_qcam_la-qcam-s.lo: qcam-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_qcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_qcam_la-qcam-s.lo -MD -MP -MF $(DEPDIR)/libsane_qcam_la-qcam-s.Tpo -c -o libsane_qcam_la-qcam-s.lo `test -f 'qcam-s.c' || echo '$(srcdir)/'`qcam-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_qcam_la-qcam-s.Tpo $(DEPDIR)/libsane_qcam_la-qcam-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_qcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_qcam_la-qcam-s.lo -MD -MP -MF $(DEPDIR)/libsane_qcam_la-qcam-s.Tpo -c -o libsane_qcam_la-qcam-s.lo `test -f 'qcam-s.c' || echo '$(srcdir)/'`qcam-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_qcam_la-qcam-s.Tpo $(DEPDIR)/libsane_qcam_la-qcam-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qcam-s.c' object='libsane_qcam_la-qcam-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_qcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_qcam_la-qcam-s.lo `test -f 'qcam-s.c' || echo '$(srcdir)/'`qcam-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_qcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_qcam_la-qcam-s.lo `test -f 'qcam-s.c' || echo '$(srcdir)/'`qcam-s.c libsane_ricoh_la-ricoh-s.lo: ricoh-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ricoh_la-ricoh-s.lo -MD -MP -MF $(DEPDIR)/libsane_ricoh_la-ricoh-s.Tpo -c -o libsane_ricoh_la-ricoh-s.lo `test -f 'ricoh-s.c' || echo '$(srcdir)/'`ricoh-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_ricoh_la-ricoh-s.Tpo $(DEPDIR)/libsane_ricoh_la-ricoh-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ricoh_la-ricoh-s.lo -MD -MP -MF $(DEPDIR)/libsane_ricoh_la-ricoh-s.Tpo -c -o libsane_ricoh_la-ricoh-s.lo `test -f 'ricoh-s.c' || echo '$(srcdir)/'`ricoh-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_ricoh_la-ricoh-s.Tpo $(DEPDIR)/libsane_ricoh_la-ricoh-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ricoh-s.c' object='libsane_ricoh_la-ricoh-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ricoh_la-ricoh-s.lo `test -f 'ricoh-s.c' || echo '$(srcdir)/'`ricoh-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ricoh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ricoh_la-ricoh-s.lo `test -f 'ricoh-s.c' || echo '$(srcdir)/'`ricoh-s.c libsane_rts8891_la-rts8891-s.lo: rts8891-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_rts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_rts8891_la-rts8891-s.lo -MD -MP -MF $(DEPDIR)/libsane_rts8891_la-rts8891-s.Tpo -c -o libsane_rts8891_la-rts8891-s.lo `test -f 'rts8891-s.c' || echo '$(srcdir)/'`rts8891-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_rts8891_la-rts8891-s.Tpo $(DEPDIR)/libsane_rts8891_la-rts8891-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_rts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_rts8891_la-rts8891-s.lo -MD -MP -MF $(DEPDIR)/libsane_rts8891_la-rts8891-s.Tpo -c -o libsane_rts8891_la-rts8891-s.lo `test -f 'rts8891-s.c' || echo '$(srcdir)/'`rts8891-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_rts8891_la-rts8891-s.Tpo $(DEPDIR)/libsane_rts8891_la-rts8891-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rts8891-s.c' object='libsane_rts8891_la-rts8891-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_rts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_rts8891_la-rts8891-s.lo `test -f 'rts8891-s.c' || echo '$(srcdir)/'`rts8891-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_rts8891_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_rts8891_la-rts8891-s.lo `test -f 'rts8891-s.c' || echo '$(srcdir)/'`rts8891-s.c libsane_s9036_la-s9036-s.lo: s9036-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_s9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_s9036_la-s9036-s.lo -MD -MP -MF $(DEPDIR)/libsane_s9036_la-s9036-s.Tpo -c -o libsane_s9036_la-s9036-s.lo `test -f 's9036-s.c' || echo '$(srcdir)/'`s9036-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_s9036_la-s9036-s.Tpo $(DEPDIR)/libsane_s9036_la-s9036-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_s9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_s9036_la-s9036-s.lo -MD -MP -MF $(DEPDIR)/libsane_s9036_la-s9036-s.Tpo -c -o libsane_s9036_la-s9036-s.lo `test -f 's9036-s.c' || echo '$(srcdir)/'`s9036-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_s9036_la-s9036-s.Tpo $(DEPDIR)/libsane_s9036_la-s9036-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='s9036-s.c' object='libsane_s9036_la-s9036-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_s9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_s9036_la-s9036-s.lo `test -f 's9036-s.c' || echo '$(srcdir)/'`s9036-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_s9036_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_s9036_la-s9036-s.lo `test -f 's9036-s.c' || echo '$(srcdir)/'`s9036-s.c libsane_sceptre_la-sceptre-s.lo: sceptre-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sceptre_la-sceptre-s.lo -MD -MP -MF $(DEPDIR)/libsane_sceptre_la-sceptre-s.Tpo -c -o libsane_sceptre_la-sceptre-s.lo `test -f 'sceptre-s.c' || echo '$(srcdir)/'`sceptre-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_sceptre_la-sceptre-s.Tpo $(DEPDIR)/libsane_sceptre_la-sceptre-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sceptre_la-sceptre-s.lo -MD -MP -MF $(DEPDIR)/libsane_sceptre_la-sceptre-s.Tpo -c -o libsane_sceptre_la-sceptre-s.lo `test -f 'sceptre-s.c' || echo '$(srcdir)/'`sceptre-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_sceptre_la-sceptre-s.Tpo $(DEPDIR)/libsane_sceptre_la-sceptre-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sceptre-s.c' object='libsane_sceptre_la-sceptre-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sceptre_la-sceptre-s.lo `test -f 'sceptre-s.c' || echo '$(srcdir)/'`sceptre-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sceptre_la-sceptre-s.lo `test -f 'sceptre-s.c' || echo '$(srcdir)/'`sceptre-s.c libsane_sharp_la-sharp-s.lo: sharp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sharp_la-sharp-s.lo -MD -MP -MF $(DEPDIR)/libsane_sharp_la-sharp-s.Tpo -c -o libsane_sharp_la-sharp-s.lo `test -f 'sharp-s.c' || echo '$(srcdir)/'`sharp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_sharp_la-sharp-s.Tpo $(DEPDIR)/libsane_sharp_la-sharp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sharp_la-sharp-s.lo -MD -MP -MF $(DEPDIR)/libsane_sharp_la-sharp-s.Tpo -c -o libsane_sharp_la-sharp-s.lo `test -f 'sharp-s.c' || echo '$(srcdir)/'`sharp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_sharp_la-sharp-s.Tpo $(DEPDIR)/libsane_sharp_la-sharp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sharp-s.c' object='libsane_sharp_la-sharp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sharp_la-sharp-s.lo `test -f 'sharp-s.c' || echo '$(srcdir)/'`sharp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sharp_la-sharp-s.lo `test -f 'sharp-s.c' || echo '$(srcdir)/'`sharp-s.c libsane_sm3600_la-sm3600-s.lo: sm3600-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sm3600_la-sm3600-s.lo -MD -MP -MF $(DEPDIR)/libsane_sm3600_la-sm3600-s.Tpo -c -o libsane_sm3600_la-sm3600-s.lo `test -f 'sm3600-s.c' || echo '$(srcdir)/'`sm3600-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_sm3600_la-sm3600-s.Tpo $(DEPDIR)/libsane_sm3600_la-sm3600-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sm3600_la-sm3600-s.lo -MD -MP -MF $(DEPDIR)/libsane_sm3600_la-sm3600-s.Tpo -c -o libsane_sm3600_la-sm3600-s.lo `test -f 'sm3600-s.c' || echo '$(srcdir)/'`sm3600-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_sm3600_la-sm3600-s.Tpo $(DEPDIR)/libsane_sm3600_la-sm3600-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sm3600-s.c' object='libsane_sm3600_la-sm3600-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sm3600_la-sm3600-s.lo `test -f 'sm3600-s.c' || echo '$(srcdir)/'`sm3600-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sm3600_la-sm3600-s.lo `test -f 'sm3600-s.c' || echo '$(srcdir)/'`sm3600-s.c libsane_sm3840_la-sm3840-s.lo: sm3840-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sm3840_la-sm3840-s.lo -MD -MP -MF $(DEPDIR)/libsane_sm3840_la-sm3840-s.Tpo -c -o libsane_sm3840_la-sm3840-s.lo `test -f 'sm3840-s.c' || echo '$(srcdir)/'`sm3840-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_sm3840_la-sm3840-s.Tpo $(DEPDIR)/libsane_sm3840_la-sm3840-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sm3840_la-sm3840-s.lo -MD -MP -MF $(DEPDIR)/libsane_sm3840_la-sm3840-s.Tpo -c -o libsane_sm3840_la-sm3840-s.lo `test -f 'sm3840-s.c' || echo '$(srcdir)/'`sm3840-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_sm3840_la-sm3840-s.Tpo $(DEPDIR)/libsane_sm3840_la-sm3840-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sm3840-s.c' object='libsane_sm3840_la-sm3840-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sm3840_la-sm3840-s.lo `test -f 'sm3840-s.c' || echo '$(srcdir)/'`sm3840-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sm3840_la-sm3840-s.lo `test -f 'sm3840-s.c' || echo '$(srcdir)/'`sm3840-s.c libsane_snapscan_la-snapscan-s.lo: snapscan-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_snapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_snapscan_la-snapscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_snapscan_la-snapscan-s.Tpo -c -o libsane_snapscan_la-snapscan-s.lo `test -f 'snapscan-s.c' || echo '$(srcdir)/'`snapscan-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_snapscan_la-snapscan-s.Tpo $(DEPDIR)/libsane_snapscan_la-snapscan-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_snapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_snapscan_la-snapscan-s.lo -MD -MP -MF $(DEPDIR)/libsane_snapscan_la-snapscan-s.Tpo -c -o libsane_snapscan_la-snapscan-s.lo `test -f 'snapscan-s.c' || echo '$(srcdir)/'`snapscan-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_snapscan_la-snapscan-s.Tpo $(DEPDIR)/libsane_snapscan_la-snapscan-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snapscan-s.c' object='libsane_snapscan_la-snapscan-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_snapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_snapscan_la-snapscan-s.lo `test -f 'snapscan-s.c' || echo '$(srcdir)/'`snapscan-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_snapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_snapscan_la-snapscan-s.lo `test -f 'snapscan-s.c' || echo '$(srcdir)/'`snapscan-s.c libsane_sp15c_la-sp15c-s.lo: sp15c-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sp15c_la-sp15c-s.lo -MD -MP -MF $(DEPDIR)/libsane_sp15c_la-sp15c-s.Tpo -c -o libsane_sp15c_la-sp15c-s.lo `test -f 'sp15c-s.c' || echo '$(srcdir)/'`sp15c-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_sp15c_la-sp15c-s.Tpo $(DEPDIR)/libsane_sp15c_la-sp15c-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_sp15c_la-sp15c-s.lo -MD -MP -MF $(DEPDIR)/libsane_sp15c_la-sp15c-s.Tpo -c -o libsane_sp15c_la-sp15c-s.lo `test -f 'sp15c-s.c' || echo '$(srcdir)/'`sp15c-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_sp15c_la-sp15c-s.Tpo $(DEPDIR)/libsane_sp15c_la-sp15c-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sp15c-s.c' object='libsane_sp15c_la-sp15c-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sp15c_la-sp15c-s.lo `test -f 'sp15c-s.c' || echo '$(srcdir)/'`sp15c-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_sp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_sp15c_la-sp15c-s.lo `test -f 'sp15c-s.c' || echo '$(srcdir)/'`sp15c-s.c libsane_st400_la-st400-s.lo: st400-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_st400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_st400_la-st400-s.lo -MD -MP -MF $(DEPDIR)/libsane_st400_la-st400-s.Tpo -c -o libsane_st400_la-st400-s.lo `test -f 'st400-s.c' || echo '$(srcdir)/'`st400-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_st400_la-st400-s.Tpo $(DEPDIR)/libsane_st400_la-st400-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_st400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_st400_la-st400-s.lo -MD -MP -MF $(DEPDIR)/libsane_st400_la-st400-s.Tpo -c -o libsane_st400_la-st400-s.lo `test -f 'st400-s.c' || echo '$(srcdir)/'`st400-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_st400_la-st400-s.Tpo $(DEPDIR)/libsane_st400_la-st400-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='st400-s.c' object='libsane_st400_la-st400-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_st400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_st400_la-st400-s.lo `test -f 'st400-s.c' || echo '$(srcdir)/'`st400-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_st400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_st400_la-st400-s.lo `test -f 'st400-s.c' || echo '$(srcdir)/'`st400-s.c libsane_stv680_la-stv680-s.lo: stv680-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_stv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_stv680_la-stv680-s.lo -MD -MP -MF $(DEPDIR)/libsane_stv680_la-stv680-s.Tpo -c -o libsane_stv680_la-stv680-s.lo `test -f 'stv680-s.c' || echo '$(srcdir)/'`stv680-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_stv680_la-stv680-s.Tpo $(DEPDIR)/libsane_stv680_la-stv680-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_stv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_stv680_la-stv680-s.lo -MD -MP -MF $(DEPDIR)/libsane_stv680_la-stv680-s.Tpo -c -o libsane_stv680_la-stv680-s.lo `test -f 'stv680-s.c' || echo '$(srcdir)/'`stv680-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_stv680_la-stv680-s.Tpo $(DEPDIR)/libsane_stv680_la-stv680-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stv680-s.c' object='libsane_stv680_la-stv680-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_stv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_stv680_la-stv680-s.lo `test -f 'stv680-s.c' || echo '$(srcdir)/'`stv680-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_stv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_stv680_la-stv680-s.lo `test -f 'stv680-s.c' || echo '$(srcdir)/'`stv680-s.c libsane_tamarack_la-tamarack-s.lo: tamarack-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_tamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_tamarack_la-tamarack-s.lo -MD -MP -MF $(DEPDIR)/libsane_tamarack_la-tamarack-s.Tpo -c -o libsane_tamarack_la-tamarack-s.lo `test -f 'tamarack-s.c' || echo '$(srcdir)/'`tamarack-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_tamarack_la-tamarack-s.Tpo $(DEPDIR)/libsane_tamarack_la-tamarack-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_tamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_tamarack_la-tamarack-s.lo -MD -MP -MF $(DEPDIR)/libsane_tamarack_la-tamarack-s.Tpo -c -o libsane_tamarack_la-tamarack-s.lo `test -f 'tamarack-s.c' || echo '$(srcdir)/'`tamarack-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_tamarack_la-tamarack-s.Tpo $(DEPDIR)/libsane_tamarack_la-tamarack-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tamarack-s.c' object='libsane_tamarack_la-tamarack-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_tamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_tamarack_la-tamarack-s.lo `test -f 'tamarack-s.c' || echo '$(srcdir)/'`tamarack-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_tamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_tamarack_la-tamarack-s.lo `test -f 'tamarack-s.c' || echo '$(srcdir)/'`tamarack-s.c libsane_teco1_la-teco1-s.lo: teco1-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco1_la-teco1-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco1_la-teco1-s.Tpo -c -o libsane_teco1_la-teco1-s.lo `test -f 'teco1-s.c' || echo '$(srcdir)/'`teco1-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_teco1_la-teco1-s.Tpo $(DEPDIR)/libsane_teco1_la-teco1-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco1_la-teco1-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco1_la-teco1-s.Tpo -c -o libsane_teco1_la-teco1-s.lo `test -f 'teco1-s.c' || echo '$(srcdir)/'`teco1-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_teco1_la-teco1-s.Tpo $(DEPDIR)/libsane_teco1_la-teco1-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco1-s.c' object='libsane_teco1_la-teco1-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco1_la-teco1-s.lo `test -f 'teco1-s.c' || echo '$(srcdir)/'`teco1-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco1_la-teco1-s.lo `test -f 'teco1-s.c' || echo '$(srcdir)/'`teco1-s.c libsane_teco2_la-teco2-s.lo: teco2-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco2_la-teco2-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco2_la-teco2-s.Tpo -c -o libsane_teco2_la-teco2-s.lo `test -f 'teco2-s.c' || echo '$(srcdir)/'`teco2-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_teco2_la-teco2-s.Tpo $(DEPDIR)/libsane_teco2_la-teco2-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco2_la-teco2-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco2_la-teco2-s.Tpo -c -o libsane_teco2_la-teco2-s.lo `test -f 'teco2-s.c' || echo '$(srcdir)/'`teco2-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_teco2_la-teco2-s.Tpo $(DEPDIR)/libsane_teco2_la-teco2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco2-s.c' object='libsane_teco2_la-teco2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco2_la-teco2-s.lo `test -f 'teco2-s.c' || echo '$(srcdir)/'`teco2-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco2_la-teco2-s.lo `test -f 'teco2-s.c' || echo '$(srcdir)/'`teco2-s.c libsane_teco3_la-teco3-s.lo: teco3-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco3_la-teco3-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco3_la-teco3-s.Tpo -c -o libsane_teco3_la-teco3-s.lo `test -f 'teco3-s.c' || echo '$(srcdir)/'`teco3-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_teco3_la-teco3-s.Tpo $(DEPDIR)/libsane_teco3_la-teco3-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_teco3_la-teco3-s.lo -MD -MP -MF $(DEPDIR)/libsane_teco3_la-teco3-s.Tpo -c -o libsane_teco3_la-teco3-s.lo `test -f 'teco3-s.c' || echo '$(srcdir)/'`teco3-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_teco3_la-teco3-s.Tpo $(DEPDIR)/libsane_teco3_la-teco3-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco3-s.c' object='libsane_teco3_la-teco3-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco3_la-teco3-s.lo `test -f 'teco3-s.c' || echo '$(srcdir)/'`teco3-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_teco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_teco3_la-teco3-s.lo `test -f 'teco3-s.c' || echo '$(srcdir)/'`teco3-s.c libsane_test_la-test-s.lo: test-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_test_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_test_la-test-s.lo -MD -MP -MF $(DEPDIR)/libsane_test_la-test-s.Tpo -c -o libsane_test_la-test-s.lo `test -f 'test-s.c' || echo '$(srcdir)/'`test-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_test_la-test-s.Tpo $(DEPDIR)/libsane_test_la-test-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_test_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_test_la-test-s.lo -MD -MP -MF $(DEPDIR)/libsane_test_la-test-s.Tpo -c -o libsane_test_la-test-s.lo `test -f 'test-s.c' || echo '$(srcdir)/'`test-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_test_la-test-s.Tpo $(DEPDIR)/libsane_test_la-test-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-s.c' object='libsane_test_la-test-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_test_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_test_la-test-s.lo `test -f 'test-s.c' || echo '$(srcdir)/'`test-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_test_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_test_la-test-s.lo `test -f 'test-s.c' || echo '$(srcdir)/'`test-s.c libsane_u12_la-u12-s.lo: u12-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_u12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_u12_la-u12-s.lo -MD -MP -MF $(DEPDIR)/libsane_u12_la-u12-s.Tpo -c -o libsane_u12_la-u12-s.lo `test -f 'u12-s.c' || echo '$(srcdir)/'`u12-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_u12_la-u12-s.Tpo $(DEPDIR)/libsane_u12_la-u12-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_u12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_u12_la-u12-s.lo -MD -MP -MF $(DEPDIR)/libsane_u12_la-u12-s.Tpo -c -o libsane_u12_la-u12-s.lo `test -f 'u12-s.c' || echo '$(srcdir)/'`u12-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_u12_la-u12-s.Tpo $(DEPDIR)/libsane_u12_la-u12-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='u12-s.c' object='libsane_u12_la-u12-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_u12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_u12_la-u12-s.lo `test -f 'u12-s.c' || echo '$(srcdir)/'`u12-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_u12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_u12_la-u12-s.lo `test -f 'u12-s.c' || echo '$(srcdir)/'`u12-s.c libsane_umax_la-umax-s.lo: umax-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax_la-umax-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax_la-umax-s.Tpo -c -o libsane_umax_la-umax-s.lo `test -f 'umax-s.c' || echo '$(srcdir)/'`umax-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_umax_la-umax-s.Tpo $(DEPDIR)/libsane_umax_la-umax-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax_la-umax-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax_la-umax-s.Tpo -c -o libsane_umax_la-umax-s.lo `test -f 'umax-s.c' || echo '$(srcdir)/'`umax-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_umax_la-umax-s.Tpo $(DEPDIR)/libsane_umax_la-umax-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax-s.c' object='libsane_umax_la-umax-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax_la-umax-s.lo `test -f 'umax-s.c' || echo '$(srcdir)/'`umax-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax_la-umax-s.lo `test -f 'umax-s.c' || echo '$(srcdir)/'`umax-s.c libsane_umax1220u_la-umax1220u-s.lo: umax1220u-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax1220u_la-umax1220u-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Tpo -c -o libsane_umax1220u_la-umax1220u-s.lo `test -f 'umax1220u-s.c' || echo '$(srcdir)/'`umax1220u-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Tpo $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax1220u_la-umax1220u-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Tpo -c -o libsane_umax1220u_la-umax1220u-s.lo `test -f 'umax1220u-s.c' || echo '$(srcdir)/'`umax1220u-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Tpo $(DEPDIR)/libsane_umax1220u_la-umax1220u-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax1220u-s.c' object='libsane_umax1220u_la-umax1220u-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax1220u_la-umax1220u-s.lo `test -f 'umax1220u-s.c' || echo '$(srcdir)/'`umax1220u-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax1220u_la-umax1220u-s.lo `test -f 'umax1220u-s.c' || echo '$(srcdir)/'`umax1220u-s.c libsane_umax_pp_la-umax_pp-s.lo: umax_pp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax_pp_la-umax_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Tpo -c -o libsane_umax_pp_la-umax_pp-s.lo `test -f 'umax_pp-s.c' || echo '$(srcdir)/'`umax_pp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Tpo $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_umax_pp_la-umax_pp-s.lo -MD -MP -MF $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Tpo -c -o libsane_umax_pp_la-umax_pp-s.lo `test -f 'umax_pp-s.c' || echo '$(srcdir)/'`umax_pp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Tpo $(DEPDIR)/libsane_umax_pp_la-umax_pp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax_pp-s.c' object='libsane_umax_pp_la-umax_pp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax_pp_la-umax_pp-s.lo `test -f 'umax_pp-s.c' || echo '$(srcdir)/'`umax_pp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_umax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_umax_pp_la-umax_pp-s.lo `test -f 'umax_pp-s.c' || echo '$(srcdir)/'`umax_pp-s.c libsane_v4l_la-v4l-s.lo: v4l-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_v4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_v4l_la-v4l-s.lo -MD -MP -MF $(DEPDIR)/libsane_v4l_la-v4l-s.Tpo -c -o libsane_v4l_la-v4l-s.lo `test -f 'v4l-s.c' || echo '$(srcdir)/'`v4l-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_v4l_la-v4l-s.Tpo $(DEPDIR)/libsane_v4l_la-v4l-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_v4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_v4l_la-v4l-s.lo -MD -MP -MF $(DEPDIR)/libsane_v4l_la-v4l-s.Tpo -c -o libsane_v4l_la-v4l-s.lo `test -f 'v4l-s.c' || echo '$(srcdir)/'`v4l-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_v4l_la-v4l-s.Tpo $(DEPDIR)/libsane_v4l_la-v4l-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='v4l-s.c' object='libsane_v4l_la-v4l-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_v4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_v4l_la-v4l-s.lo `test -f 'v4l-s.c' || echo '$(srcdir)/'`v4l-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_v4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_v4l_la-v4l-s.lo `test -f 'v4l-s.c' || echo '$(srcdir)/'`v4l-s.c libsane_xerox_mfp_la-xerox_mfp-s.lo: xerox_mfp-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_xerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_xerox_mfp_la-xerox_mfp-s.lo -MD -MP -MF $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Tpo -c -o libsane_xerox_mfp_la-xerox_mfp-s.lo `test -f 'xerox_mfp-s.c' || echo '$(srcdir)/'`xerox_mfp-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Tpo $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_xerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_xerox_mfp_la-xerox_mfp-s.lo -MD -MP -MF $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Tpo -c -o libsane_xerox_mfp_la-xerox_mfp-s.lo `test -f 'xerox_mfp-s.c' || echo '$(srcdir)/'`xerox_mfp-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Tpo $(DEPDIR)/libsane_xerox_mfp_la-xerox_mfp-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xerox_mfp-s.c' object='libsane_xerox_mfp_la-xerox_mfp-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_xerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_xerox_mfp_la-xerox_mfp-s.lo `test -f 'xerox_mfp-s.c' || echo '$(srcdir)/'`xerox_mfp-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_xerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_xerox_mfp_la-xerox_mfp-s.lo `test -f 'xerox_mfp-s.c' || echo '$(srcdir)/'`xerox_mfp-s.c libsane_la-dll-s.lo: dll-s.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_la-dll-s.lo -MD -MP -MF $(DEPDIR)/libsane_la-dll-s.Tpo -c -o libsane_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsane_la-dll-s.Tpo $(DEPDIR)/libsane_la-dll-s.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_la-dll-s.lo -MD -MP -MF $(DEPDIR)/libsane_la-dll-s.Tpo -c -o libsane_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_la-dll-s.Tpo $(DEPDIR)/libsane_la-dll-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dll-s.c' object='libsane_la-dll-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_la-dll-s.lo `test -f 'dll-s.c' || echo '$(srcdir)/'`dll-s.c libsceptre_la-sceptre.lo: sceptre.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsceptre_la-sceptre.lo -MD -MP -MF $(DEPDIR)/libsceptre_la-sceptre.Tpo -c -o libsceptre_la-sceptre.lo `test -f 'sceptre.c' || echo '$(srcdir)/'`sceptre.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsceptre_la-sceptre.Tpo $(DEPDIR)/libsceptre_la-sceptre.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsceptre_la-sceptre.lo -MD -MP -MF $(DEPDIR)/libsceptre_la-sceptre.Tpo -c -o libsceptre_la-sceptre.lo `test -f 'sceptre.c' || echo '$(srcdir)/'`sceptre.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsceptre_la-sceptre.Tpo $(DEPDIR)/libsceptre_la-sceptre.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sceptre.c' object='libsceptre_la-sceptre.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsceptre_la-sceptre.lo `test -f 'sceptre.c' || echo '$(srcdir)/'`sceptre.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsceptre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsceptre_la-sceptre.lo `test -f 'sceptre.c' || echo '$(srcdir)/'`sceptre.c libsharp_la-sharp.lo: sharp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsharp_la-sharp.lo -MD -MP -MF $(DEPDIR)/libsharp_la-sharp.Tpo -c -o libsharp_la-sharp.lo `test -f 'sharp.c' || echo '$(srcdir)/'`sharp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsharp_la-sharp.Tpo $(DEPDIR)/libsharp_la-sharp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsharp_la-sharp.lo -MD -MP -MF $(DEPDIR)/libsharp_la-sharp.Tpo -c -o libsharp_la-sharp.lo `test -f 'sharp.c' || echo '$(srcdir)/'`sharp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsharp_la-sharp.Tpo $(DEPDIR)/libsharp_la-sharp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sharp.c' object='libsharp_la-sharp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsharp_la-sharp.lo `test -f 'sharp.c' || echo '$(srcdir)/'`sharp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsharp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsharp_la-sharp.lo `test -f 'sharp.c' || echo '$(srcdir)/'`sharp.c libsm3600_la-sm3600.lo: sm3600.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsm3600_la-sm3600.lo -MD -MP -MF $(DEPDIR)/libsm3600_la-sm3600.Tpo -c -o libsm3600_la-sm3600.lo `test -f 'sm3600.c' || echo '$(srcdir)/'`sm3600.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsm3600_la-sm3600.Tpo $(DEPDIR)/libsm3600_la-sm3600.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsm3600_la-sm3600.lo -MD -MP -MF $(DEPDIR)/libsm3600_la-sm3600.Tpo -c -o libsm3600_la-sm3600.lo `test -f 'sm3600.c' || echo '$(srcdir)/'`sm3600.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsm3600_la-sm3600.Tpo $(DEPDIR)/libsm3600_la-sm3600.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sm3600.c' object='libsm3600_la-sm3600.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsm3600_la-sm3600.lo `test -f 'sm3600.c' || echo '$(srcdir)/'`sm3600.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3600_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsm3600_la-sm3600.lo `test -f 'sm3600.c' || echo '$(srcdir)/'`sm3600.c libsm3840_la-sm3840.lo: sm3840.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsm3840_la-sm3840.lo -MD -MP -MF $(DEPDIR)/libsm3840_la-sm3840.Tpo -c -o libsm3840_la-sm3840.lo `test -f 'sm3840.c' || echo '$(srcdir)/'`sm3840.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsm3840_la-sm3840.Tpo $(DEPDIR)/libsm3840_la-sm3840.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsm3840_la-sm3840.lo -MD -MP -MF $(DEPDIR)/libsm3840_la-sm3840.Tpo -c -o libsm3840_la-sm3840.lo `test -f 'sm3840.c' || echo '$(srcdir)/'`sm3840.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsm3840_la-sm3840.Tpo $(DEPDIR)/libsm3840_la-sm3840.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sm3840.c' object='libsm3840_la-sm3840.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsm3840_la-sm3840.lo `test -f 'sm3840.c' || echo '$(srcdir)/'`sm3840.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsm3840_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsm3840_la-sm3840.lo `test -f 'sm3840.c' || echo '$(srcdir)/'`sm3840.c libsnapscan_la-snapscan.lo: snapscan.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsnapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsnapscan_la-snapscan.lo -MD -MP -MF $(DEPDIR)/libsnapscan_la-snapscan.Tpo -c -o libsnapscan_la-snapscan.lo `test -f 'snapscan.c' || echo '$(srcdir)/'`snapscan.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsnapscan_la-snapscan.Tpo $(DEPDIR)/libsnapscan_la-snapscan.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsnapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsnapscan_la-snapscan.lo -MD -MP -MF $(DEPDIR)/libsnapscan_la-snapscan.Tpo -c -o libsnapscan_la-snapscan.lo `test -f 'snapscan.c' || echo '$(srcdir)/'`snapscan.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsnapscan_la-snapscan.Tpo $(DEPDIR)/libsnapscan_la-snapscan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snapscan.c' object='libsnapscan_la-snapscan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsnapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsnapscan_la-snapscan.lo `test -f 'snapscan.c' || echo '$(srcdir)/'`snapscan.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsnapscan_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsnapscan_la-snapscan.lo `test -f 'snapscan.c' || echo '$(srcdir)/'`snapscan.c libsp15c_la-sp15c.lo: sp15c.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsp15c_la-sp15c.lo -MD -MP -MF $(DEPDIR)/libsp15c_la-sp15c.Tpo -c -o libsp15c_la-sp15c.lo `test -f 'sp15c.c' || echo '$(srcdir)/'`sp15c.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libsp15c_la-sp15c.Tpo $(DEPDIR)/libsp15c_la-sp15c.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsp15c_la-sp15c.lo -MD -MP -MF $(DEPDIR)/libsp15c_la-sp15c.Tpo -c -o libsp15c_la-sp15c.lo `test -f 'sp15c.c' || echo '$(srcdir)/'`sp15c.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsp15c_la-sp15c.Tpo $(DEPDIR)/libsp15c_la-sp15c.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sp15c.c' object='libsp15c_la-sp15c.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsp15c_la-sp15c.lo `test -f 'sp15c.c' || echo '$(srcdir)/'`sp15c.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsp15c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsp15c_la-sp15c.lo `test -f 'sp15c.c' || echo '$(srcdir)/'`sp15c.c libst400_la-st400.lo: st400.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libst400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libst400_la-st400.lo -MD -MP -MF $(DEPDIR)/libst400_la-st400.Tpo -c -o libst400_la-st400.lo `test -f 'st400.c' || echo '$(srcdir)/'`st400.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libst400_la-st400.Tpo $(DEPDIR)/libst400_la-st400.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libst400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libst400_la-st400.lo -MD -MP -MF $(DEPDIR)/libst400_la-st400.Tpo -c -o libst400_la-st400.lo `test -f 'st400.c' || echo '$(srcdir)/'`st400.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libst400_la-st400.Tpo $(DEPDIR)/libst400_la-st400.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='st400.c' object='libst400_la-st400.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libst400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libst400_la-st400.lo `test -f 'st400.c' || echo '$(srcdir)/'`st400.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libst400_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libst400_la-st400.lo `test -f 'st400.c' || echo '$(srcdir)/'`st400.c libstv680_la-stv680.lo: stv680.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstv680_la-stv680.lo -MD -MP -MF $(DEPDIR)/libstv680_la-stv680.Tpo -c -o libstv680_la-stv680.lo `test -f 'stv680.c' || echo '$(srcdir)/'`stv680.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libstv680_la-stv680.Tpo $(DEPDIR)/libstv680_la-stv680.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstv680_la-stv680.lo -MD -MP -MF $(DEPDIR)/libstv680_la-stv680.Tpo -c -o libstv680_la-stv680.lo `test -f 'stv680.c' || echo '$(srcdir)/'`stv680.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libstv680_la-stv680.Tpo $(DEPDIR)/libstv680_la-stv680.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stv680.c' object='libstv680_la-stv680.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstv680_la-stv680.lo `test -f 'stv680.c' || echo '$(srcdir)/'`stv680.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstv680_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstv680_la-stv680.lo `test -f 'stv680.c' || echo '$(srcdir)/'`stv680.c libtamarack_la-tamarack.lo: tamarack.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtamarack_la-tamarack.lo -MD -MP -MF $(DEPDIR)/libtamarack_la-tamarack.Tpo -c -o libtamarack_la-tamarack.lo `test -f 'tamarack.c' || echo '$(srcdir)/'`tamarack.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libtamarack_la-tamarack.Tpo $(DEPDIR)/libtamarack_la-tamarack.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtamarack_la-tamarack.lo -MD -MP -MF $(DEPDIR)/libtamarack_la-tamarack.Tpo -c -o libtamarack_la-tamarack.lo `test -f 'tamarack.c' || echo '$(srcdir)/'`tamarack.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtamarack_la-tamarack.Tpo $(DEPDIR)/libtamarack_la-tamarack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tamarack.c' object='libtamarack_la-tamarack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtamarack_la-tamarack.lo `test -f 'tamarack.c' || echo '$(srcdir)/'`tamarack.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtamarack_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtamarack_la-tamarack.lo `test -f 'tamarack.c' || echo '$(srcdir)/'`tamarack.c libteco1_la-teco1.lo: teco1.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco1_la-teco1.lo -MD -MP -MF $(DEPDIR)/libteco1_la-teco1.Tpo -c -o libteco1_la-teco1.lo `test -f 'teco1.c' || echo '$(srcdir)/'`teco1.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libteco1_la-teco1.Tpo $(DEPDIR)/libteco1_la-teco1.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco1_la-teco1.lo -MD -MP -MF $(DEPDIR)/libteco1_la-teco1.Tpo -c -o libteco1_la-teco1.lo `test -f 'teco1.c' || echo '$(srcdir)/'`teco1.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libteco1_la-teco1.Tpo $(DEPDIR)/libteco1_la-teco1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco1.c' object='libteco1_la-teco1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco1_la-teco1.lo `test -f 'teco1.c' || echo '$(srcdir)/'`teco1.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco1_la-teco1.lo `test -f 'teco1.c' || echo '$(srcdir)/'`teco1.c libteco2_la-teco2.lo: teco2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco2_la-teco2.lo -MD -MP -MF $(DEPDIR)/libteco2_la-teco2.Tpo -c -o libteco2_la-teco2.lo `test -f 'teco2.c' || echo '$(srcdir)/'`teco2.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libteco2_la-teco2.Tpo $(DEPDIR)/libteco2_la-teco2.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco2_la-teco2.lo -MD -MP -MF $(DEPDIR)/libteco2_la-teco2.Tpo -c -o libteco2_la-teco2.lo `test -f 'teco2.c' || echo '$(srcdir)/'`teco2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libteco2_la-teco2.Tpo $(DEPDIR)/libteco2_la-teco2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco2.c' object='libteco2_la-teco2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco2_la-teco2.lo `test -f 'teco2.c' || echo '$(srcdir)/'`teco2.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco2_la-teco2.lo `test -f 'teco2.c' || echo '$(srcdir)/'`teco2.c libteco3_la-teco3.lo: teco3.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco3_la-teco3.lo -MD -MP -MF $(DEPDIR)/libteco3_la-teco3.Tpo -c -o libteco3_la-teco3.lo `test -f 'teco3.c' || echo '$(srcdir)/'`teco3.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libteco3_la-teco3.Tpo $(DEPDIR)/libteco3_la-teco3.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libteco3_la-teco3.lo -MD -MP -MF $(DEPDIR)/libteco3_la-teco3.Tpo -c -o libteco3_la-teco3.lo `test -f 'teco3.c' || echo '$(srcdir)/'`teco3.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libteco3_la-teco3.Tpo $(DEPDIR)/libteco3_la-teco3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='teco3.c' object='libteco3_la-teco3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco3_la-teco3.lo `test -f 'teco3.c' || echo '$(srcdir)/'`teco3.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libteco3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libteco3_la-teco3.lo `test -f 'teco3.c' || echo '$(srcdir)/'`teco3.c libtest_la-test.lo: test.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_la-test.lo -MD -MP -MF $(DEPDIR)/libtest_la-test.Tpo -c -o libtest_la-test.lo `test -f 'test.c' || echo '$(srcdir)/'`test.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libtest_la-test.Tpo $(DEPDIR)/libtest_la-test.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_la-test.lo -MD -MP -MF $(DEPDIR)/libtest_la-test.Tpo -c -o libtest_la-test.lo `test -f 'test.c' || echo '$(srcdir)/'`test.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_la-test.Tpo $(DEPDIR)/libtest_la-test.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test.c' object='libtest_la-test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_la-test.lo `test -f 'test.c' || echo '$(srcdir)/'`test.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_la-test.lo `test -f 'test.c' || echo '$(srcdir)/'`test.c libu12_la-u12.lo: u12.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libu12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libu12_la-u12.lo -MD -MP -MF $(DEPDIR)/libu12_la-u12.Tpo -c -o libu12_la-u12.lo `test -f 'u12.c' || echo '$(srcdir)/'`u12.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libu12_la-u12.Tpo $(DEPDIR)/libu12_la-u12.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libu12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libu12_la-u12.lo -MD -MP -MF $(DEPDIR)/libu12_la-u12.Tpo -c -o libu12_la-u12.lo `test -f 'u12.c' || echo '$(srcdir)/'`u12.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libu12_la-u12.Tpo $(DEPDIR)/libu12_la-u12.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='u12.c' object='libu12_la-u12.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libu12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libu12_la-u12.lo `test -f 'u12.c' || echo '$(srcdir)/'`u12.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libu12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libu12_la-u12.lo `test -f 'u12.c' || echo '$(srcdir)/'`u12.c libumax_la-umax.lo: umax.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_la-umax.lo -MD -MP -MF $(DEPDIR)/libumax_la-umax.Tpo -c -o libumax_la-umax.lo `test -f 'umax.c' || echo '$(srcdir)/'`umax.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libumax_la-umax.Tpo $(DEPDIR)/libumax_la-umax.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_la-umax.lo -MD -MP -MF $(DEPDIR)/libumax_la-umax.Tpo -c -o libumax_la-umax.lo `test -f 'umax.c' || echo '$(srcdir)/'`umax.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libumax_la-umax.Tpo $(DEPDIR)/libumax_la-umax.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax.c' object='libumax_la-umax.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_la-umax.lo `test -f 'umax.c' || echo '$(srcdir)/'`umax.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_la-umax.lo `test -f 'umax.c' || echo '$(srcdir)/'`umax.c libumax1220u_la-umax1220u.lo: umax1220u.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax1220u_la-umax1220u.lo -MD -MP -MF $(DEPDIR)/libumax1220u_la-umax1220u.Tpo -c -o libumax1220u_la-umax1220u.lo `test -f 'umax1220u.c' || echo '$(srcdir)/'`umax1220u.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libumax1220u_la-umax1220u.Tpo $(DEPDIR)/libumax1220u_la-umax1220u.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax1220u_la-umax1220u.lo -MD -MP -MF $(DEPDIR)/libumax1220u_la-umax1220u.Tpo -c -o libumax1220u_la-umax1220u.lo `test -f 'umax1220u.c' || echo '$(srcdir)/'`umax1220u.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libumax1220u_la-umax1220u.Tpo $(DEPDIR)/libumax1220u_la-umax1220u.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax1220u.c' object='libumax1220u_la-umax1220u.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax1220u_la-umax1220u.lo `test -f 'umax1220u.c' || echo '$(srcdir)/'`umax1220u.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax1220u_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax1220u_la-umax1220u.lo `test -f 'umax1220u.c' || echo '$(srcdir)/'`umax1220u.c libumax_pp_la-umax_pp.lo: umax_pp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp.Tpo -c -o libumax_pp_la-umax_pp.lo `test -f 'umax_pp.c' || echo '$(srcdir)/'`umax_pp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libumax_pp_la-umax_pp.Tpo $(DEPDIR)/libumax_pp_la-umax_pp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp.Tpo -c -o libumax_pp_la-umax_pp.lo `test -f 'umax_pp.c' || echo '$(srcdir)/'`umax_pp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libumax_pp_la-umax_pp.Tpo $(DEPDIR)/libumax_pp_la-umax_pp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax_pp.c' object='libumax_pp_la-umax_pp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp.lo `test -f 'umax_pp.c' || echo '$(srcdir)/'`umax_pp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp.lo `test -f 'umax_pp.c' || echo '$(srcdir)/'`umax_pp.c libumax_pp_la-umax_pp_low.lo: umax_pp_low.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp_low.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp_low.Tpo -c -o libumax_pp_la-umax_pp_low.lo `test -f 'umax_pp_low.c' || echo '$(srcdir)/'`umax_pp_low.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libumax_pp_la-umax_pp_low.Tpo $(DEPDIR)/libumax_pp_la-umax_pp_low.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp_low.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp_low.Tpo -c -o libumax_pp_la-umax_pp_low.lo `test -f 'umax_pp_low.c' || echo '$(srcdir)/'`umax_pp_low.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libumax_pp_la-umax_pp_low.Tpo $(DEPDIR)/libumax_pp_la-umax_pp_low.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax_pp_low.c' object='libumax_pp_la-umax_pp_low.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp_low.lo `test -f 'umax_pp_low.c' || echo '$(srcdir)/'`umax_pp_low.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp_low.lo `test -f 'umax_pp_low.c' || echo '$(srcdir)/'`umax_pp_low.c libumax_pp_la-umax_pp_mid.lo: umax_pp_mid.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp_mid.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp_mid.Tpo -c -o libumax_pp_la-umax_pp_mid.lo `test -f 'umax_pp_mid.c' || echo '$(srcdir)/'`umax_pp_mid.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libumax_pp_la-umax_pp_mid.Tpo $(DEPDIR)/libumax_pp_la-umax_pp_mid.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libumax_pp_la-umax_pp_mid.lo -MD -MP -MF $(DEPDIR)/libumax_pp_la-umax_pp_mid.Tpo -c -o libumax_pp_la-umax_pp_mid.lo `test -f 'umax_pp_mid.c' || echo '$(srcdir)/'`umax_pp_mid.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libumax_pp_la-umax_pp_mid.Tpo $(DEPDIR)/libumax_pp_la-umax_pp_mid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='umax_pp_mid.c' object='libumax_pp_la-umax_pp_mid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp_mid.lo `test -f 'umax_pp_mid.c' || echo '$(srcdir)/'`umax_pp_mid.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libumax_pp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libumax_pp_la-umax_pp_mid.lo `test -f 'umax_pp_mid.c' || echo '$(srcdir)/'`umax_pp_mid.c libv4l_la-v4l.lo: v4l.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libv4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libv4l_la-v4l.lo -MD -MP -MF $(DEPDIR)/libv4l_la-v4l.Tpo -c -o libv4l_la-v4l.lo `test -f 'v4l.c' || echo '$(srcdir)/'`v4l.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libv4l_la-v4l.Tpo $(DEPDIR)/libv4l_la-v4l.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libv4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libv4l_la-v4l.lo -MD -MP -MF $(DEPDIR)/libv4l_la-v4l.Tpo -c -o libv4l_la-v4l.lo `test -f 'v4l.c' || echo '$(srcdir)/'`v4l.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libv4l_la-v4l.Tpo $(DEPDIR)/libv4l_la-v4l.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='v4l.c' object='libv4l_la-v4l.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libv4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libv4l_la-v4l.lo `test -f 'v4l.c' || echo '$(srcdir)/'`v4l.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libv4l_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libv4l_la-v4l.lo `test -f 'v4l.c' || echo '$(srcdir)/'`v4l.c libxerox_mfp_la-xerox_mfp.lo: xerox_mfp.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxerox_mfp_la-xerox_mfp.lo -MD -MP -MF $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Tpo -c -o libxerox_mfp_la-xerox_mfp.lo `test -f 'xerox_mfp.c' || echo '$(srcdir)/'`xerox_mfp.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Tpo $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Plo +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxerox_mfp_la-xerox_mfp.lo -MD -MP -MF $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Tpo -c -o libxerox_mfp_la-xerox_mfp.lo `test -f 'xerox_mfp.c' || echo '$(srcdir)/'`xerox_mfp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Tpo $(DEPDIR)/libxerox_mfp_la-xerox_mfp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xerox_mfp.c' object='libxerox_mfp_la-xerox_mfp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxerox_mfp_la-xerox_mfp.lo `test -f 'xerox_mfp.c' || echo '$(srcdir)/'`xerox_mfp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxerox_mfp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxerox_mfp_la-xerox_mfp.lo `test -f 'xerox_mfp.c' || echo '$(srcdir)/'`xerox_mfp.c mostlyclean-libtool: -rm -f *.lo @@ -4201,14 +4449,14 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -4216,29 +4464,34 @@ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -4259,13 +4512,17 @@ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -4299,6 +4556,7 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -4321,6 +4579,8 @@ html: html-am +html-am: + info: info-am info-am: @@ -4328,21 +4588,30 @@ install-data-am: install-sanelibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook - install-dvi: install-dvi-am +install-dvi-am: + install-exec-am: install-libLTLIBRARIES install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -4366,8 +4635,8 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-sanelibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook - -.MAKE: install-am install-data-am install-strip uninstall-am +.MAKE: all check install install-am install-data-am install-strip \ + uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ @@ -4461,6 +4730,7 @@ done clean-local: find . -type l -name \*-s.c | xargs rm -f + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru sane-backends-1.0.20/backend/matsushita.c sane-backends-1.0.21/backend/matsushita.c --- sane-backends-1.0.20/backend/matsushita.c 2008-11-27 08:21:26.000000000 +1100 +++ sane-backends-1.0.21/backend/matsushita.c 2009-06-09 13:03:36.000000000 +1000 @@ -43,7 +43,7 @@ */ /* - $Id: matsushita.c,v 1.11 2008-11-26 21:21:26 kitno-guest Exp $ + $Id$ Matsushita/Panasonic KV-SS25, KV-SS50, KV-SS55, KV-SS50EX, KV-SS55EX, KV-SS850, KV-SS855 SCSI scanners. diff -Nru sane-backends-1.0.20/backend/matsushita.h sane-backends-1.0.21/backend/matsushita.h --- sane-backends-1.0.20/backend/matsushita.h 2005-07-07 21:55:42.000000000 +1000 +++ sane-backends-1.0.21/backend/matsushita.h 2010-04-05 23:18:04.000000000 +1000 @@ -41,7 +41,7 @@ */ /* - $Id: matsushita.h,v 1.7 2005-07-07 11:55:42 fzago-guest Exp $ + $Id$ */ /* Commands supported by the KV-SS 25 scanner. */ @@ -162,7 +162,6 @@ /*--------------------------------------------------------------------------*/ -#define MM_PER_INCH 25.4 #define mmToIlu(mm) (((mm) * 1200) / MM_PER_INCH) #define iluToMm(ilu) (((ilu) * MM_PER_INCH) / 1200) @@ -206,7 +205,7 @@ /*--------------------------------------------------------------------------*/ -#define BLACK_WHITE_STR SANE_I18N("Black & White") +#define BLACK_WHITE_STR SANE_VALUE_SCAN_MODE_LINEART #define GRAY4_STR SANE_I18N("Grayscale 4 bits") #define GRAY8_STR SANE_I18N("Grayscale 8 bits") diff -Nru sane-backends-1.0.20/backend/microtek2.c sane-backends-1.0.21/backend/microtek2.c --- sane-backends-1.0.20/backend/microtek2.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/microtek2.c 2010-04-05 23:18:04.000000000 +1000 @@ -72,7 +72,7 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" #ifdef HAVE_AUTHORIZATION #include diff -Nru sane-backends-1.0.20/backend/microtek2.h sane-backends-1.0.21/backend/microtek2.h --- sane-backends-1.0.20/backend/microtek2.h 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/microtek2.h 2010-04-05 23:18:04.000000000 +1000 @@ -78,7 +78,6 @@ #endif /* HAVE_AUTHORIZATION */ -#define MM_PER_INCH 25.4 #define ENDIAN_TYPE(d) { unsigned i, test = 0; \ for (i=0; i < sizeof(int); i++ ) \ @@ -942,10 +941,10 @@ #define MD_MODESTRING_NUMS 4 -#define MD_MODESTRING_COLOR "Color" -#define MD_MODESTRING_GRAY "Gray" -#define MD_MODESTRING_HALFTONE "Halftone" -#define MD_MODESTRING_LINEART "LineArt" +#define MD_MODESTRING_COLOR SANE_VALUE_SCAN_MODE_COLOR +#define MD_MODESTRING_GRAY SANE_VALUE_SCAN_MODE_GRAY +#define MD_MODESTRING_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE +#define MD_MODESTRING_LINEART SANE_VALUE_SCAN_MODE_LINEART SANE_String_Const scanmode_list[MD_MODESTRING_NUMS + 1]; #define MD_DEPTHVAL_NUMS 6 diff -Nru sane-backends-1.0.20/backend/microtek.c sane-backends-1.0.21/backend/microtek.c --- sane-backends-1.0.20/backend/microtek.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/microtek.c 2010-04-05 23:18:04.000000000 +1000 @@ -57,7 +57,7 @@ #define MICROTEK_MINOR 13 #define MICROTEK_PATCH 1 -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -65,16 +65,16 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" -#include "sane/sane.h" -#include "sane/sanei.h" -#include "sane/sanei_config.h" -#include "sane/sanei_scsi.h" -#include "sane/saneopts.h" +#include "../include/sane/sane.h" +#include "../include/sane/sanei.h" +#include "../include/sane/sanei_config.h" +#include "../include/sane/sanei_scsi.h" +#include "../include/sane/saneopts.h" #define BACKEND_NAME microtek -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #include "microtek.h" @@ -85,7 +85,6 @@ # define PATH_MAX 1024 #endif -#define MM_PER_INCH 25.4 #define SCSI_BUFF_SIZE sanei_scsi_max_request_size @@ -105,10 +104,10 @@ #define M_GSS_WAIT 5 /* seconds */ -#define M_LINEART "LineArt" -#define M_HALFTONE "Halftone" -#define M_GRAY "Gray" -#define M_COLOR "Color" +#define M_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define M_HALFTONE SANE_VALUE_SCAN_MODE_HALFTONE +#define M_GRAY SANE_VALUE_SCAN_MODE_GRAY +#define M_COLOR SANE_VALUE_SCAN_MODE_COLOR #define M_OPAQUE "Opaque/Normal" #define M_TRANS "Transparency" diff -Nru sane-backends-1.0.20/backend/mustek.c sane-backends-1.0.21/backend/mustek.c --- sane-backends-1.0.20/backend/mustek.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/mustek.c 2010-04-05 23:18:04.000000000 +1000 @@ -66,7 +66,7 @@ #include #include -#include "_stdint.h" +#include "../include/_stdint.h" #include "../include/sane/sane.h" #include "../include/sane/sanei.h" @@ -126,12 +126,16 @@ /* Which modes are supported? */ static SANE_String_Const mode_list_paragon[] = { - SANE_I18N ("Lineart"), SANE_I18N ("Halftone"), SANE_I18N ("Gray"), - SANE_I18N ("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_HALFTONE, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, 0 }; static SANE_String_Const mode_list_se[] = { - SANE_I18N ("Lineart"), SANE_I18N ("Gray"), SANE_I18N ("Color"), + SANE_VALUE_SCAN_MODE_LINEART, + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, 0 }; @@ -5944,16 +5948,16 @@ { SANE_String_Const mode = s->val[OPT_MODE].s; - if (strcmp (mode, "Gray") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (strcmp (mode, "Color") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap &= ~SANE_CAP_INACTIVE; } - else if ((strcmp (mode, "Lineart") == 0) + else if ((strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) && (s->hw->flags & MUSTEK_FLAG_PRO)) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; @@ -6002,8 +6006,8 @@ s->opt[OPT_HALFTONE_DIMENSION].cap |= SANE_CAP_INACTIVE; s->opt[OPT_HALFTONE_PATTERN].cap |= SANE_CAP_INACTIVE; - halftoning = strcmp (val, "Halftone") == 0; - binary = (halftoning || strcmp (val, "Lineart") == 0); + halftoning = strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE) == 0; + binary = (halftoning || strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0); if (binary) { @@ -6037,7 +6041,7 @@ if (s->hw->flags & MUSTEK_FLAG_THREE_PASS) { - if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) { s->opt[OPT_BRIGHTNESS_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_BRIGHTNESS_G].cap &= ~SANE_CAP_INACTIVE; @@ -6054,18 +6058,18 @@ } else if (s->hw->flags & MUSTEK_FLAG_PRO) { - if (strcmp (s->val[OPT_MODE].s, "Gray") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->opt[OPT_FAST_GRAY_MODE].cap &= ~SANE_CAP_INACTIVE; else s->opt[OPT_FAST_GRAY_MODE].cap |= SANE_CAP_INACTIVE; - if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->opt[OPT_BIT_DEPTH].cap &= ~SANE_CAP_INACTIVE; else s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; } else if (s->hw->flags & MUSTEK_FLAG_SE_PLUS) { - if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->opt[OPT_BIT_DEPTH].cap &= ~SANE_CAP_INACTIVE; else s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; @@ -6073,9 +6077,9 @@ if (s->val[OPT_CUSTOM_GAMMA].w) { - if (strcmp (val, "Gray") == 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (strcmp (val, "Color") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_COLOR) == 0) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; @@ -6175,13 +6179,13 @@ } encode_halftone (s); mode = s->val[OPT_MODE].s; - if (strcmp (mode, "Lineart") == 0 || strcmp (mode, "Halftone") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0 || strcmp (mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = (s->params.pixels_per_line + 7) / 8; s->params.depth = 1; } - else if (strcmp (mode, "Gray") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; @@ -6282,13 +6286,13 @@ s->start_time = start.tv_sec; /* translate options into s->mode for convenient access: */ mode = s->val[OPT_MODE].s; - if (strcmp (mode, "Lineart") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) s->mode = MUSTEK_MODE_LINEART; - else if (strcmp (mode, "Halftone") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_HALFTONE) == 0) s->mode = MUSTEK_MODE_HALFTONE; - else if (strcmp (mode, "Gray") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->mode = MUSTEK_MODE_GRAY; - else if (strcmp (mode, "Color") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->mode = MUSTEK_MODE_COLOR; /* scanner dependant specials */ diff -Nru sane-backends-1.0.20/backend/mustek.h sane-backends-1.0.21/backend/mustek.h --- sane-backends-1.0.20/backend/mustek.h 2008-05-15 22:50:24.000000000 +1000 +++ sane-backends-1.0.21/backend/mustek.h 2010-04-05 23:18:04.000000000 +1000 @@ -55,7 +55,6 @@ # define PATH_MAX 1024 #endif #define MUSTEK_CONFIG_FILE "mustek.conf" -#define MM_PER_INCH 25.4 #define MAX_WAITING_TIME 60 /* How long to wait for scanner to become ready */ #define MAX_LINE_DIST 40 /* Extra lines needed for LD correction */ diff -Nru sane-backends-1.0.20/backend/mustek_pp.c sane-backends-1.0.21/backend/mustek_pp.c --- sane-backends-1.0.20/backend/mustek_pp.c 2008-11-27 08:21:28.000000000 +1100 +++ sane-backends-1.0.21/backend/mustek_pp.c 2010-04-05 23:18:04.000000000 +1000 @@ -118,7 +118,7 @@ /* currently active Handles */ static Mustek_pp_Handle *first_hndl = NULL; -static SANE_String_Const mustek_pp_modes[4] = {"Lineart", "Grayscale", "Color", NULL}; +static SANE_String_Const mustek_pp_modes[4] = {SANE_VALUE_SCAN_MODE_LINEART, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_COLOR, NULL}; static SANE_Word mustek_pp_modes_size = 10; static SANE_String_Const mustek_pp_speeds[6] = {"Slowest", "Slower", "Normal", "Faster", "Fastest", NULL}; @@ -1443,9 +1443,9 @@ { const char *mode = hndl->val[OPT_MODE].s; - if (strcmp (mode, "Grayscale") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) hndl->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (strcmp (mode, "Color") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) { hndl->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; hndl->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; @@ -1488,20 +1488,20 @@ hndl->opt[OPT_DEPTH].cap |= SANE_CAP_INACTIVE; - if ((hndl->dev->caps & CAP_DEPTH) && (strcmp(val, "Color") == 0)) + if ((hndl->dev->caps & CAP_DEPTH) && (strcmp(val, SANE_VALUE_SCAN_MODE_COLOR) == 0)) hndl->opt[OPT_DEPTH].cap &= ~SANE_CAP_INACTIVE; if (!(hndl->dev->caps & CAP_GAMMA_CORRECT)) return SANE_STATUS_GOOD; - if (strcmp (val, "Lineart") != 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) != 0) hndl->opt[OPT_CUSTOM_GAMMA].cap &= ~SANE_CAP_INACTIVE; if (hndl->val[OPT_CUSTOM_GAMMA].w == SANE_TRUE) { - if (strcmp (val, "Grayscale") == 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_GRAY) == 0) hndl->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (strcmp (val, "Color") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_COLOR) == 0) { hndl->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; hndl->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; @@ -1610,9 +1610,9 @@ mode = hndl->val[OPT_MODE].s; - if (strcmp (mode, "Lineart") == 0) + if (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) hndl->mode = MODE_BW; - else if (strcmp (mode, "Grayscale") == 0) + else if (strcmp (mode, SANE_VALUE_SCAN_MODE_GRAY) == 0) hndl->mode = MODE_GRAYSCALE; else hndl->mode = MODE_COLOR; diff -Nru sane-backends-1.0.20/backend/mustek_usb2.c sane-backends-1.0.21/backend/mustek_usb2.c --- sane-backends-1.0.20/backend/mustek_usb2.c 2008-11-27 08:21:28.000000000 +1100 +++ sane-backends-1.0.21/backend/mustek_usb2.c 2010-04-05 23:18:04.000000000 +1000 @@ -106,7 +106,7 @@ SANE_I18N ("Color24"), SANE_I18N ("Gray16"), SANE_I18N ("Gray8"), - SANE_I18N ("Lineart"), + SANE_VALUE_SCAN_MODE_LINEART, 0 }; @@ -234,7 +234,7 @@ s->params.depth = 8; s->setpara.smScanMode = SM_GRAY; } - else if (strcmp (val, "Lineart") == 0) + else if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->params.format = SANE_FRAME_GRAY; s->params.depth = 1; @@ -2280,7 +2280,7 @@ if (s->val[option].s) free (s->val[option].s); s->val[option].s = strdup (val); - if (strcmp (s->val[option].s, "Lineart") == 0) + if (strcmp (s->val[option].s, SANE_VALUE_SCAN_MODE_LINEART) == 0) { ENABLE (OPT_THRESHOLD); } diff -Nru sane-backends-1.0.20/backend/mustek_usb2.h sane-backends-1.0.21/backend/mustek_usb2.h --- sane-backends-1.0.20/backend/mustek_usb2.h 2005-10-17 02:37:13.000000000 +1000 +++ sane-backends-1.0.21/backend/mustek_usb2.h 2010-04-05 23:18:04.000000000 +1000 @@ -60,7 +60,6 @@ #define RIE(function) do {status = function; if (status != SANE_STATUS_GOOD) \ return status;} while (SANE_FALSE) -#define MM_PER_INCH 25.4 #define SCAN_BUFFER_SIZE (64 * 1024) #define MAX_RESOLUTIONS 12 #define DEF_LINEARTTHRESHOLD 128 diff -Nru sane-backends-1.0.20/backend/mustek_usb.c sane-backends-1.0.21/backend/mustek_usb.c --- sane-backends-1.0.20/backend/mustek_usb.c 2008-11-27 08:21:28.000000000 +1100 +++ sane-backends-1.0.21/backend/mustek_usb.c 2010-04-05 23:18:04.000000000 +1000 @@ -139,21 +139,21 @@ s->params.last_frame = SANE_TRUE; - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) { s->params.format = SANE_FRAME_GRAY; s->params.depth = 1; s->bpp = 1; s->channels = 1; } - else if (!strcmp (val, "Gray")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_GRAY)) { s->params.format = SANE_FRAME_GRAY; s->params.depth = 8; s->bpp = 8; s->channels = 1; } - else if (!strcmp (val, "Color")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_COLOR)) { s->params.format = SANE_FRAME_RGB; s->params.depth = 8; @@ -191,7 +191,7 @@ s->width_dots = max_x; if (s->height_dots > max_y) s->height_dots = max_y; - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) { s->width_dots = (s->width_dots / 8) * 8; if (s->width_dots == 0) @@ -265,9 +265,9 @@ s->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; /* scan mode */ - mode_list[0] = SANE_I18N ("Color"); - mode_list[1] = SANE_I18N ("Gray"); - mode_list[2] = SANE_I18N ("Lineart"); + mode_list[0] = SANE_VALUE_SCAN_MODE_COLOR; + mode_list[1] = SANE_VALUE_SCAN_MODE_GRAY; + mode_list[2] = SANE_VALUE_SCAN_MODE_LINEART; mode_list[3] = NULL; s->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; @@ -1296,9 +1296,9 @@ s->green_table = s->green_gamma_table; s->blue_table = s->blue_gamma_table; s->gray_table = s->gray_gamma_table; - if (strcmp (s->val[OPT_MODE].s, "Gray") == 0) + if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; - else if (strcmp (s->val[OPT_MODE].s, "Color") == 0) + else if (strcmp (s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR) == 0) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; @@ -1332,7 +1332,7 @@ s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - if (strcmp (val, "Lineart") == 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; } @@ -1415,9 +1415,9 @@ val = s->val[OPT_MODE].s; - if (!strcmp (val, "Lineart")) + if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART)) color_mode = GRAY8; - else if (!strcmp (val, "Gray")) + else if (!strcmp (val, SANE_VALUE_SCAN_MODE_GRAY)) color_mode = GRAY8; else /* Color */ color_mode = RGB24; diff -Nru sane-backends-1.0.20/backend/mustek_usb.h sane-backends-1.0.21/backend/mustek_usb.h --- sane-backends-1.0.20/backend/mustek_usb.h 2002-03-18 07:20:41.000000000 +1100 +++ sane-backends-1.0.21/backend/mustek_usb.h 2010-04-05 23:18:04.000000000 +1000 @@ -56,7 +56,6 @@ #define DISABLE(OPTION) s->opt[OPTION].cap |= SANE_CAP_INACTIVE #define IS_ACTIVE(OPTION) (((s->opt[OPTION].cap) & SANE_CAP_INACTIVE) == 0) -#define MM_PER_INCH 25.4 #define MUSTEK_USB_CONFIG_FILE "mustek_usb.conf" #define SCAN_BUFFER_SIZE (64 * 1024) diff -Nru sane-backends-1.0.20/backend/nec.c sane-backends-1.0.21/backend/nec.c --- sane-backends-1.0.20/backend/nec.c 2008-11-27 08:21:28.000000000 +1100 +++ sane-backends-1.0.21/backend/nec.c 2010-04-05 23:18:04.000000000 +1000 @@ -63,7 +63,7 @@ MultiReder 600U/600S series not available MultiReader PetiScan series not available */ -#include "sane/config.h" +#include "../include/sane/config.h" #include #include @@ -73,9 +73,9 @@ #include #include -#include "sane/sane.h" -#include "sane/saneopts.h" -#include "sane/sanei_scsi.h" +#include "../include/sane/sane.h" +#include "../include/sane/saneopts.h" +#include "../include/sane/sanei_scsi.h" /* QUEUEDEBUG should be undefined unless you want to play with the sanei_scsi.c under Linux and/or with the Linux's SG driver, @@ -122,7 +122,7 @@ /* #define USE_RESOLUTION_LIST */ #define BACKEND_NAME nec -#include "sane/sanei_backend.h" +#include "../include/sane/sanei_backend.h" #ifndef PATH_MAX #define PATH_MAX 1024 @@ -133,7 +133,7 @@ #define PIX_TO_MM(x, mud) ((x) * 25.4 / mud) #define MM_TO_PIX(x, mud) ((x) * mud / 25.4) -#include "sane/sanei_config.h" +#include "../include/sane/sanei_config.h" #define NEC_CONFIG_FILE "nec.conf" #include "nec.h" @@ -152,10 +152,10 @@ } Modes; -#define M_LINEART "Lineart" -#define M_GRAY "Gray" +#define M_LINEART SANE_VALUE_SCAN_MODE_LINEART +#define M_GRAY SANE_VALUE_SCAN_MODE_GRAY #define M_LINEART_COLOR "Lineart Color" -#define M_COLOR "Color" +#define M_COLOR SANE_VALUE_SCAN_MODE_COLOR static const SANE_String_Const mode_list[] = { #if 0 diff -Nru sane-backends-1.0.20/backend/net.c sane-backends-1.0.21/backend/net.c --- sane-backends-1.0.20/backend/net.c 2009-02-27 03:11:17.000000000 +1100 +++ sane-backends-1.0.21/backend/net.c 2010-04-05 23:18:04.000000000 +1000 @@ -49,6 +49,7 @@ #include "../include/sane/config.h" #include "../include/lalloca.h" +#include "../include/_stdint.h" #include #include diff -Nru sane-backends-1.0.20/backend/niash.c sane-backends-1.0.21/backend/niash.c --- sane-backends-1.0.20/backend/niash.c 2008-11-27 08:21:28.000000000 +1100 +++ sane-backends-1.0.21/backend/niash.c 2010-04-05 23:18:04.000000000 +1000 @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - $Id: niash.c,v 1.14 2008-11-26 21:21:28 kitno-guest Exp $ + $Id$ */ /* @@ -200,9 +200,9 @@ static const SANE_Range rangeYmm = { 0, 297, 1 }; static const SANE_Int startUpGamma = SANE_FIX (1.6); -static const char colorStr[] = { "Color" }; -static const char grayStr[] = { "Gray" }; -static const char lineartStr[] = { "Lineart" }; +static const char colorStr[] = { SANE_VALUE_SCAN_MODE_COLOR }; +static const char grayStr[] = { SANE_VALUE_SCAN_MODE_GRAY }; +static const char lineartStr[] = { SANE_VALUE_SCAN_MODE_LINEART }; #define DEPTH_LINEART 1 #define DEPTH_GRAY 8 diff -Nru sane-backends-1.0.20/backend/niash_core.c sane-backends-1.0.21/backend/niash_core.c --- sane-backends-1.0.20/backend/niash_core.c 2004-10-28 04:06:19.000000000 +1000 +++ sane-backends-1.0.21/backend/niash_core.c 2009-06-09 13:03:36.000000000 +1000 @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - $Id: niash_core.c,v 1.8 2004-10-27 18:06:19 ullsig-guest Exp $ + $Id$ */ /* diff -Nru sane-backends-1.0.20/backend/niash_core.h sane-backends-1.0.21/backend/niash_core.h --- sane-backends-1.0.20/backend/niash_core.h 2004-10-28 04:06:19.000000000 +1000 +++ sane-backends-1.0.21/backend/niash_core.h 2009-06-09 13:03:36.000000000 +1000 @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - $Id: niash_core.h,v 1.5 2004-10-27 18:06:19 ullsig-guest Exp $ + $Id$ */ /* diff -Nru sane-backends-1.0.20/backend/niash_xfer.c sane-backends-1.0.21/backend/niash_xfer.c --- sane-backends-1.0.20/backend/niash_xfer.c 2006-02-04 21:28:50.000000000 +1100 +++ sane-backends-1.0.21/backend/niash_xfer.c 2009-06-09 13:03:36.000000000 +1000 @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - $Id: niash_xfer.c,v 1.4 2006-02-04 10:28:50 ullsig-guest Exp $ + $Id$ */ /* diff -Nru sane-backends-1.0.20/backend/niash_xfer.h sane-backends-1.0.21/backend/niash_xfer.h --- sane-backends-1.0.20/backend/niash_xfer.h 2004-10-16 21:14:47.000000000 +1000 +++ sane-backends-1.0.21/backend/niash_xfer.h 2009-06-09 13:03:36.000000000 +1000 @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - $Id: niash_xfer.h,v 1.3 2004-10-16 11:14:47 ullsig-guest Exp $ + $Id$ */ /* diff -Nru sane-backends-1.0.20/backend/p5.c sane-backends-1.0.21/backend/p5.c --- sane-backends-1.0.20/backend/p5.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/p5.c 2010-04-14 10:52:59.000000000 +1000 @@ -0,0 +1,2048 @@ +/* sane - Scanner Access Now Easy. + + Copyright (C) 2009 Stéphane Voltz + + 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. +*/ +/* -------------------------------------------------------------------------- + +*/ + +/* ------------------------------------------------------------------------- */ +/*! \mainpage Primax PagePartner Parallel Port scanner Index Page + * + * \section intro_sec Introduction + * + * This backend provides support for the Prima PagePartner sheet fed parallel + * port scanner. + * + * \section sane_api SANE API + * + * \subsection sane_flow sane flow + SANE FLOW + - sane_init() : initialize backend, attach scanners. + - sane_get_devices() : query list of scanner devices, backend must + probe for new devices. + - sane_open() : open a particular scanner device, adding a handle + to the opened device + - sane_set_io_mode() : set blocking mode + - sane_get_select_fd() : get scanner fd + - sane_get_option_descriptor() : get option information + - sane_control_option() : change option values + - sane_start() : start image acquisition + - sane_get_parameters() : returns actual scan parameters for the ongoing scan + - sane_read() : read image data + - sane_cancel() : cancel operation, end scan + - sane_close() : close opened scanner device, freeing scanner handle + - sane_exit() : terminate use of backend, freeing all resources for attached + devices when last frontend quits + */ + +/** + * the build number allow to know which version of the backend is running. + */ +#define BUILD 1 + +#include "p5.h" + +/** + * Import directly the low level part needed to + * operate scanner. The alternative is to prefix all public functions + * with sanei_p5_ ,and have all the functions prototyped in + * p5_device.h . + */ +#include "p5_device.c" + +/** + * number of time the backend has been loaded by sane_init. + */ +static int init_count = 0; + +/** + * NULL terminated list of opened frontend sessions. Sessions are + * inserted here on sane_open() and removed on sane_close(). + */ +static P5_Session *sessions = NULL; + +/** + * NULL terminated list of detected physical devices. + * The same device may be opened several time by different sessions. + * Entry are inserted here by the attach() function. + * */ +static P5_Device *devices = NULL; + +/** + * NULL terminated list of devices needed by sane_get_devices(), since + * the result returned must stay consistent until next call. + */ +static const SANE_Device **devlist = 0; + +/** + * list of possible color modes + */ +static SANE_String_Const mode_list[] = { + SANE_I18N (COLOR_MODE), + SANE_I18N (GRAY_MODE), + /* SANE_I18N (LINEART_MODE), not supported yet */ + 0 +}; + +static SANE_Range x_range = { + SANE_FIX (0.0), /* minimum */ + SANE_FIX (216.0), /* maximum */ + SANE_FIX (0.0) /* quantization */ +}; + +static SANE_Range y_range = { + SANE_FIX (0.0), /* minimum */ + SANE_FIX (299.0), /* maximum */ + SANE_FIX (0.0) /* no quantization */ +}; + +static const SANE_Range u8_range = { + 0, /* minimum */ + 255, /* maximum */ + 0 /* no quantization */ +}; + +static const SANE_Range threshold_percentage_range = { + SANE_FIX (0), /* minimum */ + SANE_FIX (100), /* maximum */ + SANE_FIX (1) /* quantization */ +}; + +/** + * finds the maximum string length in a string array. + */ +static size_t +max_string_size (const SANE_String_Const strings[]) +{ + size_t size, max_size = 0; + SANE_Int i; + + for (i = 0; strings[i]; ++i) + { + size = strlen (strings[i]) + 1; + if (size > max_size) + max_size = size; + } + return max_size; +} + +/**> placeholders for decoded configuration values */ +static P5_Config p5cfg; + + +/* ------------------------------------------------------------------------- */ + +/* + * SANE Interface + */ + + +/** + * Called by SANE initially. + * + * From the SANE spec: + * This function must be called before any other SANE function can be + * called. The behavior of a SANE backend is undefined if this + * function is not called first. The version code of the backend is + * returned in the value pointed to by version_code. If that pointer + * is NULL, no version code is returned. Argument authorize is either + * a pointer to a function that is invoked when the backend requires + * authentication for a specific resource or NULL if the frontend does + * not support authentication. + */ +SANE_Status +sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) +{ + SANE_Status status; + + authorize = authorize; /* get rid of compiler warning */ + + init_count++; + + /* init backend debug */ + DBG_INIT (); + DBG (DBG_info, "SANE P5 backend version %d.%d-%d\n", + SANE_CURRENT_MAJOR, V_MINOR, BUILD); + DBG (DBG_proc, "sane_init: start\n"); + DBG (DBG_trace, "sane_init: init_count=%d\n", init_count); + + if (version_code) + *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD); + + /* cold-plugging case : probe for already plugged devices */ + status = probe_p5_devices (); + + DBG (DBG_proc, "sane_init: exit\n"); + return status; +} + + +/** + * Called by SANE to find out about supported devices. + * + * From the SANE spec: + * This function can be used to query the list of devices that are + * available. If the function executes successfully, it stores a + * pointer to a NULL terminated array of pointers to SANE_Device + * structures in *device_list. The returned list is guaranteed to + * remain unchanged and valid until (a) another call to this function + * is performed or (b) a call to sane_exit() is performed. This + * function can be called repeatedly to detect when new devices become + * available. If argument local_only is true, only local devices are + * returned (devices directly attached to the machine that SANE is + * running on). If it is false, the device list includes all remote + * devices that are accessible to the SANE library. + * + * SANE does not require that this function is called before a + * sane_open() call is performed. A device name may be specified + * explicitly by a user which would make it unnecessary and + * undesirable to call this function first. + * @param device_list pointer where to store the device list + * @param local_only SANE_TRUE if only local devices are required. + * @return SANE_STATUS_GOOD when successfull + */ +SANE_Status +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) +{ + int dev_num, devnr; + struct P5_Device *device; + SANE_Device *sane_device; + int i; + + DBG (DBG_proc, "sane_get_devices: start: local_only = %s\n", + local_only == SANE_TRUE ? "true" : "false"); + + /* free existing devlist first */ + if (devlist) + { + for (i = 0; devlist[i] != NULL; i++) + free ((void *)devlist[i]); + free (devlist); + devlist = NULL; + } + + /** + * Since sane_get_devices() may be called repeatedly to detect new devices, + * the device detection must be run at each call. We are handling + * hot-plugging : we probe for devices plugged since sane_init() was called. + */ + probe_p5_devices (); + + /* if no devices detected, just return an empty list */ + if (devices == NULL) + { + devlist = malloc (sizeof (devlist[0])); + if (!devlist) + return SANE_STATUS_NO_MEM; + devlist[0] = NULL; + *device_list = devlist; + DBG (DBG_proc, "sane_get_devices: exit with no device\n"); + return SANE_STATUS_GOOD; + } + + /* count physical devices */ + devnr = 1; + device = devices; + while (device->next) + { + devnr++; + device = device->next; + } + + /* allocate room for the list, plus 1 for the NULL terminator */ + devlist = malloc ((devnr + 1) * sizeof (devlist[0])); + if (!devlist) + return SANE_STATUS_NO_MEM; + + *device_list = devlist; + + dev_num = 0; + device = devices; + + /* we build a list of SANE_Device from the list of attached devices */ + for (i = 0; i < devnr; i++) + { + /* add device according to local only flag */ + if ((local_only == SANE_TRUE && device->local == SANE_TRUE) + || local_only == SANE_FALSE) + { + /* allocate memory to add the device */ + sane_device = malloc (sizeof (*sane_device)); + if (!sane_device) + { + return SANE_STATUS_NO_MEM; + } + + /* copy data */ + sane_device->name = device->name; + sane_device->vendor = device->model->vendor; + sane_device->model = device->model->product; + sane_device->type = device->model->type; + devlist[dev_num] = sane_device; + + /* increment device counter */ + dev_num++; + } + + /* go to next detected device */ + device = device->next; + } + devlist[dev_num] = 0; + + *device_list = devlist; + + DBG (DBG_proc, "sane_get_devices: exit\n"); + + return SANE_STATUS_GOOD; +} + + +/** + * Called to establish connection with the session. This function will + * also establish meaningful defaults and initialize the options. + * + * From the SANE spec: + * This function is used to establish a connection to a particular + * device. The name of the device to be opened is passed in argument + * name. If the call completes successfully, a handle for the device + * is returned in *h. As a special case, specifying a zero-length + * string as the device requests opening the first available device + * (if there is such a device). Another special case is to only give + * the name of the backend as the device name, in this case the first + * available device will also be used. + * @param name name of the device to open + * @param handle opaque pointer where to store the pointer of + * the opened P5_Session + * @return SANE_STATUS_GOOD on success + */ +SANE_Status +sane_open (SANE_String_Const name, SANE_Handle * handle) +{ + struct P5_Session *session = NULL; + struct P5_Device *device = NULL; + + DBG (DBG_proc, "sane_open: start (devicename=%s)\n", name); + + /* check there is at least a device */ + if (devices == NULL) + { + DBG (DBG_proc, "sane_open: exit, no device to open!\n"); + return SANE_STATUS_INVAL; + } + + if (name[0] == 0 || strncmp (name, "p5", strlen ("p5")) == 0) + { + DBG (DBG_info, + "sane_open: no specific device requested, using default\n"); + if (devices) + { + device = devices; + DBG (DBG_info, "sane_open: device %s used as default device\n", + device->name); + } + } + else + { + DBG (DBG_info, "sane_open: device %s requested\n", name); + /* walk the device list until we find a matching name */ + device = devices; + while (device && strcmp (device->name, name) != 0) + { + DBG (DBG_trace, "sane_open: device %s doesn't match\n", + device->name); + device = device->next; + } + } + + /* check wether we have found a match or reach the end of the device list */ + if (!device) + { + DBG (DBG_info, "sane_open: no device found\n"); + return SANE_STATUS_INVAL; + } + + /* now we have a device, duplicate it and return it in handle */ + DBG (DBG_info, "sane_open: device %s found\n", name); + + /* device initialization */ + if (device->initialized == SANE_FALSE) + { + /** + * call to hardware initialization function here. + */ + device->fd = open_pp (device->name); + if (device->fd < 0) + { + DBG (DBG_error, "sane_open: failed to open '%s' device!\n", + device->name); + return SANE_STATUS_INVAL; + } + + /* now try to connect to scanner */ + if (connect (device->fd) != SANE_TRUE) + { + DBG (DBG_error, "sane_open: failed to connect!\n"); + close_pp (device->fd); + return SANE_STATUS_INVAL; + } + + /* load calibration data */ + restore_calibration (device); + + /* device link is OK now */ + device->initialized = SANE_TRUE; + } + device->buffer = NULL; + device->gain = NULL; + device->offset = NULL; + + /* prepare handle to return */ + session = (P5_Session *) malloc (sizeof (P5_Session)); + if (session == NULL) + { + DBG (DBG_proc, "sane_open: exit OOM\n"); + return SANE_STATUS_NO_MEM; + } + + /* initalize session */ + session->dev = device; + session->scanning = SANE_FALSE; + session->non_blocking = SANE_FALSE; + + /* initialize SANE options for this session */ + init_options (session); + + /* add the handle to the linked list of sessions */ + session->next = sessions; + sessions = session; + + /* store result */ + *handle = session; + + /* exit success */ + DBG (DBG_proc, "sane_open: exit\n"); + return SANE_STATUS_GOOD; +} + + +/** + * Set non blocking mode. In this mode, read return immediatly when + * no data is available whithin sane_read(), instead of polling the scanner. + */ +SANE_Status +sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) +{ + P5_Session *session = (P5_Session *) handle; + + DBG (DBG_proc, "sane_set_io_mode: start\n"); + if (session->scanning != SANE_TRUE) + { + DBG (DBG_error, "sane_set_io_mode: called out of a scan\n"); + return SANE_STATUS_INVAL; + } + session->non_blocking = non_blocking; + DBG (DBG_info, "sane_set_io_mode: I/O mode set to %sblocking.\n", + non_blocking ? "non " : " "); + DBG (DBG_proc, "sane_set_io_mode: exit\n"); + return SANE_STATUS_GOOD; +} + + +/** + * An advanced method we don't support but have to define. At SANE API + * level this function is meant to provide a file descriptor on which the + * frontend can do select()/poll() to wait for data. + */ +SANE_Status +sane_get_select_fd (SANE_Handle handle, SANE_Int * fdp) +{ + /* make compiler happy ... */ + handle = handle; + fdp = fdp; + + DBG (DBG_proc, "sane_get_select_fd: start\n"); + DBG (DBG_warn, "sane_get_select_fd: unsupported ...\n"); + DBG (DBG_proc, "sane_get_select_fd: exit\n"); + return SANE_STATUS_UNSUPPORTED; +} + + +/** + * Returns the options we know. + * + * From the SANE spec: + * This function is used to access option descriptors. The function + * returns the option descriptor for option number n of the device + * represented by handle h. Option number 0 is guaranteed to be a + * valid option. Its value is an integer that specifies the number of + * options that are available for device handle h (the count includes + * option 0). If n is not a valid option index, the function returns + * NULL. The returned option descriptor is guaranteed to remain valid + * (and at the returned address) until the device is closed. + */ +const SANE_Option_Descriptor * +sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) +{ + struct P5_Session *session = handle; + + DBG (DBG_proc, "sane_get_option_descriptor: start\n"); + + if ((unsigned) option >= NUM_OPTIONS) + return NULL; + + DBG (DBG_info, "sane_get_option_descriptor: \"%s\"\n", + session->options[option].descriptor.name); + + DBG (DBG_proc, "sane_get_option_descriptor: exit\n"); + return &(session->options[option].descriptor); +} + +/** + * sets automatic value for an option , called by sane_control_option after + * all checks have been done */ +static SANE_Status +set_automatic_value (P5_Session * s, int option, SANE_Int * myinfo) +{ + SANE_Status status = SANE_STATUS_GOOD; + SANE_Int i, min; + SANE_Word *dpi_list; + + switch (option) + { + case OPT_TL_X: + s->options[OPT_TL_X].value.w = x_range.min; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_TL_Y: + s->options[OPT_TL_Y].value.w = y_range.min; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_BR_X: + s->options[OPT_BR_X].value.w = x_range.max; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_BR_Y: + s->options[OPT_BR_Y].value.w = y_range.max; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_RESOLUTION: + /* we set up to the lowest available dpi value */ + dpi_list = + (SANE_Word *) s->options[OPT_RESOLUTION].descriptor.constraint. + word_list; + min = 65536; + for (i = 1; i < dpi_list[0]; i++) + { + if (dpi_list[i] < min) + min = dpi_list[i]; + } + s->options[OPT_RESOLUTION].value.w = min; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_PREVIEW: + s->options[OPT_PREVIEW].value.w = SANE_FALSE; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + case OPT_MODE: + if (s->options[OPT_MODE].value.s) + free (s->options[OPT_MODE].value.s); + s->options[OPT_MODE].value.s = strdup (mode_list[0]); + *myinfo |= SANE_INFO_RELOAD_OPTIONS; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + default: + DBG (DBG_warn, "set_automatic_value: can't set unknown option %d\n", + option); + } + + return status; +} + +/** + * sets an option , called by sane_control_option after all + * checks have been done */ +static SANE_Status +set_option_value (P5_Session * s, int option, void *val, SANE_Int * myinfo) +{ + SANE_Status status = SANE_STATUS_GOOD; + SANE_Word tmpw; + + switch (option) + { + case OPT_TL_X: + case OPT_BR_X: + case OPT_TL_Y: + case OPT_BR_Y: + s->options[option].value.w = *(SANE_Word *) val; + /* we ensure geometry is coherent */ + /* this happens when user drags TL corner right or below the BR point */ + if (s->options[OPT_BR_Y].value.w < s->options[OPT_TL_Y].value.w) + { + tmpw = s->options[OPT_BR_Y].value.w; + s->options[OPT_BR_Y].value.w = s->options[OPT_TL_Y].value.w; + s->options[OPT_TL_Y].value.w = tmpw; + } + if (s->options[OPT_BR_X].value.w < s->options[OPT_TL_X].value.w) + { + tmpw = s->options[OPT_BR_X].value.w; + s->options[OPT_BR_X].value.w = s->options[OPT_TL_X].value.w; + s->options[OPT_TL_X].value.w = tmpw; + } + + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + + case OPT_RESOLUTION: + case OPT_PREVIEW: + s->options[option].value.w = *(SANE_Word *) val; + *myinfo |= SANE_INFO_RELOAD_PARAMS; + break; + + case OPT_MODE: + if (s->options[option].value.s) + free (s->options[option].value.s); + s->options[option].value.s = strdup (val); + *myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; + break; + + case OPT_CALIBRATE: + status = sheetfed_calibration (s->dev); + *myinfo |= SANE_INFO_RELOAD_OPTIONS; + break; + + case OPT_CLEAR_CALIBRATION: + cleanup_calibration (s->dev); + *myinfo |= SANE_INFO_RELOAD_OPTIONS; + break; + + default: + DBG (DBG_warn, "set_option_value: can't set unknown option %d\n", + option); + } + return status; +} + +/** + * gets an option , called by sane_control_option after all checks + * have been done */ +static SANE_Status +get_option_value (P5_Session * s, int option, void *val) +{ + SANE_Status status; + + switch (option) + { + /* word or word equivalent options: */ + case OPT_NUM_OPTS: + case OPT_RESOLUTION: + case OPT_PREVIEW: + case OPT_TL_X: + case OPT_TL_Y: + case OPT_BR_X: + case OPT_BR_Y: + *(SANE_Word *) val = s->options[option].value.w; + break; + + /* string options: */ + case OPT_MODE: + strcpy (val, s->options[option].value.s); + break; + + /* sensor options */ + case OPT_PAGE_LOADED_SW: + status = test_document (s->dev->fd); + if (status == SANE_STATUS_GOOD) + s->options[option].value.b = SANE_TRUE; + else + s->options[option].value.b = SANE_FALSE; + *(SANE_Bool *) val = s->options[option].value.b; + break; + + case OPT_NEED_CALIBRATION_SW: + *(SANE_Bool *) val = !s->dev->calibrated; + break; + + + /* unhandled options */ + default: + DBG (DBG_warn, "get_option_value: can't get unknown option %d\n", + option); + } + + return SANE_STATUS_GOOD; +} + +/** + * Gets or sets an option value. + * + * From the SANE spec: + * This function is used to set or inquire the current value of option + * number n of the device represented by handle h. The manner in which + * the option is controlled is specified by parameter action. The + * possible values of this parameter are described in more detail + * below. The value of the option is passed through argument val. It + * is a pointer to the memory that holds the option value. The memory + * area pointed to by v must be big enough to hold the entire option + * value (determined by member size in the corresponding option + * descriptor). + * + * The only exception to this rule is that when setting the value of a + * string option, the string pointed to by argument v may be shorter + * since the backend will stop reading the option value upon + * encountering the first NUL terminator in the string. If argument i + * is not NULL, the value of *i will be set to provide details on how + * well the request has been met. + * action is SANE_ACTION_GET_VALUE, SANE_ACTION_SET_VALUE or SANE_ACTION_SET_AUTO + */ +SANE_Status +sane_control_option (SANE_Handle handle, SANE_Int option, + SANE_Action action, void *val, SANE_Int * info) +{ + P5_Session *s = handle; + SANE_Status status; + SANE_Word cap; + SANE_Int myinfo = 0; + + DBG (DBG_io2, + "sane_control_option: start: action = %s, option = %s (%d)\n", + (action == SANE_ACTION_GET_VALUE) ? "get" : (action == + SANE_ACTION_SET_VALUE) ? + "set" : (action == SANE_ACTION_SET_AUTO) ? "set_auto" : "unknown", + s->options[option].descriptor.name, option); + + if (info) + *info = 0; + + /* do checks before trying to apply action */ + + if (s->scanning) + { + DBG (DBG_warn, "sane_control_option: don't call this function while " + "scanning (option = %s (%d))\n", + s->options[option].descriptor.name, option); + return SANE_STATUS_DEVICE_BUSY; + } + + /* option must be within existing range */ + if (option >= NUM_OPTIONS || option < 0) + { + DBG (DBG_warn, + "sane_control_option: option %d >= NUM_OPTIONS || option < 0\n", + option); + return SANE_STATUS_INVAL; + } + + /* don't access an inactive option */ + cap = s->options[option].descriptor.cap; + if (!SANE_OPTION_IS_ACTIVE (cap)) + { + DBG (DBG_warn, "sane_control_option: option %d is inactive\n", option); + return SANE_STATUS_INVAL; + } + + /* now checks have been done, apply action */ + switch (action) + { + case SANE_ACTION_GET_VALUE: + status = get_option_value (s, option, val); + break; + + case SANE_ACTION_SET_VALUE: + if (!SANE_OPTION_IS_SETTABLE (cap)) + { + DBG (DBG_warn, "sane_control_option: option %d is not settable\n", + option); + return SANE_STATUS_INVAL; + } + + status = + sanei_constrain_value (&s->options[option].descriptor, val, &myinfo); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_warn, + "sane_control_option: sanei_constrain_value returned %s\n", + sane_strstatus (status)); + return status; + } + + /* return immediatly if no change */ + if (s->options[option].descriptor.type == SANE_TYPE_INT + && *(SANE_Word *) val == s->options[option].value.w) + { + status = SANE_STATUS_GOOD; + } + else + { /* apply change */ + status = set_option_value (s, option, val, &myinfo); + } + break; + + case SANE_ACTION_SET_AUTO: + /* sets automatic values */ + if (!(cap & SANE_CAP_AUTOMATIC)) + { + DBG (DBG_warn, + "sane_control_option: option %d is not autosettable\n", + option); + return SANE_STATUS_INVAL; + } + + status = set_automatic_value (s, option, &myinfo); + break; + + default: + DBG (DBG_error, "sane_control_option: invalid action %d\n", action); + status = SANE_STATUS_INVAL; + break; + } + + if (info) + *info = myinfo; + + DBG (DBG_io2, "sane_control_option: exit\n"); + return status; +} + +/** + * Called by SANE when a page acquisition operation is to be started. + * @param handle opaque handle to a frontend session + * @return SANE_STATUS_GOOD on success, SANE_STATUS_BUSY if the device is + * in use by another session or SANE_STATUS_WARMING_UP if the device is + * warming up. In this case the fronted as to call sane_start again until + * warming up is done. Any other values returned are error status. + */ +SANE_Status +sane_start (SANE_Handle handle) +{ + struct P5_Session *session = handle; + int status = SANE_STATUS_GOOD; + P5_Device *dev = session->dev; + + DBG (DBG_proc, "sane_start: start\n"); + + /* if already scanning, tell we're busy */ + if (session->scanning == SANE_TRUE) + { + DBG (DBG_info, "sane_start: device is already scanning\n"); + return SANE_STATUS_DEVICE_BUSY; + } + + /* check that the device has been initialized */ + if (dev->initialized == SANE_FALSE) + { + DBG (DBG_error, "sane_start: device is not initialized\n"); + return SANE_STATUS_INVAL; + } + + /* check if there is a document */ + status = test_document (dev->fd); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "sane_start: device is already scanning\n"); + return status; + } + + /* we compute all the scan parameters so that */ + /* we will be able to set up the registers correctly */ + compute_parameters (session); + + /* move to scan area if needed */ + if (dev->ystart > 0) + { + status = move (dev); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "sane_start: failed to move to scan area\n"); + return SANE_STATUS_INVAL; + } + } + + /* send scan command */ + status = start_scan (dev, dev->mode, dev->ydpi, dev->xstart, dev->pixels); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "sane_start: failed to start scan\n"); + return SANE_STATUS_INVAL; + } + + /* allocates work buffer */ + if (dev->buffer != NULL) + { + free (dev->buffer); + } + + dev->position = 0; + dev->top = 0; + /* compute amount of lines needed for lds correction */ + dev->bottom = dev->bytes_per_line * 2 * dev->lds; + /* computes buffer size, 66 color lines plus eventual amount needed for lds */ + dev->size = dev->pixels * 3 * 66 + dev->bottom; + dev->buffer = (uint8_t *) malloc (dev->size); + if (dev->buffer == NULL) + { + DBG (DBG_error, "sane_start: failed to allocate %d bytes\n", dev->size); + sane_cancel (handle); + return SANE_STATUS_NO_MEM; + } + + /* return now the scan has been initiated */ + session->scanning = SANE_TRUE; + session->sent = 0; + + DBG (DBG_io, "sane_start: to_send=%d\n", session->to_send); + DBG (DBG_io, "sane_start: size=%d\n", dev->size); + DBG (DBG_io, "sane_start: top=%d\n", dev->top); + DBG (DBG_io, "sane_start: bottom=%d\n", dev->bottom); + DBG (DBG_io, "sane_start: position=%d\n", dev->position); + + DBG (DBG_proc, "sane_start: exit\n"); + return status; +} + +/** @brief compute scan parameters + * This function computes two set of parameters. The one for the SANE's standard + * and the other for the hardware. Among these parameters are the bit depth, total + * number of lines, total number of columns, extra line to read for data reordering... + * @param session fronted session to compute final scan parameters + * @return SANE_STATUS_GOOD on success + */ +static SANE_Status +compute_parameters (P5_Session * session) +{ + P5_Device *dev = session->dev; + SANE_Int dpi; /* dpi for scan */ + SANE_String mode; + SANE_Status status = SANE_STATUS_GOOD; + + int tl_x, tl_y, br_x, br_y; + + mode = session->options[OPT_MODE].value.s; + dpi = session->options[OPT_RESOLUTION].value.w; + + /* scan coordinates */ + tl_x = SANE_UNFIX (session->options[OPT_TL_X].value.w); + tl_y = SANE_UNFIX (session->options[OPT_TL_Y].value.w); + br_x = SANE_UNFIX (session->options[OPT_BR_X].value.w); + br_y = SANE_UNFIX (session->options[OPT_BR_Y].value.w); + + /* only single pass scanning supported */ + session->params.last_frame = SANE_TRUE; + + /* gray modes */ + if (strcmp (mode, GRAY_MODE) == 0) + { + session->params.format = SANE_FRAME_GRAY; + dev->mode = MODE_GRAY; + dev->lds = 0; + } + else if (strcmp (mode, LINEART_MODE) == 0) + { + session->params.format = SANE_FRAME_GRAY; + dev->mode = MODE_LINEART; + dev->lds = 0; + } + else + { + /* Color */ + session->params.format = SANE_FRAME_RGB; + dev->mode = MODE_COLOR; + dev->lds = (dev->model->lds * dpi) / dev->model->max_ydpi; + } + + /* SANE level values */ + session->params.lines = ((br_y - tl_y) * dpi) / MM_PER_INCH; + if (session->params.lines == 0) + session->params.lines = 1; + session->params.pixels_per_line = ((br_x - tl_x) * dpi) / MM_PER_INCH; + if (session->params.pixels_per_line == 0) + session->params.pixels_per_line = 1; + + DBG (DBG_data, "compute_parameters: pixels_per_line =%d\n", + session->params.pixels_per_line); + + if (strcmp (mode, LINEART_MODE) == 0) + { + session->params.depth = 1; + /* in lineart, having pixels multiple of 8 avoids a costly test */ + /* at each bit to see we must go to the next byte */ + /* TODO : implement this requirement in sane_control_option */ + session->params.pixels_per_line = + ((session->params.pixels_per_line + 7) / 8) * 8; + } + else + session->params.depth = 8; + + /* width needs to be even */ + if (session->params.pixels_per_line & 1) + session->params.pixels_per_line++; + + /* Hardware settings : they can differ from the ones at SANE level */ + /* for instance the effective DPI used by a sensor may be higher */ + /* than the one needed for the SANE scan parameters */ + dev->lines = session->params.lines; + dev->pixels = session->params.pixels_per_line; + + /* motor and sensor DPI */ + dev->xdpi = dpi; + dev->ydpi = dpi; + + /* handle bounds of motor's dpi range */ + if (dev->ydpi > dev->model->max_ydpi) + { + dev->ydpi = dev->model->max_ydpi; + dev->lines = (dev->lines * dev->model->max_ydpi) / dpi; + if (dev->lines == 0) + dev->lines = 1; + + /* round number of lines */ + session->params.lines = + (session->params.lines / dev->lines) * dev->lines; + if (session->params.lines == 0) + session->params.lines = 1; + } + if (dev->ydpi < dev->model->min_ydpi) + { + dev->ydpi = dev->model->min_ydpi; + dev->lines = (dev->lines * dev->model->min_ydpi) / dpi; + } + + /* hardware values */ + dev->xstart = + ((SANE_UNFIX (dev->model->x_offset) + tl_x) * dpi) / MM_PER_INCH; + dev->ystart = + ((SANE_UNFIX (dev->model->y_offset) + tl_y) * dev->ydpi) / MM_PER_INCH; + + /* take lds correction into account when moving to scan area */ + if (dev->ystart > 2 * dev->lds) + dev->ystart -= 2 * dev->lds; + + + /* computes bytes per line */ + session->params.bytes_per_line = session->params.pixels_per_line; + dev->bytes_per_line = dev->pixels; + if (session->params.format == SANE_FRAME_RGB) + { + dev->bytes_per_line *= 3; + } + + /* in lineart mode we adjust bytes_per_line needed by frontend */ + /* we do that here because we needed sent/to_send to be as if */ + /* there was no lineart */ + if (session->params.depth == 1) + { + session->params.bytes_per_line = + (session->params.bytes_per_line + 7) / 8; + } + + session->params.bytes_per_line = dev->bytes_per_line; + session->to_send = session->params.bytes_per_line * session->params.lines; + session->params.bytes_per_line = dev->bytes_per_line; + + DBG (DBG_data, "compute_parameters: bytes_per_line =%d\n", + session->params.bytes_per_line); + DBG (DBG_data, "compute_parameters: depth =%d\n", + session->params.depth); + DBG (DBG_data, "compute_parameters: lines =%d\n", + session->params.lines); + DBG (DBG_data, "compute_parameters: image size =%d\n", + session->to_send); + + DBG (DBG_data, "compute_parameters: xstart =%d\n", dev->xstart); + DBG (DBG_data, "compute_parameters: ystart =%d\n", dev->ystart); + DBG (DBG_data, "compute_parameters: dev lines =%d\n", dev->lines); + DBG (DBG_data, "compute_parameters: dev bytes per line=%d\n", + dev->bytes_per_line); + DBG (DBG_data, "compute_parameters: dev pixels =%d\n", dev->pixels); + DBG (DBG_data, "compute_parameters: lds =%d\n", dev->lds); + + return status; +} + + +/** + * Called by SANE to retrieve information about the type of data + * that the current scan will return. + * + * From the SANE spec: + * This function is used to obtain the current scan parameters. The + * returned parameters are guaranteed to be accurate between the time + * a scan has been started (sane_start() has been called) and the + * completion of that request. Outside of that window, the returned + * values are best-effort estimates of what the parameters will be + * when sane_start() gets invoked. + * + * Calling this function before a scan has actually started allows, + * for example, to get an estimate of how big the scanned image will + * be. The parameters passed to this function are the handle of the + * device for which the parameters should be obtained and a pointer + * to a parameter structure. + */ +SANE_Status +sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) +{ + SANE_Status status; + struct P5_Session *session = (struct P5_Session *) handle; + + DBG (DBG_proc, "sane_get_parameters: start\n"); + + /* call parameters computing function */ + status = compute_parameters (session); + if (status == SANE_STATUS_GOOD && params) + *params = session->params; + + DBG (DBG_proc, "sane_get_parameters: exit\n"); + return status; +} + + +/** + * Called by SANE to read data. + * + * From the SANE spec: + * This function is used to read image data from the device + * represented by handle h. Argument buf is a pointer to a memory + * area that is at least maxlen bytes long. The number of bytes + * returned is stored in *len. A backend must set this to zero when + * the call fails (i.e., when a status other than SANE_STATUS_GOOD is + * returned). + * + * When the call succeeds, the number of bytes returned can be + * anywhere in the range from 0 to maxlen bytes. + * + * Returned data is read from working buffer. + */ +SANE_Status +sane_read (SANE_Handle handle, SANE_Byte * buf, + SANE_Int max_len, SANE_Int * len) +{ + struct P5_Session *session = (struct P5_Session *) handle; + struct P5_Device *dev = session->dev; + SANE_Status status = SANE_STATUS_GOOD; + int count; + int size, lines; + SANE_Bool x2; + SANE_Int i; + + DBG (DBG_proc, "sane_read: start\n"); + DBG (DBG_io, "sane_read: up to %d bytes required by frontend\n", max_len); + + /* some sanity checks first to protect from would be buggy frontends */ + if (!session) + { + DBG (DBG_error, "sane_read: handle is null!\n"); + return SANE_STATUS_INVAL; + } + + if (!buf) + { + DBG (DBG_error, "sane_read: buf is null!\n"); + return SANE_STATUS_INVAL; + } + + if (!len) + { + DBG (DBG_error, "sane_read: len is null!\n"); + return SANE_STATUS_INVAL; + } + + /* no data read yet */ + *len = 0; + + /* check if session is scanning */ + if (!session->scanning) + { + DBG (DBG_warn, + "sane_read: scan was cancelled, is over or has not been initiated yet\n"); + return SANE_STATUS_CANCELLED; + } + + /* check for EOF, must be done before any physical read */ + if (session->sent >= session->to_send) + { + DBG (DBG_io, "sane_read: end of scan reached\n"); + return SANE_STATUS_EOF; + } + + /* if working buffer is empty, we do a physical data read */ + if (dev->top <= dev->bottom) + { + DBG (DBG_io, "sane_read: physical data read\n"); + /* check is there is data available. In case of non-blocking mode we return + * as soon it is detected there is no data yet. Reads must by done line by + * line, so we read only when count is bigger than bytes per line + * */ + count = available_bytes (dev->fd); + DBG (DBG_io, "sane_read: count=%d bytes\n", count); + if (count < dev->bytes_per_line && session->non_blocking == SANE_TRUE) + { + DBG (DBG_io, "sane_read: scanner hasn't enough data available\n"); + DBG (DBG_proc, "sane_read: exit\n"); + return SANE_STATUS_GOOD; + } + + /* now we can wait for data here */ + while (count < dev->bytes_per_line) + { + /* test if document left the feeder, so we have to terminate the scan */ + status = test_document (dev->fd); + if (status == SANE_STATUS_NO_DOCS) + { + session->to_send = session->sent; + return SANE_STATUS_EOF; + } + + /* don't call scanner too often */ + usleep (10000); + count = available_bytes (dev->fd); + } + + /** compute size of physical data to read + * on first read, position will be 0, while it will be 'bottom' + * for the subsequent reads. + * We try to read a complete buffer */ + size = dev->size - dev->position; + + if (session->to_send - session->sent < size) + { + /* not enough data left, so read remainder of scan */ + size = session->to_send - session->sent; + } + + /* 600 dpi is 300x600 physical, and 400 is 200x400 */ + if (dev->ydpi > dev->model->max_xdpi) + { + x2 = SANE_TRUE; + } + else + { + x2 = SANE_FALSE; + } + lines = read_line (dev, + dev->buffer + dev->position, + dev->bytes_per_line, + size / dev->bytes_per_line, + SANE_TRUE, x2, dev->mode, dev->calibrated); + + /* handle document end detection TODO try to recover the partial + * buffer already read before EOD */ + if (lines == -1) + { + DBG (DBG_io, "sane_read: error reading line\n"); + return SANE_STATUS_IO_ERROR; + } + + /* gather lines until we have more than needed for lds */ + dev->position += lines * dev->bytes_per_line; + dev->top = dev->position; + if (dev->position > dev->bottom) + { + dev->position = dev->bottom; + } + DBG (DBG_io, "sane_read: size =%d\n", dev->size); + DBG (DBG_io, "sane_read: bottom =%d\n", dev->bottom); + DBG (DBG_io, "sane_read: position=%d\n", dev->position); + DBG (DBG_io, "sane_read: top =%d\n", dev->top); + } /* end of physical data reading */ + + /* logical data reading */ + /* check if there data available in working buffer */ + if (dev->position < dev->top && dev->position >= dev->bottom) + { + DBG (DBG_io, "sane_read: logical data read\n"); + /* we have more data in internal buffer than asked , + * then send only max data */ + size = dev->top - dev->position; + if (max_len < size) + { + *len = max_len; + } + else + /* if we don't have enough, send all what we have */ + { + *len = dev->top - dev->position; + } + + /* data copy */ + if (dev->lds == 0) + { + memcpy (buf, dev->buffer + dev->position, *len); + } + else + { + /* compute count of bytes for lds */ + count = dev->lds * dev->bytes_per_line; + + /* adjust for lds as we copy data to frontend */ + for (i = 0; i < *len; i++) + { + switch ((dev->position + i) % 3) + { + /* red */ + case 0: + buf[i] = dev->buffer[dev->position + i - 2 * count]; + break; + /* green */ + case 1: + buf[i] = dev->buffer[dev->position + i - count]; + break; + /* blue */ + default: + buf[i] = dev->buffer[dev->position + i]; + break; + } + } + } + dev->position += *len; + + /* update byte accounting */ + session->sent += *len; + DBG (DBG_io, "sane_read: sent %d bytes from buffer to frontend\n", + *len); + return SANE_STATUS_GOOD; + } + + /* check if we exhausted working buffer */ + if (dev->position >= dev->top && dev->position >= dev->bottom) + { + /* copy extra lines needed for lds in next buffer */ + if (dev->position > dev->bottom && dev->lds > 0) + { + memcpy (dev->buffer, + dev->buffer + dev->position - dev->bottom, dev->bottom); + } + + /* restart buffer */ + dev->position = dev->bottom; + dev->top = 0; + } + + DBG (DBG_io, "sane_read: size =%d\n", dev->size); + DBG (DBG_io, "sane_read: bottom =%d\n", dev->bottom); + DBG (DBG_io, "sane_read: position=%d\n", dev->position); + DBG (DBG_io, "sane_read: top =%d\n", dev->top); + + DBG (DBG_proc, "sane_read: exit\n"); + return status; +} + + +/** + * Cancels a scan. + * + * From the SANE spec: + * This function is used to immediately or as quickly as possible + * cancel the currently pending operation of the device represented by + * handle h. This function can be called at any time (as long as + * handle h is a valid handle) but usually affects long-running + * operations only (such as image is acquisition). It is safe to call + * this function asynchronously (e.g., from within a signal handler). + * It is important to note that completion of this operaton does not + * imply that the currently pending operation has been cancelled. It + * only guarantees that cancellation has been initiated. Cancellation + * completes only when the cancelled call returns (typically with a + * status value of SANE_STATUS_CANCELLED). Since the SANE API does + * not require any other operations to be re-entrant, this implies + * that a frontend must not call any other operation until the + * cancelled operation has returned. + */ +void +sane_cancel (SANE_Handle handle) +{ + P5_Session *session = handle; + + DBG (DBG_proc, "sane_cancel: start\n"); + + /* if scanning, abort and park head */ + if (session->scanning == SANE_TRUE) + { + /* detects if we are called after the scan is finished, + * or if the scan is aborted */ + if (session->sent < session->to_send) + { + DBG (DBG_info, "sane_cancel: aborting scan.\n"); + /* device hasn't finished scan, we are aborting it + * and we may have to do something specific for it here */ + } + else + { + DBG (DBG_info, "sane_cancel: cleaning up after scan.\n"); + } + session->scanning = SANE_FALSE; + } + eject (session->dev->fd); + + DBG (DBG_proc, "sane_cancel: exit\n"); +} + + +/** + * Ends use of the session. + * + * From the SANE spec: + * This function terminates the association between the device handle + * passed in argument h and the device it represents. If the device is + * presently active, a call to sane_cancel() is performed first. After + * this function returns, handle h must not be used anymore. + * + * Handle resources are free'd before disposing the handle. But devices + * resources must not be mdofied, since it could be used or reused until + * sane_exit() is called. + */ +void +sane_close (SANE_Handle handle) +{ + P5_Session *prev, *session; + + DBG (DBG_proc, "sane_close: start\n"); + + /* remove handle from list of open handles: */ + prev = NULL; + for (session = sessions; session; session = session->next) + { + if (session == handle) + break; + prev = session; + } + if (!session) + { + DBG (DBG_error0, "close: invalid handle %p\n", handle); + return; /* oops, not a handle we know about */ + } + + /* cancel any active scan */ + if (session->scanning == SANE_TRUE) + { + sane_cancel (handle); + } + + if (prev) + prev->next = session->next; + else + sessions = session->next; + + /* close low level device */ + if (session->dev->initialized == SANE_TRUE) + { + if (session->dev->calibrated == SANE_TRUE) + { + save_calibration (session->dev); + } + disconnect (session->dev->fd); + close_pp (session->dev->fd); + session->dev->fd = -1; + session->dev->initialized = SANE_FALSE; + + /* free device data */ + if (session->dev->buffer != NULL) + { + free (session->dev->buffer); + } + if (session->dev->buffer != NULL) + { + free (session->dev->gain); + free (session->dev->offset); + } + if (session->dev->calibrated == SANE_TRUE) + { + cleanup_calibration (session->dev); + } + } + + /* free per session data */ + free (session->options[OPT_MODE].value.s); + free ((void *)session->options[OPT_RESOLUTION].descriptor.constraint.word_list); + + free (session); + + DBG (DBG_proc, "sane_close: exit\n"); +} + + +/** + * Terminates the backend. + * + * From the SANE spec: + * This function must be called to terminate use of a backend. The + * function will first close all device handles that still might be + * open (it is recommended to close device handles explicitly through + * a call to sane_close(), but backends are required to release all + * resources upon a call to this function). After this function + * returns, no function other than sane_init() may be called + * (regardless of the status value returned by sane_exit(). Neglecting + * to call this function may result in some resources not being + * released properly. + */ +void +sane_exit (void) +{ + struct P5_Session *session, *next; + struct P5_Device *dev, *nextdev; + int i; + + DBG (DBG_proc, "sane_exit: start\n"); + init_count--; + + if (init_count > 0) + { + DBG (DBG_info, + "sane_exit: still %d fronteds to leave before effective exit.\n", + init_count); + return; + } + + /* free session structs */ + for (session = sessions; session; session = next) + { + next = session->next; + sane_close ((SANE_Handle *) session); + free (session); + } + sessions = NULL; + + /* free devices structs */ + for (dev = devices; dev; dev = nextdev) + { + nextdev = dev->next; + free (dev->name); + free (dev); + } + devices = NULL; + + /* now list of devices */ + if (devlist) + { + i = 0; + while ((SANE_Device *) devlist[i]) + { + free ((SANE_Device *) devlist[i]); + i++; + } + free (devlist); + devlist = NULL; + } + + DBG (DBG_proc, "sane_exit: exit\n"); +} + + +/** @brief probe for all supported devices + * This functions tries to probe if any of the supported devices of + * the backend is present. Each detected device will be added to the + * 'devices' list + */ +static SANE_Status +probe_p5_devices (void) +{ + /**> configuration structure used during attach */ + SANEI_Config config; + /**> list of configuration options */ + SANE_Option_Descriptor *cfg_options[NUM_CFG_OPTIONS]; + /**> placeholders pointers for option values */ + void *values[NUM_CFG_OPTIONS]; + int i; + SANE_Status status; + + DBG (DBG_proc, "probe_p5_devices: start\n"); + + /* initialize configuration options */ + cfg_options[CFG_MODEL_NAME] = + (SANE_Option_Descriptor *) malloc (sizeof (SANE_Option_Descriptor)); + cfg_options[CFG_MODEL_NAME]->name = "modelname"; + cfg_options[CFG_MODEL_NAME]->desc = "user provided scanner's model name"; + cfg_options[CFG_MODEL_NAME]->type = SANE_TYPE_INT; + cfg_options[CFG_MODEL_NAME]->unit = SANE_UNIT_NONE; + cfg_options[CFG_MODEL_NAME]->size = sizeof (SANE_Word); + cfg_options[CFG_MODEL_NAME]->cap = SANE_CAP_SOFT_SELECT; + cfg_options[CFG_MODEL_NAME]->constraint_type = SANE_CONSTRAINT_NONE; + values[CFG_MODEL_NAME] = &p5cfg.modelname; + + /* set configuration options structure */ + config.descriptors = cfg_options; + config.values = values; + config.count = NUM_CFG_OPTIONS; + + /* generic configure and attach function */ + status = sanei_configure_attach (P5_CONFIG_FILE, &config, config_attach); + /* free allocated options */ + for (i = 0; i < NUM_CFG_OPTIONS; i++) + { + free (cfg_options[i]); + } + + DBG (DBG_proc, "probe_p5_devices: end\n"); + return status; +} + +/** This function is called by sanei_configure_attach to try + * to attach the backend to a device specified by the configuration file. + * + * @param config configuration structure filled with values read + * from configuration file + * @param devname name of the device to try to attach to, it is + * the unprocessed line of the configuration file + * + * @return status SANE_STATUS_GOOD if no errors (even if no matching + * devices found) + * SANE_STATUS_INVAL in case of error + */ +static SANE_Status +config_attach (SANEI_Config * config, const char *devname) +{ + /* currently, the config is a global variable so config is useless here */ + /* the correct thing would be to have a generic sanei_attach_matching_devices + * using an attach function with a config parameter */ + config = config; + + /* the devname has been processed and is ready to be used + * directly. The config struct contains all the configuration data for + * the corresponding device. Since there is no ressources common to each + * backends regarding parallel port, we can directly call the attach + * function. */ + attach_p5 (devname, config); + + return SANE_STATUS_GOOD; +} + +/** @brief try to attach to a device by its name + * The attach tries to open the given device and match it + * with devices handled by the backend. The configuration parameter + * contains the values of the already parsed configuration options + * from the conf file. + * @param config configuration structure filled with values read + * from configuration file + * @param devicename name of the device to try to attach to, it is + * the unprocessed line of the configuration file + * + * @return status SANE_STATUS_GOOD if no errors (even if no matching + * devices found) + * SANE_STATUS_NOM_MEM if there isn't enough memory to allocate the + * device structure + * SANE_STATUS_UNSUPPORTED if the device if unknown by the backend + * SANE_STATUS_INVAL in case of other error + */ +static SANE_Status +attach_p5 (const char *devicename, SANEI_Config * config) +{ + struct P5_Device *device; + struct P5_Model *model; + + DBG (DBG_proc, "attach(%s): start\n", devicename); + if(config==NULL) + { + DBG (DBG_warn, "attach: config is NULL\n"); + } + + /* search if we already have it attached */ + for (device = devices; device; device = device->next) + { + if (strcmp (device->name, devicename) == 0) + { + DBG (DBG_info, "attach: device already attached\n"); + DBG (DBG_proc, "attach: exit\n"); + return SANE_STATUS_GOOD; + } + } + + /** + * do physical probe of the device here. In case the device is recognized, + * we allocate a device struct and give it options and model. + * Else we return SANE_STATUS_UNSUPPORTED. + */ + model = probe (devicename); + if (model == NULL) + { + DBG (DBG_info, + "attach: device %s is not managed by the backend\n", devicename); + DBG (DBG_proc, "attach: exit\n"); + return SANE_STATUS_UNSUPPORTED; + } + + /* allocate device struct */ + device = malloc (sizeof (*device)); + if (device == NULL) + { + return SANE_STATUS_NO_MEM; + DBG (DBG_proc, "attach: exit\n"); + } + memset (device, 0, sizeof (*device)); + device->model = model; + + /* name of the device */ + device->name = strdup (devicename); + + DBG (DBG_info, "attach: found %s %s %s at %s\n", + device->model->vendor, device->model->product, device->model->type, + device->name); + + /* we insert new device at start of the chained list */ + /* head of the list becomes the next, and start is replaced */ + /* with the new session struct */ + device->next = devices; + devices = device; + + /* intialization is done at sane_open */ + device->initialized = SANE_FALSE; + device->calibrated = SANE_FALSE; + + DBG (DBG_proc, "attach: exit\n"); + return SANE_STATUS_GOOD; +} + + +/** @brief set initial value for the scanning options + * for each sessions, control options are initalized based on the capability + * of the model of the physical device. + * @param session scanner session to initialize options + * @return SANE_STATUS_GOOD on success + */ +static SANE_Status +init_options (struct P5_Session *session) +{ + SANE_Int option, i, min, idx; + SANE_Word *dpi_list; + P5_Model *model = session->dev->model; + + DBG (DBG_proc, "init_options: start\n"); + + /* we first initialize each options with a default value */ + memset (session->options, 0, sizeof (session->options[OPT_NUM_OPTS])); + for (option = 0; option < NUM_OPTIONS; option++) + { + session->options[option].descriptor.size = sizeof (SANE_Word); + session->options[option].descriptor.cap = + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + } + + /* we set up all the options listed in the P5_Option enum */ + + /* last option / end of list marker */ + session->options[OPT_NUM_OPTS].descriptor.name = SANE_NAME_NUM_OPTIONS; + session->options[OPT_NUM_OPTS].descriptor.title = SANE_TITLE_NUM_OPTIONS; + session->options[OPT_NUM_OPTS].descriptor.desc = SANE_DESC_NUM_OPTIONS; + session->options[OPT_NUM_OPTS].descriptor.type = SANE_TYPE_INT; + session->options[OPT_NUM_OPTS].descriptor.cap = SANE_CAP_SOFT_DETECT; + session->options[OPT_NUM_OPTS].value.w = NUM_OPTIONS; + + /* "Standard" group: */ + session->options[OPT_STANDARD_GROUP].descriptor.title = SANE_TITLE_STANDARD; + session->options[OPT_STANDARD_GROUP].descriptor.name = SANE_NAME_STANDARD; + session->options[OPT_STANDARD_GROUP].descriptor.desc = SANE_DESC_STANDARD; + session->options[OPT_STANDARD_GROUP].descriptor.type = SANE_TYPE_GROUP; + session->options[OPT_STANDARD_GROUP].descriptor.size = 0; + session->options[OPT_STANDARD_GROUP].descriptor.cap = 0; + session->options[OPT_STANDARD_GROUP].descriptor.constraint_type = + SANE_CONSTRAINT_NONE; + + /* scan mode */ + session->options[OPT_MODE].descriptor.name = SANE_NAME_SCAN_MODE; + session->options[OPT_MODE].descriptor.title = SANE_TITLE_SCAN_MODE; + session->options[OPT_MODE].descriptor.desc = SANE_DESC_SCAN_MODE; + session->options[OPT_MODE].descriptor.type = SANE_TYPE_STRING; + session->options[OPT_MODE].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_MODE].descriptor.constraint_type = + SANE_CONSTRAINT_STRING_LIST; + session->options[OPT_MODE].descriptor.size = max_string_size (mode_list); + session->options[OPT_MODE].descriptor.constraint.string_list = mode_list; + session->options[OPT_MODE].value.s = strdup (mode_list[0]); + + /* preview */ + session->options[OPT_PREVIEW].descriptor.name = SANE_NAME_PREVIEW; + session->options[OPT_PREVIEW].descriptor.title = SANE_TITLE_PREVIEW; + session->options[OPT_PREVIEW].descriptor.desc = SANE_DESC_PREVIEW; + session->options[OPT_PREVIEW].descriptor.type = SANE_TYPE_BOOL; + session->options[OPT_PREVIEW].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_PREVIEW].descriptor.unit = SANE_UNIT_NONE; + session->options[OPT_PREVIEW].descriptor.constraint_type = + SANE_CONSTRAINT_NONE; + session->options[OPT_PREVIEW].value.w = SANE_FALSE; + + /** @brief build resolution list + * We merge xdpi and ydpi list to provide only one resolution option control. + * This is the most common case for backends and fronteds and give 'square' + * pixels. The SANE API allow to control x and y dpi independantly, but this is + * rarely done and may confuse both frontends and users. In case a dpi value exists + * for one but not for the other, the backend will have to crop data so that the + * frontend is unaffected. A common case is that motor resolution (ydpi) is higher + * than sensor resolution (xdpi), so scan lines must be scaled up to keep square + * pixel when doing sane_read(). + * TODO this deserves a dedicated function and some unit testing + */ + + /* find minimum first */ + min = 65535; + for (i = 0; i < MAX_RESOLUTIONS && model->xdpi_values[i] > 0; i++) + { + if (model->xdpi_values[i] < min) + min = model->xdpi_values[i]; + } + for (i = 0; i < MAX_RESOLUTIONS && model->ydpi_values[i] > 0; i++) + { + if (model->ydpi_values[i] < min) + min = model->ydpi_values[i]; + } + + dpi_list = malloc ((MAX_RESOLUTIONS * 2 + 1) * sizeof (SANE_Word)); + if (!dpi_list) + return SANE_STATUS_NO_MEM; + dpi_list[1] = min; + idx = 2; + + /* find any value greater than the last used min and + * less than the max value + */ + do + { + min = 65535; + for (i = 0; i < MAX_RESOLUTIONS && model->xdpi_values[i] > 0; i++) + { + if (model->xdpi_values[i] < min + && model->xdpi_values[i] > dpi_list[idx - 1]) + min = model->xdpi_values[i]; + } + for (i = 0; i < MAX_RESOLUTIONS && model->ydpi_values[i] > 0; i++) + { + if (model->ydpi_values[i] < min + && model->ydpi_values[i] > dpi_list[idx - 1]) + min = model->ydpi_values[i]; + } + if (min < 65535) + { + dpi_list[idx] = min; + idx++; + } + } + while (min != 65535); + dpi_list[idx] = 0; + /* the count of different resolution is put at the beginning */ + dpi_list[0] = idx - 1; + + session->options[OPT_RESOLUTION].descriptor.name = + SANE_NAME_SCAN_RESOLUTION; + session->options[OPT_RESOLUTION].descriptor.title = + SANE_TITLE_SCAN_RESOLUTION; + session->options[OPT_RESOLUTION].descriptor.desc = + SANE_DESC_SCAN_RESOLUTION; + session->options[OPT_RESOLUTION].descriptor.type = SANE_TYPE_INT; + session->options[OPT_RESOLUTION].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_RESOLUTION].descriptor.unit = SANE_UNIT_DPI; + session->options[OPT_RESOLUTION].descriptor.constraint_type = + SANE_CONSTRAINT_WORD_LIST; + session->options[OPT_RESOLUTION].descriptor.constraint.word_list = dpi_list; + + /* initial value is lowest available dpi */ + session->options[OPT_RESOLUTION].value.w = min; + + /* "Geometry" group: */ + session->options[OPT_GEOMETRY_GROUP].descriptor.title = SANE_TITLE_GEOMETRY; + session->options[OPT_GEOMETRY_GROUP].descriptor.name = SANE_NAME_GEOMETRY; + session->options[OPT_GEOMETRY_GROUP].descriptor.desc = SANE_DESC_GEOMETRY; + session->options[OPT_GEOMETRY_GROUP].descriptor.type = SANE_TYPE_GROUP; + session->options[OPT_GEOMETRY_GROUP].descriptor.cap = SANE_CAP_ADVANCED; + session->options[OPT_GEOMETRY_GROUP].descriptor.size = 0; + session->options[OPT_GEOMETRY_GROUP].descriptor.constraint_type = + SANE_CONSTRAINT_NONE; + + /* adapt the constraint range to the detected model */ + x_range.max = model->x_size; + y_range.max = model->y_size; + + /* top-left x */ + session->options[OPT_TL_X].descriptor.name = SANE_NAME_SCAN_TL_X; + session->options[OPT_TL_X].descriptor.title = SANE_TITLE_SCAN_TL_X; + session->options[OPT_TL_X].descriptor.desc = SANE_DESC_SCAN_TL_X; + session->options[OPT_TL_X].descriptor.type = SANE_TYPE_FIXED; + session->options[OPT_TL_X].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_TL_X].descriptor.unit = SANE_UNIT_MM; + session->options[OPT_TL_X].descriptor.constraint_type = + SANE_CONSTRAINT_RANGE; + session->options[OPT_TL_X].descriptor.constraint.range = &x_range; + session->options[OPT_TL_X].value.w = 0; + + /* top-left y */ + session->options[OPT_TL_Y].descriptor.name = SANE_NAME_SCAN_TL_Y; + session->options[OPT_TL_Y].descriptor.title = SANE_TITLE_SCAN_TL_Y; + session->options[OPT_TL_Y].descriptor.desc = SANE_DESC_SCAN_TL_Y; + session->options[OPT_TL_Y].descriptor.type = SANE_TYPE_FIXED; + session->options[OPT_TL_Y].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_TL_Y].descriptor.unit = SANE_UNIT_MM; + session->options[OPT_TL_Y].descriptor.constraint_type = + SANE_CONSTRAINT_RANGE; + session->options[OPT_TL_Y].descriptor.constraint.range = &y_range; + session->options[OPT_TL_Y].value.w = 0; + + /* bottom-right x */ + session->options[OPT_BR_X].descriptor.name = SANE_NAME_SCAN_BR_X; + session->options[OPT_BR_X].descriptor.title = SANE_TITLE_SCAN_BR_X; + session->options[OPT_BR_X].descriptor.desc = SANE_DESC_SCAN_BR_X; + session->options[OPT_BR_X].descriptor.type = SANE_TYPE_FIXED; + session->options[OPT_BR_X].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_BR_X].descriptor.unit = SANE_UNIT_MM; + session->options[OPT_BR_X].descriptor.constraint_type = + SANE_CONSTRAINT_RANGE; + session->options[OPT_BR_X].descriptor.constraint.range = &x_range; + session->options[OPT_BR_X].value.w = x_range.max; + + /* bottom-right y */ + session->options[OPT_BR_Y].descriptor.name = SANE_NAME_SCAN_BR_Y; + session->options[OPT_BR_Y].descriptor.title = SANE_TITLE_SCAN_BR_Y; + session->options[OPT_BR_Y].descriptor.desc = SANE_DESC_SCAN_BR_Y; + session->options[OPT_BR_Y].descriptor.type = SANE_TYPE_FIXED; + session->options[OPT_BR_Y].descriptor.cap |= SANE_CAP_AUTOMATIC; + session->options[OPT_BR_Y].descriptor.unit = SANE_UNIT_MM; + session->options[OPT_BR_Y].descriptor.constraint_type = + SANE_CONSTRAINT_RANGE; + session->options[OPT_BR_Y].descriptor.constraint.range = &y_range; + session->options[OPT_BR_Y].value.w = y_range.max; + + /* sensor group */ + session->options[OPT_SENSOR_GROUP].descriptor.name = SANE_NAME_SENSORS; + session->options[OPT_SENSOR_GROUP].descriptor.title = SANE_TITLE_SENSORS; + session->options[OPT_SENSOR_GROUP].descriptor.desc = SANE_DESC_SENSORS; + session->options[OPT_SENSOR_GROUP].descriptor.type = SANE_TYPE_GROUP; + session->options[OPT_SENSOR_GROUP].descriptor.constraint_type = + SANE_CONSTRAINT_NONE; + + /* page loaded sensor */ + session->options[OPT_PAGE_LOADED_SW].descriptor.name = + SANE_NAME_PAGE_LOADED; + session->options[OPT_PAGE_LOADED_SW].descriptor.title = + SANE_TITLE_PAGE_LOADED; + session->options[OPT_PAGE_LOADED_SW].descriptor.desc = + SANE_DESC_PAGE_LOADED; + session->options[OPT_PAGE_LOADED_SW].descriptor.type = SANE_TYPE_BOOL; + session->options[OPT_PAGE_LOADED_SW].descriptor.unit = SANE_UNIT_NONE; + session->options[OPT_PAGE_LOADED_SW].descriptor.cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + session->options[OPT_PAGE_LOADED_SW].value.b = 0; + + /* calibration needed */ + session->options[OPT_NEED_CALIBRATION_SW].descriptor.name = + "need-calibration"; + session->options[OPT_NEED_CALIBRATION_SW].descriptor.title = + SANE_I18N ("Need calibration"); + session->options[OPT_NEED_CALIBRATION_SW].descriptor.desc = + SANE_I18N ("The scanner needs calibration for the current settings"); + session->options[OPT_NEED_CALIBRATION_SW].descriptor.type = SANE_TYPE_BOOL; + session->options[OPT_NEED_CALIBRATION_SW].descriptor.unit = SANE_UNIT_NONE; + session->options[OPT_NEED_CALIBRATION_SW].descriptor.cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + session->options[OPT_NEED_CALIBRATION_SW].value.b = 0; + + /* button group */ + session->options[OPT_BUTTON_GROUP].descriptor.name = "Buttons"; + session->options[OPT_BUTTON_GROUP].descriptor.title = SANE_I18N ("Buttons"); + session->options[OPT_BUTTON_GROUP].descriptor.desc = SANE_I18N ("Buttons"); + session->options[OPT_BUTTON_GROUP].descriptor.type = SANE_TYPE_GROUP; + session->options[OPT_BUTTON_GROUP].descriptor.constraint_type = + SANE_CONSTRAINT_NONE; + + /* calibrate button */ + session->options[OPT_CALIBRATE].descriptor.name = "calibrate"; + session->options[OPT_CALIBRATE].descriptor.title = SANE_I18N ("Calibrate"); + session->options[OPT_CALIBRATE].descriptor.desc = + SANE_I18N ("Start calibration using special sheet"); + session->options[OPT_CALIBRATE].descriptor.type = SANE_TYPE_BUTTON; + session->options[OPT_CALIBRATE].descriptor.unit = SANE_UNIT_NONE; + session->options[OPT_CALIBRATE].descriptor.cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; + session->options[OPT_CALIBRATE].value.b = 0; + + /* clear calibration cache button */ + session->options[OPT_CLEAR_CALIBRATION].descriptor.name = "clear"; + session->options[OPT_CLEAR_CALIBRATION].descriptor.title = + SANE_I18N ("Clear calibration"); + session->options[OPT_CLEAR_CALIBRATION].descriptor.desc = + SANE_I18N ("Clear calibration cache"); + session->options[OPT_CLEAR_CALIBRATION].descriptor.type = SANE_TYPE_BUTTON; + session->options[OPT_CLEAR_CALIBRATION].descriptor.unit = SANE_UNIT_NONE; + session->options[OPT_CLEAR_CALIBRATION].descriptor.cap = + SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED | + SANE_CAP_AUTOMATIC; + session->options[OPT_CLEAR_CALIBRATION].value.b = 0; + + /* until work on calibration isfinished */ + DISABLE (OPT_CALIBRATE); + DISABLE (OPT_CLEAR_CALIBRATION); + + DBG (DBG_proc, "init_options: exit\n"); + return SANE_STATUS_GOOD; +} + +/** @brief physical probe of a device + * This function probes for a scanning device using the given name. If the + * device is managed, a model structure describing the device will be returned. + * @param devicename low level device to access to probe hardware + * @return NULL is the device is unsupported, or a model struct describing the + * device. + */ +P5_Model * +probe (const char *devicename) +{ + int fd; + + /* open parallel port device */ + fd = open_pp (devicename); + if (fd < 0) + { + DBG (DBG_error, "probe: failed to open '%s' device!\n", devicename); + return NULL; + } + + /* now try to connect to scanner */ + if (connect (fd) != SANE_TRUE) + { + DBG (DBG_error, "probe: failed to connect!\n"); + close_pp (fd); + return NULL; + } + + /* set up for memory test */ + write_reg (fd, REG1, 0x00); + write_reg (fd, REG7, 0x00); + write_reg (fd, REG0, 0x00); + write_reg (fd, REG1, 0x00); + write_reg (fd, REGF, 0x80); + if (memtest (fd, 0x0100) != SANE_TRUE) + { + disconnect (fd); + close_pp (fd); + DBG (DBG_error, "probe: memory test failed!\n"); + return NULL; + } + else + { + DBG (DBG_info, "memtest() OK...\n"); + } + write_reg (fd, REG7, 0x00); + + /* check for document presence 0xC6: present, 0xC3 no document */ + test_document (fd); + + /* release device nd parport for next uses */ + disconnect (fd); + close_pp (fd); + + /* for there is only one supported model, so we use hardcoded values */ + DBG (DBG_proc, "probe: exit\n"); + return &pagepartner_model; +} + + +/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/p5.conf.in sane-backends-1.0.21/backend/p5.conf.in --- sane-backends-1.0.20/backend/p5.conf.in 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/p5.conf.in 2010-04-05 23:18:04.000000000 +1000 @@ -0,0 +1,10 @@ +# configuration file for the p5 backend. + +# configuration option to override detected model name +#option modelname "Prima PagePartner" + +# when the parser find this line, it detects it is not an option, +# then it calls the attach function with this value. +# Currently only user mode parallel port support is possible: +# auto, /dev/paraport* (ppdev device name) +auto diff -Nru sane-backends-1.0.20/backend/p5_device.c sane-backends-1.0.21/backend/p5_device.c --- sane-backends-1.0.20/backend/p5_device.c 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/p5_device.c 2010-04-14 10:52:59.000000000 +1000 @@ -0,0 +1,1611 @@ +/** + * Description of the Primax PagePartner model + */ +static P5_Model pagepartner_model = { + "Primax PagePartner", + "Primax", + "PagePartner", + SANE_I18N ("sheetfed scanner"), + + {300, 200, 150, 100, 0}, + /* 500 seems also possible */ + {600, 400, 300, 200, 150, 100, 0}, + + 300, + 600, + 100, + 100, + 16, + + SANE_FIX (0.0), + SANE_FIX (0.0), + SANE_FIX (215.9), + SANE_FIX (300.0), +}; + +#ifdef HAVE_LINUX_PPDEV_H +static char * +addr_name (uint16_t addr) +{ + switch (addr) + { + case DATA: + return "DATA"; + break; + case STATUS: + return "STATUS"; + break; + case CONTROL: + return "CONTROL"; + break; + case EPPADR: + return "EPPADR"; + break; + case EPPDATA: + return "EPPDATA"; + break; + default: + return "*ERROR*"; + } +} +#endif + +/** @brief low level hardware access functions + * @{ + */ + +static uint8_t +inb (int fd, uint16_t addr) +{ +#ifdef HAVE_LINUX_PPDEV_H + uint8_t val = 0xff; + int rc, mode = 0xff; + + switch (addr) + { + case DATA: + rc = ioctl (fd, PPRDATA, &val); + break; + case STATUS: + rc = ioctl (fd, PPRSTATUS, &val); + break; + case CONTROL: + rc = ioctl (fd, PPRCONTROL, &val); + break; + case EPPDATA: + mode = 1; /* data_reverse */ + rc = ioctl (fd, PPDATADIR, &mode); + mode = IEEE1284_MODE_EPP | IEEE1284_DATA; + rc = ioctl (fd, PPSETMODE, &mode); +#ifdef PPSETFLAGS + mode = PP_FASTREAD; + rc = ioctl (fd, PPSETFLAGS, &mode); +#endif + rc = read (fd, &val, 1); + break; + default: + DBG (DBG_error, "inb(%s) escaped ppdev\n", addr_name (addr)); + return 0xFF; + } + if (rc < 0) + { + DBG (DBG_error, "ppdev ioctl returned <%s>\n", strerror (errno)); + } + return val; +#else + if(fd && addr) + return 0; + return 0; +#endif +} + +static void +outb (int fd, uint16_t addr, uint8_t value) +{ +#ifdef HAVE_LINUX_PPDEV_H + int rc = 0, mode = 0xff; + + switch (addr) + { + case DATA: + rc = ioctl (fd, PPWDATA, &value); + break; + case CONTROL: + mode = value & 0x20; + rc = ioctl (fd, PPDATADIR, &mode); + if (!rc) + { + value = value & 0xDF; + rc = ioctl (fd, PPWCONTROL, &value); + } + break; + case EPPDATA: + mode = 0; /* data forward */ + rc = ioctl (fd, PPDATADIR, &mode); + mode = IEEE1284_MODE_EPP | IEEE1284_DATA; + rc = ioctl (fd, PPSETMODE, &mode); + rc = write (fd, &value, 1); + break; + case EPPADR: + mode = 0; /* data forward */ + rc = ioctl (fd, PPDATADIR, &mode); + mode = IEEE1284_MODE_EPP | IEEE1284_ADDR; + rc = ioctl (fd, PPSETMODE, &mode); + rc = write (fd, &value, 1); + break; + default: + DBG (DBG_error, "outb(%s,0x%02x) escaped ppdev\n", addr_name (addr), + value); + break; + } + if (rc < 0) + { + DBG (DBG_error, "ppdev ioctl returned <%s>\n", strerror (errno)); + } +#else + if(fd && addr && value) + return; +#endif /* HAVE_LINUX_PPDEV_H */ +} + +static void +write_reg (int fd, uint8_t index, uint8_t value) +{ + uint8_t idx; + + /* both nibbles hold the same value */ + idx = index & 0x0F; + DBG (DBG_io2, "write_reg(REG%X,0x%x)\n", idx, value); + idx = idx << 4 | idx; + outb (fd, EPPADR, idx); + outb (fd, EPPDATA, value); +} + +static uint8_t +read_reg (int fd, uint8_t index) +{ + uint8_t idx; + + /* both nibbles hold the same value */ + idx = index & 0x0F; + idx = idx << 4 | idx; + outb (fd, EPPADR, idx); + return inb (fd, EPPDATA); +} + +#ifdef HAVE_LINUX_PPDEV_H +static int +read_data (int fd, uint8_t * data, int length) +{ + int mode, rc, nb; + unsigned char bval; + + bval = REG8; + mode = IEEE1284_MODE_EPP | IEEE1284_ADDR; + rc = ioctl (fd, PPSETMODE, &mode); + rc = write (fd, &bval, 1); + + mode = 1; /* data_reverse */ + rc = ioctl (fd, PPDATADIR, &mode); +#ifdef PPSETFLAGS + mode = PP_FASTREAD; + rc = ioctl (fd, PPSETFLAGS, &mode); +#endif + mode = IEEE1284_MODE_EPP | IEEE1284_DATA; + rc = ioctl (fd, PPSETMODE, &mode); + nb = 0; + while (nb < length) + { + rc = read (fd, data + nb, length - nb); + if (rc < 0) + { + DBG (DBG_error, "memtest: error reading data back!\n"); + return 0; + } + else + { + nb += rc; + } + } + + return 1; +} + +static void +index_write_data (int fd, uint8_t index, uint8_t * data, int length) +{ + int mode, rc; + unsigned char bval; + + bval = index; + mode = IEEE1284_MODE_EPP | IEEE1284_ADDR; + rc = ioctl (fd, PPSETMODE, &mode); + rc = write (fd, &bval, 1); + + mode = IEEE1284_MODE_EPP | IEEE1284_DATA; + rc = ioctl (fd, PPSETMODE, &mode); + mode = 0; /* data forward */ + rc = ioctl (fd, PPDATADIR, &mode); + rc = write (fd, data, length); + return; +} + +static void +write_data (int fd, uint8_t * data, int length) +{ + index_write_data (fd, REG8, data, length); +} + +static void +write_reg2 (int fd, uint8_t index, uint16_t value) +{ + uint8_t data2[2]; + + data2[0] = value & 0xff; + data2[1] = value >> 8; + index_write_data (fd, index, data2, 2); +} +#else + +static int +read_data (int fd, uint8_t * data, int length) +{ + if(fd && data && length) + return -1; + return -1; +} + +static void +write_data (int fd, uint8_t * data, int length) +{ + if(fd && data && length) + return; +} + +static void +write_reg2 (int fd, uint8_t index, uint16_t value) +{ + if(fd && index && value) + return; +} +#endif + +/** + * @} + */ + + +/** @brief This function checks a memory buffer. + * This function writes at the given memory address then read it back + * to check the scanner is correctly working. + * @param fd file descriptor used to access hardware + * @param addr address where to write and read + * @return SANE_TRUE on succes, SANE_FALSE otherwise + */ +static int +memtest (int fd, uint16_t addr) +{ + uint8_t sent[256]; + uint8_t back[256]; + int i; + + write_reg2 (fd, REG1, addr); + for (i = 0; i < 256; i++) + { + sent[i] = (uint8_t) i; + back[i] = 0; + } + write_data (fd, sent, 256); + read_data (fd, back, 256); + + /* check if data read back is the same that the one sent */ + for (i = 0; i < 256; i++) + { + if (back[i] != sent[i]) + { + return SANE_FALSE; + } + } + + return SANE_TRUE; +} + + +#define INB(k,y,z) val=inb(k,y); if(val!=z) { DBG(DBG_error,"expected 0x%02x, got 0x%02x\n",z, val); return SANE_FALSE; } + +/** @brief connect to scanner + * This function sends the connect sequence for the scanner. + * @param fd filedescriptor of the parallel port communication channel + * @return SANE_TRUE in case of success, SANE_FALSE otherwise + */ +static int +connect (int fd) +{ + uint8_t val; + + inb (fd, CONTROL); + outb (fd, CONTROL, 0x04); + outb (fd, DATA, 0x02); + INB (fd, DATA, 0x02); + outb (fd, DATA, 0x03); + INB (fd, DATA, 0x03); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + outb (fd, DATA, 0x03); + outb (fd, DATA, 0x83); + INB (fd, DATA, 0x83); + outb (fd, DATA, 0x82); + INB (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + outb (fd, DATA, 0x02); + outb (fd, DATA, 0x82); + outb (fd, DATA, 0xFF); + DBG (DBG_info, "connect() OK...\n"); + return SANE_TRUE; +} + +static int +disconnect (int fd) +{ + uint8_t val; + + outb (fd, CONTROL, 0x04); + outb (fd, DATA, 0x00); + INB (fd, DATA, 0x00); + outb (fd, DATA, 0x01); + INB (fd, DATA, 0x01); + outb (fd, DATA, 0x01); + outb (fd, DATA, 0x81); + outb (fd, DATA, 0x01); + outb (fd, DATA, 0x81); + INB (fd, DATA, 0x81); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x81); + INB (fd, DATA, 0x81); + outb (fd, DATA, 0x01); + outb (fd, DATA, 0x81); + outb (fd, DATA, 0x01); + outb (fd, DATA, 0x81); + INB (fd, DATA, 0x81); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + INB (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + outb (fd, DATA, 0x00); + outb (fd, DATA, 0x80); + inb (fd, CONTROL); + outb (fd, CONTROL, 0x0C); + + return SANE_STATUS_GOOD; +} + +static void +setadresses (int fd, uint16_t start, uint16_t end) +{ + write_reg (fd, REG3, start & 0xff); + write_reg (fd, REG4, start >> 8); + write_reg (fd, REG5, end & 0xff); + write_reg (fd, REG6, end >> 8); + DBG (DBG_io, "setadresses(0x%x,0x%x); OK...\n", start, end); +} + +#ifdef HAVE_LINUX_PPDEV_H +/** @brief open parallel port device + * opens parallel port's low level device in EPP mode + * @param devicename nam of the real device or the special value 'auto' + * @return file descriptor in cas of successn -1 otherwise + */ +static int +open_pp (const char *devicename) +{ + int fd, rc, mode = 0; + char *name; + + DBG (DBG_proc, "open_pp: start, devicename=%s\n", devicename); + /* TODO improve auto device finding */ + if (strncmp (devicename, "auto", 4) == 0) + { + name = strdup("/dev/parport0"); + } + else + { + name = strdup(devicename); + } + + /* open device */ + fd = open (name, O_RDWR); + if (fd < 0) + { + switch (errno) + { + case ENOENT: +#ifdef ENIO + case ENXIO: +#endif +#ifdef ENODEV + case ENODEV: +#endif + DBG (DBG_error, "open_pp: no %s device ...\n", name); + break; + case EACCES: + DBG (DBG_error, + "open_pp: current user cannot use existing %s device ...\n", + name); + break; + default: + DBG (DBG_error, "open_pp: %s while opening %s\n", strerror (errno), + name); + } + return -1; + } + free(name); + + /* claim device and set it to EPP */ + rc = ioctl (fd, PPCLAIM); + rc = ioctl (fd, PPGETMODES, &mode); + if (mode & PARPORT_MODE_PCSPP) + DBG (DBG_io, "PARPORT_MODE_PCSPP\n"); + if (mode & PARPORT_MODE_TRISTATE) + DBG (DBG_io, "PARPORT_MODE_TRISTATE\n"); + if (mode & PARPORT_MODE_EPP) + DBG (DBG_io, "PARPORT_MODE_EPP\n"); + if (mode & PARPORT_MODE_ECP) + DBG (DBG_io, "PARPORT_MODE_ECP\n"); + if (mode & PARPORT_MODE_COMPAT) + DBG (DBG_io, "PARPORT_MODE_COMPAT\n"); + if (mode & PARPORT_MODE_DMA) + DBG (DBG_io, "PARPORT_MODE_DMA\n"); + if (mode & PARPORT_MODE_EPP) + { + mode = IEEE1284_MODE_EPP; + } + else + { + /* + if (mode & PARPORT_MODE_ECP) + { + mode = IEEE1284_MODE_ECP; + } + else + */ + { + mode = -1; + } + } + if (mode == -1) + { + DBG (DBG_error, "open_pp: no EPP mode, giving up ...\n"); + rc = ioctl (fd, PPRELEASE); + close (fd); + return -1; + } + rc = ioctl (fd, PPNEGOT, &mode); + rc = ioctl (fd, PPSETMODE, &mode); + DBG (DBG_proc, "open_pp: exit\n"); + return fd; +} + +/** close low level device + * release and close low level hardware device + */ +static void +close_pp (int fd) +{ + int mode = IEEE1284_MODE_COMPAT; + + if (fd > 2) + { + ioctl (fd, PPNEGOT, &mode); + ioctl (fd, PPRELEASE); + close (fd); + } +} + +#else /* HAVE_LINUX_PPDEV_H */ + +static int +open_pp (const char *devicename) +{ + if(devicename) + return -1; + return -1; +} + +static void +close_pp (int fd) +{ + if(fd) + return; +} +#endif /* HAVE_LINUX_PPDEV_H */ + +/** @brief test if a document is inserted + * Test if a document is inserted by reading register E + * @param fd file descriptor to access scanner + * @return SANE_STATUS_NO_DOCS if no document or SANE_STATUS_GOOD + * if something is present. + */ +static SANE_Status +test_document (int fd) +{ + int detector; + + /* check for document presence 0xC6: present, 0xC3 no document */ + detector = read_reg (fd, REGE); + DBG (DBG_io, "test_document: detector=0x%02X\n", detector); + + /* document inserted */ + if (detector & 0x04) + return SANE_STATUS_GOOD; + + return SANE_STATUS_NO_DOCS; +} + +/** + * return the amount of scanned data available + * @param fd file descriptor to access scanner + * @return avaible byte number + */ +static int +available_bytes (int fd) +{ + int counter; + + /* read the number of 256 bytes block of scanned data */ + counter = read_reg (fd, REG9); + DBG (DBG_io, "available_bytes: available_bytes=0x%02X\n", counter); + return 256 * counter; +} + +static SANE_Status +build_correction (P5_Device * dev, unsigned int dpi, unsigned int mode, + unsigned int start, unsigned int width) +{ + unsigned int i, j, shift, step; + + DBG (DBG_proc, "build_correction: start=%d, width=%d\n", start, width); + DBG (DBG_trace, "build_correction: dpi=%d, mode=%d\n", dpi, mode); + + /* loop on calibration data to find the matching one */ + j = 0; + while (dev->calibration_data[j]->dpi != dpi) + { + j++; + if (j > MAX_RESOLUTIONS) + { + DBG (DBG_error, "build_correction: couldn't find calibration!\n"); + return SANE_STATUS_INVAL; + } + } + + if (dev->gain != NULL) + { + free (dev->gain); + dev->gain = NULL; + } + if (dev->offset != NULL) + { + free (dev->offset); + dev->offset = NULL; + } + dev->gain = (float *) malloc (width * sizeof (float)); + if (dev->gain == NULL) + { + DBG (DBG_error, + "build_correction: failed to allocate memory for gain!\n"); + return SANE_STATUS_NO_MEM; + } + dev->offset = (uint8_t *) malloc (width); + if (dev->offset == NULL) + { + DBG (DBG_error, + "build_correction: failed to allocate memory for offset!\n"); + return SANE_STATUS_NO_MEM; + } + + /* compute starting point of calibration data to use */ + shift = start; + step = 1; + if (mode == MODE_GRAY) + { + /* we use green data */ + shift += 1; + step = 3; + } + for (i = 0; i < width; i += step) + { + if (dev->calibration_data[j]->white_data[shift + i] - + dev->calibration_data[0]->black_data[shift + i] > BLACK_LEVEL) + { + dev->gain[i] = + WHITE_TARGET / + ((float) + (dev->calibration_data[j]->white_data[shift + i] - + dev->calibration_data[j]->black_data[shift + i])); + dev->offset[i] = dev->calibration_data[j]->black_data[shift + i]; + } + else + { + dev->gain[i] = 1.0; + dev->offset[i] = 0; + } + } + return SANE_STATUS_GOOD; + DBG (DBG_proc, "build_correction: end\n"); +} + +/** @brief start up a real scan + * This function starts the scan with the given parameters. + * @param dev device describing hardware + * @param mode color, gray level or lineart. + * @param dpi desired scan resolution. + * @param startx coordinate of the first pixel to scan in + * scan's resolution coordinate + * @param width width of the scanned area + * scanner's physical scan aread. + * @return SANE_STATUS_GOOD if scan is successfully started + */ +static SANE_Status +start_scan (P5_Device * dev, int mode, unsigned int dpi, unsigned int startx, + unsigned int width) +{ + uint8_t reg0=0; + uint8_t reg2=0; + uint8_t regF=0; + uint16_t addr=0; + uint16_t start, end; + unsigned int xdpi; + + DBG (DBG_proc, "start_scan: start \n"); + DBG (DBG_io, "start_scan: startx=%d, width=%d, dpi=%d\n", startx, width, + dpi); + + /** @brief register values + * - reg2 : reg2 seems related to x dpi and provides only 100, + * 150, 200 and 300 resolutions. + * - regF : lower nibble gives y dpi resolution ranging from 150 + * to 1200 dpi. + */ + xdpi = dpi; + switch (dpi) + { + case 100: + reg2 = 0x90; + regF = 0xA2; + break; + case 150: + reg2 = 0x10; + regF = 0xA4; + break; + case 200: + reg2 = 0x80; + regF = 0xA6; + break; + case 300: + reg2 = 0x00; + regF = 0xA8; + break; + case 400: + reg2 = 0x80; /* xdpi=200 */ + regF = 0xAA; + xdpi = 200; + break; + case 500: + reg2 = 0x00; + regF = 0xAC; + xdpi = 300; + break; + case 600: + reg2 = 0x00; + regF = 0xAE; + xdpi = 300; + break; + } + + switch (mode) + { + case MODE_COLOR: + reg0 = 0x00; + addr = 0x0100; + break; + case MODE_GRAY: + /* green channel only */ + reg0 = 0x20; + addr = 0x0100; + break; + case MODE_LINEART: + reg0 = 0x40; + addr = 0x0908; + break; + } + + write_reg (dev->fd, REG1, 0x01); + write_reg (dev->fd, REG7, 0x00); + write_reg (dev->fd, REG0, reg0); + write_reg (dev->fd, REG1, 0x00); + write_reg (dev->fd, REGF, regF); + /* the memory addr used to test need not to be related + * to resolution, 0x0100 could be always used */ + /* TODO get rid of it */ + memtest (dev->fd, addr); + + /* handle case where dpi>xdpi */ + start = startx; + if (dpi > xdpi) + { + width = (width * xdpi) / dpi; + start = (startx * xdpi) / dpi; + } + + /* compute and set start addr */ + if (mode == MODE_COLOR) + { + start = start * 3; + width = width * 3; + } + end = start + width + 1; + + /* build calibration data for the scan */ + if (dev->calibrated) + { + build_correction (dev, xdpi, mode, start, width); + } + + setadresses (dev->fd, start, end); + + write_reg (dev->fd, REG1, addr >> 8); + write_reg (dev->fd, REG2, reg2); + regF = (regF & 0x0F) | 0x80; + write_reg (dev->fd, REGF, regF); + write_reg (dev->fd, REG0, reg0); + if (mode == MODE_LINEART) + { + write_reg (dev->fd, 0x07, 0x04); + } + else + { + write_reg (dev->fd, 0x07, 0x00); + } + write_reg (dev->fd, REG1, addr >> 8); + write_reg2 (dev->fd, REG1, addr); + write_reg (dev->fd, REGF, regF | 0x01); + write_reg (dev->fd, REG0, reg0 | 0x0C); + if (mode == MODE_LINEART) + { + write_reg (dev->fd, REG1, 0x19); + } + else + { + write_reg (dev->fd, REG1, 0x11); + } + DBG (DBG_proc, "start_scan: exit\n"); + return SANE_STATUS_GOOD; +} + +/** read a line of scan data + * @param dev device to read + * @param data pointer where to store data + * @param length total bytes to read on one line + * @param ltr total number of lines to read + * @param retry signals that the function must read as much lines it can + * @param x2 tells that lines must be enlarged by a 2 factor + * @param mode COLOR_MODE if color mode + * @returns number of data lines read, -1 in case of error + */ +static int +read_line (P5_Device * dev, uint8_t * data, size_t length, int ltr, + SANE_Bool retry, SANE_Bool x2, int mode, SANE_Bool correction) +{ + uint8_t counter, read, cnt; + uint8_t inbuffer[MAX_SENSOR_PIXELS * 2 * 3 + 2]; + unsigned int i, factor; + float val; + + DBG (DBG_proc, "read_line: trying to read %d lines of %d bytes\n", ltr, + length); + + counter = read_reg (dev->fd, REG9); + DBG (DBG_io, "read_line: %d bytes available\n", counter * 256); + read = 0; + if (x2 == SANE_FALSE) + { + factor = 1; + } + else + { + factor = 2; + } + + /* in retry mode we read until not enough data, but in no retry + * read only one line , counter give us 256 bytes block available + * and we want an number multiple of color channels */ + cnt = (255 + length / factor) / 256; + while ((counter > cnt && retry == 1) || (counter > cnt && read == 0)) + { + /* read data from scanner, first and last byte aren't picture data */ + read_data (dev->fd, inbuffer, length / factor + 2); + + /* image correction */ + if (correction == SANE_TRUE) + { + for (i = 0; i < length / factor; i++) + { + val = inbuffer[i + 1] - dev->offset[i]; + if (val > 0) + { + val = val * dev->gain[i]; + if (val < 255) + inbuffer[i + 1] = val; + else + inbuffer[i + 1] = 255; + } + else + { + inbuffer[i + 1] = 0; + } + } + } + + /* handle horizontal data doubling */ + if (x2 == SANE_FALSE) + { + memcpy (data + read * length, inbuffer + 1, length); + } + else + { + if (mode == MODE_COLOR) + { + for (i = 0; i < length / factor; i += 3) + { + data[read * length + i * factor] = inbuffer[i + 1]; + data[read * length + i * factor + 1] = inbuffer[i + 2]; + data[read * length + i * factor + 2] = inbuffer[i + 3]; + data[read * length + i * factor + 3] = inbuffer[i + 1]; + data[read * length + i * factor + 4] = inbuffer[i + 2]; + data[read * length + i * factor + 5] = inbuffer[i + 3]; + } + } + else + { + for (i = 0; i < length / factor; i++) + { + data[read * length + i * factor] = inbuffer[i + 1]; + data[read * length + i * factor + 1] = inbuffer[i + 1]; + } + } + } + read++; + if (retry == SANE_TRUE) + { + read_reg (dev->fd, REGF); + read_reg (dev->fd, REGA); + read_reg (dev->fd, REG9); + counter = read_reg (dev->fd, REG9); + read_reg (dev->fd, REGA); + if (read >= ltr) + { + DBG (DBG_io, "read_line returning %d lines\n", read); + return read; + } + counter = read_reg (dev->fd, REG9); + } + } + read_reg (dev->fd, REGF); + read_reg (dev->fd, REGA); + read_reg (dev->fd, REG9); + counter = read_reg (dev->fd, REG9); + read_reg (dev->fd, REGA); + DBG (DBG_io, "read_line returning %d lines\n", read); + return read; +} + + +static SANE_Status +eject (int fd) +{ + int detector; + + DBG (DBG_proc, "eject: start ...\n"); + + do + { + write_reg2 (fd, REG1, 0x1110); + detector = read_reg (fd, REGE); + detector = read_reg (fd, REGE); + } + while ((detector & 0x04) != 0); + write_reg (fd, REG0, 0x00); + write_reg (fd, REG1, 0x00); + write_reg (fd, REGF, 0x82); + write_reg (fd, REG7, 0x00); + + DBG (DBG_proc, "eject: end.\n"); + return SANE_STATUS_GOOD; +} + +/** @brief wait for document to be present in feeder + * Polls document sensor until something is present. Give up after 20 seconds + * @param fd file descriptor of the physical device + */ +/* static int +wait_document (int fd, uint8_t detector) +{ + int count = 0; + uint8_t val; + + write_reg (fd, REG1, 0x00); + write_reg (fd, REG7, 0x00); + detector = read_reg (fd, REGE); + while (detector == 0xc3 && count < 20) + { + sleep (1); + count++; + detector = read_reg (fd, REGE); + } + setadresses (fd, 0x002d, 0x09c7); + write_reg (fd, REG1, 0x00); + write_reg (fd, REG2, 0x90); + write_reg (fd, REGF, 0x82); + write_reg (fd, REG0, 0x00); + val = inb (fd, STATUS) & 0xf8; + if (val != 0xf8) + { + DBG (DBG_error, "wait_document: unexpected STATUS value 0x%02x instead of 0xf8", val); + } + if (count >= 20) + { + DBG (DBG_error, "wait_document: failed to detect document!\n"); + return 0; + } + return 1; +} */ + +/** @brief move at 150 dpi + * move the paper at 150 dpi motor speed by the amount specified + * @params dev pointer to the device structure + */ +static SANE_Status +move (P5_Device * dev) +{ + int skip, done, read, count; + SANE_Status status = SANE_STATUS_GOOD; + unsigned char buffer[256]; + + DBG (DBG_proc, "move: start\n"); + + /* compute number of lines to skip */ + skip = dev->ystart; + + /* works, but remains to be explained ... */ + if (dev->ydpi > 300) + skip = skip / 2; + + DBG (DBG_io, "move: skipping %d lines at %d dpi\n", skip, dev->ydpi); + + /* we do a real scan of small width, discarding data */ + done = 0; + status = start_scan (dev, MODE_GRAY, dev->ydpi, 0, 256); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_error, "move: failed to start scan\n"); + return SANE_STATUS_INVAL; + } + + do + { + /* test if document left the feeder */ + status = test_document (dev->fd); + if (status == SANE_STATUS_NO_DOCS) + { + DBG (DBG_info, + "move: document was shorter than the required move\n"); + return SANE_STATUS_INVAL; + } + /* test if data is available */ + count = available_bytes (dev->fd); + if (count) + { + read = + read_line (dev, buffer, 256, 1, SANE_FALSE, SANE_FALSE, + MODE_GRAY, SANE_FALSE); + if (read == -1) + { + DBG (DBG_error, "move: failed to read data\n"); + return SANE_STATUS_INVAL; + } + done += read; + } + } + while (done < skip); + + /* reset scanner */ + write_reg2 (dev->fd, REG1, 0x1110); + count = read_reg (dev->fd, REGE); + count = read_reg (dev->fd, REGE); + write_reg (dev->fd, REG0, 0x00); + write_reg (dev->fd, REG1, 0x00); + write_reg (dev->fd, REGF, 0x82); + write_reg (dev->fd, REG7, 0x00); + + DBG (DBG_proc, "move: exit\n"); + return status; +} + +/** clean up calibration data + * @param dev device to clean up + */ +static void +cleanup_calibration (P5_Device * dev) +{ + int i; + + for (i = 0; i < MAX_RESOLUTIONS * 2; i++) + { + if (dev->calibration_data[i] != NULL) + { + free (dev->calibration_data[i]); + dev->calibration_data[i] = NULL; + } + } + dev->calibrated = SANE_FALSE; +} + +/** detect a black scan line + * parses the given buffer and retrun SANE_TRUE if the line is an + * acceptable black line for calibration + * @param buffer data line to parse + * @param pixels number of pixels + * @param mode MODE_COLOR or MODE_GRAY + * @returns SANE_TRUE if it is considered as a white line + */ +static SANE_Bool +is_black_line (uint8_t * buffer, unsigned int pixels, int mode) +{ + unsigned int i, start, end, count, width; + + /* compute width in bytes */ + if (mode == MODE_COLOR) + { + width = pixels * 3; + } + else + { + width = pixels; + } + + /* we allow the calibration target to be narrower than full width, ie + * black margin at both ends of the line */ + start = (5 * width) / 100; + end = (95 * width) / 100; + count = 0; + + /* count number of black bytes */ + for (i = start; i < end; i++) + { + if (buffer[i] > BLACK_LEVEL) + { + count++; + } + } + + /* we allow 3% black pixels maximum */ + if (count > (3 * width) / 100) + { + DBG (DBG_io, "is_black_line=SANE_FALSE\n"); + return SANE_FALSE; + } + + DBG (DBG_io, "is_black_line=SANE_TRUE\n"); + return SANE_TRUE; +} + +/** detect a white scan line + * parses the given buffer and retrun SANE_TRUE if the line is an + * acceptable white line for calibration + * @param buffer data line to parse + * @param pixels number of pixels + * @param mode MODE_COLOR or MODE_GRAY + * @returns SANE_TRUE if it is considered as a white line + */ +static SANE_Bool +is_white_line (uint8_t * buffer, unsigned int pixels, int mode) +{ + unsigned int i, start, end, count, width; + + /* compute width in bytes */ + if (mode == MODE_COLOR) + { + width = pixels * 3; + } + else + { + width = pixels; + } + + /* we allow the calibration target to be narrower than full width, ie + * black margin at both ends of the line */ + start = (5 * width) / 100; + end = (95 * width) / 100; + count = 0; + + /* count number of black bytes */ + for (i = start; i < end; i++) + { + if (buffer[i] < BLACK_LEVEL) + { + count++; + } + } + + /* we allow 3% black pixels maximum */ + if (count > (3 * width) / 100) + { + DBG (DBG_io, "is_white_line=SANE_FALSE\n"); + return SANE_FALSE; + } + + DBG (DBG_io, "is_white_line=SANE_TRUE\n"); + return SANE_TRUE; +} + +/* ------------------------------------------------------------------------- */ +/* writes gray data to a pnm file */ +/* +static void +write_gray_data (unsigned char *image, char *name, SANE_Int width, + SANE_Int height) +{ + FILE *fdbg = NULL; + + fdbg = fopen (name, "wb"); + if (fdbg == NULL) + return; + fprintf (fdbg, "P5\n%d %d\n255\n", width, height); + fwrite (image, width, height, fdbg); + fclose (fdbg); +} +*/ + +/* ------------------------------------------------------------------------- */ +/* writes rgb data to a pnm file */ +static void +write_rgb_data (char *name, unsigned char *image, SANE_Int width, + SANE_Int height) +{ + FILE *fdbg = NULL; + + fdbg = fopen (name, "wb"); + if (fdbg == NULL) + return; + fprintf (fdbg, "P6\n%d %d\n255\n", width, height); + fwrite (image, width * 3, height, fdbg); + fclose (fdbg); +} + +/** give calibration file name + * computes the calibration file name to use based on the + * backend name and device + */ +static char * +calibration_file (const char *devicename) +{ + char *ptr = NULL; + char tmp_str[PATH_MAX]; + + ptr = getenv ("HOME"); + if (ptr != NULL) + { + sprintf (tmp_str, "%s/.sane/p5-%s.cal", ptr, devicename); + } + else + { + ptr = getenv ("TMPDIR"); + if (ptr != NULL) + { + sprintf (tmp_str, "%s/p5-%s.cal", ptr, devicename); + } + else + { + sprintf (tmp_str, "/tmp/p5-%s.cal", devicename); + } + } + DBG (DBG_trace, "calibration_file: using >%s< for calibration file name\n", + tmp_str); + return strdup (tmp_str); +} + +/** restore calibration data + * restore calibration data by loading previously saved calibration data + * @param dev device to restore + * @return SANE_STATUS_GOOD on success, otherwise error code + */ +static SANE_Status +restore_calibration (P5_Device * dev) +{ + SANE_Status status = SANE_STATUS_GOOD; + char *fname = NULL; + FILE *fcalib = NULL; + size_t size; + int i; + + DBG (DBG_proc, "restore_calibration: start\n"); + cleanup_calibration (dev); + fname = calibration_file (dev->model->name); + fcalib = fopen (fname, "rb"); + if (fcalib == NULL) + { + DBG (DBG_error, "restore_calibration: failed to open %s!\n", fname); + free (fname); + return SANE_STATUS_IO_ERROR; + } + + /* loop filling calibration data until EOF reached */ + i = 0; + while (!feof (fcalib) && (i < 2 * MAX_RESOLUTIONS)) + { + dev->calibration_data[i] = malloc (sizeof (P5_Calibration_Data)); + if (dev->calibration_data[i] == NULL) + { + cleanup_calibration (dev); + free (fname); + fclose (fcalib); + DBG (DBG_error, + "restore_calibration: failed to allocate memory for calibration\n"); + return SANE_STATUS_NO_MEM; + } + size = + fread (dev->calibration_data[i], 1, sizeof (P5_Calibration_Data), + fcalib); + if (feof (fcalib)) + { + free (dev->calibration_data[i]); + dev->calibration_data[i] = NULL; + } + else if (size != sizeof (P5_Calibration_Data)) + { + cleanup_calibration (dev); + free (fname); + fclose (fcalib); + DBG (DBG_error, "restore_calibration: failed to read from file\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (DBG_trace, + "restore_calibration: read 1 calibration structure from file\n"); + i++; + } + + dev->calibrated = SANE_TRUE; + fclose (fcalib); + free (fname); + + DBG (DBG_proc, "restore_calibration: end\n"); + return status; +} + +/** save calibration data + * save calibration data from memory to file + * @param dev device calibration to save + * @return SANE_STATUS_GOOD on success, otherwise error code + */ +static SANE_Status +save_calibration (P5_Device * dev) +{ + SANE_Status status = SANE_STATUS_GOOD; + char *fname = NULL; + FILE *fcalib = NULL; + int i; + size_t size; + + DBG (DBG_proc, "save_calibration: start\n"); + fname = calibration_file (dev->model->name); + fcalib = fopen (fname, "wb"); + if (fcalib == NULL) + { + DBG (DBG_error, "save_calibration: failed to open %s!\n", fname); + free (fname); + return SANE_STATUS_IO_ERROR; + } + + /* loop filling calibration data until EOF reached */ + i = 0; + while (dev->calibration_data[i] != NULL && (i < 2 * MAX_RESOLUTIONS)) + { + size = + fwrite (dev->calibration_data[i], sizeof (P5_Calibration_Data), 1, + fcalib); + if (size != sizeof (P5_Calibration_Data)) + { + free (fname); + fclose (fcalib); + DBG (DBG_error, "save_calibration: failed to write to file\n"); + return SANE_STATUS_IO_ERROR; + } + DBG (DBG_trace, + "save_calibration: wrote 1 calibration structure to file\n"); + i++; + } + + fclose (fcalib); + free (fname); + + DBG (DBG_proc, "save_calibration: end\n"); + return status; +} + +/** calibrate scanner + * calibrates scanner by scanning a white sheet to get + * reference data. The black reference data is extracted from the lines + * that precede the physical document. + * Calibration is done at 300 color, then data is built for other modes + * and resolutions. + * @param dev device to calibrate + */ +static SANE_Status +sheetfed_calibration (P5_Device * dev) +{ + uint8_t buffer[MAX_SENSOR_PIXELS * 3]; + uint16_t white_data[MAX_SENSOR_PIXELS * 3]; + uint16_t black_data[MAX_SENSOR_PIXELS * 3]; + unsigned int i, j, k, dpi, pixels, read, black, white; + float coeff; + unsigned int red, green, blue; + int line; + SANE_Status status; + char title[40]; + + FILE *dbg = fopen ("debug.pnm", "wb"); + fprintf (dbg, "P6\n%d %d\n255\n", MAX_SENSOR_PIXELS, + CALIBRATION_SKIP_LINES * 4); + + DBG (DBG_proc, "sheetfed_calibration: start\n"); + + /* check calibration target has been loaded in ADF */ + status = test_document (dev->fd); + if (status == SANE_STATUS_NO_DOCS) + { + DBG (DBG_error, + "sheetfed_calibration: no calibration target present!\n"); + return SANE_STATUS_NO_DOCS; + } + + /* clean up calibration data */ + cleanup_calibration (dev); + + /* a RGB scan to get reference data */ + /* initialize calibration slot for the resolution */ + i = 0; + dpi = dev->model->max_xdpi; + pixels = MAX_SENSOR_PIXELS; + dev->calibration_data[i] = + (P5_Calibration_Data *) malloc (sizeof (P5_Calibration_Data)); + if (dev->calibration_data[i] == NULL) + { + cleanup_calibration (dev); + DBG (DBG_error, + "sheetfed_calibration: failed to allocate memory for calibration\n"); + return SANE_STATUS_NO_MEM; + } + dev->calibration_data[i]->dpi = dpi; + + /* start scan */ + status = start_scan (dev, MODE_COLOR, dpi, 0, pixels); + if (status != SANE_STATUS_GOOD) + { + cleanup_calibration (dev); + DBG (DBG_error, + "sheetfed_calibration: failed to start scan at %d dpi\n", dpi); + return SANE_STATUS_INVAL; + } + + white = 0; + black = 0; + read = 0; + for (j = 0; j < pixels * 3; j++) + { + black_data[j] = 0; + white_data[j] = 0; + } + + /* read lines and gather black and white ones until enough for sensor's + * native resolution */ + do + { + status = test_document (dev->fd); + if (status == SANE_STATUS_NO_DOCS && (white < 10 || black < 10)) + { + cleanup_calibration (dev); + DBG (DBG_error, + "sheetfed_calibration: calibration sheet too short!\n"); + return SANE_STATUS_INVAL; + } + memset (buffer, 0x00, MAX_SENSOR_PIXELS * 3); + line = + read_line (dev, buffer, pixels * 3, 1, SANE_FALSE, SANE_FALSE, + MODE_COLOR, SANE_FALSE); + if (line == -1) + { + DBG (DBG_error, "sheetfed_calibration: failed to read data\n"); + return SANE_STATUS_INVAL; + } + + /* if a data line has been read, add it to reference data */ + if (line) + { + read++; + fwrite (buffer, pixels * 3, 1, dbg); + if (is_white_line (buffer, pixels, MODE_COLOR) && white < 256) + { + white++; + /* first calibration lines are skipped */ + for (j = 0; j < pixels * 3 && read > CALIBRATION_SKIP_LINES; + j++) + { + white_data[j] += buffer[j]; + } + } + if (is_black_line (buffer, pixels, MODE_COLOR) && black < 256) + { + black++; + for (j = 0; j < pixels * 3; j++) + { + black_data[j] += buffer[j]; + } + } + } + } + while (test_document (dev->fd) != SANE_STATUS_NO_DOCS); + DBG (DBG_trace, "sheetfed_calibration: white lines=%d, black lines=%d\n", + white, black); + + /* average pixels and store in per dpi calibration data */ + for (j = 0; j < pixels * 3; j++) + { + dev->calibration_data[i]->white_data[j] = white_data[j] / white; + dev->calibration_data[i]->black_data[j] = black_data[j] / black; + } + + /* we average red, green and blue offset on the full sensor */ + red = 0; + green = 0; + blue = 0; + for (j = 0; j < pixels * 3; j += 3) + { + red += dev->calibration_data[i]->black_data[j]; + green += dev->calibration_data[i]->black_data[j + 1]; + blue += dev->calibration_data[i]->black_data[j + 2]; + } + for (j = 0; j < pixels * 3; j += 3) + { + dev->calibration_data[i]->black_data[j] = red / pixels; + dev->calibration_data[i]->black_data[j + 1] = green / pixels; + dev->calibration_data[i]->black_data[j + 2] = blue / pixels; + } + + /* trace calibration data for debug */ + if (DBG_LEVEL > DBG_data) + { + sprintf (title, "calibration-white-%d.pnm", + dev->calibration_data[i]->dpi); + write_rgb_data (title, dev->calibration_data[i]->white_data, pixels, 1); + sprintf (title, "calibration-black-%d.pnm", + dev->calibration_data[i]->dpi); + write_rgb_data (title, dev->calibration_data[i]->black_data, pixels, 1); + } + + /* loop on all remaining resolution and compute calibration data from it */ + for (i = 1; i < MAX_RESOLUTIONS && dev->model->xdpi_values[i] > 0; i++) + { + dev->calibration_data[i] = + (P5_Calibration_Data *) malloc (sizeof (P5_Calibration_Data)); + if (dev->calibration_data[i] == NULL) + { + cleanup_calibration (dev); + DBG (DBG_error, + "sheetfed_calibration: failed to allocate memory for calibration\n"); + return SANE_STATUS_INVAL; + } + dev->calibration_data[i]->dpi = dev->model->xdpi_values[i]; + + coeff = ((float) dev->model->xdpi_values[i]) / (float) dpi; + + /* generate data by decimation */ + for (j = 0; j < pixels / coeff; j++) + { + k = j * coeff; + dev->calibration_data[i]->white_data[j] = + dev->calibration_data[0]->white_data[k]; + dev->calibration_data[i]->white_data[j + 1] = + dev->calibration_data[0]->white_data[k + 1]; + dev->calibration_data[i]->white_data[j + 2] = + dev->calibration_data[0]->white_data[k + 2]; + dev->calibration_data[i]->black_data[j] = + dev->calibration_data[0]->black_data[k]; + dev->calibration_data[i]->black_data[j + 1] = + dev->calibration_data[0]->black_data[k + 1]; + dev->calibration_data[i]->black_data[j + 2] = + dev->calibration_data[0]->black_data[k + 2]; + } + } + + fclose (dbg); + dev->calibrated = SANE_TRUE; + + /* eject calibration target */ + eject (dev->fd); + + DBG (DBG_proc, "sheetfed_calibration: end\n"); + return SANE_STATUS_GOOD; +} + +/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff -Nru sane-backends-1.0.20/backend/p5_device.h sane-backends-1.0.21/backend/p5_device.h --- sane-backends-1.0.20/backend/p5_device.h 1970-01-01 10:00:00.000000000 +1000 +++ sane-backends-1.0.21/backend/p5_device.h 2010-04-14 10:52:59.000000000 +1000 @@ -0,0 +1,304 @@ +/* sane - Scanner Access Now Easy. + + Copyright (C) 2009 stef.dev@free.fr + + 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. +*/ + +/** @file p5_device.h + * @brief Declaration of low level structures used by the p5 backend. + * + * The structures and function declared here are used to do the low level + * communication with the physical device. + */ + +#ifndef P5_DEVICE_H +#define P5_DEVICE_H + +#include +#include +#include +#include "../include/_stdint.h" + +#ifdef HAVE_LINUX_PPDEV_H +#include +#include +#include +#include +#include +#include +#endif + +/** @name debugging levels + */ +/* @{ */ +#define DBG_error0 0 /* errors/warnings printed even with devuglevel 0 */ +#define DBG_error 1 /* fatal errors */ +#define DBG_warn 2 /* warnings and non-fatal errors */ +#define DBG_info 4 /* informational messages */ +#define DBG_proc 8 /* starting/finishing functions */ +#define DBG_trace 16 /* tracing messages */ +#define DBG_io 32 /* io functions */ +#define DBG_io2 64 /* io functions that are called very often */ +#define DBG_data 128 /* log image data */ +/* @} */ + +/** + * maximal number of resolutions + */ +#define MAX_RESOLUTIONS 8 + +/**> sensor's number of pixels 8.5' @ 300 dpi */ +#define MAX_SENSOR_PIXELS 2550 + +/**> number of lines to skip when doing calibration */ +#define CALIBRATION_SKIP_LINES 80 + +/**> last value considered as black for calibration */ +#define BLACK_LEVEL 40 + +/**> white target value for calibration */ +#define WHITE_TARGET 220.0 + +/** per dpi calibration rgb data + * Calibration data structure + */ +typedef struct P5_Calibration_Data +{ + unsigned int dpi; + uint8_t black_data[MAX_SENSOR_PIXELS * 3]; + uint8_t white_data[MAX_SENSOR_PIXELS * 3]; +} P5_Calibration_Data; + +/** + * This structure describes a particular model which is handled by the backend. + * Contained data is immutable and is used to initalize the P5_Device + * structure. + */ +typedef struct P5_Model +{ + /** @name device identifier + * These values are set up once the physical device has been detected. They + * are used to build the return value of sane_get_devices(). + */ + /* @{ */ + SANE_String_Const name; + SANE_String_Const vendor; + SANE_String_Const product; + SANE_String_Const type; + /* @} */ + + /** @name resolution + * list of avalailable physical resolution. + * The resolutions must sorted from lower to higher value. The list is terminated + * by a value of 0. + */ + /* @{ */ + int xdpi_values[MAX_RESOLUTIONS]; /** possible x resolutions */ + int ydpi_values[MAX_RESOLUTIONS]; /** possible y resolutions */ + /* @} */ + + /** @name scan area description + * Minimal and maximal values. It's easier to have dedicated members instead + * of searching these values in the dpi lists. They are initialized from dpi + * lists. + */ + /* @{ */ + int max_xdpi; /** physical maximum x dpi */ + int max_ydpi; /** physical maximum y dpi */ + int min_xdpi; /** physical minimum x dpi */ + int min_ydpi; /** physical minimum y dpi */ + /* @} */ + + /** @name line distance shift + * Distance between CCD arrays for each color. Expressed in line + * number at maximum motor resolution. + */ + int lds; + + /** @name scan area description + * The geometry values are expressed from the head parking position, + * or the start. For a given model, the scan area selected by a frontend + * will have to fit within these values. + */ + /* @{ */ + SANE_Fixed x_offset; /** Start of scan area in mm */ + SANE_Fixed y_offset; /** Start of scan area in mm */ + SANE_Fixed x_size; /** Size of scan area in mm */ + SANE_Fixed y_size; /** Size of scan area in mm */ + /* @} */ + +} P5_Model; + + +/** + * Enumeration of configuration options for a device. It must starts at 0. + */ +enum P5_Configure_Option +{ + CFG_MODEL_NAME = 0, /**