Added lexmark backend (from Fred Odendaal <freshshelf@rogers.com>).

merge-requests/1/head
Henning Geinitz 2005-10-16 17:15:37 +00:00
rodzic 6714d97cee
commit affb104893
13 zmienionych plików z 4160 dodań i 4 usunięć

Wyświetl plik

@ -43,6 +43,7 @@ Backends:
hp5400: Martijn van Oosterhout, Thomas Soumarmon (*)
ibm: M.F., Henning Meier-Geinitz (*)
leo: Frank Zago (*)
lexmark: Fred Odendaal
ma1509: Henning Meier-Geinitz (*)
matsushita: Frank Zago (*)
microtek: Matthew Marjanovic (*)
@ -142,6 +143,7 @@ Eugene S. Weiss <yossarian@users.sourceforge.net>
Feico W. Dillema <dillema@acm.org>
Franck Schneider <schnefra@hol.fr>
Frank Zago <sane at zago dot net>
Fred Odendaal <freshshelf at rogers dot com>
Frederik Ramm <frederik@remote.org>
Gerard Klaver <gerard at gkall dot hobby dot nl>
Gerhard Jaeger <gerhard@gjaeger.de>

Wyświetl plik

@ -21,6 +21,11 @@
doc/mustek_usb2/mustek_usb2.CHANGES:
Removed typedefs for DWORD, WORD and so on. Used int, unsigned
short, ... directly in the code.
* AUTHORS configure configure.in backend/Makefile.in
backend/dll.conf backend/lexmark-x1100.c backend/lexmark.c
backend/lexmark.conf backend/lexmark.h doc/Makefile.in
doc/sane-lexmark.man tools/hotplug/libsane.usermap: Added lexmark
backend (from Fred Odendaal <freshshelf@rogers.com>).
2005-10-15 Jochen Eisinger <jochen@penguin-breeder.org>

Wyświetl plik

@ -116,6 +116,7 @@ DISTFILES = abaton.c abaton.conf abaton.h agfafocus.c agfafocus.conf \
hp5400_sane.c hp5400_sanei.c hp5400_sanei.h \
ibm.c ibm.conf ibm.h ibm-scsi.c \
leo.c leo.h leo.conf \
lexmark.c lexmark-x1100.c lexmark.h lexmark.conf \
lm9830.h \
ma1509.c ma1509.conf ma1509.h \
Makefile.in matsushita.c \
@ -287,6 +288,7 @@ EXTRA_genesys = genesys_gl646 genesys_gl841
EXTRA_hp = hp-accessor hp-device hp-handle hp-hpmem hp-option hp-scl
EXTRA_umax_pp = umax_pp_low umax_pp_mid
EXTRA_epson = epson_scsi epson_usb
EXTRA_lexmark = lexmark-x1100
# When preloading dll, we need to add in all preloaded objects:
libsane-dll.la: $(addsuffix .lo,$(DLL_PRELOAD))
@ -375,6 +377,9 @@ libsane-ibm.la: ../sanei/sanei_constrain_value.lo
libsane-leo.la: ../sanei/sanei_config2.lo
libsane-leo.la: ../sanei/sanei_constrain_value.lo
libsane-leo.la: ../sanei/sanei_scsi.lo
libsane-lexmark.la: $(addsuffix .lo,$(EXTRA_lexmark))
libsane-lexmark.la: ../sanei/sanei_constrain_value.lo
libsane-lexmark.la: ../sanei/sanei_usb.lo
libsane-ma1509.la: ../sanei/sanei_constrain_value.lo
libsane-ma1509.la: ../sanei/sanei_usb.lo
libsane-matsushita.la: ../sanei/sanei_config2.lo

Wyświetl plik

@ -28,6 +28,7 @@ hp4200
hp5400
ibm
leo
lexmark
ma1509
matsushita
microtek

Plik diff jest za duży Load Diff

1006
backend/lexmark.c 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,2 @@
#usb /dev/usb/scanner0
usb 0x043d 0x007c

166
backend/lexmark.h 100644
Wyświetl plik

@ -0,0 +1,166 @@
/**************************************************************************
lexmark.h - SANE library for Lexmark scanners.
Copyright (C) 2003-2004 Lexmark International, Inc. (original source)
Copyright (C) 2005 Fred Odendaal
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.
**************************************************************************/
#ifndef LEXMARK_H
#define LEXMARK_H
/* Force the backend name for all files using this include */
#ifdef BACKEND_NAME
#undef BACKEND_NAME
#define BACKEND_NAME lexmark
#endif
#define DEBUG_NOT_STATIC
#define SANE_NAME_PAPER_SIZE "paper-size"
#define SANE_TITLE_PAPER_SIZE SANE_I18N("Paper size")
#define SANE_DESC_PAPER_SIZE \
SANE_I18N("Selects the size of the area to be scanned.");
typedef enum
{
OPT_NUM_OPTS = 0,
OPT_MODE,
OPT_X_DPI,
OPT_Y_DPI,
OPT_PREVIEW,
OPT_SCAN_SIZE,
/* must come last: */
NUM_OPTIONS
}
Lexmark_Options;
typedef enum
{
RED = 0,
GREEN,
BLUE
}
Scan_Regions;
/** @name Option_Value union
* convenience union to access option values given to the backend
* @{
*/
#ifndef SANE_OPTION
#define SANE_OPTION 1
typedef union
{
SANE_Bool b;
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
#endif
/* @} */
typedef struct Read_Buffer
{
SANE_Int gray_offset;
SANE_Int max_gray_offset;
SANE_Int region;
SANE_Int red_offset;
SANE_Int green_offset;
SANE_Int blue_offset;
SANE_Int max_red_offset;
SANE_Int max_green_offset;
SANE_Int max_blue_offset;
SANE_Byte *data;
SANE_Byte *readptr;
SANE_Byte *writeptr;
SANE_Byte *max_writeptr;
size_t size;
size_t linesize;
SANE_Bool empty;
SANE_Int image_line_no;
}
Read_Buffer;
typedef struct Lexmark_Device
{
struct Lexmark_Device *next;
SANE_Device sane;
SANE_Option_Descriptor opt[NUM_OPTIONS];
Option_Value val[NUM_OPTIONS];
SANE_Parameters params;
SANE_Int devnum;
long data_size;
SANE_Int pixel_height;
SANE_Int pixel_width;
SANE_Bool initialized;
SANE_Bool eof;
SANE_Int x_dpi;
SANE_Int y_dpi;
long data_ctr;
SANE_Bool device_cancelled;
SANE_Int cancel_ctr;
SANE_Byte *transfer_buffer;
size_t bytes_remaining;
size_t bytes_in_buffer;
SANE_Byte *read_pointer;
Read_Buffer *read_buffer;
}
Lexmark_Device;
/* Maximum transfer size */
#define MAX_XFER_SIZE 0xFFC0
/* Non-static Function Proto-types (called by lexmark.c) */
SANE_Status sanei_lexmark_x1100_init (void);
void sanei_lexmark_x1100_destroy (Lexmark_Device * dev);
SANE_Status sanei_lexmark_x1100_open_device (SANE_String_Const devname,
SANE_Int * devnum);
void sanei_lexmark_x1100_close_device (SANE_Int devnum);
SANE_Bool sanei_lexmark_x1100_search_home_fwd (Lexmark_Device * dev);
void sanei_lexmark_x1100_move_fwd (SANE_Int distance, Lexmark_Device * dev);
SANE_Bool sanei_lexmark_x1100_search_home_bwd (Lexmark_Device * dev);
SANE_Int sanei_lexmark_x1100_find_start_line (SANE_Int devnum);
SANE_Status sanei_lexmark_x1100_set_scan_regs (Lexmark_Device * dev,
SANE_Int offset);
SANE_Status sanei_lexmark_x1100_start_scan (Lexmark_Device * dev);
long sanei_lexmark_x1100_read_scan_data (SANE_Byte * data, SANE_Int size,
Lexmark_Device * dev);
#endif /* LEXMARK_H */

2
configure vendored
Wyświetl plik

@ -26415,7 +26415,7 @@ echo "$as_me: Manually selected backends: ${BACKENDS}" >&6;}
else
BACKENDS="abaton agfafocus apple artec as6e avision bh canon \
canon630u coolscan coolscan2 dc25 dmc \
epson fujitsu genesys gt68xx hp leo matsushita microtek \
epson fujitsu genesys gt68xx hp leo lexmark matsushita microtek \
microtek2 mustek mustek_usb nec pie plustek \
plustek_pp ricoh s9036 sceptre sharp \
sp15c st400 tamarack test teco1 teco2 teco3 umax umax_pp umax1220u \

Wyświetl plik

@ -330,7 +330,7 @@ else
else
BACKENDS="abaton agfafocus apple artec as6e avision bh canon \
canon630u coolscan coolscan2 dc25 dmc \
epson fujitsu genesys gt68xx hp leo matsushita microtek \
epson fujitsu genesys gt68xx hp leo lexmark matsushita microtek \
microtek2 mustek mustek_usb nec pie plustek \
plustek_pp ricoh s9036 sceptre sharp \
sp15c st400 tamarack test teco1 teco2 teco3 umax umax_pp umax1220u \

Wyświetl plik

@ -40,7 +40,7 @@ DISTCLEAN_FILES = @DISTCLEAN_FILES@
SECT1 = scanimage.1 sane-config.1 sane-find-scanner.1 gamma4scanimage.1
SECT5 = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-as6e.5 sane-dll.5 \
sane-dc25.5 sane-dmc.5 sane-epson.5 sane-hp.5 sane-gphoto2.5 \
sane-leo.5 sane-matsushita.5 sane-microtek.5 \
sane-leo.5 sane-lexmark.5 sane-matsushita.5 sane-microtek.5 \
sane-microtek2.5 sane-mustek.5 sane-nec.5 sane-net.5 sane-pie.5 \
sane-pint.5 sane-pnm.5 sane-umax.5 sane-qcam.5 sane-scsi.5 \
sane-artec.5 sane-fujitsu.5 sane-sharp.5 sane-s9036.5 \
@ -94,7 +94,7 @@ DISTFILES = Makefile.in backend-writing.txt descriptions.txt \
sane-dc25.man sane-dll.man sane-dmc.man sane-epson.man \
sane-find-scanner.man sane-fujitsu.man sane-gphoto2.man sane-hp.man \
sane-logo.png sane-logo2.jpg sane-matsushita.man sane-microtek.man \
sane-leo.man sane-microtek2.man \
sane-leo.man sane-lexmark.man sane-microtek2.man \
sane-mustek.man sane-mustek_pp.man sane-mustek_usb.man sane-nec.man \
sane-net.man sane-pie.man sane-pint.man sane-plustek.man \
sane-pnm.man sane-qcam.man sane-ricoh.man sane-s9036.man \

Wyświetl plik

@ -0,0 +1,153 @@
.TH sane-lexmark 5 "02 September 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane-lexmark
.SH NAME
sane-lexmark \- SANE backend for Lexmark X1100 Series scanners
.SH DESCRIPTION
The
.B sane-lexmark
library implements a SANE (Scanner Access Now Easy) backend that
provides access to the scanner part of Lexmark X1100 AIOs. This backend
should be considered
.B beta-quality
software!
.PP
The scanners that should work with this backend are:
.PP
.RS
.ft CR
.nf
Vendor Model status
---------------------- -----------
Lexmark X1110 untested
Lexmark X1140 untested
Lexmark X1150 untested
Lexmark X1170 untested
Lexmark X1180 basic
Lexmark X1185 basic
.fi
.ft R
.RE
The options the backend supports can either be selected through
command line options to programs like scanimage or through GUI
elements in xscanimage or xsane.
.br
If you have any strange behavior, please report to the backend
maintainer or to the SANE mailing list.
Valid command line options and their syntax can be listed by using
.RS
scanimage --help -d lexmark:usb:<usb port>
.RE
.TP
.B Scan Mode
.TP
.B --mode
selects the basic mode of operation of the scanner valid choices are
.I Lineart
,
.I Gray
and
.I Color
The Lineart mode is black and white only (1 bit). Grayscale
will produce 256 levels of gray (8 bits). Color will produce a 24 bit
color image.
.TP
.B --resolution
selects the horizontal resolution for a scan.
.TP
.B --y-resolution
selects the vertical resolution for a scan.
The scanner is capable of the following resolutions:
.PP
.RS
.ft CR
.nf
Horizontal Resolution Vertical Resolution
---------------------- --------------------
75dpi 75dpi
150dpi 150dpi
300dpi 300dpi
600dpi 600dpi
600dpi 1200dpi
.fi
.ft R
.RE
.TP
.B --preview
requests a preview scan. The resolution used for that scan is 75 dpi
and the scan area is the default or user selected as is the scan mode. The default is "no".
.TP
.B paper-size
Selects the size of the area to be scanned. Valid sizes are
.I Wallet
,
.I 3x5
,
.I 4x6
,
.I 5x7
,
.I 8x10
,
.I Letter
, the default size is 3x5.
.SH CONFIGURATION FILE
The configuration file @CONFIGDIR@/lexmark.conf contains only the usb device id (eg usb 0x043d 0x007c).
.SH FILES
.TP
.I @LIBDIR@/libsane-lexmark.a
The static library implementing this backend.
.TP
.I @LIBDIR@/libsane-lexmark.so
The shared library implementing this backend (present on systems that
support dynamic loading).
.SH ENVIRONMENT
.TP
.B SANE_DEBUG_LEXMARK
If the library was compiled with debug support enabled, this
environment variable controls the debug level for this backend. E.g.,
a value of 128 requests all debug output to be printed. Smaller levels
reduce verbosity.
.SH LIMITATIONS
The windows TWAIN driver has many more options than this SANE
backend. However they are only software adjustments. This backend only
implements what the scanner can support.
.SH BUGS
Byte ordering for color scans.
Jerky movement on 600dpi gray 8x10 scan.
Lineart not working.
Color calibration not implemented.
Dark compensation not implemented.
.SH "SEE ALSO"
sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7)
.SH AUTHOR
.TP
The package is actively maintained by Fred Odendaal.
.I http://ca.geocities.com/freshshelf@rogers.com/

Wyświetl plik

@ -73,6 +73,8 @@ libusbscanner 0x0003 0x0400 0x1001 0x0000 0x0000
libusbscanner 0x0003 0x043d 0x002d 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Lexmark|X83
libusbscanner 0x0003 0x043d 0x003d 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Lexmark|X1185
libusbscanner 0x0003 0x043d 0x007c 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Genius|ColorPage-Vivid Pro Scanner
libusbscanner 0x0003 0x0458 0x2001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Genius|ColorPage HR6 V2