sane-project-website/old-archive/1997-02/0014.html

113 wiersze
4.5 KiB
HTML

<!-- received="Tue Mar 18 17:42:56 1997 MST" -->
<!-- sent="Tue, 18 Mar 1997 17:40:36 -0700" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="davidm@azstarnet.com" -->
<!-- subject="Re: BW QuickCam" -->
<!-- id="199703190040.RAA10706@panda.mosberger" -->
<!-- inreplyto="BW QuickCam" -->
<title>sane-devel: Re: BW QuickCam</title>
<h1>Re: BW QuickCam</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:davidm@azstarnet.com"><i>davidm@azstarnet.com</i></a>)<br>
<i>Tue, 18 Mar 1997 17:40:36 -0700</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#14">[ date ]</a><a href="index.html#14">[ thread ]</a><a href="subject.html#14">[ subject ]</a><a href="author.html#14">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0015.html">Alex Belits: "QuickCam drivers"</a>
<li> <b>Previous message:</b> <a href="0013.html">Guido Muesch: "BW QuickCam"</a>
<li> <b>Maybe in reply to:</b> <a href="0013.html">Guido Muesch: "BW QuickCam"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0030.html">David Mosberger-Tang: "Re: BW QuickCam"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Mon, 17 Mar 1997 23:11:14 +0100 (MET), Guido Muesch &lt;<a href="mailto:odiug@faho.rwth-aachen.de">odiug@faho.rwth-aachen.de</a>&gt; said:</i><br>
<p>
Guido&gt; qcam.README says: The qcam backend currently works for the<br>
Guido&gt; Connectix _color_ QuickCam only. Almost all code is there<br>
Guido&gt; for the black&amp;white camera is there, but it hasn't been<br>
Guido&gt; finished or tested yet.<br>
<p>
Guido&gt; So what is missing? I have not looked deeper into the code<br>
Guido&gt; yet. Any help needed? Testing?<br>
<p>
Can you try it after applying this patch to sane-pre0.5? If it<br>
doesn't work, could you send me the debug output you get when<br>
running:<br>
<p>
SANE_DEBUG_QCAM=128 scan -d qcam &gt;/dev/null<br>
<p>
Good luck,<br>
<p>
--david<br>
<p>
--- backend/qcam.c~ Mon Mar 10 22:31:53 1997<br>
+++ backend/qcam.c Tue Mar 18 17:27:37 1997<br>
@@ -664,38 +664,25 @@<br>
}<br>
<br>
if (q-&gt;version == QC_COLOR)<br>
- {<br>
- for (len = 0; len &lt; num_bytes; len += count)<br>
- count = qc_readbytes (s, buffer + len);<br>
- }<br>
+ for (len = 0; len &lt; num_bytes; len += count)<br>
+ count = qc_readbytes (s, buffer + len);<br>
else<br>
{<br>
-#ifdef XXX<br>
/* strange -- should be 15:63 below, but 4bpp is odd */<br>
- invert = (s-&gt;val[OPT_DEPTH] == 4) ? 16 : 63;<br>
+ int i, invert = (s-&gt;val[OPT_DEPTH].w == 4) ? 16 : 63;<br>
<br>
- for (i = 0; i &lt; linestotrans; i++)<br>
+ for (len = 0; len &lt; num_bytes; len += count)<br>
{<br>
- for (pixels_read = j = 0; j &lt; transperline; j++)<br>
+ count = qc_readbytes (s, buffer + len);<br>
+ for (i = 0; i &lt; count; ++i)<br>
{<br>
- bytes = qc_readbytes (q, buffer);<br>
- assert (bytes &gt; 0);<br>
- for (k = 0; k &lt; bytes &amp;&amp; (pixels_read + k) &lt; pixels_per_line; k++)<br>
- {<br>
- assert (buffer[k] &lt;= invert);<br>
- if (buffer[k] == 0 &amp;&amp; invert == 16)<br>
- {<br>
- /* 4bpp is odd (again) -- inverter is 16, not<br>
- 15, but output must be 0-15 */<br>
- buffer[k] = 16;<br>
- }<br>
- ret[i*pixels_per_line + pixels_read + k] = invert - buffer[k];<br>
- }<br>
- pixels_read += bytes;<br>
+ /* 4bpp is odd (again) -- inverter is 16, not 15,<br>
+ but output must be 0-15 */<br>
+ if (buffer[len + i] &gt; 0 || invert != 16)<br>
+ buffer[len + i] = invert - buffer[len + i];<br>
}<br>
- qc_readbytes (q, 0); /* reset state machine */<br>
}<br>
-#endif<br>
+ qc_readbytes (s, 0); /* reset state machine */<br>
}<br>
/* we're done reading this frame: */<br>
DBG(2, "qcam.reader_process: frame complete\n");<br>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.azstarnet.com/~axplinux/sane/">http://www.azstarnet.com/~axplinux/sane/</a>
To unsubscribe: mail -s unsubscribe <a href="mailto:sane-devel-request@listserv.azstarnet.com">sane-devel-request@listserv.azstarnet.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0015.html">Alex Belits: "QuickCam drivers"</a>
<li> <b>Previous message:</b> <a href="0013.html">Guido Muesch: "BW QuickCam"</a>
<li> <b>Maybe in reply to:</b> <a href="0013.html">Guido Muesch: "BW QuickCam"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0030.html">David Mosberger-Tang: "Re: BW QuickCam"</a>
<!-- reply="end" -->
</ul>