Re: Umax Astra 6x0S - CCD distance - Do they *really* do this that way

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Fri, 20 Feb 1998 17:28:06 +0100 (MET)

Rogier Wolff wrote:
>
> becka@rz.uni-duesseldorf.de wrote:
> >
> > >
> > > For example, with a float ccd of .12, I take 88% (100-12) of the current
> > > line + 12% of the above line for blue channel and 76% (100-12*2) of the
> > > current line + 24% (12*2) of the above line for the green channel. If
> > > float ccd is <0, I swap the % values. [This is for Astra 610S, for 600S,
> > > replace green with red].
> > >
> > > >From my point of view, this may lead to reduce image quality, but I
> > > can't find another way to do this.
> >

I see that I've not been constructive, so let me post something
contstructive today :-)

You can easily "loose the floating point". This will make things somewhat
faster on most processors.

This is elementary "fixed point calculations".

float ip;
int iip, ap;
int array [MAX_ARRAY];

ip /* Interpolation position */ = ..... ;

/* the "ip" can be a float value, if it is 33.4 we want 60% of the
33rd and 40% of the 34th value. */

ap = ip;
iip = (ip * 256) - (ap * 256);

/* rv becomes 256 times the value you really want.... */
rv = array[ap] * (256-iip) + array[ap+1] * (iip);

/* so we scale it back. We could forget this if the output format
can use the extra bits... */
rv >>= 8;

Regards,

Roger.

-- 
If it's there and you can see it, it's REAL      |___R.E.Wolff@BitWizard.nl  |
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  |_____|

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com