Re: BW QuickCam

David Mosberger-Tang (davidm@azstarnet.com)
Tue, 18 Mar 1997 17:40:36 -0700

>>>>> On Mon, 17 Mar 1997 23:11:14 +0100 (MET), Guido Muesch <odiug@faho.rwth-aachen.de> said:

Guido> qcam.README says: The qcam backend currently works for the
Guido> Connectix _color_ QuickCam only. Almost all code is there
Guido> for the black&white camera is there, but it hasn't been
Guido> finished or tested yet.

Guido> So what is missing? I have not looked deeper into the code
Guido> yet. Any help needed? Testing?

Can you try it after applying this patch to sane-pre0.5? If it
doesn't work, could you send me the debug output you get when
running:

SANE_DEBUG_QCAM=128 scan -d qcam >/dev/null

Good luck,

--david

--- backend/qcam.c~ Mon Mar 10 22:31:53 1997
+++ backend/qcam.c Tue Mar 18 17:27:37 1997
@@ -664,38 +664,25 @@
}

if (q->version == QC_COLOR)
- {
- for (len = 0; len < num_bytes; len += count)
- count = qc_readbytes (s, buffer + len);
- }
+ for (len = 0; len < num_bytes; len += count)
+ count = qc_readbytes (s, buffer + len);
else
{
-#ifdef XXX
/* strange -- should be 15:63 below, but 4bpp is odd */
- invert = (s->val[OPT_DEPTH] == 4) ? 16 : 63;
+ int i, invert = (s->val[OPT_DEPTH].w == 4) ? 16 : 63;

- for (i = 0; i < linestotrans; i++)
+ for (len = 0; len < num_bytes; len += count)
{
- for (pixels_read = j = 0; j < transperline; j++)
+ count = qc_readbytes (s, buffer + len);
+ for (i = 0; i < count; ++i)
{
- bytes = qc_readbytes (q, buffer);
- assert (bytes > 0);
- for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++)
- {
- assert (buffer[k] <= invert);
- if (buffer[k] == 0 && invert == 16)
- {
- /* 4bpp is odd (again) -- inverter is 16, not
- 15, but output must be 0-15 */
- buffer[k] = 16;
- }
- ret[i*pixels_per_line + pixels_read + k] = invert - buffer[k];
- }
- pixels_read += bytes;
+ /* 4bpp is odd (again) -- inverter is 16, not 15,
+ but output must be 0-15 */
+ if (buffer[len + i] > 0 || invert != 16)
+ buffer[len + i] = invert - buffer[len + i];
}
- qc_readbytes (q, 0); /* reset state machine */
}
-#endif
+ qc_readbytes (s, 0); /* reset state machine */
}
/* we're done reading this frame: */
DBG(2, "qcam.reader_process: frame complete\n");

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com