sane-project-website/old-archive/1998-02/0118.html

93 wiersze
4.0 KiB
HTML

<!-- received="Fri Feb 20 15:05:35 1998 PST" -->
<!-- sent="Fri, 20 Feb 1998 17:28:06 +0100 (MET)" -->
<!-- name="Rogier Wolff" -->
<!-- email="R.E.Wolff@BitWizard.nl" -->
<!-- subject="Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way" -->
<!-- id="199802201628.RAA01177@cave.BitWizard.nl" -->
<!-- inreplyto="199802200845.JAA01668@cave.BitWizard.nl" -->
<title>sane-devel: Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way</title>
<h1>Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way</h1>
<b>Rogier Wolff</b> (<a href="mailto:R.E.Wolff@BitWizard.nl"><i>R.E.Wolff@BitWizard.nl</i></a>)<br>
<i>Fri, 20 Feb 1998 17:28:06 +0100 (MET)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#118">[ date ]</a><a href="index.html#118">[ thread ]</a><a href="subject.html#118">[ subject ]</a><a href="author.html#118">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0119.html">Oliver.Rauch@Wolfsburg.DE: "Astra 6X0S-patch"</a>
<li> <b>Previous message:</b> <a href="0117.html">David Skoll: "Linux 2.0.33 and Sane 0.70"</a>
<li> <b>In reply to:</b> <a href="0115.html">Rogier Wolff: "Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Rogier Wolff wrote:<br>
<i>&gt; </i><br>
<i>&gt; <a href="mailto:becka@rz.uni-duesseldorf.de">becka@rz.uni-duesseldorf.de</a> wrote:</i><br>
<i>&gt; &gt; </i><br>
<i>&gt; &gt; &gt; </i><br>
<i>&gt; &gt; &gt; For example, with a float ccd of .12, I take 88% (100-12) of the current</i><br>
<i>&gt; &gt; &gt; line + 12% of the above line for blue channel and 76% (100-12*2) of the</i><br>
<i>&gt; &gt; &gt; current line + 24% (12*2) of the above line for the green channel. If</i><br>
<i>&gt; &gt; &gt; float ccd is &lt;0, I swap the % values. [This is for Astra 610S, for 600S,</i><br>
<i>&gt; &gt; &gt; replace green with red].</i><br>
<i>&gt; &gt; &gt; </i><br>
<i>&gt; &gt; &gt; &gt;From my point of view, this may lead to reduce image quality, but I</i><br>
<i>&gt; &gt; &gt; can't find another way to do this.</i><br>
<i>&gt; &gt; </i><br>
<p>
I see that I've not been constructive, so let me post something<br>
contstructive today :-)<br>
<p>
You can easily "loose the floating point". This will make things somewhat<br>
faster on most processors. <br>
<p>
This is elementary "fixed point calculations". <br>
<p>
<p>
float ip;<br>
int iip, ap;<br>
int array [MAX_ARRAY];<br>
<p>
ip /* Interpolation position */ = ..... ;<br>
<p>
/* the "ip" can be a float value, if it is 33.4 we want 60% of the<br>
33rd and 40% of the 34th value. */<br>
<p>
<p>
ap = ip;<br>
iip = (ip * 256) - (ap * 256);<br>
<br>
/* rv becomes 256 times the value you really want.... */ <br>
rv = array[ap] * (256-iip) + array[ap+1] * (iip);<br>
<p>
/* so we scale it back. We could forget this if the output format <br>
can use the extra bits... */<br>
rv &gt;&gt;= 8; <br>
<p>
Regards, <br>
<p>
Roger. <br>
<p>
<pre>
--
If it's there and you can see it, it's REAL <a href="mailto:|___R.E.Wolff@BitWizard.nl">|___R.E.Wolff@BitWizard.nl</a> |
If it's there and you can't see it, it's TRANSPARENT | Tel: +31-15-2137555 |
If it's not there and you can see it, it's VIRTUAL |__FAX:_+31-15-2138217 |
If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983 |_____|
<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="0119.html">Oliver.Rauch@Wolfsburg.DE: "Astra 6X0S-patch"</a>
<li> <b>Previous message:</b> <a href="0117.html">David Skoll: "Linux 2.0.33 and Sane 0.70"</a>
<li> <b>In reply to:</b> <a href="0115.html">Rogier Wolff: "Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>