sane-project-website/old-archive/2001-01/0107.html

177 wiersze
6.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: SANE standard / get_select_fd / sane_read</TITLE>
<META NAME="Author" CONTENT="Christian Nassau (nassau@math.uni-frankfurt.de)">
<META NAME="Subject" CONTENT="SANE standard / get_select_fd / sane_read">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>SANE standard / get_select_fd / sane_read</H1>
<!-- received="Wed Jan 10 01:54:14 2001" -->
<!-- isoreceived="20010110095414" -->
<!-- sent="Wed, 10 Jan 2001 11:18:16 +0100" -->
<!-- isosent="20010110101816" -->
<!-- name="Christian Nassau" -->
<!-- email="nassau@math.uni-frankfurt.de" -->
<!-- subject="SANE standard / get_select_fd / sane_read" -->
<!-- id="200101101018.LAA11256@siegel.math.uni-frankfurt.de" -->
<STRONG>From:</STRONG> Christian Nassau (<A HREF="mailto:nassau@math.uni-frankfurt.de?Subject=Re:%20SANE%20standard%20/%20get_select_fd%20/%20sane_read&In-Reply-To=&lt;200101101018.LAA11256@siegel.math.uni-frankfurt.de&gt;"><EM>nassau@math.uni-frankfurt.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Wed Jan 10 2001 - 02:18:16 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0108.html">Christian Nassau: "sanei_scsi_cmd / snapscan / Prisa640S"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0106.html">Andrew Williams: "Re: help - hp 5300c"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0113.html">Oliver Rauch: "Re: SANE standard / get_select_fd / sane_read"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0113.html">Oliver Rauch: "Re: SANE standard / get_select_fd / sane_read"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#107">[ date ]</A>
<A HREF="index.html#107">[ thread ]</A>
<A HREF="subject.html#107">[ subject ]</A>
<A HREF="author.html#107">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Currently the SANE standard (1.0.2, Nov 14 2000) makes the
<BR>
following specification concerning sane_get_select_fd():
<BR>
<P>&nbsp;&nbsp;This function is used to obtain a [...] file descriptor [...]
<BR>
&nbsp;&nbsp;that is readable if and only if image data is available
<BR>
<P>and adds
<BR>
&nbsp;&nbsp;
<BR>
&nbsp;&nbsp;(i.e., when a call to sane_read() will return at least
<BR>
&nbsp;&nbsp;one byte of data).
<BR>
<P>I wonder if we can relax this a little bit, and allow the next
<BR>
call to sane_read() to return 0 bytes, as long as it performs
<BR>
some useful/necessary operations (internal to the backend).
<BR>
<P>To be more concrete: I wonder if we could make the following
<BR>
setup legal:
<BR>
<P>&nbsp;&nbsp;- the file descriptor handed over by the backend signals
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;readable if raw data from the scanner is available to
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the backend, but
<BR>
<P>&nbsp;&nbsp;- the backend does some postprocessing and would rather
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;keep some of the data until more data is available
<BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;(take chroma correction, for example, where the backend
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;doesn't want to send some lines at the beginning
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;which have incomplete color components. The initial
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call to sane_read() might just put some lines into an
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;internal buffer, which will be (partially) transferred
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when sane_read() is called the next time)
<BR>
<P>Basically, this is a question about the specification of
<BR>
sane_read(). There seem to be two competing ideas of what a
<BR>
successful call to sane_read() is:
<BR>
<P>&nbsp;&nbsp;- The last line on page 29, allows sane_read() to transfer
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;0 bytes but still return SANE_STATUS_GOOD
<BR>
<P>&nbsp;&nbsp;- On page 30 (blocking I/O mode) sane_read() has to transfer
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;at least one byte if it wants to return SANE_STATUS_GOOD
<BR>
<P>Wouldn't it be better to allow a backend to transfer 0 bytes,
<BR>
as long as it considers this a success for some internal reasons?
<BR>
<P><P>Actually, I've got another question about sane_read():
<BR>
&nbsp;
<BR>
It might be convenient for a backend to internally store only
<BR>
complete lines of image data (not fractions of a line). So:
<BR>
<P>&nbsp;- Does it have to be legal (for the frontend) to request
<BR>
&nbsp;&nbsp;&nbsp;less than bytes_per_line bytes?
<BR>
<P>This could easily lead to a deadlock if the backend transfers
<BR>
0 bytes successfully in such a case. (Which it may do in
<BR>
non-blocking mode.)
<BR>
<P>(Well, requesting 0 bytes explicitly could still be legal.)
<BR>
<P>---------
<BR>
Christian Nassau
<BR>
<P>e-mail: <A HREF="mailto:nassau@math.uni-frankfurt.de?Subject=Re:%20SANE%20standard%20/%20get_select_fd%20/%20sane_read&In-Reply-To=&lt;200101101018.LAA11256@siegel.math.uni-frankfurt.de&gt;">nassau@math.uni-frankfurt.de</A>
<BR>
home-page: <A HREF="http://www.math.uni-frankfurt.de/~nassau">http://www.math.uni-frankfurt.de/~nassau</A>
<BR>
<P>Fachbereich Mathematik (12)
<BR>
AG 8.1, Zi.814
<BR>
Johann Wolfgang Goethe-Universit&quot;at
<BR>
Robert-Mayer-Str. 6-10
<BR>
D-60054 Frankfurt/M
<BR>
--- Germany ---
<BR>
<P><P><P><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?Subject=Re:%20SANE%20standard%20/%20get_select_fd%20/%20sane_read&In-Reply-To=&lt;200101101018.LAA11256@siegel.math.uni-frankfurt.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0108.html">Christian Nassau: "sanei_scsi_cmd / snapscan / Prisa640S"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0106.html">Andrew Williams: "Re: help - hp 5300c"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0113.html">Oliver Rauch: "Re: SANE standard / get_select_fd / sane_read"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0113.html">Oliver Rauch: "Re: SANE standard / get_select_fd / sane_read"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#107">[ date ]</A>
<A HREF="index.html#107">[ thread ]</A>
<A HREF="subject.html#107">[ subject ]</A>
<A HREF="author.html#107">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Wed Jan 10 2001 - 01:55:27 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>