sane-project-website/old-archive/1999-06/0226.html

76 wiersze
3.1 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Mon Jun 28 10:03:50 1999 PDT" -->
<!-- sent="Mon, 28 Jun 1999 18:42:05 +0200" -->
<!-- name="abel deuring" -->
<!-- email="a.deuring@satzbau-gmbh.de" -->
<!-- subject="Re: calculation of bytes to read, bytes per line etc" -->
<!-- id="" -->
<!-- inreplyto="calculation of bytes to read, bytes per line etc" -->
<title>sane-devel: Re: calculation of bytes to read, bytes per line etc</title>
<h1>Re: calculation of bytes to read, bytes per line etc</h1>
<b>abel deuring</b> (<a href="mailto:a.deuring@satzbau-gmbh.de"><i>a.deuring@satzbau-gmbh.de</i></a>)<br>
<i>Mon, 28 Jun 1999 18:42:05 +0200</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#226">[ date ]</a><a href="index.html#226">[ thread ]</a><a href="subject.html#226">[ subject ]</a><a href="author.html#226">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0227.html">joel@cs.rochester.edu: "Re: X6EL modes under OS/2?"</a>
<li> <b>Previous message:</b> <a href="0225.html">Oliver Rauch: "XSANE-0.27 available"</a>
<li> <b>Maybe in reply to:</b> <a href="0220.html">Meino Christian Cramer: "calculation of bytes to read, bytes per line etc"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Hi Meino !<br>
<p>
<i>&gt; Unfortunatly, there most be some round errors or</i><br>
<i>&gt; something like that, cause Xscanimage gets (or means)</i><br>
<i>&gt; a greater amount of bytes to read, than my scanner is</i><br>
<i>&gt; willing to send.</i><br>
<p>
If it is possible for the Avision scanner, an easy and reliable solution<br>
would be to ask the scanner how many bytes it will return for a scan:<br>
The frontends call sane_get_parameters after a scan is started in order<br>
to get the real scan size. <br>
<p>
Several backends have the function sane_get_parameters implemented like<br>
this:<br>
<p>
SANE_Status sane_get_parameters(SANE_Handle handle, SANE_Parameters<br>
*params)<br>
{<br>
Scanner *s = handle;<br>
<p>
if (!s-&gt;scanning) {<br>
/* estimate the number of pixel per line and the number of<br>
scan lines based on the selected resolution, scan window<br>
size etc., and set *params accordingly<br>
*/<br>
...<br>
}<br>
else {<br>
/* the scanner has received a "set window" and a "start scan"<br>
command; now ask the scanner how many pixels per line<br>
and how many lines it will send. Set *params accordingly<br>
*/<br>
...<br>
}<br>
}<br>
<p>
Abel<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="0227.html">joel@cs.rochester.edu: "Re: X6EL modes under OS/2?"</a>
<li> <b>Previous message:</b> <a href="0225.html">Oliver Rauch: "XSANE-0.27 available"</a>
<li> <b>Maybe in reply to:</b> <a href="0220.html">Meino Christian Cramer: "calculation of bytes to read, bytes per line etc"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>