Preview and range fix for Epson 2480/2580

merge-requests/1/head
Oliver Schwartz 2005-10-24 19:46:40 +00:00
rodzic 17a68e32a6
commit aa37ec8374
5 zmienionych plików z 67 dodań i 30 usunięć

Wyświetl plik

@ -1,3 +1,9 @@
2005-10-24 Oliver Schwartz <Oliver.Schwartz@gmx.de>
* backend/snapscan.c backend/snapscan-scsi.c backend/snapscan.h
backend/snapscan-options.c: Fix transparency range for Epson
2480/2580, fix preview for Epson 2580.
2005-10-24 Henning Meier-Geinitz <henning@meier-geinitz.de>
* doc/descriptions/umax1220u.desc: Marked backend as

Wyświetl plik

@ -161,6 +161,15 @@ static const SANE_Range x_range_tpo_2480 =
SANE_FIX (0.0), SANE_FIX (55.0), 0
}; /* mm */
static const SANE_Range y_range_tpo_2480 =
{
SANE_FIX (0.0), SANE_FIX (125.0), 0
}; /* mm */
/* TPO range for the Epson 2580 */
static const SANE_Range x_range_tpo_2580 =
{
SANE_FIX (0.0), SANE_FIX (55.0), 0
}; /* mm */
static const SANE_Range y_range_tpo_2580 =
{
SANE_FIX (0.0), SANE_FIX (80.0), 0
}; /* mm */
@ -265,8 +274,16 @@ static void init_options (SnapScan_Scanner * ps)
y_range_tpo = y_range_tpo_1670;
break;
case PERFECTION2480:
x_range_tpo = x_range_tpo_2480;
y_range_tpo = y_range_tpo_2480;
if (ps->hconfig_epson & 0x20)
{
x_range_tpo = x_range_tpo_2580;
y_range_tpo = y_range_tpo_2580;
}
else
{
x_range_tpo = x_range_tpo_2480;
y_range_tpo = y_range_tpo_2480;
}
break;
case PERFECTION3490:
x_range_tpo = x_range_tpo_3490;
@ -1585,6 +1602,9 @@ SANE_Status sane_control_option (SANE_Handle h,
/*
* $Log$
* Revision 1.28 2005/10/24 19:46:40 oliver-guest
* Preview and range fix for Epson 2480/2580
*
* Revision 1.27 2005/10/13 22:43:30 oliver-guest
* Fixes for 16 bit scan mode from Simon Munton
*

Wyświetl plik

@ -366,24 +366,25 @@ static void check_range (int *v, SANE_Range r)
#define INQUIRY_RET_LEN 120
#define INQUIRY_RET_LEN_EPSON 139
#define INQUIRY_VENDOR 8 /* Offset in reply data to vendor name */
#define INQUIRY_PRODUCT 16 /* Offset in reply data to product id */
#define INQUIRY_REV 32 /* Offset in reply data to revision level */
#define INQUIRY_PRL2 36 /* Product Revision Level 2 (AGFA) */
#define INQUIRY_HCFG 37 /* Hardware Configuration (AGFA) */
#define INQUIRY_HWST 40 /* Hardware status */
#define INQUIRY_VENDOR 8 /* Offset in reply data to vendor name */
#define INQUIRY_PRODUCT 16 /* Offset in reply data to product id */
#define INQUIRY_REV 32 /* Offset in reply data to revision level */
#define INQUIRY_PRL2 36 /* Product Revision Level 2 (AGFA) */
#define INQUIRY_HCFG 37 /* Hardware Configuration (AGFA) */
#define INQUIRY_HWST 40 /* Hardware status */
#define INQUIRY_HWMI 41 /* HARDWARE Model ID */
#define INQUIRY_PIX_PER_LINE 42 /* Pixels per scan line (AGFA) */
#define INQUIRY_BYTE_PER_LINE 44 /* Bytes per scan line (AGFA) */
#define INQUIRY_NUM_LINES 46 /* number of scan lines (AGFA) */
#define INQUIRY_OPT_RES 48 /* optical resolution (AGFA) */
#define INQUIRY_PIX_PER_LINE 42 /* Pixels per scan line (AGFA) */
#define INQUIRY_BYTE_PER_LINE 44 /* Bytes per scan line (AGFA) */
#define INQUIRY_NUM_LINES 46 /* number of scan lines (AGFA) */
#define INQUIRY_OPT_RES 48 /* optical resolution (AGFA) */
#define INQUIRY_SCAN_SPEED 51 /* scan speed (AGFA) */
#define INQUIRY_EXPTIME1 52 /* exposure time, first digit (AGFA) */
#define INQUIRY_EXPTIME2 53 /* exposure time, second digit (AGFA) */
#define INQUIRY_G2R_DIFF 54 /* green to red difference (AGFA) */
#define INQUIRY_B2R_DIFF 55 /* green to red difference (AGFA) */
#define INQUIRY_FIRMWARE 96 /* firmware date and time (AGFA) */
#define INQUIRY_EXPTIME1 52 /* exposure time, first digit (AGFA) */
#define INQUIRY_EXPTIME2 53 /* exposure time, second digit (AGFA) */
#define INQUIRY_G2R_DIFF 54 /* green to red difference (AGFA) */
#define INQUIRY_B2R_DIFF 55 /* green to red difference (AGFA) */
#define INQUIRY_FIRMWARE 96 /* firmware date and time (AGFA) */
#define INQUIRY_BYTE_PER_LINE_MSB 132 /* ?? top byte of bytes per scan line - epson 2480 */
#define INQUIRY_EPSON_HCFG 138 /* ?? Hardware configuration (Epson) */
/* a mini-inquiry reads only the first 36 bytes of inquiry data, and
@ -483,11 +484,10 @@ static SANE_Status inquiry (SnapScan_Scanner *pss)
break;
case PERFECTION2480:
case PERFECTION3490:
if (pss->firmware_loaded)
{
snapscani_debug_data(tmpstr, pss->buf+120, 19);
DBG (DL_DATA_TRACE, "%s: Epson additional inquiry data:\n%s\n", me, tmpstr);
}
snapscani_debug_data(tmpstr, pss->buf+120, 19);
DBG (DL_DATA_TRACE, "%s: Epson additional inquiry data:\n%s\n", me, tmpstr);
pss->hconfig_epson = pss->buf[INQUIRY_EPSON_HCFG];
/* fall through */
default:
{
signed char min_diff;
@ -522,7 +522,7 @@ static SANE_Status inquiry (SnapScan_Scanner *pss)
u_char_to_u_short (pss->buf + INQUIRY_PIX_PER_LINE);
pss->bytes_per_line =
u_char_to_u_short (pss->buf + INQUIRY_BYTE_PER_LINE);
if (pss->pdev->model == PERFECTION2480)
if ((pss->pdev->model == PERFECTION2480) || (pss->pdev->model == PERFECTION3490))
pss->bytes_per_line += pss->buf[INQUIRY_BYTE_PER_LINE_MSB] << 16;
pss->lines =
u_char_to_u_short (pss->buf + INQUIRY_NUM_LINES) - pss->chroma;
@ -944,8 +944,8 @@ static SANE_Status set_window (SnapScan_Scanner *pss)
if (!pss->highquality) {
source |= 0x80; /* no high quality */
}
if (pss->pdev->model == PERFECTION3490) {
source |= 0x40; /* 3490 always needs no_preview bit */
if ((pss->pdev->model == PERFECTION2480) || (pss->pdev->model == PERFECTION3490)) {
source |= 0x40; /* 2480/3490 always need no_preview bit */
}
if (pss->source == SRC_TPO) {
source |= 0x08;
@ -1097,6 +1097,7 @@ static SANE_Status wait_scanner_ready (SnapScan_Scanner *pss)
/* This seems to happen for Epson scanners. Return
SANE_STATUS_GOOD and hope the scanner accepts the
next command... */
DBG (DL_CALL_TRACE, "%s: No timeout specified, returning immediately\n", me);
return SANE_STATUS_GOOD;
}
}
@ -1475,6 +1476,9 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
/*
* $Log$
* Revision 1.45 2005/10/24 19:46:40 oliver-guest
* Preview and range fix for Epson 2480/2580
*
* Revision 1.44 2005/10/23 21:28:58 oliver-guest
* Fix for buffer size in high res modes, fixes for delay code
*

Wyświetl plik

@ -1,7 +1,7 @@
/* sane - Scanner Access Now Easy.
Copyright (C) 1997, 1998, 2001 Franck Schnefra, Michel Roelofs,
Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller,
Copyright (C) 1997-2005 Franck Schnefra, Michel Roelofs, Emmanuel Blot,
Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller, Simon Munton,
Petter Reinholdtsen, Gary Plewa, Sebastien Sable, Mikael Magnusson,
Oliver Schwartz and Kevin Charter
@ -79,7 +79,7 @@
#define EXPECTED_MAJOR 1
#define MINOR_VERSION 4
#define BUILD 46
#define BUILD 47
#define BACKEND_NAME snapscan
@ -894,7 +894,7 @@ SANE_Status sane_open (SANE_String_Const name, SANE_Handle * h)
pss->sense_str = NULL;
pss->as_str = NULL;
pss->phys_buf_sz = DEFAULT_SCANNER_BUF_SZ;
if (pss->pdev->model == PERFECTION2480)
if ((pss->pdev->model == PERFECTION2480) || (pss->pdev->model == PERFECTION3490))
pss->phys_buf_sz *= 2;
if (psd->bus == SCSI) {
pss->phys_buf_sz = sanei_scsi_max_request_size;
@ -1556,7 +1556,7 @@ static SANE_Status measure_transfer_rate (SnapScan_Scanner *pss)
the buffer size must be rounded to a 128-byte boundary. */
DBG (DL_VERBOSE, "%s: have ring buffer\n", me);
if (pss->pdev->model == PERFECTION2480)
if ((pss->pdev->model == PERFECTION2480) || (pss->pdev->model == PERFECTION3490))
{
/* Epson 2480: read a multiple of bytes per line, limit to less than 0xfff0 */
if (pss->bytes_per_line > 0xfff0)
@ -1914,6 +1914,9 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
/*
* $Log$
* Revision 1.56 2005/10/24 19:46:40 oliver-guest
* Preview and range fix for Epson 2480/2580
*
* Revision 1.55 2005/10/23 21:28:58 oliver-guest
* Fix for buffer size in high res modes, fixes for delay code
*

Wyświetl plik

@ -363,6 +363,7 @@ struct snapscan_scanner
size_t bytes_per_line; /* bytes per scan line */
size_t pixels_per_line; /* pixels per scan line */
u_char hconfig; /* hardware configuration byte */
u_char hconfig_epson; /* additional hw configuration for some Epson scanners */
u_char hwst; /* hardware status byte */
float ms_per_line; /* speed: milliseconds per scan line */
SANE_Bool nonblocking; /* wait on reads for data? */
@ -414,6 +415,9 @@ struct snapscan_scanner
/*
* $Log$
* Revision 1.37 2005/10/24 19:46:40 oliver-guest
* Preview and range fix for Epson 2480/2580
*
* Revision 1.36 2005/09/28 21:33:11 oliver-guest
* Added 16 bit option for Epson scanners (untested)
*