* backend/fujitsu.[ch], backend/fujitsu-scsi.h: backend v68,

- add halftone type and pattern options
 - support M3097G with IPC and CMP options via modified VPD response
* doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: backend v68,
 - manpage cleanup
merge-requests/1/head
m. allan noah 2008-07-02 20:43:49 +00:00
rodzic da1587f897
commit 40e5aaa7fe
5 zmienionych plików z 167 dodań i 124 usunięć

Wyświetl plik

@ -765,8 +765,14 @@ static scsiblk hw_statusB = { hw_statusC, sizeof (hw_statusC) };
* pattern number, three builtin and five downloadable * pattern number, three builtin and five downloadable
* supported; higher numbers = error. * supported; higher numbers = error.
*/ */
#define set_WD_halftone(sb, val) putnbyte(sb + 0x1b, val, 2) #define set_WD_ht_type(sb, val) sb[0x1b] = val
#define get_WD_halftone(sb) getnbyte(sb + 0x1b, 2) #define get_WD_ht_type(sb) sb[0x1b]
#define WD_ht_type_DEFAULT 0
#define WD_ht_type_DITHER 1
#define WD_ht_type_DIFFUSION 2
#define set_WD_ht_pattern(sb, val) sb[0x1c] = val
#define get_WD_ht_pattern(sb) sb[0x1c]
/* 0x1d - Reverse image, padding type /* 0x1d - Reverse image, padding type
* 3091: bit 7=1: reverse black&white * 3091: bit 7=1: reverse black&white

Wyświetl plik

@ -342,9 +342,12 @@
- simplify sane_start() and fix interlaced duplex jpeg support - simplify sane_start() and fix interlaced duplex jpeg support
- simplify sane_read() and add non-interlaced duplex jpeg support - simplify sane_read() and add non-interlaced duplex jpeg support
- removed unused code - removed unused code
v67 2008-06-30, MAN v67 2008-07-01, MAN
- add IPC/DTC/SDTC options - add IPC/DTC/SDTC options
- call check_for_cancel() in sane_cancel, unless s->reader flag is set - call check_for_cancel() in sane_cancel, unless s->reader flag is set
v68 2008-07-02, MAN
- add halftone type and pattern options
- support M3097G with IPC and CMP options via modified VPD response
SANE FLOW DIAGRAM SANE FLOW DIAGRAM
@ -405,7 +408,7 @@
#include "fujitsu.h" #include "fujitsu.h"
#define DEBUG 1 #define DEBUG 1
#define BUILD 67 #define BUILD 68
/* values for SANE_DEBUG_FUJITSU env var: /* values for SANE_DEBUG_FUJITSU env var:
- errors 5 - errors 5
@ -434,7 +437,9 @@ static const char string_Off[] = "Off";
static const char string_DTC[] = "DTC"; static const char string_DTC[] = "DTC";
static const char string_SDTC[] = "SDTC"; static const char string_SDTC[] = "SDTC";
static const char string_Disable[] = "Disable";
static const char string_Dither[] = "Dither";
static const char string_Diffusion[] = "Diffusion";
static const char string_Red[] = "Red"; static const char string_Red[] = "Red";
static const char string_Green[] = "Green"; static const char string_Green[] = "Green";
@ -1017,22 +1022,46 @@ init_vpd (struct fujitsu *s)
set_IN_page_length(buffer,0x5f); set_IN_page_length(buffer,0x5f);
} }
/* some versions of 3097 have short vpd, fill in missing part */ /* M3097G has short vpd, fill in missing part */
/* FIXME: do we need another block for devices with IPC? */
else if (strstr (s->model_name, "M3097G") else if (strstr (s->model_name, "M3097G")
&& (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) && (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF)
&& get_IN_page_length (buffer) == 0x19){ && get_IN_page_length (buffer) == 0x19){
unsigned char vpd3097g[] = { unsigned char vpd3097g[] = {
0, 0, 0, 0,
0xc2, 0x08, 0, 0, 0, 0, 0, 0, 0xed, 0xbf, 0, 1, 0, 0, 0, 0, 0xc2, 0x08, 0, 0, 0, 0, 0, 0, 0xed, 0xbf, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0xff, 0xff, 0xff, 0, 0x45, 0x35, 0x40, 0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0x45, 0x35, 0, 0xe0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0 0, 0, 0, 0
}; };
DBG (5, "init_vpd: M3097G repair\n"); DBG (5, "init_vpd: M3097G repair\n");
set_IN_page_length(buffer,0x5f); set_IN_page_length(buffer,0x5f);
memcpy(buffer+0x19+5,vpd3097g,sizeof(vpd3097g)); memcpy(buffer+0x1e,vpd3097g,sizeof(vpd3097g));
/*IPC*/
if(strstr (s->model_name, "i")){
DBG (5, "init_vpd: M3097G IPC repair\n");
/*subwin cmd*/
buffer[0x2b] = 1;
/*rif/dtc/sdtc/outline/emph/sep/mirr/wlf*/
buffer[0x58] = 0xff;
/*subwin/diffusion*/
buffer[0x59] = 0xc0;
}
/*CMP*/
if(strstr (s->model_name, "m")){
DBG (5, "init_vpd: M3097G CMP repair\n");
/*4megs*/
buffer[0x23] = 0x40;
/*mh/mr/mmr*/
buffer[0x5a] = 0xe0;
}
} }
DBG (15, "init_vpd: length=%0x\n",get_IN_page_length (buffer)); DBG (15, "init_vpd: length=%0x\n",get_IN_page_length (buffer));
@ -2519,6 +2548,48 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
opt->cap = SANE_CAP_INACTIVE; opt->cap = SANE_CAP_INACTIVE;
} }
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]=NULL;
opt->name = "ht-type";
opt->title = "Halftone type";
opt->desc = "Control type of halftone filter";
opt->type = SANE_TYPE_STRING;
opt->unit = SANE_UNIT_NONE;
opt->constraint_type = SANE_CONSTRAINT_STRING_LIST;
opt->constraint.string_list = s->ht_type_list;
opt->size = maxStringSize (opt->constraint.string_list);
if(s->has_diffusion && s->mode == MODE_HALFTONE )
opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
else
opt->cap = SANE_CAP_INACTIVE;
}
if(option==OPT_HT_PATTERN){
opt->name = "ht-pattern";
opt->title = "Halftone pattern";
opt->desc = "Control pattern of halftone filter";
opt->type = SANE_TYPE_INT;
opt->unit = SANE_UNIT_NONE;
opt->constraint_type = SANE_CONSTRAINT_RANGE;
opt->constraint.range = &s->ht_pattern_range;
s->ht_pattern_range.min=0;
s->ht_pattern_range.max=s->num_internal_dither - 1;
s->ht_pattern_range.quant=1;
if (s->num_internal_dither && s->mode == MODE_HALFTONE)
opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
else
opt->cap = SANE_CAP_INACTIVE;
}
if(option==OPT_OUTLINE){ if(option==OPT_OUTLINE){
opt->name = "outline"; opt->name = "outline";
opt->title = "Outline"; opt->title = "Outline";
@ -3739,6 +3810,24 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
*val_p = s->rif; *val_p = s->rif;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
case OPT_HT_TYPE:
switch (s->ht_type) {
case WD_ht_type_DEFAULT:
strcpy (val, string_Default);
break;
case WD_ht_type_DITHER:
strcpy (val, string_Dither);
break;
case WD_ht_type_DIFFUSION:
strcpy (val, string_Diffusion);
break;
}
return SANE_STATUS_GOOD;
case OPT_HT_PATTERN:
*val_p = s->ht_pattern;
return SANE_STATUS_GOOD;
case OPT_OUTLINE: case OPT_OUTLINE:
*val_p = s->outline; *val_p = s->outline;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
@ -4340,6 +4429,19 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
s->rif = val_c; s->rif = val_c;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
case OPT_HT_TYPE:
if (!strcmp(val, string_Default))
s->ht_type = WD_ht_type_DEFAULT;
else if (!strcmp(val, string_Dither))
s->ht_type = WD_ht_type_DITHER;
else if (!strcmp(val, string_Diffusion))
s->ht_type = WD_ht_type_DIFFUSION;
return SANE_STATUS_GOOD;
case OPT_HT_PATTERN:
s->ht_pattern = val_c;
return SANE_STATUS_GOOD;
case OPT_OUTLINE: case OPT_OUTLINE:
s->outline = val_c; s->outline = val_c;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
@ -5688,6 +5790,11 @@ set_window (struct fujitsu *s)
set_WD_bitsperpixel (desc1, s->params.depth); set_WD_bitsperpixel (desc1, s->params.depth);
if(s->mode == MODE_HALFTONE){
set_WD_ht_type(desc1, s->ht_type);
set_WD_ht_pattern(desc1, s->ht_pattern);
}
set_WD_rif (desc1, s->rif); set_WD_rif (desc1, s->rif);
set_WD_compress_type(desc1, COMP_NONE); set_WD_compress_type(desc1, COMP_NONE);

Wyświetl plik

@ -37,6 +37,8 @@ enum fujitsu_Option
/*IPC*/ /*IPC*/
OPT_RIF, OPT_RIF,
OPT_HT_TYPE,
OPT_HT_PATTERN,
OPT_OUTLINE, OPT_OUTLINE,
OPT_EMPHASIS, OPT_EMPHASIS,
OPT_SEPARATION, OPT_SEPARATION,
@ -354,9 +356,11 @@ struct fujitsu
SANE_Range threshold_range; SANE_Range threshold_range;
/*ipc group*/ /*ipc group*/
SANE_String_Const ht_type_list[4];
SANE_Range ht_pattern_range;
SANE_Range emphasis_range; SANE_Range emphasis_range;
SANE_String_Const wl_follow_list[5]; SANE_String_Const wl_follow_list[4];
SANE_String_Const ipc_mode_list[5]; SANE_String_Const ipc_mode_list[4];
SANE_Range gamma_curve_range; SANE_Range gamma_curve_range;
SANE_Range threshold_curve_range; SANE_Range threshold_curve_range;
SANE_Range variance_range; SANE_Range variance_range;
@ -412,6 +416,8 @@ struct fujitsu
/* ipc */ /* ipc */
int rif; int rif;
int ht_type;
int ht_pattern;
int outline; int outline;
int emphasis; int emphasis;
int separation; int separation;

Wyświetl plik

@ -11,9 +11,9 @@
:backend "fujitsu" ; name of backend :backend "fujitsu" ; name of backend
:url "http://www.thebility.com/fujitsu/" :url "http://www.thebility.com/fujitsu/"
:version "65" ; version of backend :version "68" ; version of backend
:manpage "sane-fujitsu" ; name of manpage (if it exists) :manpage "sane-fujitsu" ; name of manpage (if it exists)
:comment "Backend re-written for SANE release 1.0.18, see sane-fujitsu manpage" :comment "Backend updated for SANE release 1.1.0, see sane-fujitsu manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-fujitsu 5 "2008-06-24" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" .TH sane-fujitsu 5 "2008-07-03" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane-fujitsu .IX sane-fujitsu
.SH NAME .SH NAME
@ -10,71 +10,21 @@ The
library implements a SANE (Scanner Access Now Easy) backend which library implements a SANE (Scanner Access Now Easy) backend which
provides access to most Fujitsu flatbed and ADF scanners. provides access to most Fujitsu flatbed and ADF scanners.
This document describes the rewritten backend, version 21 and greater. This document describes backend version 68, which shipped with SANE 1.1.0.
The backend supports lineart, halftone, grayscale, and color .SH SUPPORTED HARDWARE
scanning for most USB and SCSI scanners, depending on hardware capabilities. This version has at least basic support for every model which speaks the
Most simple scanning related features are exposed. Fujitsu SCSI and SCSI-over-USB protocols, with many scanners having nearly
This version features at least basic support for many more models. complete support. Specifically, the SCSI M309x and M409x series, the SCSI
See KNOWN ISSUES. fi-series, most of the USB fi-series, and the USB ScanSnap S5xx scanners
are supported. Please see the list at www.sane-project.org for details.
.SH HARDWARE SUPPORT This backend may support other Fujitsu scanners. The best
The following scanners are thought to have at least basic scanning way to determine level of support is to test the scanner directly,
capability, either because they have been tested with a prior or to collect a trace of the windows driver in action.
version, or because documentation indicates they are compatible Please contact the author with test results, positive or negative.
with a tested model.
.PP .SH UNSUPPORTED HARDWARE
.RS
.ft CR
.nf
WORKGROUP SIZED SCANNERS:
--------------------------------------
SCSI: SCSI/USB: USB:
------------ ------------ ------------
M3091DC fi-4120C fi-5110C
M3092DC fi-4220C fi-5110EOX
SP-93GX fi-4120C2 fi-5110EOX2
fi-4220C2 fi-5110EOXM
fi-5120C S500
fi-5220C S500M
.fi
.ft R
.RE
.P
.PP
.RS
.ft CR
.nf
DEPARTMENTAL SIZED SCANNERS:
--------------------------------------
SCSI: SCSI/USB:
------------ ------------
M3093GX/DG fi-4340C
M3096G/GX fi-4530C
M3097G+/DG fi-5530C
fi-4640S
fi-4750C
.fi
.ft R
.RE
.P
.PP
.RS
.ft CR
.nf
PRODUCTION SIZED SCANNERS:
--------------------------------------
SCSI: SCSI/USB:
------------ ------------
M3099G/GH/GX fi-5650C
M4097D fi-5750C
fi-4750L fi-5900C
fi-4860C
M4099D
.fi
.ft R
.RE
.P
The following scanners are known NOT to work with this backend, The following scanners are known NOT to work with this backend,
either because they have a non-fujitsu chipset, or an unsupported either because they have a non-fujitsu chipset, or an unsupported
interface type. Some of these scanners may be supported by another interface type. Some of these scanners may be supported by another
@ -83,39 +33,30 @@ backend.
.RS .RS
.ft CR .ft CR
.nf .nf
UNSUPPORTED SCANNERS:
-------------------------------------- --------------------------------------
SCSI: SERIAL: USB: SCSI: SERIAL: USB:
------------ ------------ ------------ ------------ ------------ ------------
ScanStation M3093E/DE/EX fi-4110EOX2 ScanStation M3093E/DE/EX fi-4110EOX/2
ScanPartner M3096EX fi-4010CU ScanPartner M3096EX fi-4010CU
SP-Jr M3097E+/DE SP-Jr M3097E+/DE S300/S300M
SP-10/10C M3099A/EH/EX SP-10/10C M3099A/EH/EX fi-60F
SP-15C/300C SP-15C/300C fi-5015C
SP-600C/620C SP-600C/620C
.fi .fi
.ft R .ft R
.RE .RE
.P .P
This backend may support scanners not listed here. The best
way to determine level of support is to test the scanner directly.
Fujitsu equipment has historically been good enough to not be
damaged by incorrect commands if the scanner is incompatible.
Please contact the author with test results, positive or negative.
.SH OPTIONS .SH OPTIONS
A modest effort has been made to expose the standard options to the API. Effort has been made to expose all hardware options, including:
This allows a frontend to set scanning region, resolution, bit-depth,
color mode, and enable the automatic document feeder. The fujitsu backend
supports the following basic options for most scanners:
.PP .PP
source s source s
.RS .RS
Selects the source for the scan. Options Selects the source for the scan. Options
may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex". may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex".
.RE .RE
.PP .PP
mode m mode m
.RS .RS
Selects the mode for the scan. Options Selects the mode for the scan. Options
may include "Lineart", "Halftone", "Gray", and "Color". may include "Lineart", "Halftone", "Gray", and "Color".
@ -139,10 +80,14 @@ Sets paper size. Used by scanner to determine centering of scan
coordinates when using ADF and to detect double feed errors. coordinates when using ADF and to detect double feed errors.
.RE .RE
.PP .PP
Other options will be available based on the capabilities of the scanner. Other options will be available based on the capabilities of the scanner:
Use 'scanimage --help' to get a list. Be aware that some options may machines with IPC or DTC will have additional enhancement options, those
with CMP will have compression options, those with endorser will have a
group of imprinter options.
Use 'scanimage --help' to get a list, but be aware that some options may
appear only when another option has been set, and that advanced options appear only when another option has been set, and that advanced options
may be hidden by the frontend. may be hidden by some frontend programs.
.PP .PP
.SH CONFIGURATION FILE .SH CONFIGURATION FILE
The configuration file "fujitsu.conf" is used to tell the backend how to look The configuration file "fujitsu.conf" is used to tell the backend how to look
@ -214,36 +159,14 @@ enables debugging output to stderr. Valid values are:
35 Useless noise 35 Useless noise
.RE .RE
.SH OLDER VERSIONS
Backend versions prior to this were numbered with a two part version,
or with no version number at all. At the time this version was written,
all older versions were retroactively renumbered, 1.0.2 - 1.0.20.
.PP
The current backend may have lost support for some feature you were using.
The last of the "old" backends, 1.0.20, is still available as source from:
.PP
http://www.thebility.com/fujitsu/
.PP
If you find that you need to use the older version, please contact the
author, to try and get those features restored to a later version.
.SH KNOWN ISSUES .SH KNOWN ISSUES
.PP - Some scanner specific 'quirks' are not accounted for, making it possible
.RS
All IPC, imprinter options are disabled.
.br
.br
Most scanner specific 'quirks' are not accounted for, making it possible
to set some options in ways that the scanner does not support. to set some options in ways that the scanner does not support.
.br .br
.br - Any model that does not support VPD during inquiry will not function until
Some flatbed options are affected by adf settings. an override is added to the backend.
.br
.br
Any model that does not support VPD during inquiry will not function.
.RE
.SH HISTORY .SH CREDITS
m3091 backend: Frederik Ramm <frederik a t remote d o t org> m3091 backend: Frederik Ramm <frederik a t remote d o t org>
.br .br
m3096g backend: Randolph Bentson <bentson a t holmsjoen d o t com> m3096g backend: Randolph Bentson <bentson a t holmsjoen d o t com>
@ -278,7 +201,8 @@ sane(7),
sane-scsi(5), sane-scsi(5),
sane-usb(5), sane-usb(5),
sane-sp15c(5), sane-sp15c(5),
sane-avision(5) sane-avision(5),
sane-epjitsu(5)
.SH AUTHOR .SH AUTHOR
m. allan noah: <kitno455 a t gmail d o t com> m. allan noah: <kitno455 a t gmail d o t com>