Re: PIXMA: 1 Bit B/W Lineart for pixma_mp150 and pixma_mp810 Subdrivers
Rolf Bensch <rolf <at> bensch-online.de>
2012-02-07 09:30:59 GMT
Am 06.02.2012 17:52, schrieb ibu ☉ radempa ䷰:
>
> Thanks! There is a small typo however in your commit:
>
> DEVICE ("Canon PIXMA MX360", "MX360", MX350_PID, 1200, 0, 0, 638, 1050,
> PIXMA_CAP_CIS | PIXMA_CAP_ADF),
>
> should read
>
> DEVICE ("Canon PIXMA MX360", "MX360", MX360_PID, 1200, 0, 0, 638, 1050,
> PIXMA_CAP_CIS | PIXMA_CAP_ADF),
>
> With the latter it works.
I just changed this in git.
>
>> There seems to be a problem somewhere around post_process_image_data in
>> pixma_mp150.c. Please use the attached patch to generate log files of
>> gray and lineart scans. Please send them packed to avoid an unreadable
>> ML archive.
>
> Attached. (Command lines included.)
>
I need more debug info. Please use the attached patches to generate the
log files again.
How do you scan the images? Please try ADF and flatbed.
Thanks,
Rolf
--- sub-driver-pixma_mp810/pixma_mp150.c 2012-02-07 10:19:32.000000000 +0100
+++ sane-backends/backend/pixma_mp150.c 2012-02-07 10:19:36.000000000 +0100
@@ -707,8 +707,8 @@
data[0x05] = 0x01; /* This one also seen at 0. Don't know yet what's used for */
pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x08);
pixma_set_be16 (s->param->ydpi | 0x8000, data + 0x0a);
- /*PDBG (pixma_dbg (4, "*send_scan_param***** Setting: xdpi=%hi ydpi=%hi x=%i y=%i w=%i ***** \n",
- s->param->xdpi,s->param->ydpi,(s->param->x)-(s->param->xs),s->param->y,raw_width));*/
+ PDBG (pixma_dbg (4, "*send_scan_param***** Setting: xdpi=%hi ydpi=%hi x=%i y=%i w=%i ***** \n",
+ s->param->xdpi,s->param->ydpi,(s->param->x)-(s->param->xs),s->param->y,raw_width));
pixma_set_be32 (s->param->x - s->param->xs, data + 0x0c);
pixma_set_be32 (s->param->y, data + 0x10);
pixma_set_be32 (raw_width, data + 0x14);
@@ -1029,19 +1029,19 @@
m = (n > 0) ? s->param->wx / n : 1;
sptr = dptr = gptr = cptr = mp->imgbuf;
line_size = get_cis_ccd_line_size (s);
- /*PDBG (pixma_dbg (4, "*post_process_image_data***** ----- Set n=%u, m=%u, line_size=%u ----- *****
\n", n, m, line_size));*/
+ PDBG (pixma_dbg (4, "*post_process_image_data***** ----- Set n=%u, m=%u, line_size=%u ----- *****
\n", n, m, line_size));
lines = (mp->data_left_ofs - mp->imgbuf) / line_size;
- /*PDBG (pixma_dbg (4, "*post_process_image_data***** lines = %i > 2 * mp->color_shift +
mp->stripe_shift = %i ***** \n",
- lines, 2 * mp->color_shift + mp->stripe_shift));*/
+ PDBG (pixma_dbg (4, "*post_process_image_data***** lines = %i > 2 * mp->color_shift +
mp->stripe_shift = %i ***** \n",
+ lines, 2 * mp->color_shift + mp->stripe_shift));
if (lines > 2 * mp->color_shift + mp->stripe_shift)
{
lines -= 2 * mp->color_shift + mp->stripe_shift;
for (i = 0; i < lines; i++, sptr += line_size)
{
/* Color plane and stripes shift needed by e.g. CCD */
- /*PDBG (pixma_dbg (4, "*post_process_image_data***** Processing with c=%u, n=%u, m=%u, w=%i,
line_size=%u ***** \n",
- c, n, m, s->param->wx, line_size));*/
+ PDBG (pixma_dbg (4, "*post_process_image_data***** Processing with c=%u, n=%u, m=%u, w=%i,
line_size=%u ***** \n",
+ c, n, m, s->param->wx, line_size));
if (c >= 3)
dptr = shift_colors (dptr, sptr,
s->param->wx, s->param->xdpi, s->cfg->pid, c,
@@ -1141,6 +1141,9 @@
mp150_t *mp = (mp150_t *) s->subdriver;
unsigned w_max;
+ PDBG (pixma_dbg (4, "*mp150_check_param***** Initially: channels=%u, depth=%u, x=%u, y=%u, w=%u,
h=%u, xs=%u, wx=%u *****\n",
+ sp->channels, sp->depth, sp->x, sp->y, sp->w, sp->h, sp->xs, sp->wx));
+
/* MP150 only supports 8 bit per channel in color and grayscale mode */
if (sp->depth != 1)
{
@@ -1184,7 +1187,7 @@
/*PDBG (pixma_dbg (4, "*mp150_check_param***** Selected origin, origin shift: %i, %i *****\n", sp->x, sp->xs));*/
sp->wx = calc_raw_width (mp, sp);
sp->line_size = sp->w * sp->channels * (((sp->depth == 1) ? 8 : sp->depth) / 8); /* bytes per line per color
after cropping */
- /*PDBG (pixma_dbg (4, "*mp150_check_param***** Final scan width and line-size: %i, %i *****\n",
sp->wx, sp->line_size));*/
+ PDBG (pixma_dbg (4, "*mp150_check_param***** Final scan width and line-size: %i, %i *****\n", sp->wx, sp->line_size));
/* Some exceptions here for particular devices */
/* Those devices can scan up to 14" with ADF, but A4 11.7" in flatbed */
@@ -1238,6 +1241,9 @@
sp->ydpi = sp->xdpi;
}
+ PDBG (pixma_dbg (4, "*mp150_check_param***** Finally: channels=%u, depth=%u, x=%u, y=%u, w=%u,
h=%u, xs=%u, wx=%u *****\n",
+ sp->channels, sp->depth, sp->x, sp->y, sp->w, sp->h, sp->xs, sp->wx));
+
return 0;
}
@@ -1399,7 +1405,7 @@
mp->state = state_finished;
return 0;
}
- /*PDBG (pixma_dbg (4, "*mp150_fill_buffer***** moving %u bytes into buffer *****\n", mp->data_left_len));*/
+ PDBG (pixma_dbg (4, "*mp150_fill_buffer***** moving %u bytes into buffer *****\n", mp->data_left_len));
memmove (mp->imgbuf, mp->data_left_ofs, mp->data_left_len);
error = read_image_block (s, header, mp->imgbuf + mp->data_left_len);
if (error < 0)
@@ -1413,7 +1419,7 @@
}
bytes_received = error;
- /*PDBG (pixma_dbg (4, "*mp150_fill_buffer***** %u bytes received by read_image_block *****\n", bytes_received));*/
+ PDBG (pixma_dbg (4, "*mp150_fill_buffer***** %u bytes received by read_image_block *****\n", bytes_received));
block_size = pixma_get_be32 (header + 12);
mp->last_block = header[8] & 0x38;
if ((header[8] & ~0x38) != 0)
--- sub-driver-pixma_mp810/pixma.c 2012-02-07 10:19:32.000000000 +0100
+++ sane-backends/backend/pixma.c 2012-02-07 10:19:36.000000000 +0100
@@ -573,7 +573,7 @@
cfg = pixma_get_config (ss->s);
- /* PDBG (pixma_dbg (4, "*control_option***** n = %u, a = %u\n", n, a)); */
+ PDBG (pixma_dbg (4, "*control_option***** n = %u, a = %u\n", n, a));
result = SANE_STATUS_UNSUPPORTED;
switch (n)
--
--
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-request <at> lists.alioth.debian.org