From e30553a7c5b663ee879343b1d1385e5544e2521f Mon Sep 17 00:00:00 2001 From: Oliver Schwartz Date: Wed, 2 Apr 2003 21:01:07 +0000 Subject: [PATCH] SnapScan backend 1.4.25 --- ChangeLog | 7 +++++++ backend/snapscan-scsi.c | 30 ++++++++++++++++++++++++------ backend/snapscan.c | 19 +++++++++++++++---- backend/snapscan.conf | 2 ++ backend/snapscan.h | 26 +++++++++++++++++--------- doc/descriptions/snapscan.desc | 23 ++++++++++++++++++----- 6 files changed, 83 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f7698f6f..115f51de9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-03 Oliver Schwartz + + * backend/snapscan.c backend/snapscan.h backend/snapscan-scsi.c + backend/snapscan.conf doc/descriptions/snapscan.desc: + SnapScan backend 1.4.25 - added support for Epson Perfection 660, + enhanced support for Acer 5000 + 2003-04-02 Henning Meier-Geinitz * doc/sane-as6e.man: Added info about $PATH. Minor formatting fixes. diff --git a/backend/snapscan-scsi.c b/backend/snapscan-scsi.c index e9c57c5d0..93f9db281 100644 --- a/backend/snapscan-scsi.c +++ b/backend/snapscan-scsi.c @@ -518,6 +518,7 @@ static SANE_Status inquiry (SnapScan_Scanner *pss) pss->actual_res = u_char_to_u_short (pss->buf + INQUIRY_OPT_RES); + pss->pixels_per_line = u_char_to_u_short (pss->buf + INQUIRY_PIX_PER_LINE); pss->bytes_per_line = @@ -742,6 +743,7 @@ static SANE_Status set_window (SnapScan_Scanner *pss) SANE_Status status; unsigned char source; u_char *pc; + int pos_factor; DBG (DL_CALL_TRACE, "%s\n", me); zero_buf (pss->cmd, MAX_SCSI_CMD_LEN); @@ -763,19 +765,32 @@ static SANE_Status set_window (SnapScan_Scanner *pss) u_short_to_u_charp (pss->res, pc + SET_WINDOW_P_YRES); DBG (DL_CALL_TRACE, "%s Resolution: %d\n", me, pss->res); + pos_factor = pss->actual_res; + if (pss->pdev->model == PRISA5000) + { + if (pss->res > 600) + { + pos_factor = 1200; + } + else + { + pos_factor = 600; + } + } + /* it's an ugly sound if the scanner drives against the rear wall, and with changing max values we better be sure */ check_range(&(pss->brx), pss->pdev->x_range); check_range(&(pss->bry), pss->pdev->y_range); { int tlxp = - (int) (pss->actual_res*IN_PER_MM*SANE_UNFIX(pss->tlx)); + (int) (pos_factor*IN_PER_MM*SANE_UNFIX(pss->tlx)); int tlyp = - (int) (pss->actual_res*IN_PER_MM*SANE_UNFIX(pss->tly)); + (int) (pos_factor*IN_PER_MM*SANE_UNFIX(pss->tly)); int brxp = - (int) (pss->actual_res*IN_PER_MM*SANE_UNFIX(pss->brx)); + (int) (pos_factor*IN_PER_MM*SANE_UNFIX(pss->brx)); int bryp = - (int) (pss->actual_res*IN_PER_MM*SANE_UNFIX(pss->bry)); + (int) (pos_factor*IN_PER_MM*SANE_UNFIX(pss->bry)); /* Check for brx > tlx and bry > tly */ if (brxp <= tlxp) { @@ -1186,8 +1201,11 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) /* * $Log$ - * Revision 1.20 2003/01/08 21:45:15 oliverschwartz - * Update to snapscan backend 1.4.18 + * Revision 1.21 2003/04/02 21:00:47 oliverschwartz + * SnapScan backend 1.4.25 + * + * Revision 1.35 2003/02/08 10:45:09 oliverschwartz + * Use 600 DPI as optical resolution for Benq 5000 * * Revision 1.34 2002/12/10 20:14:12 oliverschwartz * Enable color offset correction for SnapScan300 diff --git a/backend/snapscan.c b/backend/snapscan.c index 8218fc4af..2854e3817 100644 --- a/backend/snapscan.c +++ b/backend/snapscan.c @@ -78,7 +78,7 @@ #define EXPECTED_MAJOR 1 #define MINOR_VERSION 4 -#define BUILD 18 +#define BUILD 25 #include "snapscan.h" @@ -220,7 +220,15 @@ static inline int is_colour_mode (SnapScan_Mode m) static inline int calibration_line_length(SnapScan_Scanner *pss) { - int pixel_length = pss->actual_res * 8.5; + int pos_factor = pss->actual_res; + int pixel_length; + + if (pss->pdev->model == PRISA5000) + { + pos_factor = 600; + } + + pixel_length = pos_factor * 8.5; if(is_colour_mode(actual_mode(pss))) { return 3 * pixel_length; @@ -1754,8 +1762,11 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) /* * $Log$ - * Revision 1.27 2003/01/08 21:45:15 oliverschwartz - * Update to snapscan backend 1.4.18 + * Revision 1.28 2003/04/02 21:00:47 oliverschwartz + * SnapScan backend 1.4.25 + * + * Revision 1.56 2003/02/08 10:45:09 oliverschwartz + * Use 600 DPI as optical resolution for Benq 5000 * * Revision 1.55 2003/01/08 21:16:17 oliverschwartz * Added support for Acer / Benq 310U diff --git a/backend/snapscan.conf b/backend/snapscan.conf index ec8ce367f..9ad083013 100644 --- a/backend/snapscan.conf +++ b/backend/snapscan.conf @@ -89,3 +89,5 @@ usb 0x06bd 0x208f # Agfa Snapscan e52 usb 0x06bd 0x20fd +# Epson Perfection 660 +usb 0x04b8 0x0114 diff --git a/backend/snapscan.h b/backend/snapscan.h index e1c919ceb..0281a46a4 100644 --- a/backend/snapscan.h +++ b/backend/snapscan.h @@ -96,7 +96,8 @@ typedef enum PRISA4300, /* Acer ScanPrisa 3300/4300 - 600 DPI */ PRISA4300_2, /* Acer ScanPrisa 3300/4300 - 600 DPI, 42 bit*/ PRISA5000, /* Acer ScanPrisa 5000 - 1200 DPI */ - PRISA5300 /* Acer ScanPrisa 5300 - 1200 DPI */ + PRISA5300, /* Acer ScanPrisa 5300 - 1200 DPI */ + PERFECTION660 /* Epson Perfection 660 - 1200 DPI */ } SnapScan_Model; struct SnapScan_Driver_desc { @@ -126,7 +127,8 @@ static struct SnapScan_Driver_desc drivers[] = {PRISA4300_2, "Acer4300 (42 bit)"}, {PRISA1240, "Acer1240"}, {PRISA5000, "Acer5000"}, - {PRISA5300, "Acer5300"} + {PRISA5300, "Acer5300"}, + {PERFECTION660, "Perfection 660"} }; #define known_drivers ((int) (sizeof(drivers)/sizeof(drivers[0]))) @@ -140,8 +142,8 @@ struct SnapScan_Model_desc static struct SnapScan_Model_desc scanners[] = { /* SCSI model name -> enum value */ - {"FlatbedScanner_2", VUEGO610S}, - {"FlatbedScanner_4", VUEGO310S}, + {"FlatbedScanner_2", VUEGO310S}, + {"FlatbedScanner_4", VUEGO610S}, {"FlatbedScanner_5", PRISA620S}, {"FlatbedScanner_9", PRISA620S}, {"FlatbedScanner13", PRISA620S}, @@ -171,7 +173,8 @@ static struct SnapScan_Model_desc scanners[] = {"SNAPSCAN 310", SNAPSCAN310}, {"SNAPSCAN 600", SNAPSCAN600}, {"SnapScan", SNAPSCAN}, - {"ACERSCAN_A4____1", ACER300F} + {"ACERSCAN_A4____1", ACER300F}, + {"Perfection 660", PERFECTION660} }; #define known_scanners ((int) (sizeof(scanners)/sizeof(scanners[0]))) @@ -181,7 +184,8 @@ static char *vendors[] = "AGFA", "COLOR", "Color", - "ACERPER" + "ACERPER", + "EPSON" }; #define known_vendors ((int) (sizeof(vendors)/sizeof(vendors[0]))) @@ -189,7 +193,8 @@ static SANE_Word usb_vendor_ids[] = { /* USB Vendor IDs */ 0x06bd, /* Agfa */ - 0x04a5 /* Acer */ + 0x04a5, /* Acer */ + 0x04b8 /* Epson */ }; #define known_usb_vendor_ids ((int) (sizeof(usb_vendor_ids)/sizeof(usb_vendor_ids[0]))) @@ -369,8 +374,11 @@ struct snapscan_scanner /* * $Log$ - * Revision 1.19 2003/01/08 21:45:15 oliverschwartz - * Update to snapscan backend 1.4.18 + * Revision 1.20 2003/04/02 21:00:48 oliverschwartz + * SnapScan backend 1.4.25 + * + * Revision 1.37 2003/02/05 22:11:11 oliverschwartz + * Added Epson Perfection 660 * * Revision 1.36 2003/01/08 21:16:36 oliverschwartz * Added support for Acer / Benq 310U diff --git a/doc/descriptions/snapscan.desc b/doc/descriptions/snapscan.desc index c0d221cd0..d591f246b 100644 --- a/doc/descriptions/snapscan.desc +++ b/doc/descriptions/snapscan.desc @@ -21,9 +21,10 @@ ; other types: :stillcam, :vidcam, ; :meta, :api +;----------------------------------------------------------------------------- + :mfg "AGFA" ; name a manufacturer :url "http://www.agfa.com/" -;----------------------------------------------------------------------------- :model "SnapScan 300" ; name models for above-specified mfg. :interface "SCSI" @@ -90,6 +91,8 @@ :interface "USB" :status :untested +;------------------------------------------------------------------------------ + :mfg "Acer Peripherals" :comment "Company was renamed to Benq." @@ -99,7 +102,6 @@ :mfg "Benq" :url "http://www.benq.com" :comment "Formerly Acer Peripherals" -;------------------------------------------------------------------------------ :model "300f" :interface "SCSI" @@ -162,16 +164,17 @@ :model "5000" :interface "USB" -:status :alpha +:status :beta :model "5300" :interface "USB" :status :alpha :comment "Problems with firmware upload reported" +;------------------------------------------------------------------------------ + :mfg "Guillemot / Hercules" :url "http://www.guillemot.com" -;------------------------------------------------------------------------------ :model "Maxi Scan A4 Deluxe (SCSI)" :interface "SCSI" @@ -183,9 +186,10 @@ :status :stable :comment "Seems to be a repackaged Benq 3300." +;------------------------------------------------------------------------------ + :mfg "Mitsubishi" :url "http://www.mitsubishi.com" -;------------------------------------------------------------------------------ :model "Diamondview 648UT" :interface "USB" @@ -197,5 +201,14 @@ :status :stable :comment "Seems to be a repackaged Benq 4300." +;------------------------------------------------------------------------------ + +:mfg "Epson" +:url "http://www.epson.com" + +:model "Perfection 660" +:interface "USB" +:status :beta + ; :comment and :url specifiers are optional after :mfg, :model, :desc, ; and at the top-level.