Re: [Announce] WinSANE 0.1.0.0 Release

Brian Macy (bmacy@sunshinecomputing.com)
Mon, 10 May 1999 08:44:41 -0700

> No. "packed" modes are violently unpleasant, and while some scanners might
> use them to buy some compression, SANE doesn't support any such a format.
>
> A series of three 10-bit samples (e.g. an RGB pixel captured by a one-pass
> 30-bit parallel port scanner) will arive through SANE as...
>
> 98765432 10------ 98765432 10------ 98765432 10------
> Or, alternatively (ENDIAN dependence kicks in here)
> 10------ 98765432 10------ 98765432 10------ 98765432
>
> The ---- sequences will usually be either zero, or copied from the top
bits
> of the 10-bit sample (explanation a few weeks ago on this list). The
> backend should tell you how many bits are "really there" in any case.
> You can tell which way around the samples are from the ENDIAN stuff set
> by the sender. Your job, as a recipient, is to correct anything which is
> "the wrong way around" for your application/ platform.
>
> Note that since the _high_ bits are used, you could assume that you're
> always receiving true 16-bit samples. For a simple application (like
> photo retouching) this is probably fairly safe.

Hmmm... so are you saying that anything greater than 1bit depth uses byte
aligned data??? Actually the docs (3.2) say "Valid bit depths are 1, 8, or
16 bits per sample. If a device's natural bit depth is something else, it is
up to the driver to scale the sample values appropriately (e.g., a 4 bit
sample could be scaled by a factor of four to represent a sample value of
depth 8)." So if there is a bit depth of 10 the driver better scale it to
16bits and the LSB format must be:
98765432 xxxxxx10 (where the x's must be zero)
or some value scaled to a 16bit value.

Oh wait.... never mind... the 10bit value is getting left shifted 6bits to
scale it up to the 16bit values.

BTW thanks much for your help.

Brian Macy

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