sane-project-website/old-archive/1997-05/0031.html

81 wiersze
4.4 KiB
HTML

<!-- received="Wed May 28 09:40:31 1997 MST" -->
<!-- sent="Wed, 28 May 1997 09:24:54 -0700" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="davidm@azstarnet.com" -->
<!-- subject="Re: image buffering" -->
<!-- id="199705281624.JAA07110@panda.mosberger" -->
<!-- inreplyto="Pine.3.89.9705281733.A7825-0100000@medchem2.pharmazie.uni-halle.de" -->
<title>sane-devel: Re: image buffering</title>
<h1>Re: image buffering</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:davidm@azstarnet.com"><i>davidm@azstarnet.com</i></a>)<br>
<i>Wed, 28 May 1997 09:24:54 -0700</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#31">[ date ]</a><a href="index.html#31">[ thread ]</a><a href="subject.html#31">[ subject ]</a><a href="author.html#31">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<li> <b>Previous message:</b> <a href="0030.html">David Mosberger-Tang: "Re: HP support"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<li> <b>Reply:</b> <a href="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Hi Mathias,<br>
<p>
<i>&gt;&gt;&gt;&gt;&gt; On Wed, 28 May 1997 17:52:14 +0059 (MDT), "Mathias Weigt (Stud. 94)" &lt;<a href="mailto:p5iba@medchem2.pharmazie.uni-halle.de">p5iba@medchem2.pharmazie.uni-halle.de</a>&gt; said:</i><br>
<p>
Mathias&gt; Servus! In the last postings the buffering of images was<br>
Mathias&gt; mentioned. I thought a little bit and like to know more<br>
Mathias&gt; about it. In scanimage.c must_buffer is set for handheld<br>
Mathias&gt; scanners (parm.lines&lt;0) or for three pass scanning (either<br>
Mathias&gt; of the three frames). I think scanning a full size image<br>
Mathias&gt; (14 x 8.5 inch) at 600 dpi will cost 125 Mbyte of memory. I<br>
Mathias&gt; don`t have such an amount of memory (only if I double my<br>
Mathias&gt; swapspace) and I think not many people on Linux have.<br>
Mathias&gt; David mentioned that a temporary file wouldn`t be a nice<br>
Mathias&gt; solution. Here is my question: Why not ? Shouldn't it be<br>
Mathias&gt; possible to write three temporary files for the red, green<br>
Mathias&gt; and blue frame (of course not as image but the red bytes in<br>
Mathias&gt; a line...) so that each will consume 1/3 of the entire<br>
Mathias&gt; image in space? After the last pass the picture can be put<br>
Mathias&gt; together from those three files and send to stdout or file.<br>
<p>
It's certainly possible. Michael suggested using mmap'ing to provide<br>
backing store in the filesystem instead of the swap-space. Of the two<br>
solutions, I think mmap is technically preferable when there is plenty<br>
memory available. On the other hand, mmap is still quite a portability<br>
nightmare, so using regular files might still be better, overall.<br>
<p>
However, the real issue is: what if you have tons of memory/swap-space<br>
but not much free diskspace? Don't say that doesn't happen. My<br>
system has 64MB of RAM and much more swap-space, yet I'm hard-pressed<br>
to find 256MB of free space on any of the filesystems... So, in that<br>
case, using temporary files would prevent me from acquiring the images<br>
(since you'd need 128MB of temporary space plus 128MB to store the<br>
resulting image).<br>
<p>
To me, it seems like we should use memory/swap-space when it looks<br>
like the image might fit in the available memory/swap-space and use<br>
temporary files otherwise. E.g., on Linux, we could base this<br>
decision on MemTotal: as reported in /proc/meminfo.<br>
<p>
--david<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="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<li> <b>Previous message:</b> <a href="0030.html">David Mosberger-Tang: "Re: HP support"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<li> <b>Reply:</b> <a href="0032.html">Gordon Matzigkeit: "Re: image buffering"</a>
<!-- reply="end" -->
</ul>