sane-project-website/old-archive/1999-04/0041.html

77 wiersze
3.6 KiB
HTML

<!-- received="Sat Apr 3 12:50:32 1999 PST" -->
<!-- sent="Sat, 3 Apr 1999 12:50:26 -0800" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="David.Mosberger@acm.org" -->
<!-- subject="Re: 16 bit per sample support" -->
<!-- id="199904032050.MAA15834@panda.mostang.com" -->
<!-- inreplyto="36ED3A6F.BE355DC2@wolfsburg.de" -->
<title>sane-devel: Re: 16 bit per sample support</title>
<h1>Re: 16 bit per sample support</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:David.Mosberger@acm.org"><i>David.Mosberger@acm.org</i></a>)<br>
<i>Sat, 3 Apr 1999 12:50:26 -0800</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#41">[ date ]</a><a href="index.html#41">[ thread ]</a><a href="subject.html#41">[ subject ]</a><a href="author.html#41">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0042.html">Oliver Graf: "Re: Epson GT-5000 (parallel port)"</a>
<li> <b>Previous message:</b> <a href="0040.html">David Taylor: "Epson GT-5000 (parallel port)"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0053.html">Jonathan A. Buzzard: "Re: 16 bit per sample support"</a>
<li> <b>Reply:</b> <a href="0053.html">Jonathan A. Buzzard: "Re: 16 bit per sample support"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Mon, 15 Mar 1999 17:50:56 +0100, Oliver Rauch &lt;<a href="mailto:oliver.rauch@Wolfsburg.DE">oliver.rauch@Wolfsburg.DE</a>&gt; said:</i><br>
<p>
<i> &gt;&gt; I would suggest that for backends that support &gt; 8 bit/sample</i><br>
<i> &gt;&gt; output, that sane return the data in the high-order bits, and</i><br>
<i> &gt;&gt; then if you don't need the extra bits (eg for display on the</i><br>
<i> &gt;&gt; screen), you can simply truncate the low-order bits and treat it</i><br>
<i> &gt;&gt; like 8 bits/sample. This is how PNG stores the data, whether 5</i><br>
<i> &gt;&gt; bps or 12 bps -&gt; it only really "stores" either 8 or 16</i><br>
<i> &gt;&gt; bits/sample, and converts all other bit depths to fit.</i><br>
<p>
Oliver&gt; It does not matter how we define it, there are advantages<br>
Oliver&gt; and disadvantages for both possibilities. The point is that<br>
Oliver&gt; is has to be defined!<br>
<p>
This is perfectly well defined in section 3.2:<br>
<p>
... Valid bit depths are 1, 8, or 16 bits per sample.<br>
If a device's natural bit depth is something else, it is up<br>
to the driver to scale the sample values appropriately (e.g.,<br>
a 4 bit sample could be scaled by a factor of four to represent<br>
a sample value of depth 8).<br>
<p>
Note that, as Andy has pointed out several times, it's best to<br>
scale in a way that preserves the full dynamic range of the<br>
format. E.g., to scale from 4 to 8 bits, multiply by 0x11,<br>
instead of just 0x10. This way, you get mappings like this:<br>
<p>
sample scaled<br>
value value<br>
0x0 0x00<br>
0x1 0x11<br>
0x2 0x22<br>
: :<br>
0xf 0xff<br>
<p>
--david<br>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0042.html">Oliver Graf: "Re: Epson GT-5000 (parallel port)"</a>
<li> <b>Previous message:</b> <a href="0040.html">David Taylor: "Epson GT-5000 (parallel port)"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0053.html">Jonathan A. Buzzard: "Re: 16 bit per sample support"</a>
<li> <b>Reply:</b> <a href="0053.html">Jonathan A. Buzzard: "Re: 16 bit per sample support"</a>
<!-- reply="end" -->
</ul>