Re: QuickCam bit depth wired to 8: why?

Andrew Kuchling (amk@magnet.com)
Thu, 19 Jun 1997 13:09:18 -0400 (EDT)

David Mosberger-Tang wrote:
>qc_readbytes() would be the right place. Cases 4 and 6 there can occur
>with the b&w camera only.

However, reader_process also inverts the values for the B&W
qcam, so just shifting things over in qc_readbytes() isn't enough.
For the moment I've added the shift to reader_process() after the
inversion (patch included below FYI) and it works fine; if doing the
shift in reader_process() is unacceptable, let me know and I'll redo
the patch. (Maybe the inversion should be taken out of reader_process
and moved into the 4- and 6-bit cases in qc_readbytes?)

Andrew Kuchling
amk@magnet.com
http://people.magnet.com/%7Eamk/

diff -urN /scratch/sane-0.6/backend/qcam.c sane-0.6/backend/qcam.c
--- /scratch/sane-0.6/backend/qcam.c Sat Jun 14 17:30:54 1997
+++ sane-0.6/backend/qcam.c Thu Jun 19 12:50:33 1997
@@ -858,6 +858,10 @@
but output must be 0-15 */
if (buffer[len + i] > 0 || invert != 16)
buffer[len + i] = invert - buffer[len + i];
+ if (invert==16)
+ buffer[len+i] <<= 4;
+ else
+ buffer[len+i] <<= 2;
}
}
qc_readbytes (s, 0); /* reset state machine */

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