2000-03-05 13:57:25 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* SANE - Scanner Access Now Easy.
|
|
|
|
|
|
|
|
avision.h
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
*****************************************************************************
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
This backend is based upon the Tamarack backend and adapted to the Avision
|
2007-11-17 16:19:53 +00:00
|
|
|
scanners by René Rebe and Meino Cramer.
|
2002-01-16 23:18:43 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
Check the avision.c file for detailed copyright and change-log
|
|
|
|
information.
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
********************************************************************************/
|
2000-03-05 13:57:25 +00:00
|
|
|
|
|
|
|
#ifndef avision_h
|
|
|
|
#define avision_h
|
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
#ifdef HAVE_STDINT_H
|
|
|
|
# include <stdint.h> /* available in ISO C99 */
|
|
|
|
#else
|
|
|
|
# include <sys/types.h>
|
|
|
|
typedef uint8_t uint8_t;
|
|
|
|
typedef uint16_t uint16_t;
|
|
|
|
typedef uint32_t uint32_t;
|
|
|
|
#endif /* HAVE_STDINT_H */
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
#ifndef PATH_MAX
|
|
|
|
# define PATH_MAX 1024
|
|
|
|
#endif
|
|
|
|
|
2003-03-25 01:43:35 +00:00
|
|
|
typedef enum Avision_ConnectionType {
|
|
|
|
AV_SCSI,
|
|
|
|
AV_USB
|
|
|
|
} Avision_ConnectionType;
|
|
|
|
|
|
|
|
/* information needed for device access */
|
|
|
|
typedef struct Avision_Connection {
|
2005-07-15 09:12:27 +00:00
|
|
|
Avision_ConnectionType connection_type;
|
2003-03-25 01:43:35 +00:00
|
|
|
int scsi_fd; /* SCSI filedescriptor */
|
|
|
|
SANE_Int usb_dn; /* USB (libusb or scanner.c) device number */
|
2005-07-15 09:12:27 +00:00
|
|
|
enum {
|
|
|
|
AVISION_USB_UNTESTED_STATUS, /* status type untested */
|
|
|
|
AVISION_USB_INT_STATUS, /* interrupt endp. (USB 1.x device) status */
|
|
|
|
AVISION_USB_BULK_STATUS /* bulk endp. (USB 2.0 device) status */
|
|
|
|
} usb_status;
|
|
|
|
|
2003-03-25 01:43:35 +00:00
|
|
|
} Avision_Connection;
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
typedef struct Avision_HWEntry {
|
2004-06-22 14:12:52 +00:00
|
|
|
const char* scsi_mfg;
|
|
|
|
const char* scsi_model;
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
2003-03-25 01:43:35 +00:00
|
|
|
int usb_vendor;
|
|
|
|
int usb_product;
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
2002-04-12 00:14:01 +00:00
|
|
|
const char* real_mfg;
|
|
|
|
const char* real_model;
|
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* feature overwrites - as embedded CPUs have 16bit enums - this
|
|
|
|
would need a change ... */
|
2002-11-23 16:17:07 +00:00
|
|
|
/* force no calibration */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_CALIB ((uint64_t)1<<0)
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
/* force all in one command calibration */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_ONE_CALIB_CMD ((uint64_t)1<<1)
|
2003-02-16 17:35:05 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
/* no gamma table */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_GAMMA ((uint64_t)1<<2)
|
2002-11-23 16:17:07 +00:00
|
|
|
|
|
|
|
/* light check is bogus */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_LIGHT_CHECK_BOGUS ((uint64_t)1<<3)
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* no button though the device advertise it */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_BUTTON ((uint64_t)1<<4)
|
2003-02-16 17:35:05 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
/* if the scan area needs to be forced to A3 */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FORCE_A3 ((uint64_t)1<<5)
|
2004-06-22 14:12:52 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
/* if the scan area and resolution needs to be forced for films */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FORCE_FILM ((uint64_t)1<<6)
|
2003-03-25 01:43:35 +00:00
|
|
|
|
2008-05-26 09:57:28 +00:00
|
|
|
/* does not suport, or very broken background (added for AV610C2) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_BACKGROUND ((uint64_t)1<<7)
|
2003-10-28 09:41:27 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
/* is film scanner - no detection yet */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FILMSCANNER ((uint64_t)1<<8)
|
2005-07-15 09:12:27 +00:00
|
|
|
|
2003-10-28 09:41:27 +00:00
|
|
|
/* fujitsu adaption */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FUJITSU ((uint64_t)1<<9)
|
2005-07-15 09:12:27 +00:00
|
|
|
|
|
|
|
/* gray calibration data has to be uploaded on the blue channel ... ? */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_GRAY_CALIB_BLUE ((uint64_t)1<<10)
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
/* Interrupt endpoint button readout (so far AV220) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_INT_BUTTON ((uint64_t)1<<11)
|
2005-07-15 09:12:27 +00:00
|
|
|
|
|
|
|
/* send acceleration table ... */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_ACCEL_TABLE ((uint64_t)1<<12)
|
2005-12-04 21:29:22 +00:00
|
|
|
|
|
|
|
/* non-interlaced scanns up to 300 dpi (AV32xx / AV83xx) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NON_INTERLACED_DUPLEX_300 ((uint64_t)1<<13)
|
2005-12-04 21:29:22 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* do not read multiples of 64 bytes - stalls the USB chip */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_64BYTE_ALIGN ((uint64_t)1<<14)
|
2005-12-04 21:29:22 +00:00
|
|
|
|
|
|
|
/* force channel-by-channel calibration */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_MULTI_CALIB_CMD ((uint64_t)1<<15)
|
2006-06-06 11:24:18 +00:00
|
|
|
|
|
|
|
/* non color scans are faster with a filter applied (AV32xx) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FASTER_WITH_FILTER ((uint64_t)1<<16)
|
2006-06-06 11:24:18 +00:00
|
|
|
|
|
|
|
/* interlaced data with 1 line distance */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_2ND_LINE_INTERLACED ((uint64_t)1<<17)
|
2006-06-06 11:24:18 +00:00
|
|
|
|
|
|
|
/* does not keep the window though it advertices so */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_DOES_NOT_KEEP_WINDOW ((uint64_t)1<<18)
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* does not keep the gamma though it advertices so */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_DOES_NOT_KEEP_GAMMA ((uint64_t)1<<19)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
2006-06-06 11:24:18 +00:00
|
|
|
/* advertises ADF is BGR order, but isn't (or vice versa) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_ADF_BGR_ORDER_INVERT ((uint64_t)1<<20)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* allows 12bit mode, though not flagged */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_12_BIT_MODE ((uint64_t)1<<21)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
2008-05-26 09:57:28 +00:00
|
|
|
/* very broken background raster */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_BACKGROUND_QUIRK ((uint64_t)1<<22)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* though marked as GRAY only the scanner can do GRAY modes */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_GRAY_MODES ((uint64_t)1<<23)
|
2005-07-15 09:12:27 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* no seperate, single REAR scan (AV122, DM152, ...) */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_REAR ((uint64_t)1<<24)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* only scan with some known good hardware resolutions, as the
|
|
|
|
scanner fails to properly interpoloate in between (e.g. AV121,
|
|
|
|
DM152 on duplex scans - but also the AV600), software scale and
|
|
|
|
interpolate to all the others */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_SOFT_SCALE ((uint64_t)1<<25)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* does keep window though it does not advertice it - the AV122/DM152
|
|
|
|
mess up image data if window is resend between ADF pages */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_DOES_KEEP_WINDOW ((uint64_t)1<<26)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* does keep gamma though it does not advertice it */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_DOES_KEEP_GAMMA ((uint64_t)1<<27)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* does the scanner contain a Cancel button? */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_CANCEL_BUTTON ((uint64_t)1<<28)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* is the rear image offset? */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_REAR_OFFSET ((uint64_t)1<<29)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
/* some devices do not need a START_SCAN, even hang with it */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_START_SCAN ((uint64_t)1<<30)
|
2007-11-17 16:19:53 +00:00
|
|
|
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_INT_STATUS ((uint64_t)1<<31)
|
2015-03-07 11:16:47 +00:00
|
|
|
|
2010-02-13 18:09:38 +00:00
|
|
|
/* force no calibration */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_NO_TUNE_SCAN_LENGTH ((uint64_t)1<<32)
|
2010-12-23 10:47:56 +00:00
|
|
|
|
|
|
|
/* for gray scans, set grey filter */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_USE_GRAY_FILTER ((uint64_t)1<<33)
|
2011-01-29 02:50:09 +00:00
|
|
|
|
|
|
|
/* For (HP) scanners with flipping duplexers */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_ADF_FLIPPING_DUPLEX ((uint64_t)1<<34)
|
2011-01-29 02:50:10 +00:00
|
|
|
|
|
|
|
/* For scanners which need to have their firmware read to properly function. */
|
2015-03-07 18:51:14 +00:00
|
|
|
#define AV_FIRMWARE ((uint64_t)1<<35)
|
2015-03-07 11:16:47 +00:00
|
|
|
|
|
|
|
/* maybe more ...*/
|
|
|
|
uint64_t feature_type;
|
2010-02-13 18:09:38 +00:00
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
} Avision_HWEntry;
|
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
typedef enum {
|
2002-11-23 16:17:07 +00:00
|
|
|
AV_ASIC_Cx = 0,
|
|
|
|
AV_ASIC_C1 = 1,
|
2005-07-15 09:12:27 +00:00
|
|
|
AV_ASIC_W1 = 2,
|
2002-11-23 16:17:07 +00:00
|
|
|
AV_ASIC_C2 = 3,
|
|
|
|
AV_ASIC_C5 = 5,
|
2003-02-16 17:35:05 +00:00
|
|
|
AV_ASIC_C6 = 6,
|
2007-11-17 16:19:53 +00:00
|
|
|
AV_ASIC_C7 = 7,
|
2005-07-15 09:12:27 +00:00
|
|
|
AV_ASIC_OA980 = 128,
|
|
|
|
AV_ASIC_OA982 = 129
|
2002-12-01 13:42:18 +00:00
|
|
|
} asic_type;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AV_THRESHOLDED,
|
|
|
|
AV_DITHERED,
|
2005-07-15 09:12:27 +00:00
|
|
|
AV_GRAYSCALE, /* all gray needs to be before color for is_color() */
|
|
|
|
AV_GRAYSCALE12,
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
AV_GRAYSCALE16,
|
2005-07-15 09:12:27 +00:00
|
|
|
AV_TRUECOLOR,
|
|
|
|
AV_TRUECOLOR12,
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
AV_TRUECOLOR16,
|
2002-12-01 13:42:18 +00:00
|
|
|
AV_COLOR_MODE_LAST
|
|
|
|
} color_mode;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AV_NORMAL,
|
|
|
|
AV_TRANSPARENT,
|
|
|
|
AV_ADF,
|
2005-07-15 09:12:27 +00:00
|
|
|
AV_ADF_REAR,
|
|
|
|
AV_ADF_DUPLEX,
|
2003-10-28 09:41:27 +00:00
|
|
|
AV_SOURCE_MODE_LAST
|
|
|
|
} source_mode;
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
typedef enum {
|
|
|
|
AV_NORMAL_DIM,
|
|
|
|
AV_TRANSPARENT_DIM,
|
|
|
|
AV_ADF_DIM,
|
|
|
|
AV_SOURCE_MODE_DIM_LAST
|
|
|
|
} source_mode_dim;
|
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
enum Avision_Option
|
|
|
|
{
|
2000-11-14 20:05:35 +00:00
|
|
|
OPT_NUM_OPTS = 0, /* must come first */
|
|
|
|
|
|
|
|
OPT_MODE_GROUP,
|
|
|
|
OPT_MODE,
|
|
|
|
OPT_RESOLUTION,
|
2005-12-04 21:29:22 +00:00
|
|
|
#define OPT_RESOLUTION_DEFAULT 150
|
2000-11-14 20:05:35 +00:00
|
|
|
OPT_SPEED,
|
|
|
|
OPT_PREVIEW,
|
|
|
|
|
2003-10-28 09:41:27 +00:00
|
|
|
OPT_SOURCE, /* scan source normal, transparency, ADF */
|
|
|
|
|
2000-11-14 20:05:35 +00:00
|
|
|
OPT_GEOMETRY_GROUP,
|
|
|
|
OPT_TL_X, /* top-left x */
|
|
|
|
OPT_TL_Y, /* top-left y */
|
|
|
|
OPT_BR_X, /* bottom-right x */
|
|
|
|
OPT_BR_Y, /* bottom-right y */
|
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
OPT_OVERSCAN_TOP, /* overscan for auto-crop/deskew, if supported */
|
|
|
|
OPT_OVERSCAN_BOTTOM,
|
|
|
|
OPT_BACKGROUND, /* background raster lines to read out */
|
|
|
|
|
2000-11-14 20:05:35 +00:00
|
|
|
OPT_ENHANCEMENT_GROUP,
|
|
|
|
OPT_BRIGHTNESS,
|
|
|
|
OPT_CONTRAST,
|
|
|
|
OPT_QSCAN,
|
|
|
|
OPT_QCALIB,
|
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
OPT_GAMMA_VECTOR, /* first must be gray */
|
2000-11-14 20:05:35 +00:00
|
|
|
OPT_GAMMA_VECTOR_R, /* then r g b vector */
|
|
|
|
OPT_GAMMA_VECTOR_G,
|
|
|
|
OPT_GAMMA_VECTOR_B,
|
2008-05-26 09:57:28 +00:00
|
|
|
|
|
|
|
OPT_EXPOSURE, /* film exposure adjustment */
|
|
|
|
OPT_IR, /* infra-red */
|
|
|
|
OPT_MULTISAMPLE, /* multi-sample */
|
2000-11-14 20:05:35 +00:00
|
|
|
|
2011-01-29 02:50:04 +00:00
|
|
|
OPT_MISC_GROUP,
|
2002-04-08 14:35:32 +00:00
|
|
|
OPT_FRAME, /* Film holder control */
|
2006-06-06 11:24:18 +00:00
|
|
|
|
|
|
|
OPT_POWER_SAVE_TIME, /* set power save time to the scanner */
|
2007-11-17 16:19:53 +00:00
|
|
|
|
|
|
|
OPT_MESSAGE, /* optional message from the scanner display */
|
2006-06-06 11:24:18 +00:00
|
|
|
OPT_NVRAM, /* retrieve NVRAM values as pretty printed text */
|
2002-04-08 14:35:32 +00:00
|
|
|
|
2011-01-29 02:50:05 +00:00
|
|
|
OPT_PAPERLEN, /* Use paper_length field to detect double feeds */
|
2011-01-29 02:50:14 +00:00
|
|
|
OPT_ADF_FLIP, /* For flipping duplex, reflip the document */
|
2011-01-29 02:50:05 +00:00
|
|
|
|
2000-11-14 20:05:35 +00:00
|
|
|
NUM_OPTIONS /* must come last */
|
2000-03-05 13:57:25 +00:00
|
|
|
};
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
typedef struct Avision_Dimensions
|
2000-03-05 13:57:25 +00:00
|
|
|
{
|
2002-04-08 14:35:32 +00:00
|
|
|
/* in dpi */
|
2002-12-01 13:42:18 +00:00
|
|
|
int xres;
|
|
|
|
int yres;
|
2002-11-23 16:17:07 +00:00
|
|
|
|
|
|
|
/* in pixels */
|
2000-11-14 20:05:35 +00:00
|
|
|
long tlx;
|
|
|
|
long tly;
|
|
|
|
long brx;
|
|
|
|
long bry;
|
2002-04-08 14:35:32 +00:00
|
|
|
|
|
|
|
/* in pixels */
|
|
|
|
int line_difference;
|
2007-11-17 16:19:53 +00:00
|
|
|
int rear_offset; /* in pixels of HW res */
|
2005-07-15 09:12:27 +00:00
|
|
|
|
|
|
|
/* interlaced duplex scan */
|
|
|
|
SANE_Bool interlaced_duplex;
|
2002-04-08 14:35:32 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
/* in dpi, likewise - different if software scaling required */
|
|
|
|
int hw_xres;
|
|
|
|
int hw_yres;
|
|
|
|
|
|
|
|
int hw_pixels_per_line;
|
|
|
|
int hw_bytes_per_line;
|
|
|
|
int hw_lines;
|
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
} Avision_Dimensions;
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
/* this contains our low-level info - not relevant for the SANE interface */
|
|
|
|
typedef struct Avision_Device
|
2000-03-05 13:57:25 +00:00
|
|
|
{
|
2000-11-14 20:05:35 +00:00
|
|
|
struct Avision_Device* next;
|
|
|
|
SANE_Device sane;
|
2005-07-15 09:12:27 +00:00
|
|
|
Avision_Connection connection;
|
2002-01-16 23:18:43 +00:00
|
|
|
|
|
|
|
/* structs used to store config options */
|
2000-11-14 20:05:35 +00:00
|
|
|
SANE_Range dpi_range;
|
|
|
|
SANE_Range x_range;
|
|
|
|
SANE_Range y_range;
|
|
|
|
SANE_Range speed_range;
|
2002-04-12 00:14:01 +00:00
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
asic_type inquiry_asic_type;
|
2002-01-16 23:18:43 +00:00
|
|
|
SANE_Bool inquiry_new_protocol;
|
2006-06-06 11:24:18 +00:00
|
|
|
|
|
|
|
SANE_Bool inquiry_nvram_read;
|
|
|
|
SANE_Bool inquiry_power_save_time;
|
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
SANE_Bool inquiry_light_box;
|
2002-11-23 16:17:07 +00:00
|
|
|
SANE_Bool inquiry_adf;
|
2005-07-15 09:12:27 +00:00
|
|
|
SANE_Bool inquiry_duplex;
|
|
|
|
SANE_Bool inquiry_duplex_interlaced;
|
2005-12-04 21:29:22 +00:00
|
|
|
SANE_Bool inquiry_paper_length;
|
2007-11-17 16:19:53 +00:00
|
|
|
SANE_Bool inquiry_batch_scan;
|
2002-08-30 09:21:51 +00:00
|
|
|
SANE_Bool inquiry_detect_accessories;
|
2002-01-16 23:18:43 +00:00
|
|
|
SANE_Bool inquiry_needs_calibration;
|
|
|
|
SANE_Bool inquiry_needs_gamma;
|
2005-12-04 21:29:22 +00:00
|
|
|
SANE_Bool inquiry_keeps_gamma;
|
|
|
|
SANE_Bool inquiry_keeps_window;
|
2002-11-23 16:17:07 +00:00
|
|
|
SANE_Bool inquiry_calibration;
|
|
|
|
SANE_Bool inquiry_3x3_matrix;
|
2002-01-16 23:18:43 +00:00
|
|
|
SANE_Bool inquiry_needs_software_colorpack;
|
2002-11-23 16:17:07 +00:00
|
|
|
SANE_Bool inquiry_needs_line_pack;
|
|
|
|
SANE_Bool inquiry_adf_need_mirror;
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
SANE_Bool inquiry_adf_bgr_order;
|
2002-11-23 16:17:07 +00:00
|
|
|
SANE_Bool inquiry_light_detect;
|
|
|
|
SANE_Bool inquiry_light_control;
|
2008-05-26 09:57:28 +00:00
|
|
|
SANE_Bool inquiry_exposure_control;
|
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
int inquiry_max_shading_target;
|
2007-11-17 16:19:53 +00:00
|
|
|
SANE_Bool inquiry_button_control;
|
|
|
|
unsigned int inquiry_buttons;
|
|
|
|
SANE_Bool inquiry_tune_scan_length;
|
|
|
|
SANE_Bool inquiry_background_raster;
|
|
|
|
int inquiry_background_raster_pixel;
|
2005-07-15 09:12:27 +00:00
|
|
|
|
|
|
|
enum {AV_FLATBED,
|
|
|
|
AV_FILM,
|
|
|
|
AV_SHEETFEED
|
|
|
|
} scanner_type;
|
2002-01-16 23:18:43 +00:00
|
|
|
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
/* the list of available color modes */
|
2005-07-15 09:12:27 +00:00
|
|
|
SANE_String_Const color_list[AV_COLOR_MODE_LAST + 1];
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
color_mode color_list_num[AV_COLOR_MODE_LAST];
|
2004-10-21 15:01:04 +00:00
|
|
|
color_mode color_list_default;
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
|
|
|
/* the list of available source modes */
|
2005-07-15 09:12:27 +00:00
|
|
|
SANE_String_Const source_list[AV_SOURCE_MODE_LAST + 1];
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
source_mode source_list_num[AV_SOURCE_MODE_LAST];
|
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
int inquiry_optical_res; /* in dpi */
|
|
|
|
int inquiry_max_res; /* in dpi */
|
2002-01-16 23:18:43 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
double inquiry_x_ranges [AV_SOURCE_MODE_DIM_LAST]; /* in mm */
|
|
|
|
double inquiry_y_ranges [AV_SOURCE_MODE_DIM_LAST]; /* in mm */
|
2002-01-16 23:18:43 +00:00
|
|
|
|
2002-08-30 09:21:51 +00:00
|
|
|
int inquiry_color_boundary;
|
2002-11-23 16:17:07 +00:00
|
|
|
int inquiry_gray_boundary;
|
2002-08-30 09:21:51 +00:00
|
|
|
int inquiry_dithered_boundary;
|
|
|
|
int inquiry_thresholded_boundary;
|
|
|
|
int inquiry_line_difference; /* software color pack */
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
|
|
|
int inquiry_channels_per_pixel;
|
|
|
|
int inquiry_bits_per_channel;
|
2007-11-17 16:19:53 +00:00
|
|
|
int inquiry_no_gray_modes;
|
2005-12-04 21:29:22 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
int scsi_buffer_size; /* nice to have SCSI buffer size */
|
2007-11-17 16:19:53 +00:00
|
|
|
int read_stripe_size; /* stripes to be read at-a-time */
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
2002-08-30 09:21:51 +00:00
|
|
|
/* film scanner atributes - maybe these should be in the scanner struct? */
|
2002-04-08 14:35:32 +00:00
|
|
|
SANE_Range frame_range;
|
|
|
|
SANE_Word current_frame;
|
|
|
|
SANE_Word holder_type;
|
2002-08-30 09:21:51 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
/* some versin corrections */
|
2007-11-17 16:19:53 +00:00
|
|
|
uint16_t data_dq; /* was ox0A0D - but hangs some new scanners */
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2002-04-12 00:14:01 +00:00
|
|
|
Avision_HWEntry* hw;
|
2000-03-05 13:57:25 +00:00
|
|
|
} Avision_Device;
|
|
|
|
|
2002-01-16 23:18:43 +00:00
|
|
|
/* all the state relevant for the SANE interface */
|
|
|
|
typedef struct Avision_Scanner
|
2000-03-05 13:57:25 +00:00
|
|
|
{
|
2002-04-12 00:14:01 +00:00
|
|
|
struct Avision_Scanner* next;
|
|
|
|
Avision_Device* hw;
|
2000-11-14 20:05:35 +00:00
|
|
|
|
|
|
|
SANE_Option_Descriptor opt [NUM_OPTIONS];
|
|
|
|
Option_Value val [NUM_OPTIONS];
|
|
|
|
SANE_Int gamma_table [4][256];
|
|
|
|
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
/* we now save the calib data because we might need it for 16bit software
|
|
|
|
calibration :-( */
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t* dark_avg_data;
|
|
|
|
uint8_t* white_avg_data;
|
|
|
|
|
|
|
|
/* background raster data, if duplex first front, then rear */
|
|
|
|
uint8_t* background_raster;
|
2002-08-30 09:21:51 +00:00
|
|
|
|
2000-11-14 20:05:35 +00:00
|
|
|
/* Parsed option values and variables that are valid only during
|
2002-04-08 14:35:32 +00:00
|
|
|
the actual scan: */
|
2007-11-17 16:19:53 +00:00
|
|
|
SANE_Bool prepared; /* first page marker */
|
2002-04-08 14:35:32 +00:00
|
|
|
SANE_Bool scanning; /* scan in progress */
|
2007-11-17 16:19:53 +00:00
|
|
|
unsigned int page; /* page counter, 0: uninitialized, 1: scanning 1st page, ... */
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2002-04-08 14:35:32 +00:00
|
|
|
SANE_Parameters params; /* scan window */
|
|
|
|
Avision_Dimensions avdimen; /* scan window - detailed internals */
|
2005-07-15 09:12:27 +00:00
|
|
|
|
|
|
|
/* Internal data for duplex scans */
|
|
|
|
char duplex_rear_fname [PATH_MAX];
|
|
|
|
SANE_Bool duplex_rear_valid;
|
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
color_mode c_mode;
|
2003-10-28 09:41:27 +00:00
|
|
|
source_mode source_mode;
|
2005-07-15 09:12:27 +00:00
|
|
|
source_mode_dim source_mode_dim;
|
2000-11-14 20:05:35 +00:00
|
|
|
|
2003-03-25 01:43:35 +00:00
|
|
|
/* Avision HW Access Connection (SCSI/USB abstraction) */
|
|
|
|
Avision_Connection av_con;
|
|
|
|
|
2008-05-15 12:50:25 +00:00
|
|
|
SANE_Pid reader_pid; /* process id of reader */
|
2006-06-06 11:24:18 +00:00
|
|
|
int read_fds; /* pipe reading end */
|
|
|
|
int write_fds; /* pipe writing end */
|
2000-11-14 20:05:35 +00:00
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
} Avision_Scanner;
|
|
|
|
|
|
|
|
/* Some Avision driver internal defines */
|
2003-02-16 17:35:05 +00:00
|
|
|
#define AV_WINID 0
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
/* Avision SCSI over USB error codes */
|
|
|
|
#define AVISION_USB_GOOD 0x00
|
|
|
|
#define AVISION_USB_REQUEST_SENSE 0x02
|
|
|
|
#define AVISION_USB_BUSY 0x08
|
2004-04-14 Rene Rebe <rene@rocklinux.org>
* backend/avision.h, backend/avision.c: the current development state,
including cleanups, code refactoring, dynamic color and scan source
list creation, implemented ADF mirroring needed for some ASICs ,
some scan window scaliing fixes for some ASICs, added 16bit gray
and color support, fixed a tiny big-endian issue, fixed command
error reporting for some ASICs, improved inquiry logging and some
tiny fixes for film-scanners.
Sorry for such a bit chunk so late in feature freeze (...). But tested on Ultra
SPARC, PowerPC and x86 Linux ... ;-)
2004-04-14 20:20:39 +00:00
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
/* SCSI commands that the Avision scanners understand: */
|
|
|
|
|
|
|
|
#define AVISION_SCSI_TEST_UNIT_READY 0x00
|
2003-03-25 01:43:35 +00:00
|
|
|
#define AVISION_SCSI_REQUEST_SENSE 0x03
|
2002-08-30 09:21:51 +00:00
|
|
|
#define AVISION_SCSI_MEDIA_CHECK 0x08
|
2002-01-19 00:38:07 +00:00
|
|
|
#define AVISION_SCSI_INQUIRY 0x12
|
2002-08-30 09:21:51 +00:00
|
|
|
#define AVISION_SCSI_MODE_SELECT 0x15
|
2003-02-16 17:35:05 +00:00
|
|
|
#define AVISION_SCSI_RESERVE_UNIT 0x16
|
|
|
|
#define AVISION_SCSI_RELEASE_UNIT 0x17
|
2002-01-19 00:38:07 +00:00
|
|
|
#define AVISION_SCSI_SCAN 0x1b
|
|
|
|
#define AVISION_SCSI_SET_WINDOW 0x24
|
2000-11-14 20:05:35 +00:00
|
|
|
#define AVISION_SCSI_READ 0x28
|
|
|
|
#define AVISION_SCSI_SEND 0x2a
|
2002-08-30 09:21:51 +00:00
|
|
|
#define AVISION_SCSI_OBJECT_POSITION 0x31
|
|
|
|
#define AVISION_SCSI_GET_DATA_STATUS 0x34
|
|
|
|
|
|
|
|
#define AVISION_SCSI_OP_REJECT_PAPER 0x00
|
|
|
|
#define AVISION_SCSI_OP_LOAD_PAPER 0x01
|
|
|
|
#define AVISION_SCSI_OP_GO_HOME 0x02
|
2002-11-23 16:17:07 +00:00
|
|
|
#define AVISION_SCSI_OP_TRANS_CALIB_GRAY 0x04
|
2002-08-30 09:21:51 +00:00
|
|
|
#define AVISION_SCSI_OP_TRANS_CALIB_COLOR 0x05
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2010-12-21 02:02:20 +00:00
|
|
|
/* These apply to bitset1. The values are 0 to 6, shifted 3 bits to the left */
|
|
|
|
#define AVISION_FILTER_NONE 0x00
|
|
|
|
#define AVISION_FILTER_RED 0x08
|
|
|
|
#define AVISION_FILTER_GREEN 0x10
|
|
|
|
#define AVISION_FILTER_BLUE 0x18
|
|
|
|
#define AVISION_FILTER_RGB 0x20
|
|
|
|
#define AVISION_FILTER_CMYK 0x28
|
|
|
|
#define AVISION_FILTER_GRAY 0x30
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
/* The SCSI structures that we have to send to an avision to get it to
|
2000-03-05 13:57:25 +00:00
|
|
|
do various stuff... */
|
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct command_header
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t opc;
|
|
|
|
uint8_t pad0 [3];
|
|
|
|
uint8_t len;
|
|
|
|
uint8_t pad1;
|
2002-11-23 16:17:07 +00:00
|
|
|
} command_header;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct command_set_window
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t opc;
|
|
|
|
uint8_t reserved0 [5];
|
|
|
|
uint8_t transferlen [3];
|
|
|
|
uint8_t control;
|
2002-11-23 16:17:07 +00:00
|
|
|
} command_set_window;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct command_read
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t opc;
|
|
|
|
uint8_t bitset1;
|
|
|
|
uint8_t datatypecode;
|
|
|
|
uint8_t readtype;
|
|
|
|
uint8_t datatypequal [2];
|
|
|
|
uint8_t transferlen [3];
|
|
|
|
uint8_t control;
|
2002-11-23 16:17:07 +00:00
|
|
|
} command_read;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct command_scan
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t opc;
|
|
|
|
uint8_t bitset0;
|
|
|
|
uint8_t reserved0 [2];
|
|
|
|
uint8_t transferlen;
|
|
|
|
uint8_t bitset1;
|
2002-11-23 16:17:07 +00:00
|
|
|
} command_scan;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct command_send
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t opc;
|
|
|
|
uint8_t bitset1;
|
|
|
|
uint8_t datatypecode;
|
|
|
|
uint8_t reserved0;
|
|
|
|
uint8_t datatypequal [2];
|
|
|
|
uint8_t transferlen [3];
|
|
|
|
uint8_t reserved1;
|
2002-11-23 16:17:07 +00:00
|
|
|
} command_send;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
typedef struct firmware_status
|
|
|
|
{
|
|
|
|
uint8_t download_firmware;
|
|
|
|
uint8_t first_effective_pixel_flatbed [2];
|
|
|
|
uint8_t first_effective_pixel_adf_front [2];
|
|
|
|
uint8_t first_effective_pixel_adf_rear [2];
|
|
|
|
uint8_t reserved;
|
|
|
|
} firmware_status;
|
|
|
|
|
2006-06-06 11:24:18 +00:00
|
|
|
typedef struct nvram_data
|
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t pad_scans [4];
|
|
|
|
uint8_t adf_simplex_scans [4];
|
|
|
|
uint8_t adf_duplex_scans [4];
|
|
|
|
uint8_t flatbed_scans [4];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t flatbed_leading_edge [2];
|
|
|
|
uint8_t flatbed_side_edge [2];
|
|
|
|
uint8_t adf_leading_edge [2];
|
|
|
|
uint8_t adf_side_edge [2];
|
|
|
|
uint8_t adf_rear_leading_edge [2];
|
|
|
|
uint8_t adf_rear_side_edge [2];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t born_month [2];
|
|
|
|
uint8_t born_day [2];
|
|
|
|
uint8_t born_year [2];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t first_scan_month [2];
|
|
|
|
uint8_t first_scan_day [2];
|
|
|
|
uint8_t first_scan_year [2];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t vertical_magnification [2];
|
|
|
|
uint8_t horizontal_magnification [2];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t ccd_type;
|
|
|
|
uint8_t scan_speed;
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
char serial [24];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t power_saving_time [2];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t auto_feed;
|
|
|
|
uint8_t roller_count [4];
|
|
|
|
uint8_t multifeed_count [4];
|
|
|
|
uint8_t jam_count [4];
|
|
|
|
|
|
|
|
uint8_t reserved;
|
|
|
|
char identify_info[16];
|
|
|
|
char formal_name[16];
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t reserved2 [10];
|
|
|
|
} nvram_data;
|
2006-06-06 11:24:18 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
typedef struct command_set_window_window
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2003-02-16 17:35:05 +00:00
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t reserved0 [6];
|
|
|
|
uint8_t desclen [2];
|
2003-02-16 17:35:05 +00:00
|
|
|
} header;
|
|
|
|
|
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t winid;
|
|
|
|
uint8_t reserved0;
|
|
|
|
uint8_t xres [2];
|
|
|
|
uint8_t yres [2];
|
|
|
|
uint8_t ulx [4];
|
|
|
|
uint8_t uly [4];
|
|
|
|
uint8_t width [4];
|
|
|
|
uint8_t length [4];
|
|
|
|
uint8_t brightness;
|
|
|
|
uint8_t threshold;
|
|
|
|
uint8_t contrast;
|
|
|
|
uint8_t image_comp;
|
|
|
|
uint8_t bpc;
|
|
|
|
uint8_t halftone [2];
|
|
|
|
uint8_t padding_and_bitset;
|
|
|
|
uint8_t bitordering [2];
|
|
|
|
uint8_t compr_type;
|
|
|
|
uint8_t compr_arg;
|
|
|
|
uint8_t paper_length[2];
|
|
|
|
uint8_t reserved1 [4];
|
2005-07-15 09:12:27 +00:00
|
|
|
|
2003-02-16 17:35:05 +00:00
|
|
|
/* Avision specific parameters */
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t vendor_specific;
|
|
|
|
uint8_t paralen; /* bytes following after this byte */
|
2003-02-16 17:35:05 +00:00
|
|
|
} descriptor;
|
|
|
|
|
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t bitset1;
|
|
|
|
uint8_t highlight;
|
|
|
|
uint8_t shadow;
|
|
|
|
uint8_t line_width [2];
|
|
|
|
uint8_t line_count [2];
|
2003-02-16 17:35:05 +00:00
|
|
|
|
2006-06-06 11:24:18 +00:00
|
|
|
/* the tail is quite version and model specific */
|
2003-02-16 17:35:05 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t bitset2;
|
|
|
|
uint8_t reserved;
|
2003-02-16 17:35:05 +00:00
|
|
|
} old;
|
|
|
|
|
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t bitset2;
|
|
|
|
uint8_t ir_exposure_time;
|
2003-02-16 17:35:05 +00:00
|
|
|
|
|
|
|
/* optional */
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t r_exposure_time [2];
|
|
|
|
uint8_t g_exposure_time [2];
|
|
|
|
uint8_t b_exposure_time [2];
|
2003-02-16 17:35:05 +00:00
|
|
|
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t bitset3; /* reserved in the v2 */
|
|
|
|
uint8_t auto_focus;
|
|
|
|
uint8_t line_width_msb;
|
|
|
|
uint8_t line_count_msb;
|
|
|
|
uint8_t background_lines;
|
2003-02-16 17:35:05 +00:00
|
|
|
} normal;
|
|
|
|
|
|
|
|
struct {
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t reserved0 [4];
|
|
|
|
uint8_t paper_size;
|
|
|
|
uint8_t paperx [4];
|
|
|
|
uint8_t papery [4];
|
|
|
|
uint8_t reserved1 [2];
|
2003-02-16 17:35:05 +00:00
|
|
|
} fujitsu;
|
|
|
|
} type;
|
|
|
|
} avision;
|
|
|
|
} command_set_window_window;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct page_header
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t pad0 [4];
|
|
|
|
uint8_t code;
|
|
|
|
uint8_t length;
|
2002-11-23 16:17:07 +00:00
|
|
|
} page_header;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct avision_page
|
2000-11-14 20:05:35 +00:00
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t gamma;
|
|
|
|
uint8_t thresh;
|
|
|
|
uint8_t masks;
|
|
|
|
uint8_t delay;
|
|
|
|
uint8_t features;
|
|
|
|
uint8_t pad0;
|
2002-11-23 16:17:07 +00:00
|
|
|
} avision_page;
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2002-11-23 16:17:07 +00:00
|
|
|
typedef struct calibration_format
|
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint16_t pixel_per_line;
|
|
|
|
uint8_t bytes_per_channel;
|
|
|
|
uint8_t lines;
|
|
|
|
uint8_t flags;
|
|
|
|
uint8_t ability1;
|
|
|
|
uint8_t r_gain;
|
|
|
|
uint8_t g_gain;
|
|
|
|
uint8_t b_gain;
|
|
|
|
uint16_t r_shading_target;
|
|
|
|
uint16_t g_shading_target;
|
|
|
|
uint16_t b_shading_target;
|
|
|
|
uint16_t r_dark_shading_target;
|
|
|
|
uint16_t g_dark_shading_target;
|
|
|
|
uint16_t b_dark_shading_target;
|
2002-11-23 16:17:07 +00:00
|
|
|
|
|
|
|
/* not returned but usefull in some places */
|
2007-11-17 16:19:53 +00:00
|
|
|
uint8_t channels;
|
2002-11-23 16:17:07 +00:00
|
|
|
} calibration_format;
|
|
|
|
|
2005-12-04 21:29:22 +00:00
|
|
|
typedef struct matrix_3x3
|
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint16_t v[9];
|
2005-12-04 21:29:22 +00:00
|
|
|
} matrix_3x3;
|
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
typedef struct acceleration_info
|
|
|
|
{
|
2007-11-17 16:19:53 +00:00
|
|
|
uint16_t total_steps;
|
|
|
|
uint16_t stable_steps;
|
|
|
|
uint32_t table_units;
|
|
|
|
uint32_t base_units;
|
|
|
|
uint16_t start_speed;
|
|
|
|
uint16_t target_speed;
|
|
|
|
uint8_t ability;
|
|
|
|
uint8_t table_count;
|
|
|
|
uint8_t reserved[6];
|
2005-07-15 09:12:27 +00:00
|
|
|
} acceleration_info;
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2003-10-28 09:41:27 +00:00
|
|
|
/* set/get SCSI highended (big-endian) variables. Declare them as an array
|
|
|
|
* of chars endianness-safe, int-size safe ... */
|
2000-03-05 13:57:25 +00:00
|
|
|
#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
|
2002-11-23 16:17:07 +00:00
|
|
|
var[1] = ((val) ) & 0xff
|
2000-03-05 13:57:25 +00:00
|
|
|
|
|
|
|
#define set_triple(var,val) var[0] = ((val) >> 16) & 0xff; \
|
|
|
|
var[1] = ((val) >> 8 ) & 0xff; \
|
2002-11-23 16:17:07 +00:00
|
|
|
var[2] = ((val) ) & 0xff
|
2000-03-05 13:57:25 +00:00
|
|
|
|
|
|
|
#define set_quad(var,val) var[0] = ((val) >> 24) & 0xff; \
|
|
|
|
var[1] = ((val) >> 16) & 0xff; \
|
|
|
|
var[2] = ((val) >> 8 ) & 0xff; \
|
2002-11-23 16:17:07 +00:00
|
|
|
var[3] = ((val) ) & 0xff
|
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
#define get_double(var) ((*var << 8) + *(var + 1))
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
#define get_triple(var) ((*var << 16) + \
|
2005-12-04 21:29:22 +00:00
|
|
|
(*(var + 1) << 8) + *(var + 2))
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2002-12-01 13:42:18 +00:00
|
|
|
#define get_quad(var) ((*var << 24) + \
|
|
|
|
(*(var + 1) << 16) + \
|
|
|
|
(*(var + 2) << 8) + *(var + 3))
|
2000-03-05 13:57:25 +00:00
|
|
|
|
2003-10-28 09:41:27 +00:00
|
|
|
/* set/get Avision lowended (little-endian) shading data */
|
|
|
|
#define set_double_le(var,val) var[0] = ((val) ) & 0xff; \
|
|
|
|
var[1] = ((val) >> 8) & 0xff
|
|
|
|
|
|
|
|
#define get_double_le(var) ((*(var + 1) << 8) + *var)
|
|
|
|
|
2003-11-23 23:35:53 +00:00
|
|
|
#define BIT(n, p) ((n & (1 << p)) ? 1 : 0)
|
2002-01-16 23:18:43 +00:00
|
|
|
|
2003-03-25 01:43:35 +00:00
|
|
|
#define SET_BIT(n, p) (n |= (1 << p))
|
2005-07-15 09:12:27 +00:00
|
|
|
#define CLEAR_BIT(n, p) (n &= ~(1 << p))
|
2002-11-23 16:17:07 +00:00
|
|
|
|
2002-04-08 14:35:32 +00:00
|
|
|
/* These should be in saneopts.h */
|
|
|
|
#define SANE_NAME_FRAME "frame"
|
|
|
|
#define SANE_TITLE_FRAME SANE_I18N("Number of the frame to scan")
|
|
|
|
#define SANE_DESC_FRAME SANE_I18N("Selects the number of the frame to scan")
|
|
|
|
|
2005-07-15 09:12:27 +00:00
|
|
|
#define SANE_NAME_DUPLEX "duplex"
|
|
|
|
#define SANE_TITLE_DUPLEX SANE_I18N("Duplex scan")
|
|
|
|
#define SANE_DESC_DUPLEX SANE_I18N("Duplex scan provide a scan of the front and back side of the document")
|
|
|
|
|
|
|
|
#ifdef AVISION_ENHANCED_SANE
|
|
|
|
#warning "Compiled Avision backend will violate the SANE standard"
|
|
|
|
/* Some Avision SANE extensions */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SANE_STATUS_LAMP_WARMING = SANE_STATUS_ACCESS_DENIED + 1 /* lamp is warming up */
|
|
|
|
}
|
|
|
|
SANE_Avision_Status;
|
|
|
|
|
|
|
|
/* public API extension */
|
|
|
|
|
|
|
|
extern SANE_Status ENTRY(media_check) (SANE_Handle handle);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
#endif /* avision_h */
|