From 28346f51119980dd48056016173a56efc9eb08c8 Mon Sep 17 00:00:00 2001 From: Ullrich Sigwanz Date: Sat, 4 Feb 2006 10:28:51 +0000 Subject: [PATCH] adding trust office scan 19200 --- ChangeLog | 522 ++++++++++--------- backend/niash.c | 956 +++++++++++++++++----------------- backend/niash_xfer.c | 64 +-- doc/descriptions/niash.desc | 16 +- doc/sane-niash.man | 22 +- tools/hotplug/libsane.usermap | 5 +- 6 files changed, 808 insertions(+), 777 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37483c6ba..eb28fb663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,357 +1,363 @@ +2006-02-04 Ullrich Sigwanz + + * backend/niash_xfer.c: Added Trust OfficeScan 19200 + * doc/descriptions/niash.desc: Added Trust OfficeScan 19200 + * backend/niash.c: Removed Reload on X,Y settings + 2006-02-02 Oliver Schwartz - * backend/snapscan.h: Corrected USB ID for Benq 310 + * backend/snapscan.h: Corrected USB ID for Benq 310 2006-01-31 Gerhard Jaeger - * doc/plustek/Plustek-USB.changes: Update. - * backend/plustek.c: Bumped build number. - * backend/plustek-usbdevs.c: Fixed CanoScan N1220U settings. + * doc/plustek/Plustek-USB.changes: Update. + * backend/plustek.c: Bumped build number. + * backend/plustek-usbdevs.c: Fixed CanoScan N1220U settings. 2006-01-29 Henning Meier-Geinitz - * doc/descriptions-external/brother2.desc: Changed status of - Brother MFC-410CN to "basic" (bug #302961). - * doc/descriptions/unsupported.desc: Added Benq 7400UT and Genius - Colorpage CS. + * doc/descriptions-external/brother2.desc: Changed status of + Brother MFC-410CN to "basic" (bug #302961). + * doc/descriptions/unsupported.desc: Added Benq 7400UT and Genius + Colorpage CS. 2006-01-26 Henning Meier-Geinitz - * backend/snapscan-usb.c: Added #defines for SHM_R/W for cygwin - (patch from Philip Aston ). - * AUTHORS: Troy Rollo is now active. + * backend/snapscan-usb.c: Added #defines for SHM_R/W for cygwin + (patch from Philip Aston ). + * AUTHORS: Troy Rollo is now active. 2006-01-22 Henning Meier-Geinitz - * doc/descriptions-external/epkowa.desc: Updated to match - iscan-1.18.0. Added usb ids (patch from Olaf Meeuwissen - ). - * doc/descriptions/unsupported.desc: Added Scanshell 800N and - Canon Smartbase MP360. - * sanei/sanei_usb.c tools/sane-find-scanner.c: Added checks for - altsetting =! 0. + * doc/descriptions-external/epkowa.desc: Updated to match + iscan-1.18.0. Added usb ids (patch from Olaf Meeuwissen + ). + * doc/descriptions/unsupported.desc: Added Scanshell 800N and + Canon Smartbase MP360. + * sanei/sanei_usb.c tools/sane-find-scanner.c: Added checks for + altsetting =! 0. 2006-01-22 Mattias Ellert - * backend/dll.c, backend/plustek-usbhw.c, backend/plustek-usbscan.c, - sanei/sanei_pio.c: Fixed warnings about C++ style comments. - * backend/hp5400_xfer.h: Fixed compilation warnings. + * backend/dll.c, backend/plustek-usbhw.c, backend/plustek-usbscan.c, + sanei/sanei_pio.c: Fixed warnings about C++ style comments. + * backend/hp5400_xfer.h: Fixed compilation warnings. 2006-01-21 Mattias Ellert - * backend/canon-sane.c: Fixed variable redeclaration. + * backend/canon-sane.c: Fixed variable redeclaration. 2006-01-05 St�hane Voltz - * tools/hotplug/libsane.usermap: Added Dell A920 (rebranded X1100) + * tools/hotplug/libsane.usermap: Added Dell A920 (rebranded X1100) 2006-01-19 Gerhard Jaeger - * doc/plustek/Plustek-USB.changes: Update. - * backend/plustek.c: Bumped build number. Fixed constraint_type for - OPT_BUTTON. - * backend/plustek-usbdevs.c: Added high-speed setting for HP2200. - Cleanup. + * doc/plustek/Plustek-USB.changes: Update. + * backend/plustek.c: Bumped build number. Fixed constraint_type for + OPT_BUTTON. + * backend/plustek-usbdevs.c: Added high-speed setting for HP2200. + Cleanup. 2006-01-18 Gerhard Jaeger - * doc/plustek/Plustek-USB.changes: Update. - * backend/plustek.c: Bumped build number. - * backend/plustek-usbdevs.c: Fixed CanoScan N670U settings, - see (bugreport #302738). + * doc/plustek/Plustek-USB.changes: Update. + * backend/plustek.c: Bumped build number. + * backend/plustek-usbdevs.c: Fixed CanoScan N670U settings, + see (bugreport #302738). 2006-01-15 Henning Meier-Geinitz - * doc/descriptions/canon630u.desc doc/descriptions/coolscan2.desc - doc/descriptions/hp5400.desc doc/descriptions/niash.desc - doc/descriptions/unsupported.desc: Added USB vendor and product - ids. Minor cleanup. - * backend/artec_eplus48u.conf.in doc/sane-artec_eplus48u.man - doc/descriptions/artec_eplus48u.desc: Added Yakumo Scan50. Minor - cleanup. - * doc/descriptions/gt68xx.desc: Added Mustek BearPaw 1248 CU. - * doc/descriptions/lexmark.desc: Added USB vendor and product - ids. Changed status of X1150 and X1170 according to reports on - sane-devel. + * doc/descriptions/canon630u.desc doc/descriptions/coolscan2.desc + doc/descriptions/hp5400.desc doc/descriptions/niash.desc + doc/descriptions/unsupported.desc: Added USB vendor and product + ids. Minor cleanup. + * backend/artec_eplus48u.conf.in doc/sane-artec_eplus48u.man + doc/descriptions/artec_eplus48u.desc: Added Yakumo Scan50. Minor + cleanup. + * doc/descriptions/gt68xx.desc: Added Mustek BearPaw 1248 CU. + * doc/descriptions/lexmark.desc: Added USB vendor and product + ids. Changed status of X1150 and X1170 according to reports on + sane-devel. 2006-01-15 Ulrich Deiters - * backend/canon-sane.c: fixed byte-swapping problem for little-endian - platforms (affects raw-mode scanning with FS2710 slide scanner) + * backend/canon-sane.c: fixed byte-swapping problem for little-endian + platforms (affects raw-mode scanning with FS2710 slide scanner) 2006-01-14 Henning Meier-Geinitz - * tools/check-usb-chip.c: Improved rts8822l-01h chipset - detection by adding check for descriptor.bcdUSB == 0x110 reported - by some scanners and accepting any value diferent to 0, read - from 0xfe11 register. Patch from Jonathan Bravo Lopez - . - * tools/sane-desc.c: Added "ignore" parameter to :usbid - token. Print warning if a backend defines USB models without - defining usbid. Print warning if a model doesn't have an - interface. - * doc/descriptions.txt: Added "ignore" parameter to :usbid - token. - * doc/descriptions-external/hpaio.desc doc/descriptions-external/hpoj.desc - doc/descriptions-external/samsung.desc: Updated comments. Added - usb ids or "ignore". + * tools/check-usb-chip.c: Improved rts8822l-01h chipset + detection by adding check for descriptor.bcdUSB == 0x110 reported + by some scanners and accepting any value diferent to 0, read + from 0xfe11 register. Patch from Jonathan Bravo Lopez + . + * tools/sane-desc.c: Added "ignore" parameter to :usbid + token. Print warning if a backend defines USB models without + defining usbid. Print warning if a model doesn't have an + interface. + * doc/descriptions.txt: Added "ignore" parameter to :usbid + token. + * doc/descriptions-external/hpaio.desc doc/descriptions-external/hpoj.desc + doc/descriptions-external/samsung.desc: Updated comments. Added + usb ids or "ignore". 2006-01-10 Oliver Schwartz - * doc/descriptions/snapscan.desc: Changed entries for duplicate USB IDs, - added Epson Stylus CX-1500 - * backend/snapscan.c backend/snapscan-scsi.c: Added support for 12 bit - gamma tables for Epson CX-1500 - * backend/snapscan.conf.in: Added Epson Stylus CX-1500 + * doc/descriptions/snapscan.desc: Changed entries for duplicate USB IDs, + added Epson Stylus CX-1500 + * backend/snapscan.c backend/snapscan-scsi.c: Added support for 12 bit + gamma tables for Epson CX-1500 + * backend/snapscan.conf.in: Added Epson Stylus CX-1500 2006-01-10 Gerard Klaver - * doc/descriptions-external/stv680.desc: Added USB id. - added Creative webcam to list - + * doc/descriptions-external/stv680.desc: Added USB id. + added Creative webcam to list + 2006-01-10 Henning Meier-Geinitz - * doc/descriptions-external/epkowa.desc: Film area guide mode of - 4990 not supported (bug #302728). - * doc/descriptions-external/brother-mfc4600.desc - doc/descriptions-external/brother.desc - doc/descriptions-external/brother2.desc - doc/descriptions-external/hp3770.desc - doc/descriptions-external/hp3900.desc - doc/descriptions-external/hp8200.desc - doc/descriptions-external/hp_rts88xx.desc - doc/descriptions-external/mustek_a3p1.desc - doc/descriptions-external/primascan.desc - doc/descriptions-external/template.desc. - doc/descriptions-external/viceo.desc: - Added several USB ids. Added some more scanners. General cleanup. + * doc/descriptions-external/epkowa.desc: Film area guide mode of + 4990 not supported (bug #302728). + * doc/descriptions-external/brother-mfc4600.desc + doc/descriptions-external/brother.desc + doc/descriptions-external/brother2.desc + doc/descriptions-external/hp3770.desc + doc/descriptions-external/hp3900.desc + doc/descriptions-external/hp8200.desc + doc/descriptions-external/hp_rts88xx.desc + doc/descriptions-external/mustek_a3p1.desc + doc/descriptions-external/primascan.desc + doc/descriptions-external/template.desc. + doc/descriptions-external/viceo.desc: + Added several USB ids. Added some more scanners. General cleanup. 2006-01-09 Henning Meier-Geinitz - * doc/descriptions/gt68xx.desc: Added USB id. - * doc/descriptions/unsupported.desc: Added interfaces to Panasonic - scanners. + * doc/descriptions/gt68xx.desc: Added USB id. + * doc/descriptions/unsupported.desc: Added interfaces to Panasonic + scanners. 2006-01-08 Oliver Schwartz - * doc/descriptions/snapscan.desc: Added USB IDs + * doc/descriptions/snapscan.desc: Added USB IDs 2006-01-08 Henning Meier-Geinitz - * doc/descriptions/unsupported.desc: Added Xerox 4800. - * doc/descriptions.txt tools/sane-desc.c: Added support for - keyword :usbid. All output modes now print the usb vendor and - product modes. Added usermap, db, and udev output modes for - generating USB vendor/product lists for hotplug (ng) and Linux - udev. Added version information to html modes. - * doc/descriptions/gt68xx.desc: Added vendor and product ids for - all scanners. - * doc/descriptions/artec_eplus48u.desc - doc/descriptions/genesys.desc doc/descriptions/hp3500.desc - doc/descriptions/hp4200.desc doc/descriptions/ma1509.desc - doc/descriptions/microtek2.desc doc/descriptions/mustek_usb.desc - doc/descriptions/mustek_usb2.desc doc/descriptions/sm3600.desc - doc/descriptions/sm3840.desc doc/descriptions/template.desc. - doc/descriptions/umax1220u.desc doc/descriptions/unsupported.desc - doc/descriptions-external/template.desc.: - Added USB vendor and product ids. Minor cleanups. + * doc/descriptions/unsupported.desc: Added Xerox 4800. + * doc/descriptions.txt tools/sane-desc.c: Added support for + keyword :usbid. All output modes now print the usb vendor and + product modes. Added usermap, db, and udev output modes for + generating USB vendor/product lists for hotplug (ng) and Linux + udev. Added version information to html modes. + * doc/descriptions/gt68xx.desc: Added vendor and product ids for + all scanners. + * doc/descriptions/artec_eplus48u.desc + doc/descriptions/genesys.desc doc/descriptions/hp3500.desc + doc/descriptions/hp4200.desc doc/descriptions/ma1509.desc + doc/descriptions/microtek2.desc doc/descriptions/mustek_usb.desc + doc/descriptions/mustek_usb2.desc doc/descriptions/sm3600.desc + doc/descriptions/sm3840.desc doc/descriptions/template.desc. + doc/descriptions/umax1220u.desc doc/descriptions/unsupported.desc + doc/descriptions-external/template.desc.: + Added USB vendor and product ids. Minor cleanups. 2006-01-07 Henning Meier-Geinitz - * doc/descriptions/unsupported.desc: Added Medion MD 85264 finger - print sensor and Trust Office Scan USB 19200. - * doc/descriptions-external/brother2.desc - tools/hotplug/libsane.usermap: Brother DCP-7010 is reported to - work (bug #302862). - * tools/check-usb-chip.c: Print version information when detecting - chip sets. - * sanei/sanei_usb.c: Added warning if libusb support is not built - in and some more debug messages. - * doc/descriptions-external/hp3900.desc: Status of HP ScanJet 4070 - Photosmart is now minimal. - * tools/sane-desc.c: Added new output mode: statistics. This mode - prints overal statistics about known devices. Added support for - more than one search directory. Removed support for deprecated - backend status ("alpha", "beta" ...). Ran indent -gnu. HTML - output (backends and mfgs) prints statitics now. Unify status - and device type strings. Simplified status and device type - string printing. Removed any remaining links of backend status. + * doc/descriptions/unsupported.desc: Added Medion MD 85264 finger + print sensor and Trust Office Scan USB 19200. + * doc/descriptions-external/brother2.desc + tools/hotplug/libsane.usermap: Brother DCP-7010 is reported to + work (bug #302862). + * tools/check-usb-chip.c: Print version information when detecting + chip sets. + * sanei/sanei_usb.c: Added warning if libusb support is not built + in and some more debug messages. + * doc/descriptions-external/hp3900.desc: Status of HP ScanJet 4070 + Photosmart is now minimal. + * tools/sane-desc.c: Added new output mode: statistics. This mode + prints overal statistics about known devices. Added support for + more than one search directory. Removed support for deprecated + backend status ("alpha", "beta" ...). Ran indent -gnu. HTML + output (backends and mfgs) prints statitics now. Unify status + and device type strings. Simplified status and device type + string printing. Removed any remaining links of backend status. 2006-01-06 Oliver Schwartz - * backend/snapscan-scsi.c backend/snapscan-options.c backend/snapscan.c: + * backend/snapscan-scsi.c backend/snapscan-options.c backend/snapscan.c: Some fixes for the Epson Stylus CX1500 2006-01-05 St�hane Voltz - * backend/umax_pp_low.c: removed unused local variable + * backend/umax_pp_low.c: removed unused local variable 2006-01-05 Henning Meier-Geinitz - * backend/Makefile.in backend/abaton.conf backend/abaton.conf.in - backend/agfafocus.conf backend/agfafocus.conf.in - backend/apple.conf backend/apple.conf.in backend/artec.conf - backend/artec.conf.in backend/artec_eplus48u.conf - backend/artec_eplus48u.conf.in backend/avision.conf - backend/avision.conf.in backend/bh.conf backend/bh.conf.in - backend/canon.conf backend/canon.conf.in backend/canon630u.conf - backend/canon630u.conf.in backend/canon_pp.conf - backend/canon_pp.conf.in backend/coolscan.conf - backend/coolscan.conf.in backend/coolscan2.conf - backend/coolscan2.conf.in backend/dc210.conf - backend/dc210.conf.in backend/dc240.conf backend/dc240.conf.in - backend/dc25.conf backend/dc25.conf.in backend/dll.conf - backend/dll.conf.in backend/dmc.conf backend/dmc.conf.in - backend/epson.conf backend/epson.conf.in backend/fujitsu.conf - backend/fujitsu.conf.in backend/genesys.conf - backend/genesys.conf.in backend/gphoto2.conf - backend/gphoto2.conf.in backend/gt68xx.conf - backend/gt68xx.conf.in backend/hp.conf backend/hp.conf.in - backend/hp4200.conf backend/hp4200.conf.in backend/hp5400.conf - backend/hp5400.conf.in backend/hpsj5s.conf - backend/hpsj5s.conf.in backend/ibm.conf backend/ibm.conf.in - backend/leo.conf backend/leo.conf.in backend/lexmark.conf - backend/lexmark.conf.in backend/ma1509.conf - backend/ma1509.conf.in backend/matsushita.conf - backend/matsushita.conf.in backend/microtek.conf - backend/microtek.conf.in backend/microtek2.conf - backend/microtek2.conf.in backend/mustek.conf - backend/mustek.conf.in backend/mustek_pp.conf - backend/mustek_pp.conf.in backend/mustek_usb.conf - backend/mustek_usb.conf.in backend/nec.conf backend/nec.conf.in - backend/net.conf backend/net.conf.in backend/pie.conf - backend/pie.conf.in backend/plustek.conf backend/plustek.conf.in - backend/plustek_pp.conf backend/plustek_pp.conf.in - backend/qcam.conf backend/qcam.conf.in backend/ricoh.conf - backend/ricoh.conf.in backend/s9036.conf backend/s9036.conf.in - backend/saned.conf backend/saned.conf.in backend/sceptre.conf - backend/sceptre.conf.in backend/sharp.conf backend/sharp.conf.in - backend/sm3840.conf backend/sm3840.conf.in backend/snapscan.conf - backend/snapscan.conf.in backend/sp15c.conf - backend/sp15c.conf.in backend/st400.conf backend/st400.conf.in - backend/tamarack.conf backend/tamarack.conf.in - backend/teco1.conf backend/teco1.conf.in backend/teco2.conf - backend/teco2.conf.in backend/teco3.conf backend/teco3.conf.in - backend/test.conf backend/test.conf.in backend/u12.conf - backend/u12.conf.in backend/umax.conf backend/umax.conf.in - backend/umax1220u.conf backend/umax1220u.conf.in - backend/umax_pp.conf backend/umax_pp.conf.in backend/v4l.conf - backend/v4l.conf.in: - Renamed backend configuration files from *.conf to - *.conf.in. The configuration files are preprocessed by - backend/Makefile now and variables like @DATADIR@ are substituted - by the appropriate directories. This is especially useful for - firmware locations. For the firmware paths for the artec_eplus48u, - gt68xx, and snapscan backends variables were used. Bug #302590. - Regenerate .conf files only if .conf.in were changed. - * backend/.cvsignore: Added *.conf. - * README.linux: Mentioned udev. - * doc/backend-writing.txt: New chapters about the build system and - the files and directories of sane-backends. Fixed building - instructions for tstbackend. Mentioned that sane_* symbols - should be only used for API symbols. - * testsuite/Makefile.in testsuite/README testsuite/testfile.pnm: - Changed testsuite to use the test backend instead of the pnm - backend. This actually works with current sane-backends. - * PROBLEMS: Removed pnm problem description. It's not relevant for - normal users and explained in the sane-pnm man page anyway. - * backend/genesys.c: Fixed some compilation warnings. - * tools/hotplug/libsane.usermap: Added Hewlett-Packard PSC 1210. + * backend/Makefile.in backend/abaton.conf backend/abaton.conf.in + backend/agfafocus.conf backend/agfafocus.conf.in + backend/apple.conf backend/apple.conf.in backend/artec.conf + backend/artec.conf.in backend/artec_eplus48u.conf + backend/artec_eplus48u.conf.in backend/avision.conf + backend/avision.conf.in backend/bh.conf backend/bh.conf.in + backend/canon.conf backend/canon.conf.in backend/canon630u.conf + backend/canon630u.conf.in backend/canon_pp.conf + backend/canon_pp.conf.in backend/coolscan.conf + backend/coolscan.conf.in backend/coolscan2.conf + backend/coolscan2.conf.in backend/dc210.conf + backend/dc210.conf.in backend/dc240.conf backend/dc240.conf.in + backend/dc25.conf backend/dc25.conf.in backend/dll.conf + backend/dll.conf.in backend/dmc.conf backend/dmc.conf.in + backend/epson.conf backend/epson.conf.in backend/fujitsu.conf + backend/fujitsu.conf.in backend/genesys.conf + backend/genesys.conf.in backend/gphoto2.conf + backend/gphoto2.conf.in backend/gt68xx.conf + backend/gt68xx.conf.in backend/hp.conf backend/hp.conf.in + backend/hp4200.conf backend/hp4200.conf.in backend/hp5400.conf + backend/hp5400.conf.in backend/hpsj5s.conf + backend/hpsj5s.conf.in backend/ibm.conf backend/ibm.conf.in + backend/leo.conf backend/leo.conf.in backend/lexmark.conf + backend/lexmark.conf.in backend/ma1509.conf + backend/ma1509.conf.in backend/matsushita.conf + backend/matsushita.conf.in backend/microtek.conf + backend/microtek.conf.in backend/microtek2.conf + backend/microtek2.conf.in backend/mustek.conf + backend/mustek.conf.in backend/mustek_pp.conf + backend/mustek_pp.conf.in backend/mustek_usb.conf + backend/mustek_usb.conf.in backend/nec.conf backend/nec.conf.in + backend/net.conf backend/net.conf.in backend/pie.conf + backend/pie.conf.in backend/plustek.conf backend/plustek.conf.in + backend/plustek_pp.conf backend/plustek_pp.conf.in + backend/qcam.conf backend/qcam.conf.in backend/ricoh.conf + backend/ricoh.conf.in backend/s9036.conf backend/s9036.conf.in + backend/saned.conf backend/saned.conf.in backend/sceptre.conf + backend/sceptre.conf.in backend/sharp.conf backend/sharp.conf.in + backend/sm3840.conf backend/sm3840.conf.in backend/snapscan.conf + backend/snapscan.conf.in backend/sp15c.conf + backend/sp15c.conf.in backend/st400.conf backend/st400.conf.in + backend/tamarack.conf backend/tamarack.conf.in + backend/teco1.conf backend/teco1.conf.in backend/teco2.conf + backend/teco2.conf.in backend/teco3.conf backend/teco3.conf.in + backend/test.conf backend/test.conf.in backend/u12.conf + backend/u12.conf.in backend/umax.conf backend/umax.conf.in + backend/umax1220u.conf backend/umax1220u.conf.in + backend/umax_pp.conf backend/umax_pp.conf.in backend/v4l.conf + backend/v4l.conf.in: + Renamed backend configuration files from *.conf to + *.conf.in. The configuration files are preprocessed by + backend/Makefile now and variables like @DATADIR@ are substituted + by the appropriate directories. This is especially useful for + firmware locations. For the firmware paths for the artec_eplus48u, + gt68xx, and snapscan backends variables were used. Bug #302590. + Regenerate .conf files only if .conf.in were changed. + * backend/.cvsignore: Added *.conf. + * README.linux: Mentioned udev. + * doc/backend-writing.txt: New chapters about the build system and + the files and directories of sane-backends. Fixed building + instructions for tstbackend. Mentioned that sane_* symbols + should be only used for API symbols. + * testsuite/Makefile.in testsuite/README testsuite/testfile.pnm: + Changed testsuite to use the test backend instead of the pnm + backend. This actually works with current sane-backends. + * PROBLEMS: Removed pnm problem description. It's not relevant for + normal users and explained in the sane-pnm man page anyway. + * backend/genesys.c: Fixed some compilation warnings. + * tools/hotplug/libsane.usermap: Added Hewlett-Packard PSC 1210. 2006-01-03 Henning Meier-Geinitz - * doc/sane.tex: Corrected formula for calculation of - bytes_per_line in chapter 4.3.8 sane_get_parameters. - New version: 1.04. + * doc/sane.tex: Corrected formula for calculation of + bytes_per_line in chapter 4.3.8 sane_get_parameters. + New version: 1.04. 2006-01-02 Henning Meier-Geinitz - * backend/microtek2.c backend/microtek2.h: Fixed problem with - option "resolution" which esists twice at the same time. Bug - #302466. - * tools/hotplug/libsane.usermap: Added Canon LiDE 60 (bug - #302830). - * backend/gt68xx.c backend/gt68xx.conf backend/gt68xx_devices.c - backend/gt68xx_high.c doc/descriptions/gt68xx.desc - doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Added Plustek - OpticPro S(T)12 (product id 0x040b). Mostly untested. Print - warmup message 5 seconds after starting the warm-up. - * doc/descriptions/unsupported.desc: Added Visioneer 9450 - USB. Updated comments for Plustek S(T)12. - * backend/test.c backend/test.conf backend/test.h - doc/sane-test.man doc/descriptions/test.desc: - Added option "source" which can be used to simulate an Automatic - Document Feeder (ADF). Added copyright header to test.h. - * frontend/scanimage.c: Don't create and delete a file in batch - mode if the document feeder is empty or if CTRL-D is pressed in - prompt mode. This change avoids deleting existing files. For an - explanation, see bug #302797. + * backend/microtek2.c backend/microtek2.h: Fixed problem with + option "resolution" which esists twice at the same time. Bug + #302466. + * tools/hotplug/libsane.usermap: Added Canon LiDE 60 (bug + #302830). + * backend/gt68xx.c backend/gt68xx.conf backend/gt68xx_devices.c + backend/gt68xx_high.c doc/descriptions/gt68xx.desc + doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Added Plustek + OpticPro S(T)12 (product id 0x040b). Mostly untested. Print + warmup message 5 seconds after starting the warm-up. + * doc/descriptions/unsupported.desc: Added Visioneer 9450 + USB. Updated comments for Plustek S(T)12. + * backend/test.c backend/test.conf backend/test.h + doc/sane-test.man doc/descriptions/test.desc: + Added option "source" which can be used to simulate an Automatic + Document Feeder (ADF). Added copyright header to test.h. + * frontend/scanimage.c: Don't create and delete a file in batch + mode if the document feeder is empty or if CTRL-D is pressed in + prompt mode. This change avoids deleting existing files. For an + explanation, see bug #302797. 2006-01-01 Oliver Schwartz - * backend/snapscan-data.c backend/snapscan-options.c backend/snapscan.c - doc/descriptions/snascan.desc: - Added (static) calibration data for Benq 5150 / 5250 - * backend/snapscan.h backend/snapscan.conf: - Added preliminary support for Epson Stylus CX 1500 - * backend/Makefile.in: Added snapscan-data.c + * backend/snapscan-data.c backend/snapscan-options.c backend/snapscan.c + doc/descriptions/snascan.desc: + Added (static) calibration data for Benq 5150 / 5250 + * backend/snapscan.h backend/snapscan.conf: + Added preliminary support for Epson Stylus CX 1500 + * backend/Makefile.in: Added snapscan-data.c 2005-12-29 Henning Meier-Geinitz - * doc/descriptions-external/scanwit.desc: Added "(Acer)" to - manufacturer name (bug #302801). - * doc/descriptions/unsupported.desc: Added/updated several old - Acer (Benq) and Agfa parport scanners. + * doc/descriptions-external/scanwit.desc: Added "(Acer)" to + manufacturer name (bug #302801). + * doc/descriptions/unsupported.desc: Added/updated several old + Acer (Benq) and Agfa parport scanners. 2005-12-28 Henning Meier-Geinitz - * tools/hotplug/libsane.usermap: Added Brother MFC 8440. - * Makefile.in: make libcheck now also checks for non standard sane - symbols (sane_*). - * doc/descriptions/unsupported.desc: HP Scanjet 3690 uses GL646_HP - chipset. + * tools/hotplug/libsane.usermap: Added Brother MFC 8440. + * Makefile.in: make libcheck now also checks for non standard sane + symbols (sane_*). + * doc/descriptions/unsupported.desc: HP Scanjet 3690 uses GL646_HP + chipset. 2005-12-27 Henning Meier-Geinitz - * README.linux: Mention ld.so.conf issue. - * doc/descriptions/unsupported.desc - doc/descriptions-external/hp3900.desc: Added external hp3900 - backend. Moved (possibly) supported scanners from - unsupported.desc. - * doc/backend-writing.c: Added some hints about what to do to add - a new backend to the existing sane-backends code. + * README.linux: Mention ld.so.conf issue. + * doc/descriptions/unsupported.desc + doc/descriptions-external/hp3900.desc: Added external hp3900 + backend. Moved (possibly) supported scanners from + unsupported.desc. + * doc/backend-writing.c: Added some hints about what to do to add + a new backend to the existing sane-backends code. 2005-12-24 Henning Meier-Geinitz - * doc/descriptions/unsupported.desc: Added Lexmark X2330. + * doc/descriptions/unsupported.desc: Added Lexmark X2330. 2005-12-23 Henning Meier-Geinitz - * doc/descriptions/unsupported.desc: Added Canon Pixma MP500. - * README.openbsd: Added hint about CPPFLAGS. - * doc/descriptions/artec.desc: Changed status of Artec AT6 to - "good" as reported in bug #302749. - * tools/hotplug/libsane.usermap: Added Brother MFC-7420. + * doc/descriptions/unsupported.desc: Added Canon Pixma MP500. + * README.openbsd: Added hint about CPPFLAGS. + * doc/descriptions/artec.desc: Changed status of Artec AT6 to + "good" as reported in bug #302749. + * tools/hotplug/libsane.usermap: Added Brother MFC-7420. 2005-12-20 Henning Meier-Geinitz - * backend/dll.c doc/descriptions/dll.desc: Fixed dynamic loading - on current HP/UX systems (bug #302732). - * AUTHORS ChangeLog configure configure.in backend/Makefile.in - backend/dll.conf backend/hp3500.c doc/Makefile.in - doc/sane-hp3500.man doc/sane.man doc/descriptions/hp3500.desc: - Added hp3500 backend which supports the HP ScanJet 3500 series, - including the 3500C, 3530C and 3570C (patch from Troy Rollo - ) (bug #302687). - * doc/descriptions-external/hp3500.desc: Deleted. - * doc/descriptions/hp4200.desc doc/descriptions/lexmark.desc - doc/descriptions/mustek_usb2.desc: Removed "NEW!" markers. + * backend/dll.c doc/descriptions/dll.desc: Fixed dynamic loading + on current HP/UX systems (bug #302732). + * AUTHORS ChangeLog configure configure.in backend/Makefile.in + backend/dll.conf backend/hp3500.c doc/Makefile.in + doc/sane-hp3500.man doc/sane.man doc/descriptions/hp3500.desc: + Added hp3500 backend which supports the HP ScanJet 3500 series, + including the 3500C, 3530C and 3570C (patch from Troy Rollo + ) (bug #302687). + * doc/descriptions-external/hp3500.desc: Deleted. + * doc/descriptions/hp4200.desc doc/descriptions/lexmark.desc + doc/descriptions/mustek_usb2.desc: Removed "NEW!" markers. 2005-12-18 Henning Meier-Geinitz - * Makefile.in: List ChangeLog-1.0.17 in DISTFILES. - * configure configure.in: Changed version to 1.0.17-cvs. Enabled - compilation warnings. - * doc/descriptions-external/brother2.desc: Added Brother MFC-215C. - + * Makefile.in: List ChangeLog-1.0.17 in DISTFILES. + * configure configure.in: Changed version to 1.0.17-cvs. Enabled + compilation warnings. + * doc/descriptions-external/brother2.desc: Added Brother MFC-215C. + Older entries can be found in ChangeLog-1.0.17. diff --git a/backend/niash.c b/backend/niash.c index 8ab64584e..41c572d98 100644 --- a/backend/niash.c +++ b/backend/niash.c @@ -31,8 +31,8 @@ #include "../include/sane/sanei_config.h" #include "../include/sane/saneopts.h" -#include /* malloc, free */ -#include /* memcpy */ +#include /* malloc, free */ +#include /* memcpy */ #include #include #include @@ -73,7 +73,7 @@ typedef enum optDPI, optGroupImage, - optGammaTable, /* gamma table */ + optGammaTable, /* gamma table */ optGroupMode, optMode, @@ -89,14 +89,14 @@ typedef enum optLamp, optCalibrate, - optGamma /* analog gamma = single number */ + optGamma /* analog gamma = single number */ } EOptionIndex; typedef union { SANE_Word w; - SANE_Word *wa; /* word array */ + SANE_Word *wa; /* word array */ SANE_String s; } TOptionValue; @@ -112,20 +112,20 @@ typedef struct THWParams HWParams; TDataPipe DataPipe; - int iLinesLeft; /* lines to scan */ - int iBytesLeft; /* bytes to read */ - int iPixelsPerLine; /* pixels in one scan line */ + int iLinesLeft; /* lines to scan */ + int iBytesLeft; /* bytes to read */ + int iPixelsPerLine; /* pixels in one scan line */ - SANE_Int aGammaTable[SANE_GAMMA_SIZE]; /* a 12-to-8 bit color lookup table */ + SANE_Int aGammaTable[SANE_GAMMA_SIZE]; /* a 12-to-8 bit color lookup table */ /* fCancelled needed to let sane issue the cancel message instead of an error message */ - SANE_Bool fCancelled; /* SANE_TRUE if scanning cancelled */ + SANE_Bool fCancelled; /* SANE_TRUE if scanning cancelled */ - SANE_Bool fScanning; /* SANE_TRUE if actively scanning */ + SANE_Bool fScanning; /* SANE_TRUE if actively scanning */ - int WarmUpTime; /* time to wait before a calibration starts */ - unsigned char CalWhite[3]; /* values for the last calibration of white */ + int WarmUpTime; /* time to wait before a calibration starts */ + unsigned char CalWhite[3]; /* values for the last calibration of white */ struct timeval WarmUpStarted; /* system type to trace the time elapsed */ } TScanner; @@ -155,7 +155,7 @@ static const SANE_Range rangeGamma = { SANE_FIX (0.25), SANE_FIX (4.0), SANE_FIX (0.0) }; -/* interpolate a sane gamma table to a hardware appropriate one +/* interpolate a sane gamma table to a hardware appropriate one just in case the sane gamma table would be smaller */ static void _ConvertGammaTable (SANE_Word * saneGamma, unsigned char *hwGamma) @@ -175,11 +175,11 @@ _ConvertGammaTable (SANE_Word * saneGamma, unsigned char *hwGamma) /* the interpolation of the rest depends on the gap */ for (j = current + 1; j < HW_GAMMA_SIZE && j < next; ++j) - { - hwGamma[j] = - (saneGamma[i] * (next - j) + - saneGamma[i + 1] * (j - current)) / (next - current); - } + { + hwGamma[j] = + (saneGamma[i] * (next - j) + + saneGamma[i + 1] * (j - current)) / (next - current); + } current = next; } } @@ -241,7 +241,7 @@ static int _bytesPerLineLineart (int pixelsPerLine) { return (pixelsPerLine * BITS_PER_PIXEL_LINEART + - BITS_PADDING) / BITS_PER_BYTE; + BITS_PADDING) / BITS_PER_BYTE; } static int @@ -254,7 +254,7 @@ static int _bytesPerLineColor (int pixelsPerLine) { return (pixelsPerLine * BITS_PER_PIXEL_COLOR + - BITS_PADDING) / BITS_PER_BYTE; + BITS_PADDING) / BITS_PER_BYTE; } @@ -290,11 +290,11 @@ _rgb2gray (unsigned char *buffer, int pixels, int threshold) { acc += aWeight[x % BYTES_PER_PIXEL_COLOR] * buffer[x]; if ((x + 1) % BYTES_PER_PIXEL_COLOR == 0) - { - buffer[x / BYTES_PER_PIXEL_COLOR] = - (unsigned char) (acc / WEIGHT_W); - acc = 0; - } + { + buffer[x / BYTES_PER_PIXEL_COLOR] = + (unsigned char) (acc / WEIGHT_W); + acc = 0; + } } #undef WEIGHT_R #undef WEIGHT_G @@ -317,14 +317,14 @@ _rgb2lineart (unsigned char *buffer, int pixels, int threshold) for (x = 0; x < nx; ++x) { if (x < pixels && buffer[x] < thresh) - { - acc |= aMask[x % BITS_PER_BYTE]; - } + { + acc |= aMask[x % BITS_PER_BYTE]; + } if ((x + 1) % BITS_PER_BYTE == 0) - { - buffer[x / BITS_PER_BYTE] = (unsigned char) (acc); - acc = 0; - } + { + buffer[x / BITS_PER_BYTE] = (unsigned char) (acc); + acc = 0; + } } } @@ -344,11 +344,11 @@ static const TModeParam modeParam[] = { }; -#define WARMUP_AFTERSTART 1 /* flag for 1st warm up */ +#define WARMUP_AFTERSTART 1 /* flag for 1st warm up */ #define WARMUP_INSESSION 0 -#define WARMUP_TESTINTERVAL 15 /* test every 15sec */ -#define WARMUP_TIME 30 /* first wait is 30sec minimum */ -#define WARMUP_MAXTIME 90 /* after one and a half minute start latest */ +#define WARMUP_TESTINTERVAL 15 /* test every 15sec */ +#define WARMUP_TIME 30 /* first wait is 30sec minimum */ +#define WARMUP_MAXTIME 90 /* after one and a half minute start latest */ #define CAL_DEV_MAX 15 /* maximum deviation of cal values in percent between 2 tests */ @@ -399,13 +399,13 @@ _WarmUpLamp (TScanner * s, int iMode) static void _WaitForLamp (TScanner * s, unsigned char *pabCalibTable) { - struct timeval now[2]; /* toggling time holder */ - int i; /* rgb loop */ - int iCal = 0; /* counter */ - int iCurrent = 0; /* buffer and time-holder swap flag */ + struct timeval now[2]; /* toggling time holder */ + int i; /* rgb loop */ + int iCal = 0; /* counter */ + int iCurrent = 0; /* buffer and time-holder swap flag */ SANE_Bool fHasCal; - unsigned char CalWhite[2][3]; /* toggling buffer */ - int iDelay = 0; /* delay loop counter */ + unsigned char CalWhite[2][3]; /* toggling buffer */ + int iDelay = 0; /* delay loop counter */ _WarmUpLamp (s, SANE_FALSE); @@ -424,101 +424,101 @@ _WaitForLamp (TScanner * s, unsigned char *pabCalibTable) /* check if the last scan has lower calibration values than the current one would have */ if (s->WarmUpTime && fHasCal) - { - SANE_Bool fOver = SANE_TRUE; - for (i = 0; fOver && i < 3; ++i) - { - if (!s->CalWhite[i]) - fOver = SANE_FALSE; - else if (CalWhite[iCurrent][i] < s->CalWhite[i]) - fOver = SANE_FALSE; - } + { + SANE_Bool fOver = SANE_TRUE; + for (i = 0; fOver && i < 3; ++i) + { + if (!s->CalWhite[i]) + fOver = SANE_FALSE; + else if (CalWhite[iCurrent][i] < s->CalWhite[i]) + fOver = SANE_FALSE; + } - /* warm up is not needed, when calibration data is above - the calibration data of the last scan */ - if (fOver) - { - s->WarmUpTime = 0; - DBG (DBG_MSG, - "_WaitForLamp: Values seem stable, skipping next calibration cycle\n"); - } - } + /* warm up is not needed, when calibration data is above + the calibration data of the last scan */ + if (fOver) + { + s->WarmUpTime = 0; + DBG (DBG_MSG, + "_WaitForLamp: Values seem stable, skipping next calibration cycle\n"); + } + } /* break the loop, when the longest wait time has expired - to prevent a hanging application, + to prevent a hanging application, even if the values might not be good, yet */ if (s->WarmUpTime && fHasCal && iCal) - { - /* abort, when we have waited long enough */ - if (_TimeElapsed - (&s->WarmUpStarted, &now[iCurrent], WARMUP_MAXTIME)) - { - /* stop idling */ - s->WarmUpTime = 0; - DBG (DBG_MSG, "_WaitForLamp: WARMUP_MAXTIME=%ds elapsed!\n", - WARMUP_MAXTIME); - } - } + { + /* abort, when we have waited long enough */ + if (_TimeElapsed + (&s->WarmUpStarted, &now[iCurrent], WARMUP_MAXTIME)) + { + /* stop idling */ + s->WarmUpTime = 0; + DBG (DBG_MSG, "_WaitForLamp: WARMUP_MAXTIME=%ds elapsed!\n", + WARMUP_MAXTIME); + } + } /* enter a delay loop, when there is still time to wait */ if (s->WarmUpTime) - { - /* if the (too low) calibration values have just been acquired - we start waiting */ - if (fHasCal) - DBG (DBG_MSG, "_WaitForLamp: entering delay loop\r"); - else - DBG (DBG_MSG, "_WaitForLamp: delay loop %d \r", ++iDelay); - sleep (1); - fHasCal = SANE_FALSE; - gettimeofday (&now[!iCurrent], 0); - } + { + /* if the (too low) calibration values have just been acquired + we start waiting */ + if (fHasCal) + DBG (DBG_MSG, "_WaitForLamp: entering delay loop\r"); + else + DBG (DBG_MSG, "_WaitForLamp: delay loop %d \r", ++iDelay); + sleep (1); + fHasCal = SANE_FALSE; + gettimeofday (&now[!iCurrent], 0); + } /* look if we should check again */ - if (s->WarmUpTime /* did we have to wait at all */ - /* is the minimum time elapsed */ - && _TimeElapsed (&s->WarmUpStarted, &now[!iCurrent], s->WarmUpTime) - /* has the minimum time elapsed since the last calibration */ - && _TimeElapsed (&now[iCurrent], &now[!iCurrent], - WARMUP_TESTINTERVAL)) - { - int dev = 0; /* 0 percent deviation in cal value as default */ - iDelay = 0; /* all delays processed */ - /* new calibration */ - ++iCal; - iCurrent = !iCurrent; /* swap the test-buffer, and time-holder */ - SimpleCalibExt (&s->HWParams, pabCalibTable, CalWhite[iCurrent]); - fHasCal = SANE_TRUE; + if (s->WarmUpTime /* did we have to wait at all */ + /* is the minimum time elapsed */ + && _TimeElapsed (&s->WarmUpStarted, &now[!iCurrent], s->WarmUpTime) + /* has the minimum time elapsed since the last calibration */ + && _TimeElapsed (&now[iCurrent], &now[!iCurrent], + WARMUP_TESTINTERVAL)) + { + int dev = 0; /* 0 percent deviation in cal value as default */ + iDelay = 0; /* all delays processed */ + /* new calibration */ + ++iCal; + iCurrent = !iCurrent; /* swap the test-buffer, and time-holder */ + SimpleCalibExt (&s->HWParams, pabCalibTable, CalWhite[iCurrent]); + fHasCal = SANE_TRUE; - for (i = 0; i < 3; ++i) - { - /* copy for faster and clearer access */ - int cwa; - int cwb; - int ldev; - cwa = CalWhite[!iCurrent][i]; - cwb = CalWhite[iCurrent][i]; - /* find the biggest deviation of one color */ - if (cwa > cwb) - ldev = 0; - else if (cwa && cwb) - ldev = ((cwb - cwa) * 100) / cwb; - else - ldev = 100; - dev = MAX (dev, ldev); - } + for (i = 0; i < 3; ++i) + { + /* copy for faster and clearer access */ + int cwa; + int cwb; + int ldev; + cwa = CalWhite[!iCurrent][i]; + cwb = CalWhite[iCurrent][i]; + /* find the biggest deviation of one color */ + if (cwa > cwb) + ldev = 0; + else if (cwa && cwb) + ldev = ((cwb - cwa) * 100) / cwb; + else + ldev = 100; + dev = MAX (dev, ldev); + } - /* show the biggest deviation of the calibration values */ - DBG (DBG_MSG, "_WaitForLamp: recalibration #%d, deviation = %d%%\n", - iCal, dev); + /* show the biggest deviation of the calibration values */ + DBG (DBG_MSG, "_WaitForLamp: recalibration #%d, deviation = %d%%\n", + iCal, dev); - /* the deviation to the previous calibration is tolerable */ - if (dev <= CAL_DEV_MAX) - s->WarmUpTime = 0; - } + /* the deviation to the previous calibration is tolerable */ + if (dev <= CAL_DEV_MAX) + s->WarmUpTime = 0; + } } /* remember the values of this calibration @@ -541,10 +541,10 @@ _SetScalarGamma (SANE_Int * aiGamma, SANE_Int sfGamma) { int iData; iData = - floor (256.0 * - pow (((double) j / (double) SANE_GAMMA_SIZE), 1.0 / fGamma)); + floor (256.0 * + pow (((double) j / (double) SANE_GAMMA_SIZE), 1.0 / fGamma)); if (iData > 255) - iData = 255; + iData = 255; aiGamma[j] = iData; } } @@ -561,7 +561,7 @@ _MaxStringSize (const SANE_String_Const strings[]) { size = strlen (strings[i]) + 1; if (size > max_size) - max_size = size; + max_size = size; } return max_size; } @@ -609,172 +609,172 @@ _InitOptions (TScanner * s) pDesc->cap = 0; switch (i) - { + { - case optCount: - pDesc->title = SANE_TITLE_NUM_OPTIONS; - pDesc->desc = SANE_DESC_NUM_OPTIONS; - pDesc->cap = SANE_CAP_SOFT_DETECT; - pVal->w = (SANE_Word) optLast; - break; + case optCount: + pDesc->title = SANE_TITLE_NUM_OPTIONS; + pDesc->desc = SANE_DESC_NUM_OPTIONS; + pDesc->cap = SANE_CAP_SOFT_DETECT; + pVal->w = (SANE_Word) optLast; + break; - case optGroupGeometry: - pDesc->title = "Geometry"; - pDesc->type = SANE_TYPE_GROUP; - pDesc->size = 0; - break; + case optGroupGeometry: + pDesc->title = "Geometry"; + pDesc->type = SANE_TYPE_GROUP; + pDesc->size = 0; + break; - case optTLX: - pDesc->name = SANE_NAME_SCAN_TL_X; - pDesc->title = SANE_TITLE_SCAN_TL_X; - pDesc->desc = SANE_DESC_SCAN_TL_X; - pDesc->unit = SANE_UNIT_MM; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeXmm; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = rangeXmm.min; - break; + case optTLX: + pDesc->name = SANE_NAME_SCAN_TL_X; + pDesc->title = SANE_TITLE_SCAN_TL_X; + pDesc->desc = SANE_DESC_SCAN_TL_X; + pDesc->unit = SANE_UNIT_MM; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeXmm; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = rangeXmm.min; + break; - case optTLY: - pDesc->name = SANE_NAME_SCAN_TL_Y; - pDesc->title = SANE_TITLE_SCAN_TL_Y; - pDesc->desc = SANE_DESC_SCAN_TL_Y; - pDesc->unit = SANE_UNIT_MM; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeYmm; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = rangeYmm.min; - break; + case optTLY: + pDesc->name = SANE_NAME_SCAN_TL_Y; + pDesc->title = SANE_TITLE_SCAN_TL_Y; + pDesc->desc = SANE_DESC_SCAN_TL_Y; + pDesc->unit = SANE_UNIT_MM; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeYmm; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = rangeYmm.min; + break; - case optBRX: - pDesc->name = SANE_NAME_SCAN_BR_X; - pDesc->title = SANE_TITLE_SCAN_BR_X; - pDesc->desc = SANE_DESC_SCAN_BR_X; - pDesc->unit = SANE_UNIT_MM; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeXmm; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = 210 /* A4 width instead of rangeXmm.max */ ; - break; + case optBRX: + pDesc->name = SANE_NAME_SCAN_BR_X; + pDesc->title = SANE_TITLE_SCAN_BR_X; + pDesc->desc = SANE_DESC_SCAN_BR_X; + pDesc->unit = SANE_UNIT_MM; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeXmm; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = 210 /* A4 width instead of rangeXmm.max */ ; + break; - case optBRY: - pDesc->name = SANE_NAME_SCAN_BR_Y; - pDesc->title = SANE_TITLE_SCAN_BR_Y; - pDesc->desc = SANE_DESC_SCAN_BR_Y; - pDesc->unit = SANE_UNIT_MM; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeYmm; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = 290 /* have a bit reserve instaed of rangeYmm.max */ ; - break; + case optBRY: + pDesc->name = SANE_NAME_SCAN_BR_Y; + pDesc->title = SANE_TITLE_SCAN_BR_Y; + pDesc->desc = SANE_DESC_SCAN_BR_Y; + pDesc->unit = SANE_UNIT_MM; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeYmm; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = 290 /* have a bit reserve instaed of rangeYmm.max */ ; + break; - case optDPI: - pDesc->name = SANE_NAME_SCAN_RESOLUTION; - pDesc->title = SANE_TITLE_SCAN_RESOLUTION; - pDesc->desc = SANE_DESC_SCAN_RESOLUTION; - pDesc->unit = SANE_UNIT_DPI; - pDesc->constraint_type = SANE_CONSTRAINT_WORD_LIST; - pDesc->constraint.word_list = setResolutions; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = setResolutions[2]; /* default to 150dpi */ - break; + case optDPI: + pDesc->name = SANE_NAME_SCAN_RESOLUTION; + pDesc->title = SANE_TITLE_SCAN_RESOLUTION; + pDesc->desc = SANE_DESC_SCAN_RESOLUTION; + pDesc->unit = SANE_UNIT_DPI; + pDesc->constraint_type = SANE_CONSTRAINT_WORD_LIST; + pDesc->constraint.word_list = setResolutions; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = setResolutions[2]; /* default to 150dpi */ + break; - case optGroupImage: - pDesc->title = SANE_I18N ("Image"); - pDesc->type = SANE_TYPE_GROUP; - pDesc->size = 0; - break; + case optGroupImage: + pDesc->title = SANE_I18N ("Image"); + pDesc->type = SANE_TYPE_GROUP; + pDesc->size = 0; + break; - case optGamma: - pDesc->name = SANE_NAME_ANALOG_GAMMA; - pDesc->title = SANE_TITLE_ANALOG_GAMMA; - pDesc->desc = SANE_DESC_ANALOG_GAMMA; - pDesc->type = SANE_TYPE_FIXED; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeGamma; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = startUpGamma; - break; + case optGamma: + pDesc->name = SANE_NAME_ANALOG_GAMMA; + pDesc->title = SANE_TITLE_ANALOG_GAMMA; + pDesc->desc = SANE_DESC_ANALOG_GAMMA; + pDesc->type = SANE_TYPE_FIXED; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeGamma; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->w = startUpGamma; + break; - case optGammaTable: - pDesc->name = SANE_NAME_GAMMA_VECTOR; - pDesc->title = SANE_TITLE_GAMMA_VECTOR; - pDesc->desc = SANE_DESC_GAMMA_VECTOR; - pDesc->size = sizeof (s->aGammaTable); - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeGammaTable; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->wa = s->aGammaTable; - break; + case optGammaTable: + pDesc->name = SANE_NAME_GAMMA_VECTOR; + pDesc->title = SANE_TITLE_GAMMA_VECTOR; + pDesc->desc = SANE_DESC_GAMMA_VECTOR; + pDesc->size = sizeof (s->aGammaTable); + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeGammaTable; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + pVal->wa = s->aGammaTable; + break; - case optGroupMisc: - pDesc->title = SANE_I18N ("Miscellaneous"); - pDesc->type = SANE_TYPE_GROUP; - pDesc->size = 0; - break; + case optGroupMisc: + pDesc->title = SANE_I18N ("Miscellaneous"); + pDesc->type = SANE_TYPE_GROUP; + pDesc->size = 0; + break; - case optLamp: - pDesc->name = "lamp"; - pDesc->title = SANE_I18N ("Lamp status"); - pDesc->desc = SANE_I18N ("Switches the lamp on or off."); - pDesc->type = SANE_TYPE_BOOL; - pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - /* switch the lamp on when starting for first the time */ - pVal->w = SANE_TRUE; - break; + case optLamp: + pDesc->name = "lamp"; + pDesc->title = SANE_I18N ("Lamp status"); + pDesc->desc = SANE_I18N ("Switches the lamp on or off."); + pDesc->type = SANE_TYPE_BOOL; + pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; + /* switch the lamp on when starting for first the time */ + pVal->w = SANE_TRUE; + break; - case optCalibrate: - pDesc->name = "calibrate"; - pDesc->title = SANE_I18N ("Calibrate"); - pDesc->desc = SANE_I18N ("Calibrates for black and white level."); - pDesc->type = SANE_TYPE_BUTTON; - pDesc->cap = SANE_CAP_SOFT_SELECT; - pDesc->size = 0; - break; + case optCalibrate: + pDesc->name = "calibrate"; + pDesc->title = SANE_I18N ("Calibrate"); + pDesc->desc = SANE_I18N ("Calibrates for black and white level."); + pDesc->type = SANE_TYPE_BUTTON; + pDesc->cap = SANE_CAP_SOFT_SELECT; + pDesc->size = 0; + break; - case optGroupMode: - pDesc->title = SANE_I18N ("Scan Mode"); - pDesc->desc = ""; - pDesc->type = SANE_TYPE_GROUP; - break; + case optGroupMode: + pDesc->title = SANE_I18N ("Scan Mode"); + pDesc->desc = ""; + pDesc->type = SANE_TYPE_GROUP; + break; - case optMode: - /* scan mode */ - pDesc->name = SANE_NAME_SCAN_MODE; - pDesc->title = SANE_TITLE_SCAN_MODE; - pDesc->desc = SANE_DESC_SCAN_MODE; - pDesc->type = SANE_TYPE_STRING; - pDesc->size = _MaxStringSize (modeList); - pDesc->constraint_type = SANE_CONSTRAINT_STRING_LIST; - pDesc->constraint.string_list = modeList; - pDesc->cap = - SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_EMULATED; - pVal->w = MODE_COLOR; - break; + case optMode: + /* scan mode */ + pDesc->name = SANE_NAME_SCAN_MODE; + pDesc->title = SANE_TITLE_SCAN_MODE; + pDesc->desc = SANE_DESC_SCAN_MODE; + pDesc->type = SANE_TYPE_STRING; + pDesc->size = _MaxStringSize (modeList); + pDesc->constraint_type = SANE_CONSTRAINT_STRING_LIST; + pDesc->constraint.string_list = modeList; + pDesc->cap = + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_EMULATED; + pVal->w = MODE_COLOR; + break; - case optGroupEnhancement: - pDesc->title = SANE_I18N ("Enhancement"); - pDesc->desc = ""; - pDesc->type = SANE_TYPE_GROUP; - break; + case optGroupEnhancement: + pDesc->title = SANE_I18N ("Enhancement"); + pDesc->desc = ""; + pDesc->type = SANE_TYPE_GROUP; + break; - case optThreshold: - pDesc->name = SANE_NAME_THRESHOLD; - pDesc->title = SANE_TITLE_THRESHOLD; - pDesc->desc = SANE_DESC_THRESHOLD; - pDesc->type = SANE_TYPE_INT; - pDesc->unit = SANE_UNIT_PERCENT; - pDesc->constraint_type = SANE_CONSTRAINT_RANGE; - pDesc->constraint.range = &rangeThreshold; - pDesc->cap = - SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE | - SANE_CAP_EMULATED; - pVal->w = 50; + case optThreshold: + pDesc->name = SANE_NAME_THRESHOLD; + pDesc->title = SANE_TITLE_THRESHOLD; + pDesc->desc = SANE_DESC_THRESHOLD; + pDesc->type = SANE_TYPE_INT; + pDesc->unit = SANE_UNIT_PERCENT; + pDesc->constraint_type = SANE_CONSTRAINT_RANGE; + pDesc->constraint.range = &rangeThreshold; + pDesc->cap = + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE | + SANE_CAP_EMULATED; + pVal->w = 50; - default: - DBG (DBG_ERR, "Uninitialised option %d\n", i); - break; - } + default: + DBG (DBG_ERR, "Uninitialised option %d\n", i); + break; + } } } @@ -801,9 +801,9 @@ _ReportDevice (TScannerModel * pModel, const char *pszDeviceName) else { for (pDev = _pFirstSaneDev; pDev->pNext; pDev = pDev->pNext) - { - ; - } + { + ; + } pDev->pNext = pNew; } @@ -856,11 +856,11 @@ sane_exit (void) if (_pSaneDevList) { for (pDev = _pFirstSaneDev; pDev; pDev = pNext) - { - pNext = pDev->pNext; - free ((void *) pDev->dev.name); - free (pDev); - } + { + pNext = pDev->pNext; + free ((void *) pDev->dev.name); + free (pDev); + } _pFirstSaneDev = 0; free (_pSaneDevList); _pSaneDevList = 0; @@ -894,7 +894,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { _pSaneDevList[i++] = &pDev->dev; } - _pSaneDevList[i++] = 0; /* last entry is 0 */ + _pSaneDevList[i++] = 0; /* last entry is 0 */ *device_list = _pSaneDevList; @@ -981,7 +981,7 @@ sane_get_option_descriptor (SANE_Handle h, SANE_Int n) SANE_Status sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action Action, - void *pVal, SANE_Int * pInfo) + void *pVal, SANE_Int * pInfo) { TScanner *s; SANE_Bool fVal; @@ -1003,182 +1003,186 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action Action, { case SANE_ACTION_GET_VALUE: switch (n) - { + { - /* Get options of type SANE_Word */ - case optCount: - case optDPI: - case optGamma: - case optTLX: - case optTLY: - case optBRX: - case optBRY: - case optThreshold: - DBG (DBG_MSG, - "sane_control_option: SANE_ACTION_GET_VALUE %d = %d\n", n, - (int) s->aValues[n].w); - *(SANE_Word *) pVal = s->aValues[n].w; - break; + /* Get options of type SANE_Word */ + case optCount: + case optDPI: + case optGamma: + case optTLX: + case optTLY: + case optBRX: + case optBRY: + case optThreshold: + DBG (DBG_MSG, + "sane_control_option: SANE_ACTION_GET_VALUE %d = %d\n", n, + (int) s->aValues[n].w); + *(SANE_Word *) pVal = s->aValues[n].w; + break; - /* Get options of type SANE_Word array */ - case optGammaTable: - DBG (DBG_MSG, "Reading gamma table\n"); - memcpy (pVal, s->aValues[n].wa, s->aOptions[n].size); - break; + /* Get options of type SANE_Word array */ + case optGammaTable: + DBG (DBG_MSG, "Reading gamma table\n"); + memcpy (pVal, s->aValues[n].wa, s->aOptions[n].size); + break; - case optMode: - DBG (DBG_MSG, "Reading scan mode %s\n", - modeList[s->aValues[optMode].w]); - strcpy ((char *) pVal, modeList[s->aValues[optMode].w]); - break; + case optMode: + DBG (DBG_MSG, "Reading scan mode %s\n", + modeList[s->aValues[optMode].w]); + strcpy ((char *) pVal, modeList[s->aValues[optMode].w]); + break; - /* Get options of type SANE_Bool */ - case optLamp: - GetLamp (&s->HWParams, &fLampIsOn); - *(SANE_Bool *) pVal = fLampIsOn; - break; + /* Get options of type SANE_Bool */ + case optLamp: + GetLamp (&s->HWParams, &fLampIsOn); + *(SANE_Bool *) pVal = fLampIsOn; + break; - case optCalibrate: - /* although this option has nothing to read, - it's added here to avoid a warning when running scanimage --help */ - break; + case optCalibrate: + /* although this option has nothing to read, + it's added here to avoid a warning when running scanimage --help */ + break; - default: - DBG (DBG_MSG, "SANE_ACTION_GET_VALUE: Invalid option (%d)\n", n); - } + default: + DBG (DBG_MSG, "SANE_ACTION_GET_VALUE: Invalid option (%d)\n", n); + } break; case SANE_ACTION_SET_VALUE: if (s->fScanning) - { - DBG (DBG_ERR, - "sane_control_option: SANE_ACTION_SET_VALUE not allowed during scan\n"); - return SANE_STATUS_INVAL; - } + { + DBG (DBG_ERR, + "sane_control_option: SANE_ACTION_SET_VALUE not allowed during scan\n"); + return SANE_STATUS_INVAL; + } switch (n) - { + { - case optCount: - return SANE_STATUS_INVAL; + case optCount: + return SANE_STATUS_INVAL; - case optGamma: - case optDPI: - case optTLX: - case optTLY: - case optBRX: - case optBRY: - case optThreshold: - info |= SANE_INFO_RELOAD_PARAMS; - status = sanei_constrain_value (&s->aOptions[n], pVal, &info); - if (status != SANE_STATUS_GOOD) - { - DBG (DBG_ERR, "Failed to constrain option %d (%s)\n", n, - s->aOptions[n].title); - return status; - } + case optGamma: + case optThreshold: + case optDPI: - /* check values if they are equal */ - fSame = s->aValues[n].w == *(SANE_Word *) pVal; + info |= SANE_INFO_RELOAD_PARAMS; + /* fall through */ - /* set the values */ - s->aValues[n].w = *(SANE_Word *) pVal; - DBG (DBG_MSG, - "sane_control_option: SANE_ACTION_SET_VALUE %d = %d\n", n, - (int) s->aValues[n].w); - if (n == optGamma) - { - if (!fSame && optLast > optGammaTable) - { - info |= SANE_INFO_RELOAD_OPTIONS; - } - _SetScalarGamma (s->aGammaTable, s->aValues[n].w); - } - break; + case optTLX: + case optTLY: + case optBRX: + case optBRY: - case optGammaTable: - DBG (DBG_MSG, "Writing gamma table\n"); - pi = (SANE_Int *) pVal; - memcpy (s->aValues[n].wa, pVal, s->aOptions[n].size); + status = sanei_constrain_value (&s->aOptions[n], pVal, &info); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_ERR, "Failed to constrain option %d (%s)\n", n, + s->aOptions[n].title); + return status; + } - /* prepare table for debug */ - strcpy (szTable, "Gamma table summary:"); - for (i = 0; i < SANE_GAMMA_SIZE; i++) - { - if ((SANE_GAMMA_SIZE / 16) && (i % (SANE_GAMMA_SIZE / 16)) == 0) - { - strcat (szTable, "\n"); - DBG (DBG_MSG, szTable); - strcpy (szTable, ""); - } - /* test for number print */ - if ((SANE_GAMMA_SIZE / 64) && (i % (SANE_GAMMA_SIZE / 64)) == 0) - { - sprintf (szTemp, " %04X", pi[i]); - strcat (szTable, szTemp); - } - } - if (strlen (szTable)) - { - strcat (szTable, "\n"); - DBG (DBG_MSG, szTable); - } - break; + /* check values if they are equal */ + fSame = s->aValues[n].w == *(SANE_Word *) pVal; - case optMode: - { - SANE_Word *pCap; - int fCapChanged = 0; + /* set the values */ + s->aValues[n].w = *(SANE_Word *) pVal; + DBG (DBG_MSG, + "sane_control_option: SANE_ACTION_SET_VALUE %d = %d\n", n, + (int) s->aValues[n].w); + if (n == optGamma) + { + if (!fSame && optLast > optGammaTable) + { + info |= SANE_INFO_RELOAD_OPTIONS; + } + _SetScalarGamma (s->aGammaTable, s->aValues[n].w); + } + break; - pCap = &s->aOptions[optThreshold].cap; + case optGammaTable: + DBG (DBG_MSG, "Writing gamma table\n"); + pi = (SANE_Int *) pVal; + memcpy (s->aValues[n].wa, pVal, s->aOptions[n].size); - if (strcmp ((char const *) pVal, colorStr) == 0) - { - s->aValues[optMode].w = MODE_COLOR; - fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 1); - } - if (strcmp ((char const *) pVal, grayStr) == 0) - { - s->aValues[optMode].w = MODE_GRAY; - fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 1); - } - if (strcmp ((char const *) pVal, lineartStr) == 0) - { - s->aValues[optMode].w = MODE_LINEART; - fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 0); + /* prepare table for debug */ + strcpy (szTable, "Gamma table summary:"); + for (i = 0; i < SANE_GAMMA_SIZE; i++) + { + if ((SANE_GAMMA_SIZE / 16) && (i % (SANE_GAMMA_SIZE / 16)) == 0) + { + strcat (szTable, "\n"); + DBG (DBG_MSG, szTable); + strcpy (szTable, ""); + } + /* test for number print */ + if ((SANE_GAMMA_SIZE / 64) && (i % (SANE_GAMMA_SIZE / 64)) == 0) + { + sprintf (szTemp, " %04X", pi[i]); + strcat (szTable, szTemp); + } + } + if (strlen (szTable)) + { + strcat (szTable, "\n"); + DBG (DBG_MSG, szTable); + } + break; - } - info |= SANE_INFO_RELOAD_PARAMS; - if (fCapChanged) - { - info |= SANE_INFO_RELOAD_OPTIONS; - } - DBG (DBG_MSG, "setting scan mode: %s\n", (char const *) pVal); - } - break; + case optMode: + { + SANE_Word *pCap; + int fCapChanged = 0; + + pCap = &s->aOptions[optThreshold].cap; + + if (strcmp ((char const *) pVal, colorStr) == 0) + { + s->aValues[optMode].w = MODE_COLOR; + fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 1); + } + if (strcmp ((char const *) pVal, grayStr) == 0) + { + s->aValues[optMode].w = MODE_GRAY; + fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 1); + } + if (strcmp ((char const *) pVal, lineartStr) == 0) + { + s->aValues[optMode].w = MODE_LINEART; + fCapChanged = _ChangeCap (pCap, SANE_CAP_INACTIVE, 0); + + } + info |= SANE_INFO_RELOAD_PARAMS; + if (fCapChanged) + { + info |= SANE_INFO_RELOAD_OPTIONS; + } + DBG (DBG_MSG, "setting scan mode: %s\n", (char const *) pVal); + } + break; - case optLamp: - fVal = *(SANE_Bool *) pVal; - DBG (DBG_MSG, "lamp %s\n", fVal ? "on" : "off"); - if (fVal) - _WarmUpLamp (s, WARMUP_INSESSION); - else - SetLamp (&s->HWParams, SANE_FALSE); - break; + case optLamp: + fVal = *(SANE_Bool *) pVal; + DBG (DBG_MSG, "lamp %s\n", fVal ? "on" : "off"); + if (fVal) + _WarmUpLamp (s, WARMUP_INSESSION); + else + SetLamp (&s->HWParams, SANE_FALSE); + break; - case optCalibrate: + case optCalibrate: /* SimpleCalib(&s->HWParams); */ - break; + break; - default: - DBG (DBG_ERR, "SANE_ACTION_SET_VALUE: Invalid option (%d)\n", n); - } + default: + DBG (DBG_ERR, "SANE_ACTION_SET_VALUE: Invalid option (%d)\n", n); + } if (pInfo != NULL) - { - *pInfo |= info; - } + { + *pInfo |= info; + } break; @@ -1212,12 +1216,12 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters * p) if (s->aValues[optTLX].w >= s->aValues[optBRX].w) { DBG (DBG_ERR, "TLX should be smaller than BRX\n"); - return SANE_STATUS_INVAL; /* proper error code? */ + return SANE_STATUS_INVAL; /* proper error code? */ } if (s->aValues[optTLY].w >= s->aValues[optBRY].w) { DBG (DBG_ERR, "TLY should be smaller than BRY\n"); - return SANE_STATUS_INVAL; /* proper error code? */ + return SANE_STATUS_INVAL; /* proper error code? */ } @@ -1228,18 +1232,18 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters * p) p->last_frame = SANE_TRUE; p->lines = MM_TO_PIXEL (s->aValues[optBRY].w - s->aValues[optTLY].w, - s->aValues[optDPI].w); + s->aValues[optDPI].w); p->depth = pMode->depth; p->pixels_per_line = MM_TO_PIXEL (s->aValues[optBRX].w - s->aValues[optTLX].w, - s->aValues[optDPI].w); + s->aValues[optDPI].w); p->bytes_per_line = pMode->bytesPerLine (p->pixels_per_line); return SANE_STATUS_GOOD; } -/* get the scale down factor for a resolution that is +/* get the scale down factor for a resolution that is not supported by hardware */ static int _SaneEmulateScaling (int iDpi) @@ -1278,13 +1282,13 @@ sane_start (SANE_Handle h) s->ScanParams.iLpi = s->aValues[optDPI].w * iScaleDown; /* calculate correction for filling of circular buffer */ - iLineCorr = 3 * s->HWParams.iSensorSkew; /* usually 16 motor steps */ + iLineCorr = 3 * s->HWParams.iSensorSkew; /* usually 16 motor steps */ /* calculate correction for garbage lines */ iLineCorr += s->HWParams.iSkipLines * (HW_LPI / s->ScanParams.iLpi); s->ScanParams.iTop = MM_TO_PIXEL (s->aValues[optTLY].w + s->HWParams.iTopLeftY, - HW_LPI) - iLineCorr; + HW_LPI) - iLineCorr; s->ScanParams.iLeft = MM_TO_PIXEL (s->aValues[optTLX].w + s->HWParams.iTopLeftX, HW_DPI); @@ -1308,7 +1312,7 @@ sane_start (SANE_Handle h) } WriteGammaCalibTable (abGamma, abGamma, abGamma, abCalibTable, 0, 0, - &s->HWParams); + &s->HWParams); /* prepare the actual scan */ if (!InitScan (&s->ScanParams, &s->HWParams)) @@ -1324,8 +1328,8 @@ sane_start (SANE_Handle h) if (s->HWParams.fReg07) { s->DataPipe.iSkipLines += - MM_TO_PIXEL (s->aValues[optTLY].w + s->HWParams.iTopLeftY, - s->aValues[optDPI].w * iScaleDown); + MM_TO_PIXEL (s->aValues[optTLY].w + s->HWParams.iTopLeftY, + s->aValues[optDPI].w * iScaleDown); } s->iBytesLeft = 0; s->iPixelsPerLine = par.pixels_per_line; @@ -1333,9 +1337,9 @@ sane_start (SANE_Handle h) /* hack */ s->DataPipe.pabLineBuf = (unsigned char *) malloc (HW_PIXELS * 3); CircBufferInit (s->HWParams.iXferHandle, &s->DataPipe, - par.pixels_per_line, s->ScanParams.iHeight, - s->ScanParams.iLpi * s->HWParams.iSensorSkew / HW_LPI, - s->HWParams.iReversedHead, iScaleDown, iScaleDown); + par.pixels_per_line, s->ScanParams.iHeight, + s->ScanParams.iLpi * s->HWParams.iSensorSkew / HW_LPI, + s->HWParams.iReversedHead, iScaleDown, iScaleDown); s->fScanning = SANE_TRUE; s->fCancelled = SANE_FALSE; @@ -1360,18 +1364,18 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len) if (!s->fScanning) { if (s->fCancelled) - { - DBG (DBG_MSG, "\n"); - DBG (DBG_MSG, "sane_read: sane_read cancelled\n"); - s->fCancelled = SANE_FALSE; - return SANE_STATUS_CANCELLED; - } + { + DBG (DBG_MSG, "\n"); + DBG (DBG_MSG, "sane_read: sane_read cancelled\n"); + s->fCancelled = SANE_FALSE; + return SANE_STATUS_CANCELLED; + } else - { - DBG (DBG_ERR, - "sane_read: sane_read only allowed after sane_start\n"); - return SANE_STATUS_INVAL; - } + { + DBG (DBG_ERR, + "sane_read: sane_read only allowed after sane_start\n"); + return SANE_STATUS_INVAL; + } } p = &s->DataPipe; @@ -1396,36 +1400,36 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len) { /* read a line from the transfer buffer */ if (CircBufferGetLineEx (s->HWParams.iXferHandle, p, p->pabLineBuf, - s->HWParams.iReversedHead, SANE_TRUE)) - { - pMode->adaptFormat (p->pabLineBuf, s->iPixelsPerLine, - s->aValues[optThreshold].w); - s->iBytesLeft = pMode->bytesPerLine (s->iPixelsPerLine); - s->iLinesLeft--; - } + s->HWParams.iReversedHead, SANE_TRUE)) + { + pMode->adaptFormat (p->pabLineBuf, s->iPixelsPerLine, + s->aValues[optThreshold].w); + s->iBytesLeft = pMode->bytesPerLine (s->iPixelsPerLine); + s->iLinesLeft--; + } /* stop scanning further, when the read action fails because we try read after the end of the buffer */ else - { - FinishScan (&s->HWParams); - CircBufferExit (p); - free (p->pabLineBuf); - p->pabLineBuf = NULL; - *len = 0; - DBG (DBG_MSG, "\n"); - DBG (DBG_MSG, "sane_read: read after end of buffer\n"); - s->fCancelled = SANE_FALSE; - s->fScanning = SANE_FALSE; - return SANE_STATUS_EOF; - } + { + FinishScan (&s->HWParams); + CircBufferExit (p); + free (p->pabLineBuf); + p->pabLineBuf = NULL; + *len = 0; + DBG (DBG_MSG, "\n"); + DBG (DBG_MSG, "sane_read: read after end of buffer\n"); + s->fCancelled = SANE_FALSE; + s->fScanning = SANE_FALSE; + return SANE_STATUS_EOF; + } } /* copy (part of) a line */ *len = MIN (maxlen, s->iBytesLeft); memcpy (buf, - &p->pabLineBuf[pMode->bytesPerLine (s->iPixelsPerLine) - - s->iBytesLeft], *len); + &p->pabLineBuf[pMode->bytesPerLine (s->iPixelsPerLine) - + s->iBytesLeft], *len); s->iBytesLeft -= *len; DBG (DBG_MSG, " read=%d \n", *len); diff --git a/backend/niash_xfer.c b/backend/niash_xfer.c index 027bcd921..a3d0ea257 100644 --- a/backend/niash_xfer.c +++ b/backend/niash_xfer.c @@ -19,13 +19,13 @@ */ /* - Provides a simple interface to read and write data from the scanner, - without any knowledge whether it's a parallel or USB scanner + Provides a simple interface to read and write data from the scanner, + without any knowledge whether it's a parallel or USB scanner */ -#include /* printf */ -#include /* better error reports */ -#include /* better error reports */ +#include /* printf */ +#include /* better error reports */ +#include /* better error reports */ #include "niash_xfer.h" @@ -43,6 +43,8 @@ STATIC TScannerModel ScannerModels[] = { , {"Agfa", "Snapscan Touch", 0x6BD, 0x100, eAgfaTouch} , + {"Trust", "Office Scanner USB 19200", 0x47b, 0x1000, eAgfaTouch} + , /* last entry all zeros */ {0, 0, 0, 0, 0} }; @@ -53,11 +55,11 @@ static TScannerModel *_pModel; /* MatchUsbDevice ============== - Matches a given USB vendor and product id against a list of - supported scanners. + Matches a given USB vendor and product id against a list of + supported scanners. IN iVendor USB vendor ID - iProduct USB product ID + iProduct USB product ID OUT *ppModel Pointer to TScannerModel structure Returns TRUE if a matching USB scanner was found @@ -71,12 +73,12 @@ MatchUsbDevice (int iVendor, int iProduct, TScannerModel ** ppModel) while (pModels->pszName != NULL) { if ((pModels->iVendor == iVendor) && (pModels->iProduct == iProduct)) - { - DBG (DBG_MSG, "found %s %s\n", pModels->pszVendor, - pModels->pszName); - *ppModel = pModels; - return SANE_TRUE; - } + { + DBG (DBG_MSG, "found %s %s\n", pModels->pszVendor, + pModels->pszName); + *ppModel = pModels; + return SANE_TRUE; + } /* next model to match */ pModels++; } @@ -104,8 +106,8 @@ _AttachUsb (SANE_String_Const devname) /* NiashXferInit =============== - Initialises all registered data transfer modules, which causes - them to report any devices found through the pfnReport callback. + Initialises all registered data transfer modules, which causes + them to report any devices found through the pfnReport callback. IN pfnReport Function to call to report a transfer device */ @@ -123,13 +125,13 @@ NiashXferInit (TFnReportDevice * pfnReport) DBG (DBG_MSG, "Looking for %s...\n", pModels->pszName); _pModel = pModels; if (sanei_usb_find_devices ((SANE_Int) pModels->iVendor, - (SANE_Int) pModels->iProduct, - _AttachUsb) != SANE_STATUS_GOOD) - { + (SANE_Int) pModels->iProduct, + _AttachUsb) != SANE_STATUS_GOOD) + { - DBG (DBG_ERR, "Error invoking sanei_usb_find_devices"); - break; - } + DBG (DBG_ERR, "Error invoking sanei_usb_find_devices"); + break; + } pModels++; } } @@ -141,7 +143,7 @@ NiashXferOpen (const char *pszName, EScannerModel * peModel) SANE_Status status; SANE_Word vendor, product; int fd; - TScannerModel *pModel; + TScannerModel *pModel = 0; DBG (DBG_MSG, "Trying to open %s...\n", pszName); @@ -178,8 +180,8 @@ static void parusb_write_reg (int fd, unsigned char bReg, unsigned char bValue) { sanei_usb_control_msg (fd, - USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - 0x0C, bReg, 0, 1, &bValue); + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, + 0x0C, bReg, 0, 1, &bValue); } @@ -187,8 +189,8 @@ static void parusb_read_reg (int fd, unsigned char bReg, unsigned char *pbValue) { sanei_usb_control_msg (fd, - USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x0C, bReg, 0, 1, pbValue); + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, + 0x0C, bReg, 0, 1, pbValue); } @@ -247,8 +249,8 @@ NiashWriteBulk (int iHandle, unsigned char *pabBuf, int iSize) abSetup[4] = (iSize) & 0xFF; abSetup[5] = (iSize >> 8) & 0xFF; sanei_usb_control_msg (iHandle, - USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - 0x04, USB_SETUP, 0, 8, abSetup); + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, + 0x04, USB_SETUP, 0, 8, abSetup); /* do the bulk write */ size = iSize; @@ -279,8 +281,8 @@ NiashReadBulk (int iHandle, unsigned char *pabBuf, int iSize) abSetup[4] = (iSize) & 0xFF; abSetup[5] = (iSize >> 8) & 0xFF; sanei_usb_control_msg (iHandle, - USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - 0x04, USB_SETUP, 0, 8, abSetup); + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, + 0x04, USB_SETUP, 0, 8, abSetup); /* do the bulk read */ size = iSize; diff --git a/doc/descriptions/niash.desc b/doc/descriptions/niash.desc index b09725c1b..960468c21 100644 --- a/doc/descriptions/niash.desc +++ b/doc/descriptions/niash.desc @@ -10,7 +10,7 @@ ; :backend "niash" -:version "0.2" +:version "0.3" :manpage "sane-niash" :url "http://sourceforge.net/projects/hp3300backend" @@ -36,6 +36,12 @@ :comment "If you use Linux 2.6, version 2.6.8 or newer is necessary." :status :complete +:model "ScanJet 4300c/Silitek" +:interface "USB" +:usbid "0x047b" "0x1002" +:comment "If you use Linux 2.6, version 2.6.8 or newer is necessary." +:status :complete + :mfg "Agfa" :url "http://www.agfa.com" @@ -44,6 +50,14 @@ :usbid "0x06bd" "0x0100" :status :complete +:mfg "Trust" +:url "http://www.trust.com" + +:model "Office Scan USB 19200" +:interface "USB" +:usbid "0x047b" "0x1000" +:status :complete + diff --git a/doc/sane-niash.man b/doc/sane-niash.man index ee212512f..b29d1a36d 100644 --- a/doc/sane-niash.man +++ b/doc/sane-niash.man @@ -15,11 +15,13 @@ the following models: .ft CR .nf MANUFACTURER: MODEL: USB ID: ---------------- -------------- --------- -Agfa Snapscan Touch 06BD-0100 (1)(a) -Hewlett-Packard Scanjet 3300c 03F0-0205 (1)(a)(b) -Hewlett-Packard Scanjet 3400c 03F0-0405 (2)(b) -Hewlett-Packard Scanjet 4300c 03F0-0305 (2)(a) +--------------- ---------------- --------- +Agfa Snapscan Touch 047B-1000 (1)(a) +Trust Office Scan 1900 06BD-0100 (1)(a) +Hewlett-Packard Scanjet 3300c 03F0-0205 (1)(a)(b) +Hewlett-Packard Scanjet 3400c 03F0-0405 (2)(b) +Hewlett-Packard Scanjet 4300c 03F0-0305 (2)(a) +Silitek ScanJet 4300c 047B-1002 (2)(b) .fi .ft R .PP @@ -49,15 +51,15 @@ support dynamic loading). .SH CAVEATS If you use a .br -Hewlett-Packard Scanjet 3400c -or +Hewlett-Packard Scanjet 3400c +or .br -Hewlett-Packard Scanjet 4300c +Hewlett-Packard Scanjet 4300c .br together with Linux kernel .BR 2.6 , -kernel version -.B 2.6.8 +kernel version +.B 2.6.8 or newer is necessary. .SH ENVIRONMENT diff --git a/tools/hotplug/libsane.usermap b/tools/hotplug/libsane.usermap index 168c20141..ba74dffca 100644 --- a/tools/hotplug/libsane.usermap +++ b/tools/hotplug/libsane.usermap @@ -313,7 +313,7 @@ libusbscanner 0x0003 0x04b8 0x080e 0x0000 0x0000 libusbscanner 0x0003 0x04b8 0x0810 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Epson Corp.|Stylus RX620/RX630 (PM-A870) libusbscanner 0x0003 0x04b8 0x0811 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Epson Corp.|Stylus CX6600 +# Epson Corp.|Stylus CX6600 libusbscanner 0x0003 0x04b8 0x0813 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Epson Corp.|(PM-A700) libusbscanner 0x0003 0x04b8 0x0814 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 @@ -529,5 +529,8 @@ libusbscanner 0x0003 0x1606 0x0230 0x0000 0x0000 libusbscanner 0x0003 0x0a82 0x4600 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Silitek Corp.|HP ScanJet 4300c libusbscanner 0x0003 0x047b 0x1002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +# Trust|Office Scanner USB 19200 +libusbscanner 0x0003 0x047b 0x1000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Dell|A920 libusbscanner 0x0003 0x413c 0x5105 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +