Merged the Avision 0.3.0 backend (incl. genreal cleanups, USB handling ...)

also updated the homepage url and the man-page.
DEVEL_2_0_BRANCH-1
Rene Rebe 2002-01-16 23:18:43 +00:00
rodzic 8ae2a40c07
commit a4101b2fe5
4 zmienionych plików z 771 dodań i 191 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -6,29 +6,28 @@
; ;
; ":backend" *must* be specified. ; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?). ; All other information is optional (but what good is the file without it?).
;
:backend "avision" ; name of backend :backend "avision" ; name of backend
:version "0.2.1" ; version of backend :version "0.3.0" ; version of backend
:status :beta ; :alpha, :beta, :stable, :new :status :beta ; :alpha, :beta, :stable, :new
:url "http://www.rene.rebe.myokay.net/avision/index.html" ; backend's web page :url "http://drocklinux.dyndns.org/rene/avision/index.html" ; backend's web page
;
; Sorry, no manpage yet. Anybody want to write one?
:manpage "sane-avision" ; name of manpage (if it exists) :manpage "sane-avision" ; name of manpage (if it exists)
:devicetype :scanner :devicetype :scanner
:mfg "Avision" ; name a manufacturer :mfg "Avision" ; name a manufacturer
:url "http://www.avision.com/" :url "http://www.avision.com/"
:model "AV 6240" ; name models for above-specified mfg. :model "AV 6240" ; name models for above-specified mfg.
:interface "SCSI" :interface "SCSI"
:comment "1 pass, ??? DPI" :comment "1 pass, ??? DPI"
:model "AV 630 CS" ; name models for above-specified mfg. :model "AV 630 CS"
:interface "SCSI" :interface "SCSI"
:comment "1 pass, 1200*600 DPI" ; :comment "1 pass, 1200*600 DPI"
:model "AV 620 CS" ; name models for above-specified mfg. :model "AV 620 CS"
:interface "SCSI" :interface "SCSI"
:comment "1 pass, 1200*600 DPI" :comment "1 pass, 1200*600 DPI"

Wyświetl plik

@ -3,8 +3,6 @@
avision.h avision.h
This file (C) 1999, 2000 Meino Christian Cramer and Rene Rebe
This file is part of the SANE package. This file is part of the SANE package.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -41,22 +39,36 @@
***************************************************************************** *****************************************************************************
This file implements a SANE backend for the Avision AV 630CS (and other ...) This backend is based upon the Tamarack backend and adapted to the Avision
scanner with SCSI-2 command set. scanners by René Rebe and Meino Cramer.
(feedback to: mccramer@s.netic.de and rene.rebe@myokay.net) Copyright 1999, 2000, 2001, 2002 by
"René Rebe" <rene.rebe@gmx.net>
"Meino Christian Cramer" <mccramer@s.netic.de>
"Martin Jelínek" <mates@sirrah.troja.mff.cuni.cz>
Additional Contributers:
"Gunter Wagner"
(some fixes and the transparency option)
Very much thanks to: Very much thanks to:
Avision INC for the documentation we got! ;-) Avision INC for the documentation we got! ;-)
Gunter Wagner for some fixes and the transparency option.
Check the avision.c file for a ChangeLog ...
*****************************************************************************/
********************************************************************************/
#ifndef avision_h #ifndef avision_h
#define avision_h #define avision_h
#include <sys/types.h> #include <sys/types.h>
typedef struct Avision_HWEntry {
char* mfg;
char* model;
SANE_Bool usb;
} Avision_HWEntry;
enum Avision_Option enum Avision_Option
{ {
OPT_NUM_OPTS = 0, /* must come first */ OPT_NUM_OPTS = 0, /* must come first */
@ -92,15 +104,14 @@ enum Avision_Option
NUM_OPTIONS /* must come last */ NUM_OPTIONS /* must come last */
}; };
typedef union Option_Value
typedef union
{ {
SANE_Word w; SANE_Word w;
SANE_Word *wa; /* word array */ SANE_Word *wa; /* word array */
SANE_String s; SANE_String s;
} Option_Value; } Option_Value;
typedef struct typedef struct Avision_Dimensions
{ {
long tlx; long tlx;
long tly; long tly;
@ -115,42 +126,70 @@ typedef struct
int res; int res;
} Avision_Dimensions; } Avision_Dimensions;
typedef struct /* this contains our low-level info - not relevant for the SANE interface */
typedef struct Avision_Device
{ {
struct Avision_Device* next; struct Avision_Device* next;
SANE_Device sane; SANE_Device sane;
/* structs used to store config options */
SANE_Range dpi_range; SANE_Range dpi_range;
SANE_Range x_range; SANE_Range x_range;
SANE_Range y_range; SANE_Range y_range;
SANE_Range speed_range; SANE_Range speed_range;
unsigned flags;
SANE_Bool is_usb;
SANE_Bool inquiry_new_protocol;
SANE_Bool inquiry_needs_calibration;
SANE_Bool inquiry_needs_gamma;
SANE_Bool inquiry_needs_software_colorpack;
int inquiry_grey_res; /* in dpi */
int inquiry_color_res; /* in dpi */
double inquiry_x_range; /* in mm */
double inquiry_y_range; /* in mm */
double inquiry_adf_x_range; /* in mm */
double inquiry_adf_y_range; /* in mm */
double inquiry_transp_x_range; /* in mm */
double inquiry_transp_y_range; /* in mm */
int inquiry_color_boundary;
int inquiry_grey_boundary;
int inquiry_line_difference; /* software color pack */
int inquiry_bits_per_channel;
} Avision_Device; } Avision_Device;
typedef struct /* all the state relevant for the SANE interface */
typedef struct Avision_Scanner
{ {
/* all the state needed to define a scan request: */
struct Avision_Scanner *next; struct Avision_Scanner *next;
Avision_Device *hw;
SANE_Option_Descriptor opt [NUM_OPTIONS]; SANE_Option_Descriptor opt [NUM_OPTIONS];
Option_Value val [NUM_OPTIONS]; Option_Value val [NUM_OPTIONS];
SANE_Int gamma_table [4][256]; SANE_Int gamma_table [4][256];
int scanning; SANE_Bool scanning; /* scan in progress */
int pass; /* pass number */ /*int pass;*/ /* pass number */
int line; /* current line number */ int line; /* current line number */
SANE_Parameters params; SANE_Parameters params;
/* Parsed option values and variables that are valid only during /* Parsed option values and variables that are valid only during
actual scanning: */ actual scanning: */
int mode; int mode;
Avision_Dimensions avdimen; /* Used for internal calculationg */ Avision_Dimensions avdimen; /* Used for internal calculationg */
int fd; /* SCSI filedescriptor */ int fd; /* SCSI filedescriptor */
pid_t reader_pid; /* process id of reader */ pid_t reader_pid; /* process id of reader */
int pipe; /* pipe to reader process */ int pipe; /* pipe to reader process */
/* scanner dependent/low-level state: */
Avision_Device *hw;
} Avision_Scanner; } Avision_Scanner;
#define AV_ADF_ON 0x80 #define AV_ADF_ON 0x80
@ -286,9 +325,9 @@ struct command_read
unsigned char opc; unsigned char opc;
unsigned char bitset1; unsigned char bitset1;
unsigned char datatypecode; unsigned char datatypecode;
unsigned char calibchn; unsigned char calibchn;
unsigned char datatypequal [2]; unsigned char datatypequal [2];
unsigned char transferlen [3]; unsigned char transferlen [3];
unsigned char control; unsigned char control;
}; };
@ -307,11 +346,10 @@ struct command_send
unsigned char datatypecode; unsigned char datatypecode;
unsigned char reserved0; unsigned char reserved0;
unsigned char datatypequal [2]; unsigned char datatypequal [2];
unsigned char transferlen [3]; unsigned char transferlen [3];
unsigned char reserved1; unsigned char reserved1;
}; };
struct command_set_window_window_header struct command_set_window_window_header
{ {
unsigned char reserved0 [6]; unsigned char reserved0 [6];
@ -372,7 +410,6 @@ struct avision_page
char pad0; char pad0;
}; };
/* set SCSI highended variables. Declare them as an array of chars */ /* set SCSI highended variables. Declare them as an array of chars */
/* endianness-safe, int-size safe... */ /* endianness-safe, int-size safe... */
#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \ #define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
@ -387,4 +424,6 @@ struct avision_page
var[2] = ((val) >> 8 ) & 0xff; \ var[2] = ((val) >> 8 ) & 0xff; \
var[3] = ((val) ) & 0xff; var[3] = ((val) ) & 0xff;
#define BIT(n, p) ((n & ( 1 << p))?1:0)
#endif /* avision_h */ #endif /* avision_h */

Wyświetl plik

@ -1,12 +1,51 @@
.TH sane-avision 5 "24 Jun 2000" .TH sane-avision 5 "10 Dec 2001"
.IX sane-avision .IX sane-avision
.SH NAME .SH NAME
sane-avision - SANE backend for Avision AV 630 CS flatbed scanners sane-avision - SANE backend for Avision (and OEM HP, Minolta) flatbed scanners
.SH ABOUT THIS FILE
This file only is a short descripton of the avision-backend for sane!
.SH DESCRIPTION .SH DESCRIPTION
The The
.B sane-avision .B sane-avision
library implements a SANE (Scanner Access Now Easy) backend that library implements a SANE (Scanner Access Now Easy) backend that
provides access to Avision AV 630 CS flatbed scanners. provides access to Avision flatbed scanners and the Avision
OEM scanners labelled with HP and Minolta.
.SH CONFIGURATION
The configuration file for this backend resides in
@CONFIGDIR@/avision.conf.
Its contents is a list of device names that correspond to Avision and Avision
compatible scanners. Empty lines and lines starting with a hash mark (#) are
ignored. A sample configuration file is shown below:
.B I suggest you hold one hand on the power-button of the scanner while you try
the first scans!
#scsi Vendor Model Type Bus Channel ID LUN
scsi AVISION
/dev/scanner
# this is a comment
#
option force-a4
option allow-usb
- force-a4:
forces the backend to overwrite the scanable area
returned by the scanner. This might be needed for
the AV 630 which returns no area - or newer scanners
which retuns the area in a unkown format our backend
doesn't recongize yet.
- allow-usb:
tells the backend to use USB scanner - which do not
work correctly yet.
.SH "DEVICE NAMES" .SH "DEVICE NAMES"
This backend expects device names of the form: This backend expects device names of the form:
@ -41,6 +80,7 @@ The static library implementing this backend.
.I @LIBDIR@/libsane-avision.so .I @LIBDIR@/libsane-avision.so
The shared library implementing this backend (present on systems that The shared library implementing this backend (present on systems that
support dynamic loading). support dynamic loading).
.SH ENVIRONMENT .SH ENVIRONMENT
.TP .TP
.B SANE_CONFIG_DIR .B SANE_CONFIG_DIR
@ -68,6 +108,7 @@ export SANE_DEBUG_AVISION=4
.SH "SEE ALSO" .SH "SEE ALSO"
sane(7), sane\-scsi(5) sane(7), sane\-scsi(5)
.br .br
http://www.rene.rebe.myokay.net/avision/index.html http://drocklinux.dyndns.org/rene/avision/index.html
.SH AUTHOR .SH AUTHOR
Meino Christian Cramer, Rene Rebe René Rebe, Meino Christian Cramer and Martin Jelínek