Adding v1.0.9 of the epjitsu backend: supports Epson-based Fujitsu scanners,

currently the fi-60F flatbed and ScanSnap S300 duplex ADF machines
merge-requests/1/head
m. allan noah 2007-12-18 02:02:51 +00:00
rodzic 7b7a80e679
commit 559212e96e
14 zmienionych plików z 4019 dodań i 4 usunięć

Wyświetl plik

@ -30,6 +30,7 @@ Backends:
dell1600n_net: Jon Chambers (*)
dll: David Mosberger
dmc: David F. Skoll
epjitsu: m. allan noah (*)
epson: Karl Heinz Kremer (*)
fujitsu: Randolph Bentson, Frederik Ramm, Oliver Schirrmeister (*),
m. allan noah (*)

Wyświetl plik

@ -1,3 +1,9 @@
2007-12-17 m. allan noah <kitno455 a t gmail d o t com>
* backend/epjitsu*, backend/Makefile.in, backend/dll.conf.in,
doc/sane-epjitsu.man, doc/Makefile.in, doc/sane.man,
doc/descriptions/epjitsu.desc, configure, configure.in, AUTHORS:
add backend for Epson-based Fujitsu scanners (fi-60F and S300)
2007-12-17 Gerhard Jaeger <gerhard@gjaeger.de>
* backend/plustek-usb.[ch] backend/plustek-usbcal.c backend/plustek-usbimg.c

Wyświetl plik

@ -99,6 +99,7 @@ DISTFILES = abaton.c abaton.conf.in abaton.h agfafocus.c agfafocus.conf.in \
dc210.c dc210.conf.in dc210.h \
dc240.c dc240.conf.in dc240.h dc25.c dc25.conf.in dc25.h dell1600n_net.c\
dell1600n_net.conf.in dll.aliases dll.c dll.conf.in dmc.c dmc.conf.in dmc.h \
epjitsu.c epjitsu.conf.in epjitsu.h epjitsu-cmd.h \
epson.c epson_scsi.c epson_usb.c epson.conf.in epson.h epson_scsi.h \
epson_usb.h epson2_net.c epson2_net.h epson2.c epson2_scsi.c epson2.conf.in\
epson2-io.c epson2-io.h epson2-commands.c epson2-commands.h\
@ -376,6 +377,9 @@ libsane-dc240.la: ../sanei/sanei_constrain_value.lo ../sanei/sanei_jpeg.lo
libsane-dmc.la: ../sanei/sanei_config2.lo
libsane-dmc.la: ../sanei/sanei_constrain_value.lo
libsane-dmc.la: ../sanei/sanei_scsi.lo
libsane-epjitsu.la: ../sanei/sanei_config2.lo
libsane-epjitsu.la: ../sanei/sanei_constrain_value.lo
libsane-epjitsu.la: ../sanei/sanei_usb.lo
libsane-epson.la: $(addsuffix .lo,$(EXTRA_epson))
libsane-epson.la: ../sanei/sanei_config2.lo
libsane-epson.la: ../sanei/sanei_constrain_value.lo

Wyświetl plik

@ -19,6 +19,7 @@ coolscan2
#dc240
dell1600n_net
dmc
epjitsu
epson
epson2
fujitsu

Wyświetl plik

@ -0,0 +1,257 @@
/*************** COARSE CALIBRATION DEFAULT PAYLOAD *************/
/* 1b c6 (send coarse cal) command payload - not resolution specific? */
/* first group of 3 is offset?, larger # == brighter */
/* second group of 3 is gain?, larger # == brighter */
static unsigned char coarseCalData_FI60F[] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x26, 0x00, 0x26, 0x00, 0x26,
0x00, 0x00, 0x0b, 0x22, 0x00, 0x00, 0x0b, 0x22, 0x00, 0x00, 0x0b, 0x22
};
static unsigned char coarseCalData_S300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x24, 0x00, 0x28, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** fi-60F 150dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x____ bytes) */
static unsigned char setWindowCoarseCal_FI60F_150[] = {
0
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x____ bytes) */
static unsigned char setWindowFineCal_FI60F_150[] = {
0
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0x____ bytes) */
static unsigned char setWindowSendCal_FI60F_150[] = {
0
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_FI60F_150[] = {
0
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_FI60F_150[] = {
0
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_FI60F_150[] = {
0
};
/*************** fi-60F 300dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x1c20 bytes) */
static unsigned char setWindowCoarseCal_FI60F_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x60, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x1c20 bytes) */
static unsigned char setWindowFineCal_FI60F_300[] = {
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0x3840 bytes) */
static unsigned char setWindowSendCal_FI60F_300[] = {
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, 0x01, 0x10, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_FI60F_300[] = { /* plus 0x3840 data bytes */
0x8c, 0x0f, 0x8c, 0x0f, 0x8c, 0x0f, 0x8c, 0x0f, 0x8c, 0x0f, 0x8c, 0x0f, 0x00, 0x04
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_FI60F_300[] = {
0x39, 0x3f, 0x39, 0x3f, 0x39, 0x3f, 0x07
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_FI60F_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x60, 0x00, 0x00, 0x06, 0xd5, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x48, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** fi-60F 600dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x2160 bytes) */
static unsigned char setWindowCoarseCal_FI60F_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x2160 bytes) */
static unsigned char setWindowFineCal_FI60F_600[] = {
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0x42c0 bytes) */
static unsigned char setWindowSendCal_FI60F_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x20, 0x00, 0x00, 0x0d, 0xaa, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_FI60F_600[] = {
0x4f, 0x10, 0x4f, 0x10, 0x4f, 0x10, 0x4f, 0x10, 0x4f, 0x10, 0x4f, 0x10, 0x00, 0x04
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_FI60F_600[] = {
0x2b, 0x40, 0x2b, 0x40, 0x2b, 0x40, 0x07
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_FI60F_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x20, 0x00, 0x00, 0x0d, 0xaa, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 150dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_150[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x63c0 bytes) */
static unsigned char setWindowFineCal_S300_150[] = {
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */
static unsigned char setWindowSendCal_S300_150[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 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, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_150[] = { /* plus 0xc780 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_150[] = { /* plus 0xc780 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xd0, 0x34, 0xd0, 0x34, 0xd0, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_150[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00,
/*0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc8, 0x00, 0x00, 0x09, 0x0d, 0x00, 0x00,*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc8, 0x00, 0x00, 0x06, 0xe2, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 300dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x6000 bytes) */
static unsigned char setWindowCoarseCal_S300_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x6000 bytes) */
static unsigned char setWindowFineCal_S300_300[] = {
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc000 bytes) */
static unsigned char setWindowSendCal_S300_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_300[] = { /* plus 0xc000 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_300[] = { /* plus 0xc000 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xb8, 0x34, 0xb8, 0x34, 0xb8, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
/*0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x12, 0x18, 0x00, 0x00,*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#if 0
/*************** S300 600dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0xbc40 bytes) */
static unsigned char setWindowCoarseCal_S300_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0xbc40 bytes) */
static unsigned char setWindowFineCal_S300_600[] = {
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0x17880 bytes) */
static unsigned char setWindowSendCal_S300_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x10, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_600[] = {
0x7f, 0x0b, 0x7f, 0x0b, 0x7f, 0x0b, 0x7f, 0x0b, 0x7f, 0x0b, 0x7f, 0x0b, 0x00, 0x04
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_600[] = {
0xc7, 0x23, 0xc7, 0x23, 0xc7, 0x23, 0x07
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x40, 0x00, 0x00, 0x24, 0x21, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif

3279
backend/epjitsu.c 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,25 @@
# For scanners connected via USB on a known device (kernel driver):
#usb /dev/usb/scanner0
# For scanners connected via USB using vendor and device ids (libusb):
#usb VENDORID PRODUCTID
# NOTE: if you have to add your device here- please send the id and model
# to the author via email, so it can be included in next version. kitno455 at
# gmail dot com - with epjitsu in the subject line
# these devices require a firmware file in order to function
# it can generally be found inside C:\windows\fjsti.cab or
# C:\windows\fjmini\*.cab
# open that file and look for a ~65K .NAL file with the scanner's name
# and copy it someplace sane can reach it. then update the line below.
# NOTE: the firmware line must occur BEFORE the usb line for your scanner
# Fujitsu fi-60F
firmware /lib/firmware/60f_0A00.nal
firmware /lib/firmware/60f_0000.nal
usb 0x04c5 0x10c7
# Fujitsu S300
firmware /lib/firmware/300_0A00.nal
usb 0x04c5 0x1156

286
backend/epjitsu.h 100644
Wyświetl plik

@ -0,0 +1,286 @@
#ifndef EPJITSU_H
#define EPJITSU_H
/*
* Part of SANE - Scanner Access Now Easy.
* Please see opening comment in epjitsu.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 scanner_Option
{
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_SOURCE, /*adffront/adfback/adfduplex/fb*/
OPT_MODE, /*mono/gray/color*/
OPT_X_RES,
OPT_Y_RES,
/* must come last: */
NUM_OPTIONS
};
#define FIRMWARE_LENGTH 0x10000
#define MAX_IMG_PASS 0x10000
#define MAX_IMG_BLOCK 0x80000
struct transfer {
int height;
int width_pix;
int width_bytes;
int total_pix;
int total_bytes;
int rx_bytes;
int tx_bytes;
unsigned char * buffer;
};
struct scanner
{
/* --------------------------------------------------------------------- */
/* immutable values which are set during init of scanner. */
struct scanner *next;
int model;
int has_fb;
int has_adf;
int x_res_150;
int x_res_300;
int x_res_600;
int y_res_150;
int y_res_300;
int y_res_600;
/* --------------------------------------------------------------------- */
/* immutable values which are set during inquiry probing of the scanner. */
SANE_Device sane; /*contains: name, vendor, model, type*/
/* --------------------------------------------------------------------- */
/* changeable SANE_Option structs provide our interface to frontend. */
/* long array of option structs */
SANE_Option_Descriptor opt[NUM_OPTIONS];
/* --------------------------------------------------------------------- */
/* 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 */
/*mode group, room for lineart, gray, color, null */
SANE_String_Const source_list[5];
SANE_String_Const mode_list[4];
SANE_Int x_res_list[4];
SANE_Int y_res_list[4];
/* --------------------------------------------------------------------- */
/* changeable vars to hold user input. modified by SANE_Options above */
/*mode group*/
int source; /* adf or fb */
int mode; /* color,lineart,etc */
int res; /* from a limited list, x and y same */
int resolution_x; /* unused dummy */
int resolution_y; /* unused dummy */
int threshold;
int height; /* may run out on adf */
/* --------------------------------------------------------------------- */
/* values which are set by user parameter changes, scanner specific */
unsigned char * setWindowCoarseCal; /* sent before coarse cal */
size_t setWindowCoarseCalLen;
unsigned char * setWindowFineCal; /* sent before fine cal */
size_t setWindowFineCalLen;
unsigned char * setWindowSendCal; /* sent before send cal */
size_t setWindowSendCalLen;
unsigned char * sendCal1Header; /* part of 1b c3 command */
size_t sendCal1HeaderLen;
unsigned char * sendCal2Header; /* part of 1b c4 command */
size_t sendCal2HeaderLen;
unsigned char * setWindowScan; /* sent before scan */
size_t setWindowScanLen;
/* --------------------------------------------------------------------- */
/* values which are set by scanning functions to keep track of pages, etc */
int started;
int side;
int send_eof; /*we've sent all of image*/
/* 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 buffer for building calibration data */
struct transfer 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;
/* 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;
/* final-sized front image, always used */
struct transfer front;
/* final-sized back image, only used during duplex/backside */
struct transfer back;
/* --------------------------------------------------------------------- */
/* values used by the command and data sending function */
int fd; /* The scanner device file descriptor. */
};
#define MODEL_S300 0
#define MODEL_FI60F 1
#define USB_COMMAND_TIME 10000
#define USB_DATA_TIME 10000
#define SIDE_FRONT 0
#define SIDE_BACK 1
#define SOURCE_FLATBED 0
#define SOURCE_ADF_FRONT 1
#define SOURCE_ADF_BACK 2
#define SOURCE_ADF_DUPLEX 3
#define MODE_COLOR 0
#define MODE_GRAYSCALE 1
#define MODE_LINEART 2
#define WINDOW_COARSECAL 0
#define WINDOW_FINECAL 1
#define WINDOW_SENDCAL 2
#define WINDOW_SCAN 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 CONFIG_FILE "epjitsu.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 *devicename);
static SANE_Status connect_fd (struct scanner *s);
static SANE_Status disconnect_fd (struct scanner *s);
static SANE_Status
do_cmd(struct scanner *s, int shortTime,
unsigned char * cmdBuff, size_t cmdLen,
unsigned char * outBuff, size_t outLen,
unsigned char * inBuff, size_t * inLen
);
/*
static SANE_Status load_calibration (struct scanner *s);
static SANE_Status read_from_scanner_gray(struct scanner *s);
*/
/* commands */
static SANE_Status load_fw(struct scanner *s);
static SANE_Status get_ident(struct scanner *s);
static SANE_Status change_params(struct scanner *s);
void update_block_totals(struct scanner * s);
static SANE_Status teardown_buffers(struct scanner *s);
static SANE_Status setup_buffers(struct scanner *s);
static SANE_Status ingest(struct scanner *s);
static SANE_Status coarsecal(struct scanner *s);
static SANE_Status finecal(struct scanner *s);
static SANE_Status lamp(struct scanner *s, unsigned char set);
static SANE_Status set_window(struct scanner *s, int window);
static SANE_Status scan(struct scanner *s);
static SANE_Status read_from_scanner(struct scanner *s, struct transfer *tp);
static SANE_Status fill_frontback_buffers_S300(struct scanner *s);
static SANE_Status fill_frontback_buffers_FI60F(struct scanner *s);
void free_scanner(struct scanner *s);
/* utils */
static void hexdump (int level, char *comment, unsigned char *p, int l);
static size_t maxStringSize (const SANE_String_Const strings[]);
#endif /* EPJITSU_H */

2
configure vendored
Wyświetl plik

@ -27044,7 +27044,7 @@ else
echo "$as_me: Manually selected backends: ${BACKENDS}" >&6;}
else
BACKENDS="abaton agfafocus apple artec as6e avision bh canon \
canon630u cardscan coolscan coolscan2 dc25 dmc \
canon630u cardscan coolscan coolscan2 dc25 dmc epjitsu \
epson fujitsu genesys gt68xx hp leo lexmark matsushita microtek \
microtek2 mustek mustek_usb nec pie pixma plustek \
plustek_pp ricoh s9036 sceptre sharp \

Wyświetl plik

@ -361,7 +361,7 @@ else
AC_MSG_NOTICE([Manually selected backends: ${BACKENDS}])
else
BACKENDS="abaton agfafocus apple artec as6e avision bh canon \
canon630u cardscan coolscan coolscan2 dc25 dmc \
canon630u cardscan coolscan coolscan2 dc25 dmc epjitsu \
epson fujitsu genesys gt68xx hp leo lexmark matsushita microtek \
microtek2 mustek mustek_usb nec pie pixma plustek \
plustek_pp ricoh s9036 sceptre sharp \

Wyświetl plik

@ -54,7 +54,7 @@ SECT5 = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-as6e.5 sane-dll.5 \
sane-ma1509.5 sane-ibm.5 sane-hp5400.5 sane-plustek_pp.5 sane-u12.5 \
sane-niash.5 sane-sm3840.5 sane-genesys.5 sane-hp4200.5 \
sane-mustek_usb2.5 sane-hp3500.5 sane-pixma.5 sane-stv680.5 \
sane-hp5590.5 sane-cardscan.5 sane-hp3900.5
sane-hp5590.5 sane-cardscan.5 sane-hp3900.5 sane-epjitsu.5
SECT7 = sane.7
SECT8 = saned.8
MANPAGES = $(SECT1) $(SECT5) $(SECT7) $(SECT8)
@ -112,7 +112,7 @@ DISTFILES = Makefile.in backend-writing.txt descriptions.txt \
sane-ma1509.man sane-ibm.man sane-hp5400.man sane-plustek_pp.man \
sane-u12.man sane-niash.man sane-sm3840.man sane-genesys.man sane-hp4200.man \
sane-mustek_usb2.man sane-hp3500.man sane-pixma.man sane-stv680.man \
sane-hp5590.man sane-cardscan.man sane-hp3900.man
sane-hp5590.man sane-cardscan.man sane-hp3900.man sane-epjitsu.man
.PHONY: all clean depend dist distclean html html-man install \
sane-html uninstall

Wyświetl plik

@ -0,0 +1,36 @@
;
; SANE Backend specification file
;
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
; All syntactic elements are keyword tokens, followed by a string or
; keyword argument, as specified.
;
; ":backend" *must* be specified.
; All other information is optional (but what good is the file without it?).
;
:backend "epjitsu" ; name of backend
:url "http://www.thebility.com/epjitsu/"
:version "1.0.9" ; version of backend
:manpage "sane-epjitsu" ; name of manpage (if it exists)
:comment "Only basic support provided, see sane-epjitsu manpage"
:devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam,
; :meta, :api
:mfg "Fujitsu" ; name a manufacturer
:url "http://www.fujitsu.com/"
;==================================================
:model "fi-60F"
:interface "USB"
:status :basic
:usbid "0x04c5" "0x10C7"
:comment "A6-size flatbed, 300/600 dpi, color/grayscale in hardware"
:model "ScanSnap S300"
:interface "USB"
:status :basic
:usbid "0x04c5" "0x1156"
:comment "10 sheet ADF, 150/300 dpi, always scans in triplex color, no TWAIN driver"

Wyświetl plik

@ -0,0 +1,110 @@
.TH sane-epjitsu 5 "2007-12-17" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane-epjitsu
.SH NAME
sane-epjitsu \- SANE backend for Epson-based Fujitsu USB scanners.
.SH DESCRIPTION
The
.B sane-epjitsu
library implements a SANE (Scanner Access Now Easy) backend which provides basic access the Fujitsu fi-60F and ScanSnap S300 scanners.
.SH HARDWARE SUPPORT
These scanners are fairly limited, only supporting a couple of modes and resolutions, and always scanning full width. The backend supports missing modes (binary, grayscale) in software, but makes no effort to offer intermediate resolutions or scan area controls. See
.B KNOWN ISSUES.
This backend may support other scanners. If physical inspection reveals an Epson chipset, please contact the author for instructions on collecting a USB trace under Windows to verify.
.SH OPTIONS
A limited effort has been made to expose the standard options to the API. This allows a frontend to set resolution, color mode, and choose the ADF setting. The epjitsu backend supports the following basic options for most scanners:
.PP
source s
.RS
Selects the source for the scan. Options may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex".
.RE
.PP
mode m
.RS
Selects the mode for the scan. Options may include "Lineart", "Gray", "Color".
.RE
.PP
resolution, y-resolution
.RS
Controls scan resolution. Setting --resolution also sets --y-resolution, though this behavior is overridden by some frontends.
.RE
.PP
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 appear only when another option has been set, and that advanced options may be hidden by the frontend.
.PP
.SH CONFIGURATION FILE
The configuration file "@CONFIGDIR@/epjitsu.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. If the configuration file is missing, the backend will not work.
.PP
Scanners can be specified in the configuration file in two ways:
.PP
"usb 0x04c5 0x10c7" (or other vendor/product ids)
.RS
Requests backend to search all usb busses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a supported scanner.
.RE
.PP
"usb /dev/usb/scanner0" (or other device file)
.RS
Some systems use a kernel driver to access usb scanners. This method is untested.
.RE
.PP
The only configuration option supported is "firmware /PATH/TO/FILE", allowing you to set the location of the firmware file you have extracted from the Windows driver.
.PP
.B Note:
This firmware is a copyrighted work of Fujitsu, so cannot be provided by the backend or the author. Please do not ask.
.PP
.B Note:
These scanners REQUIRE a firmware file to function. See the supplied configuration file for more detail.
.PP
.B Note:
This option may appear multiple times in the configuration file. It only applies to scanners discovered by 'usb' lines that follow this option.
.PP
.SH ENVIRONMENT
The backend uses a single environment variable, SANE_DEBUG_EPJITSU, which enables debugging output to stderr. Valid values are:
.PP
.RS
5 Errors
.br
10 Function trace
.br
15 Function detail
.br
20 Option commands
.br
25 USB trace
.br
30 USB detail
.br
35 Useless noise
.RE
.SH KNOWN ISSUES
.PP
.RS
No scan area options are exposed.
.br
.br
No brightness, contrast, or threshold options are exposed.
.br
.br
fi-60F hardware grayscale mode is not used.
.br
.br
Calibration is far from perfect.
.RE
.SH CREDITS
S300 support funded by Microdea, Inc.
.br
fi-60F support funded by Bill McMullin.
.SH "SEE ALSO"
sane(7),
sane-usb(5)
.SH AUTHOR
m. allan noah: <kitno455 a t gmail d o t com>

Wyświetl plik

@ -219,6 +219,11 @@ parallel port scanners. See
.BR sane-canon_pp (5)
for details.
.TP
.B cardscan
This backend provides support for the Corex Cardscan 800c USB scanner. See
.BR sane-cardscan (5)
for details.
.TP
.B coolscan
This is a SANE backend for Nikon Coolscan film-scanners. See
.BR sane-coolscan (5)
@ -232,6 +237,11 @@ or
.I http://coolscan2.sourceforge.net
for details.
.TP
.B epjitsu
The epjitsu backend provides support for Epson-based Fujitsu USB scanners. See
.BR sane-epjitsu (5)
for details.
.TP
.B epson
The SANE epson backend provides support for Epson SCSI, parallel port and USB
flatbed scanners. See