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

86 wiersze
3.5 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="Sat Aug 14 19:49:54 1999 PDT" -->
<!-- sent="Sun, 15 Aug 1999 03:49:16 +0100 (GMT)" -->
<!-- name="Nick Lamb" -->
<!-- email="njl98r@ecs.soton.ac.uk" -->
<!-- subject="Re: Starting a discussion about SANE and TWAIN..." -->
<!-- id="" -->
<!-- inreplyto="199908150215.TAA03217@icarus.com" -->
<title>sane-devel: Re: Starting a discussion about SANE and TWAIN...</title>
<h1>Re: Starting a discussion about SANE and TWAIN...</h1>
<b>Nick Lamb</b> (<a href="mailto:njl98r@ecs.soton.ac.uk"><i>njl98r@ecs.soton.ac.uk</i></a>)<br>
<i>Sun, 15 Aug 1999 03:49:16 +0100 (GMT)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#156">[ date ]</a><a href="index.html#156">[ thread ]</a><a href="subject.html#156">[ subject ]</a><a href="author.html#156">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0157.html">Stephen Williams: "Re: Starting a discussion about SANE and TWAIN..."</a>
<li> <b>Previous message:</b> <a href="0155.html">Nick Lamb: "Re: SANE V2"</a>
<li> <b>In reply to:</b> <a href="0154.html">Stephen Williams: "Re: Starting a discussion about SANE and TWAIN..."</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
On Sat, 14 Aug 1999, Stephen Williams wrote:<br>
<p>
<i>&gt; So all I'm looking for at the moment is some sort of means to negotiate</i><br>
<i>&gt; frame formats.</i><br>
<p>
Ok. IIRC Your scanners can do RGB, but prefer not to for speed reasons?<br>
So in writing the backend, first start by supporting this (slow) option<br>
as the default and then add an option (eventually to be a well-known<br>
option in SANE 2.0) which controls the compression.<br>
<p>
I haven't finished looking at this, but so far I think this will work<br>
for SANE_FRAME_JFIF (perhaps code 6 in the enumeration)<br>
<p>
OPTION ONE -- If the backend knows before sending any data how much<br>
there will be exactly in the JFIF image.<br>
<p>
format = SANE_FRAME_JFIF (6)<br>
last_frame = TRUE<br>
lines = 1<br>
depth = 8<br>
pixels_per_line = 0<br>
bytes_per_line = sizeof(JFIF image)<br>
<p>
OPTION TWO -- If the backend doesn't know how much data there is until<br>
later, or until it runs out.<br>
<p>
format = SANE_FRAME_JFIF (6)<br>
last_frame = TRUE<br>
lines = -1<br>
depth = 8<br>
pixels_per_line = 0<br>
bytes_per_line = 4096 (or 65536, whatever)<br>
<p>
A compliant SANE 1.0 frontend will reject such frames without danger, a<br>
proposed 2.0 frontend without any JFIF code will save them to a file<br>
and likely use a buffer with size ~= bytes_per_line.<br>
An intelligent SANE 2.0 frontend will know to sane_read(...) until EOF<br>
and then deal with the JFIF data appropriately.<br>
<p>
OPTION TWO is probably the one to go for, but I like OPTION ONE at lot<br>
because it's so very simple ;)<br>
<p>
Might try to write a modifed scanimage which handles all this tomorrow<br>
if I get a chance. Now, time for bed.<br>
<p>
Nick.<br>
<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="0157.html">Stephen Williams: "Re: Starting a discussion about SANE and TWAIN..."</a>
<li> <b>Previous message:</b> <a href="0155.html">Nick Lamb: "Re: SANE V2"</a>
<li> <b>In reply to:</b> <a href="0154.html">Stephen Williams: "Re: Starting a discussion about SANE and TWAIN..."</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>