From 59fc80c118feba1607bf1356f32d01fbbe411f27 Mon Sep 17 00:00:00 2001 From: Oliver Schwartz Date: Mon, 15 Aug 2005 18:06:38 +0000 Subject: [PATCH] Added support for Epson 3490/3590 (thanks to Matt Judge) --- ChangeLog | 7 +++++++ backend/snapscan-options.c | 24 ++++++++++++++++++++++++ backend/snapscan-scsi.c | 10 +++++++++- backend/snapscan.c | 7 +++++-- backend/snapscan.conf | 3 +++ backend/snapscan.h | 14 +++++++++++--- doc/descriptions/snapscan.desc | 8 ++++++++ 7 files changed, 67 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 274c71992..dba80a6e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-15 Oliver Schwartz + + * backend/snapscan.c backend/snapscan-options.c backend/snapscan-scsi.c + backend/snapscan.h doc/descriptions/snapscan.desc + backend/snapscan.conf: Added support for Epson Perfection 3490/3590 + (thanks to Matt Judge). + 2005-08-15 Gerhard Jaeger * doc/plustek/Plustek-USB.changes: Update. diff --git a/backend/snapscan-options.c b/backend/snapscan-options.c index aa5e94a85..7f9e67253 100644 --- a/backend/snapscan-options.c +++ b/backend/snapscan-options.c @@ -164,6 +164,16 @@ static const SANE_Range y_range_tpo_2480 = SANE_FIX (0.0), SANE_FIX (80.0), 0 }; /* mm */ +/* TPO range for the Epson 3490 */ +static const SANE_Range x_range_tpo_3490 = +{ + SANE_FIX (0.0), SANE_FIX (33.0), 0 +}; /* mm */ +static const SANE_Range y_range_tpo_3490 = +{ + SANE_FIX (0.0), SANE_FIX (162.0), 0 +}; /* mm */ + static SANE_Range x_range_tpo; static SANE_Range y_range_tpo; static const SANE_Range gamma_range = @@ -221,6 +231,9 @@ static void init_options (SnapScan_Scanner * ps) {10, 50, 75, 100, 150, 200, 300, 400, 600, 800, 1600}; static SANE_Word resolutions_2400[] = {10, 50, 75, 100, 150, 200, 300, 400, 600, 1200, 2400}; + static SANE_Word resolutions_3200[] = + {13, 200, 240, 266, 300, 350, 360, 400, 600, 720, 800, 1200, 2400, 3200}; + //{17, 50, 72, 96, 150, 200, 240, 266, 300, 350, 360, 400, 600, 720, 800, 1200, 2400, 3200}; static SANE_String_Const names_all[] = {md_colour, md_bilevelcolour, md_greyscale, md_lineart, NULL}; static SANE_String_Const names_basic[] = @@ -253,6 +266,10 @@ static void init_options (SnapScan_Scanner * ps) x_range_tpo = x_range_tpo_2480; y_range_tpo = y_range_tpo_2480; break; + case PERFECTION3490: + x_range_tpo = x_range_tpo_3490; + y_range_tpo = y_range_tpo_3490; + break; default: x_range_tpo = x_range_tpo_default; y_range_tpo = y_range_tpo_default; @@ -309,6 +326,9 @@ static void init_options (SnapScan_Scanner * ps) case PERFECTION2480: po[OPT_SCANRES].constraint.word_list = resolutions_2400; break; + case PERFECTION3490: + po[OPT_SCANRES].constraint.word_list = resolutions_3200; + break; default: po[OPT_SCANRES].constraint.word_list = resolutions_600; break; @@ -532,6 +552,7 @@ static void init_options (SnapScan_Scanner * ps) if ((!(ps->hconfig & HCFG_CAL_ALLOWED)) || (ps->pdev->model == SNAPSCANE52) || (ps->pdev->model == PERFECTION1670) + || (ps->pdev->model == PERFECTION3490) || (ps->pdev->model == PRISA5300)) { po[OPT_QUALITY_CAL].cap |= SANE_CAP_INACTIVE; ps->val[OPT_QUALITY_CAL].b = SANE_FALSE; @@ -1514,6 +1535,9 @@ SANE_Status sane_control_option (SANE_Handle h, /* * $Log$ + * Revision 1.22 2005/08/15 18:06:37 oliver-guest + * Added support for Epson 3490/3590 (thanks to Matt Judge) + * * Revision 1.21 2005/07/20 21:37:29 oliver-guest * Changed TPO scanning area for 2480/2580, reenabled 2400 DPI for 2480/2580 * diff --git a/backend/snapscan-scsi.c b/backend/snapscan-scsi.c index 7c645d3d7..768d773a7 100644 --- a/backend/snapscan-scsi.c +++ b/backend/snapscan-scsi.c @@ -499,15 +499,16 @@ static SANE_Status inquiry (SnapScan_Scanner *pss) pss->read_bytes = 0; pss->hwst = pss->buf[INQUIRY_HWST]; pss->hconfig = pss->buf[INQUIRY_HCFG]; - pss->bpp = 8; switch (pss->pdev->model) { case PERFECTION1270: case PERFECTION1670: case PERFECTION2480: + case PERFECTION3490: pss->bpp = 14; break; default: + pss->bpp = 8; if (pss->hconfig & HCFG_ADC) pss->bpp = 10; break; @@ -774,6 +775,9 @@ static SANE_Status set_window (SnapScan_Scanner *pss) case PERFECTION2480: pos_factor = (pss->res > 1200) ? 2400 : 1200; break; + case PERFECTION3490: + pos_factor = (pss->res > 1600) ? 3200 : 1600; + break; default: pos_factor = pss->actual_res; break; @@ -1331,6 +1335,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) case PERFECTION1270: case PERFECTION1670: case PERFECTION2480: + case PERFECTION3490: /* Epson firmware files contain an info block which specifies the length of the firmware data. The length information is stored at offset 0x64 from @@ -1384,6 +1389,9 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) /* * $Log$ + * Revision 1.33 2005/08/15 18:06:37 oliver-guest + * Added support for Epson 3490/3590 (thanks to Matt Judge) + * * Revision 1.32 2005/07/18 17:37:37 oliver-guest * ZETA changes for SnapScan backend * diff --git a/backend/snapscan.c b/backend/snapscan.c index ce6d1c8d1..0a2c4e4dd 100644 --- a/backend/snapscan.c +++ b/backend/snapscan.c @@ -178,9 +178,8 @@ static inline int calibration_line_length(SnapScan_Scanner *pss) break; case PERFECTION1270: case PERFECTION1670: - pos_factor = 800; - break; case PERFECTION2480: + case PERFECTION3490: pos_factor = 800; break; default: @@ -1289,6 +1288,7 @@ static SANE_Status send_gamma_table (SnapScan_Scanner *pss, u_char dtc, u_char d case PERFECTION1270: case PERFECTION1670: case PERFECTION2480: + case PERFECTION3490: /* Some epson scanners need the gamma table twice */ status = send (pss, dtc, dtcq); CHECK_STATUS (status, me, "2nd send"); @@ -1871,6 +1871,9 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) /* * $Log$ + * Revision 1.50 2005/08/15 18:06:37 oliver-guest + * Added support for Epson 3490/3590 (thanks to Matt Judge) + * * Revision 1.49 2005/08/07 12:37:29 oliver-guest * Use first known device if no device is specified * diff --git a/backend/snapscan.conf b/backend/snapscan.conf index 4cefed939..f05df4af1 100644 --- a/backend/snapscan.conf +++ b/backend/snapscan.conf @@ -107,3 +107,6 @@ usb 0x04b8 0x011f # Epson Perfection 2480 usb 0x04b8 0x0121 + +# Epson Perfection 3490 +usb 0x04b8 0x0122 diff --git a/backend/snapscan.h b/backend/snapscan.h index 7c4fb09a8..526950fee 100644 --- a/backend/snapscan.h +++ b/backend/snapscan.h @@ -102,7 +102,8 @@ typedef enum PERFECTION660, /* Epson Perfection 660 - 1200 DPI */ PERFECTION1270, /* Epson Perfection 1270 - 1600 DPI */ PERFECTION1670, /* Epson Perfection 1670 - 1600 DPI */ - PERFECTION2480, + PERFECTION2480, /* Epson Perfection 2480 - 2400 DPI */ + PERFECTION3490, /* Epson Perfection 3490 - 3200 DPI */ ARCUS1200 /* Agfa Arcus 1200 - 1200 DPI (rebadged Acer?) */ } SnapScan_Model; @@ -138,7 +139,8 @@ static struct SnapScan_Driver_desc drivers[] = {PERFECTION660, "Perfection 660"}, {PERFECTION1270, "Perfection 1270"}, {PERFECTION1670, "Perfection 1670"}, - {PERFECTION2480, "Perfection 2480"} + {PERFECTION2480, "Perfection 2480"}, + {PERFECTION3490, "Perfection 3490"} }; #define known_drivers ((int) (sizeof(drivers)/sizeof(drivers[0]))) @@ -190,6 +192,7 @@ static struct SnapScan_Model_desc scanners[] = {"Perfection 660", PERFECTION660}, {"EPSON Scanner", PERFECTION1670}, /* dummy entry to detect scanner */ {"EPSON Scanner1", PERFECTION2480}, /* dummy entry to detect scanner */ + {"EPSON Scanner2", PERFECTION3490}, /* dummy entry to detect scanner */ {"ARCUS 1200", ARCUS1200} }; @@ -221,6 +224,7 @@ static char *vendors[] = #define USB_PRODUCT_PERFECTION1270 0x0120 #define USB_PRODUCT_PERFECTION1670 0x011f #define USB_PRODUCT_PERFECTION2480 0x0121 +#define USB_PRODUCT_PERFECTION3490 0x0122 static SANE_Word usb_vendor_ids[] = { @@ -245,7 +249,8 @@ static struct SnapScan_USB_Model_desc usb_scanners[] = {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION660, PERFECTION660}, /* Epson Perfection 660 */ {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION1270, PERFECTION1270}, /* Epson Perfection 1270 */ {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION1670, PERFECTION1670}, /* Epson Perfection 1670 */ - {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION2480, PERFECTION2480} /* Epson Perfection 2480 */ + {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION2480, PERFECTION2480}, /* Epson Perfection 2480 */ + {USB_VENDOR_EPSON, USB_PRODUCT_PERFECTION3490, PERFECTION3490} /* Epson Perfection 3490 */ }; #define known_usb_scanners ((int) (sizeof(usb_scanners)/sizeof(usb_scanners[0]))) @@ -406,6 +411,9 @@ struct snapscan_scanner /* * $Log$ + * Revision 1.34 2005/08/15 18:06:37 oliver-guest + * Added support for Epson 3490/3590 (thanks to Matt Judge) + * * Revision 1.33 2005/02/08 22:17:53 oliver-guest * Added IDs for Benq 5250C and 5000S * diff --git a/doc/descriptions/snapscan.desc b/doc/descriptions/snapscan.desc index 9ea6cf636..ea6de627e 100644 --- a/doc/descriptions/snapscan.desc +++ b/doc/descriptions/snapscan.desc @@ -251,5 +251,13 @@ :status :basic :comment "Problems with preview scans reported, unplugging transparency unit seems to help" +:model "Perfection 3490" +:interface "USB" +:status :basic + +:model "Perfection 3590" +:interface "USB" +:status :untested + ; :comment and :url specifiers are optional after :mfg, :model, :desc, ; and at the top-level.