canon_dr backend v57

- complete support for X-10, including hardware cropping (by manuarg)
- minor comments and move a bit of code for consistency
merge-requests/43/head
m. allan noah 2019-02-24 20:37:55 -05:00
rodzic 81faeb46f2
commit 9c4ac1f07f
3 zmienionych plików z 12 dodań i 8 usunięć

Wyświetl plik

@ -336,6 +336,8 @@
- rename all DUPLEX_INTERLACE_* to indicate start and end of line - rename all DUPLEX_INTERLACE_* to indicate start and end of line
v56 2016-08-23, MAN v56 2016-08-23, MAN
- initial support for P-150 - initial support for P-150
v57 2019-02-24, manuarg
- complete support for X-10, including hardware cropping
SANE FLOW DIAGRAM SANE FLOW DIAGRAM
@ -386,7 +388,7 @@
#include "canon_dr.h" #include "canon_dr.h"
#define DEBUG 1 #define DEBUG 1
#define BUILD 56 #define BUILD 57
/* values for SANE_DEBUG_CANON_DR env var: /* values for SANE_DEBUG_CANON_DR env var:
- errors 5 - errors 5
@ -2956,6 +2958,10 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
*val_p = s->side; *val_p = s->side;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
case OPT_HW_CROP:
*val_p = s->hwcrop;
return SANE_STATUS_GOOD;
/* Sensor Group */ /* Sensor Group */
case OPT_START: case OPT_START:
ret = read_panel(s,OPT_START); ret = read_panel(s,OPT_START);
@ -3001,10 +3007,6 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
ret = read_sensors(s,OPT_CARD_LOADED); ret = read_sensors(s,OPT_CARD_LOADED);
*val_p = s->sensor_card_loaded; *val_p = s->sensor_card_loaded;
return ret; return ret;
case OPT_HW_CROP:
*val_p = s->hwcrop;
return SANE_STATUS_GOOD;
} }
} }
else if (action == SANE_ACTION_SET_VALUE) { else if (action == SANE_ACTION_SET_VALUE) {
@ -3910,6 +3912,7 @@ send_panel(struct scanner *s)
/* /*
* Request the size of the scanned image * Request the size of the scanned image
*/ */
/* we should really be updating s->s and s->i instead */
static SANE_Status static SANE_Status
get_pixelsize(struct scanner *s) get_pixelsize(struct scanner *s)
{ {
@ -4330,6 +4333,7 @@ sane_start (SANE_Handle handle)
DBG (5, "sane_start: ERROR: cannot send panel\n"); DBG (5, "sane_start: ERROR: cannot send panel\n");
} }
/* we should really be updating s->s and s->i instead */
if(s->hwcrop){ if(s->hwcrop){
s->u.br_x = s->max_x; s->u.br_x = s->max_x;
s->u.tl_x = 0; s->u.tl_x = 0;

Wyświetl plik

@ -11,9 +11,9 @@
:backend "canon_dr" ; name of backend :backend "canon_dr" ; name of backend
:url "http://www.thebility.com/canon/" :url "http://www.thebility.com/canon/"
:version "51" ; version of backend :version "57" ; version of backend
:manpage "sane-canon_dr" ; name of manpage (if it exists) :manpage "sane-canon_dr" ; name of manpage (if it exists)
:comment "Backend updated for SANE release 1.0.25, see sane-canon_dr manpage" :comment "Backend updated for SANE release 1.0.28, see sane-canon_dr manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api

Wyświetl plik

@ -10,7 +10,7 @@ The
library implements a SANE (Scanner Access Now Easy) backend which library implements a SANE (Scanner Access Now Easy) backend which
provides access to some Canon DR-series scanners. provides access to some Canon DR-series scanners.
This document describes backend version 51, which shipped with SANE 1.0.25. This document describes backend version 57, which shipped with SANE 1.0.28.
.SH SUPPORTED HARDWARE .SH SUPPORTED HARDWARE
This version has only been tested with a few scanner models. Please see This version has only been tested with a few scanner models. Please see