sane-project-website/old-archive/1999-08/0194.html

231 wiersze
12 KiB
HTML

<!-- received="Mon Aug 16 04:24:41 1999 PDT" -->
<!-- sent="Mon, 16 Aug 1999 13:23:51 +0200 (MET DST)" -->
<!-- name="becka@rz.uni-duesseldorf.de" -->
<!-- email="becka@rz.uni-duesseldorf.de" -->
<!-- subject="Re: SANE V2" -->
<!-- id="199908161123.NAA11079@zeus.rz.uni-duesseldorf.de" -->
<!-- inreplyto="37B77CEA.C63CD9FC@martoneconsulting.com" -->
<title>sane-devel: Re: SANE V2</title>
<h1>Re: SANE V2</h1>
<a href="mailto:becka@rz.uni-duesseldorf.de"><i>becka@rz.uni-duesseldorf.de</i></a><br>
<i>Mon, 16 Aug 1999 13:23:51 +0200 (MET DST)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#194">[ date ]</a><a href="index.html#194">[ thread ]</a><a href="subject.html#194">[ subject ]</a><a href="author.html#194">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Previous message:</b> <a href="0193.html">Ewald R. de Wit: "Re: SANE V2"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Reply:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Hi !<br>
<p>
<i>&gt; I agree with this requirement. Luckily, in the Bell+Howell case, the</i><br>
<i>&gt; scanner supports bit-depth 1, grayscale, so this is very easy to do.</i><br>
<i>&gt; This is the default format that the backend will send; a --compression</i><br>
<i>&gt; option (Values None, G4, G3-2D, G3-1D) controls the format of the data</i><br>
<i>&gt; sent. The default is None which sends _GRAY with bits_per_pixel = 1.</i><br>
<i>&gt; If this option needs to be changed to a "well known" option, that is</i><br>
<i>&gt; easily done as well.</i><br>
<p>
O.K. - so you are with me with respect to letting the user or frontend choose <br>
compressed datatype by using a well-known option - right ?<br>
<p>
<i>&gt; &gt; I am fully with you, that SANE is intended for scanners, and should target</i><br>
<i>&gt; &gt; images, but if we can add other file types at no cost, Why not ?</i><br>
<i>&gt; I'd just add that the G31D, G32D, and G42D need the getparm stuff. These</i><br>
<i>&gt; datastreams do not have the height and width encoded within them, but these</i><br>
<i>&gt; are necessary to decoding. You also need the resolution(s) which can be </i><br>
<i>&gt; gotten by querying the option(s).</i><br>
<p>
I see. I also do not say, that the parameter struct shall always be empty <br>
or bogus, if we use the MIME transfer type.<br>
<p>
If a field makes sense, we should fill it out reasonably.<br>
<p>
<i>&gt; (It'd be nice to have the resolution(s)</i><br>
<i>&gt; in the SANE_Parameter structure, but not at all necessary).</i><br>
<p>
O.K. - I see the point in this. So it seems necessary to extend the params <br>
struct anyway - right ?<br>
<p>
If so, I suggest to add two short strings in there that allow to transfer<br>
a textual type description (MIME or better, if we have something better),<br>
and a suggested filename.<br>
Moreover additions that seem to be wanted are dpix/dpiy and probably a flag <br>
that separates pages instead of images, as some scanners can deliver multiple<br>
images per page.<br>
<p>
<i>&gt; The cost would seem to me to be the extra complexity in parsing through</i><br>
<i>&gt; the mime stuff to get at the actual data stream.</i><br>
<p>
Yes. And actuallz I should have phrased my proposal in another order.<br>
I as well think, that transferring the mimetype outband is better, as it is<br>
easier to do for both the front- and the backend, and we need less special <br>
casing to transfer the actual datastream.<br>
<p>
<i>&gt; And if I understand it</i><br>
<i>&gt; properly, MIME doesn't provide a vehicle for specifying the height, width</i><br>
<i>&gt; and resolution necessary to decode the image data.</i><br>
<p>
It does. Mimetypes can have extra attributes. You could use <br>
"tiff/g3; height=452; width=7834; dpix= ...". However I agree with you, that<br>
this is not a good idea. WE should use fields in the params struct for it.<br>
they are already there, why waste them. <br>
<p>
<i>&gt; I think the MIME idea has merit *in addition* to the frame types that</i><br>
<i>&gt; I proposed earlier. When MIME will be used *instead*, then I'm unhappy.</i><br>
<p>
You are proposing something in between of 5-10 new frametypes. And <br>
frametypes are very indescriptive with respect to binary compatibility.<br>
<p>
You can convey any information you can put into a frametype in a string <br>
as well. And a string can be displayed to the user or looked up in a <br>
user-readable/writeable database to find something to do with the data.<br>
<p>
<i>&gt; &gt; that can attach between a front and a backend (like the net stuff or the</i><br>
<i>&gt; &gt; dll backend does) and can convert from common filetypes to SANE RAW.</i><br>
<i>&gt; This is a good idea and would be very helpful if you had a device that</i><br>
<i>&gt; didn't luckily provide data in one of the basic SANE formats.</i><br>
<p>
We could use that to simplify backend writing by writing middleends that<br>
by their existence allow to write backends that do not export the RAW <br>
datatypes.<br>
<p>
<i>&gt; &gt; good solution. It also gives tuneability for the parameters (jpeg-quality)</i><br>
<i>&gt; &gt; in a simple way, as a middleend can extend the optionlist.</i><br>
<i>&gt; And in the high-volume area, you definitely want to avoid the middleend</i><br>
<i>&gt; and send compressed data all the way through for performance reasons.</i><br>
<i>&gt; So, you can choose not to use the middleend. I like this.</i><br>
<p>
Yes. I even thought it the other way round: You open the source, and when you <br>
find it doesn't transfer in a format you can handle, but you really<br>
want to handle the data instead of just saving them away, you re-open the<br>
source through the middleend, and will magically get a bunch of new formats,<br>
especially RAW.<br>
<p>
<i>&gt; &gt; That the "proposed MIME-type" of the current data stream. It is using extra</i><br>
<i>&gt; &gt; outband data (width and height) from the getparms operation, which all</i><br>
<i>&gt; &gt; other formats we are talking of do not need, as they contain that inband.</i><br>
<p>
<i>&gt; As I mentioned earlier the G31D, G32D, and G42D formats need outband data.</i><br>
<i>&gt; I think the JFIF has it inband, and I'm not sure about the JBIG.</i><br>
<p>
O.K. - but this outband data is readily available from params - right ?<br>
<p>
<i>&gt; I think the multiple image frametypes are deserving of first class </i><br>
<i>&gt; attention (e.g. their own frame types). </i><br>
<p>
Note, that this is very bad for binary compatibility. If you get a backend <br>
that is newer than your frontend (not unusual, once manufacturer's start<br>
making backends), chances are, that you find it is willing to transmit in <br>
an unknown frametype. There is no reasonable way to find out, what this<br>
number means.<br>
<p>
A string gives the chance to ask the user.<br>
<p>
<i>&gt; The MIME frametype has the advantage of extensibility, but seems to </i><br>
<i>&gt; require more smarts in the frontend. </i><br>
<p>
Apart from replacing a switch() with a chain of if (strcmp()==) else if ...<br>
I see no difference.<br>
<p>
<i>&gt; I could see dropping the _ASCII frame format and doing that through MIME.</i><br>
<i>&gt; I'd still prefer the _ASCII from a simplicity point of view, but I </i><br>
<i>&gt; wouldn't fight for it.</i><br>
<p>
I do not see a difference in complexity. <br>
<p>
<p>
<i>&gt; switch(parms.frametype) {</i><br>
<i>&gt; case FT_JPG:...</i><br>
<i>&gt; case FT_TIFFG3:...</i><br>
<i>&gt; case FT_MIME:</i><br>
<i>&gt; if (strcmp(parms.mimetype,"image/jpeg")==0) {</i><br>
<i>&gt; ...</i><br>
<i>&gt; } else if (strcmp(parms.mimetype,"image/tiffg3")==0) {</i><br>
<i>&gt; ...</i><br>
<i>&gt; }</i><br>
<i>&gt; }</i><br>
<p>
Why at all having the extra types, then ?<br>
<p>
The point is: If an application wants to handle a frametype, it needs to <br>
know it. If it knows the frametype, it as well knows the mimetype, as there<br>
is a 1:1 relation.<br>
<p>
<i>&gt; This way a frontend, or middleend that wants to support the compressed</i><br>
<i>&gt; image formats but avoid the MIME support can simply drop the third case.</i><br>
<p>
As the third case is a simple superset of the others, I see no gain. It's <br>
just a question of where the code gets written down. In your above scheme<br>
I would do:<br>
<p>
<i>&gt; switch(parms.frametype) {</i><br>
<i>&gt; case FT_JPG: jpg: ...</i><br>
<i>&gt; case FT_TIFFG3: g3 : ...</i><br>
<i>&gt; case FT_MIME:</i><br>
<i>&gt; if (strcmp(parms.mimetype,"image/jpeg")==0) {</i><br>
<i>&gt; goto jpg;</i><br>
<i>&gt; } else if (strcmp(parms.mimetype,"image/tiffg3")==0) {</i><br>
<i>&gt; goto g3;</i><br>
<i>&gt; }</i><br>
<i>&gt; }</i><br>
<p>
You see: no gain making a difference. It will be handled by the same code <br>
anyway.<br>
<p>
<i>&gt; &gt; 1. Add a well-known option that allows to select the transmission format.</i><br>
<i>&gt; Fine, but you get into a bind when you have multiple transmissions in</i><br>
<i>&gt; a single operation. You get the G42D compressed data interspersed with</i><br>
<i>&gt; the decoded barcodes, or simultaneous JFIF and TIFF from a single page,</i><br>
<i>&gt; if I remember Stephen William's description correctly. In the Bell+Howell</i><br>
<i>&gt; backend the image transmission format is specified via the --compression</i><br>
<i>&gt; option and the barcode stuff is specified through a series of options.</i><br>
<i>&gt; And it is also possible to specify --compresion g42d and ask for a </i><br>
<i>&gt; thumbnail (icon) also. The thumbnails are uncompressed, but the full </i><br>
<i>&gt; images are.</i><br>
<p>
O.K. - this is a problem, but negotiating per frame would be a bit comple I <br>
think. IMHO the well known option should take care for the bulk "payload" <br>
data. If other chunks exist - o.k. The user can use his/her brain to use<br>
more detailed options.<br>
<p>
<i>&gt; &gt; 2. Add a single bew frametype that announces the transmission of arbitrarily</i><br>
<p>
<i>&gt; I think the image formats proposed earlier (JFIF, G31D, G32D, G42D, and JBIG)</i><br>
<i>&gt; need their own frame formats. The MIME based one is quite extensible and</i><br>
<i>&gt; can handle future growth.</i><br>
<p>
O.K. - if it really really really pleases all people here, we can add that <br>
types. But as said, I am afraid of opening a neverending growth of the<br>
frame types, which is very bad regarding compatibility and cannot be easily <br>
extended by just editing a textfile or something.<br>
<p>
CU, ANdy<br>
<p>
<pre>
--
Andreas Beck | Email : &lt;<a href="mailto:Andreas.Beck@ggi-project.org">Andreas.Beck@ggi-project.org</a>&gt;
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Previous message:</b> <a href="0193.html">Ewald R. de Wit: "Re: SANE V2"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Reply:</b> <a href="0195.html">Stephen Williams: "Re: SANE V2"</a>
<!-- reply="end" -->
</ul>