Re: AppleScanner(s) Support

David Mosberger-Tang (David.Mosberger@acm.org)
Wed, 28 Jan 1998 21:24:06 -0800

>>>>> On Wed, 28 Jan 98 17:27:18 EET, Milon Firikis <milonf@isosun.ariadne-t.gr> said:

Milon> What I want to announce is The "Apple Scanner(s) pre Alpha"
Milon> support patch! A premature version of the backend is allmost
Milon> ready:

Milon> I will post it on this list about Monday...

Cool. May I ask what OS you're doing this on? MkLinux?

Milon> Question: AppleScanner has a gray16 mode. I am capable of
Milon> scanning in binary modes (1bit) but I am having some problems
Milon> with this (4bit) mode. scanimage segfaults? What should I
Milon> do? I could built an internal buffer so that backend would
Milon> report 8bit depth to the frontends. Is this the right thing
Milon> to do? or should the frontends be aware for such "weird"
Milon> formats?

Yes, the SANE API restricts bit depths to be a multiple of 8 bits
(with the notable exception of 1 bit depth). So you'd have to expand
& scale the 4 bit nibbles into 8 bit bytes. If Andy is reading this
mail, he'll be sure to point out that you should do the scaling with
something like this:

byte = (nibble << 4) | nibble;

This makes sure the smallest intensity maps into 0x00 and the largest
intensity maps to 0xff (i.e., there is no "compression" in the output
range).

Right, Andy? ;-)

--david

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