summaryrefslogtreecommitdiff
path: root/backend/epson2-ops.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
commit9f8889f928ce86ba4a78659d378c6ba29bc9f735 (patch)
treec9567cb0d015b68ce3da8d03472b6443f1cb1ca9 /backend/epson2-ops.c
parent446e9454b8cbe5b689149415d11d36e88442ca88 (diff)
parent154785ab2d5df7ddc8c2cf813b773c340e5e2aea (diff)
Merge branch 'release/debian/1.0.32-1'debian/1.0.32-1
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.