kopia lustrzana https://gitlab.com/sane-project/backends
* backend/canon_dr.[ch]: backend v19
- pad gray deinterlacing area for DR-2510C - override tl_x and br_x for fixed width scanners * doc/descriptions/canon_dr.desc: backend v19, update commentsmerge-requests/1/head
rodzic
cd0b09ddf4
commit
dc278c2e9f
|
@ -1,3 +1,9 @@
|
||||||
|
2009-03-22 m. allan noah <kitno455 a t gmail d o t com>
|
||||||
|
* backend/canon_dr.[ch]: backend v19
|
||||||
|
- pad gray deinterlacing area for DR-2510C
|
||||||
|
- override tl_x and br_x for fixed width scanners
|
||||||
|
* doc/descriptions/canon_dr.desc: backend v19, update comments
|
||||||
|
|
||||||
2009-03-21 m. allan noah <kitno455 a t gmail d o t com>
|
2009-03-21 m. allan noah <kitno455 a t gmail d o t com>
|
||||||
* backend/canon_dr.[ch], backend/canon_dr-cmd.h: backend v15 thru v18
|
* backend/canon_dr.[ch], backend/canon_dr-cmd.h: backend v15 thru v18
|
||||||
- add byte-oriented duplex interlace code
|
- add byte-oriented duplex interlace code
|
||||||
|
|
|
@ -147,6 +147,9 @@
|
||||||
- remove default config file from code
|
- remove default config file from code
|
||||||
- add initial gray deinterlacing code for DR-2510C
|
- add initial gray deinterlacing code for DR-2510C
|
||||||
- rename do_usb_reset to do_usb_clear
|
- rename do_usb_reset to do_usb_clear
|
||||||
|
v19 2009-03-22, MAN
|
||||||
|
- pad gray deinterlacing area for DR-2510C
|
||||||
|
- override tl_x and br_x for fixed width scanners
|
||||||
|
|
||||||
SANE FLOW DIAGRAM
|
SANE FLOW DIAGRAM
|
||||||
|
|
||||||
|
@ -207,7 +210,7 @@
|
||||||
#include "canon_dr.h"
|
#include "canon_dr.h"
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#define BUILD 18
|
#define BUILD 19
|
||||||
|
|
||||||
/* values for SANE_DEBUG_CANON_DR env var:
|
/* values for SANE_DEBUG_CANON_DR env var:
|
||||||
- errors 5
|
- errors 5
|
||||||
|
@ -1053,6 +1056,7 @@ init_model (struct scanner *s)
|
||||||
s->unknown_byte2 = 0x80;
|
s->unknown_byte2 = 0x80;
|
||||||
s->has_counter = 1;
|
s->has_counter = 1;
|
||||||
s->head_interlace = HEAD_INTERLACE_2510;
|
s->head_interlace = HEAD_INTERLACE_2510;
|
||||||
|
s->fixed_width = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG (10, "init_model: finish\n");
|
DBG (10, "init_model: finish\n");
|
||||||
|
@ -2792,8 +2796,16 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
|
||||||
/* this backend only sends single frame images */
|
/* this backend only sends single frame images */
|
||||||
params->last_frame = 1;
|
params->last_frame = 1;
|
||||||
|
|
||||||
|
/* dumb scanner, always scans full width */
|
||||||
|
/*FIXME: move this elsewhere*/
|
||||||
|
if(s->fixed_width){
|
||||||
|
s->tl_x = 0;
|
||||||
|
params->pixels_per_line = s->max_x * s->resolution_x / 1200;
|
||||||
|
}
|
||||||
|
else{
|
||||||
params->pixels_per_line
|
params->pixels_per_line
|
||||||
= s->resolution_x * (s->br_x - s->tl_x) / 1200;
|
= (s->br_x - s->tl_x) * s->resolution_x / 1200;
|
||||||
|
}
|
||||||
|
|
||||||
params->lines = s->resolution_y * (s->br_y - s->tl_y) / 1200;
|
params->lines = s->resolution_y * (s->br_y - s->tl_y) / 1200;
|
||||||
|
|
||||||
|
@ -3069,7 +3081,7 @@ set_window (struct scanner *s)
|
||||||
SANE_Status ret = SANE_STATUS_GOOD;
|
SANE_Status ret = SANE_STATUS_GOOD;
|
||||||
|
|
||||||
/* The command specifies the number of bytes in the data phase
|
/* The command specifies the number of bytes in the data phase
|
||||||
* the data phase has a header, followed by 1 or 2 window desc blocks
|
* the data phase has a header, followed by 1 window desc block
|
||||||
* the header specifies the number of bytes in 1 window desc block
|
* the header specifies the number of bytes in 1 window desc block
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -3102,13 +3114,13 @@ set_window (struct scanner *s)
|
||||||
set_WD_Yres (desc1, s->resolution_y);
|
set_WD_Yres (desc1, s->resolution_y);
|
||||||
|
|
||||||
/* we have to center the window ourselves */
|
/* we have to center the window ourselves */
|
||||||
set_WD_ULX (desc1, s->tl_x + (s->max_x - s->page_width) / 2);
|
set_WD_ULX (desc1, (s->max_x - s->page_width) / 2 + s->tl_x);
|
||||||
set_WD_ULY (desc1, s->tl_y);
|
|
||||||
|
|
||||||
/* some models require that the tly value be inverted? */
|
/* some models require that the tly value be inverted? */
|
||||||
if(s->invert_tly){
|
if(s->invert_tly)
|
||||||
set_WD_ULY (desc1, ~s->tl_y);
|
set_WD_ULY (desc1, ~s->tl_y);
|
||||||
}
|
else
|
||||||
|
set_WD_ULY (desc1, s->tl_y);
|
||||||
|
|
||||||
set_WD_width (desc1, s->params.pixels_per_line * 1200/s->resolution_x);
|
set_WD_width (desc1, s->params.pixels_per_line * 1200/s->resolution_x);
|
||||||
set_WD_length (desc1, s->params.lines * 1200/s->resolution_y);
|
set_WD_length (desc1, s->params.lines * 1200/s->resolution_y);
|
||||||
|
@ -3745,6 +3757,11 @@ copy_buffer_2510(struct scanner *s, unsigned char * buf, int len, int side)
|
||||||
for(j=0;j<twidth;j++){
|
for(j=0;j<twidth;j++){
|
||||||
s->buffers[side][s->bytes_rx[side]++] = buf[i+(twidth-j)*3-2];
|
s->buffers[side][s->bytes_rx[side]++] = buf[i+(twidth-j)*3-2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* pad remainder (1/12th) with black */
|
||||||
|
for(j=0;j<bwidth/12;j++){
|
||||||
|
s->buffers[side][s->bytes_rx[side]++] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG (10, "copy_buffer_2510: finish\n");
|
DBG (10, "copy_buffer_2510: finish\n");
|
||||||
|
|
|
@ -148,6 +148,7 @@ struct scanner
|
||||||
int unknown_byte; /* weird byte, required, meaning unknown */
|
int unknown_byte; /* weird byte, required, meaning unknown */
|
||||||
int unknown_byte2; /* weird byte, required, meaning unknown */
|
int unknown_byte2; /* weird byte, required, meaning unknown */
|
||||||
size_t status_length; /* usually 4, sometimes 16 */
|
size_t status_length; /* usually 4, sometimes 16 */
|
||||||
|
int fixed_width; /* sometime machines always scan full width */
|
||||||
|
|
||||||
int color_interlace; /* different models interlace colors differently */
|
int color_interlace; /* different models interlace colors differently */
|
||||||
int duplex_interlace; /* different models interlace sides differently */
|
int duplex_interlace; /* different models interlace sides differently */
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
: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 "18" ; version of backend
|
:version "19" ; version of backend
|
||||||
:manpage "sane-canon_dr" ; name of manpage (if it exists)
|
:manpage "sane-canon_dr" ; name of manpage (if it exists)
|
||||||
:comment "New backend as of SANE release 1.1.0, testers needed, see manpage"
|
:comment "New backend as of SANE release 1.1.0, testers needed, see manpage"
|
||||||
:devicetype :scanner ; start of a list of devices....
|
:devicetype :scanner ; start of a list of devices....
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
:interface "USB"
|
:interface "USB"
|
||||||
:usbid "0x1083" "0x1617"
|
:usbid "0x1083" "0x1617"
|
||||||
:status :basic
|
:status :basic
|
||||||
:comment "Only simplex gray works, requires user to always scan full-width."
|
:comment "Only simplex gray works, always scans full-width."
|
||||||
|
|
||||||
:model "DR-2580C"
|
:model "DR-2580C"
|
||||||
:interface "USB SCSI"
|
:interface "USB SCSI"
|
||||||
|
|
Ładowanie…
Reference in New Issue