summaryrefslogtreecommitdiff
path: root/backend/epson2-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/epson2-ops.c')
-rw-r--r--backend/epson2-ops.c46
1 files changed, 10 insertions, 36 deletions
diff --git a/backend/epson2-ops.c b/backend/epson2-ops.c
index ba0d9cb..83a0169 100644
--- a/backend/epson2-ops.c
+++ b/backend/epson2-ops.c
@@ -302,6 +302,9 @@ e2_dev_post_init(struct Epson_Device *dev)
dev->need_reset_on_source_change = SANE_TRUE;
}
+ if (e2_dev_model(dev, "DS-G20000"))
+ dev->cmd->bright_range.min = -3;
+
return SANE_STATUS_GOOD;
}
@@ -822,24 +825,15 @@ e2_discover_capabilities(Epson_Scanner *s)
if (esci_request_focus_position(s, &s->currentFocusPosition) ==
SANE_STATUS_GOOD) {
- DBG(1, "setting focus is supported\n");
+ DBG(1, "setting focus is supported, current focus: %u\n", s->currentFocusPosition);
dev->focusSupport = SANE_TRUE;
- s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE;
-
- /* reflect the current focus position in the GUI */
- if (s->currentFocusPosition < 0x4C) {
- /* focus on glass */
- s->val[OPT_FOCUS].w = 0;
- } else {
- /* focus 2.5mm above glass */
- s->val[OPT_FOCUS].w = 1;
- }
-
+ s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE;
+ s->val[OPT_FOCUS_POS].w = s->currentFocusPosition;
} else {
DBG(1, "setting focus is not supported\n");
dev->focusSupport = SANE_FALSE;
- s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE;
- s->val[OPT_FOCUS].w = 0; /* on glass - just in case */
+ s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE;
+ s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; /* just in case */
}
/* Set defaults for no extension. */
@@ -948,8 +942,6 @@ e2_set_extended_scanning_parameters(Epson_Scanner * s)
/* ESC e */
buf[26] = extensionCtrl;
-
- /* XXX focus */
}
/* ESC g, scanning mode (normal or high speed) */
@@ -1063,24 +1055,6 @@ e2_set_scanning_parameters(Epson_Scanner * s)
* buffer to set the scan area for
* ES-9000H and GT-30000
*/
-
- /*
- * set the focus position according to the extension used:
- * if the TPU is selected, then focus 2.5mm above the glass,
- * otherwise focus on the glass. Scanners that don't support
- * this feature, will just ignore these calls.
- */
-
- if (s->hw->focusSupport == SANE_TRUE) {
- if (s->val[OPT_FOCUS].w == 0) {
- DBG(1, "setting focus to glass surface\n");
- esci_set_focus_position(s, 0x40);
- } else {
- DBG(1,
- "setting focus to 2.5mm above glass\n");
- esci_set_focus_position(s, 0x59);
- }
- }
}
/* ESC C, Set color */
@@ -1496,7 +1470,7 @@ e2_wait_button(Epson_Scanner * s)
else
sleep(1);
} else {
- /* we run into an error condition, just continue */
+ /* we ran into an error condition, just continue */
s->hw->wait_for_button = SANE_FALSE;
}
}
@@ -1997,7 +1971,7 @@ color_shuffle(SANE_Handle handle, int *new_length)
* We just finished the line in line_buffer[0] - write it to the
* output buffer and continue.
*
- * The ouput buffer ist still "buf", but because we are
+ * The output buffer is still "buf", but because we are
* only overwriting from the beginning of the memory area
* we are not interfering with the "still to shuffle" data
* in the same area.