Re: 16 bit per sample support

Oliver Rauch (oliver.rauch@Wolfsburg.DE)
Mon, 15 Mar 1999 17:50:56 +0100

Andreas Dilger wrote:

> > In the sane api it is not define how bit depths between 8 and 16 bits are
> > handled. So if the scanner gives back 12 bpp is this bit 0-11 or bit 5-16
> > or does this mean the colors are mixed togeht in some bytes:
> > (8 bits red) (4 bits red, 4 bits green) (8 bits green) (8 bits blue) (4 bits
> > blue, whats with the rest?)
>
> I would suggest that for backends that support > 8 bit/sample output, that sane
> return the data in the high-order bits, and then if you don't need the extra
> bits (eg for display on the screen), you can simply truncate the low-order
> bits and treat it like 8 bits/sample. This is how PNG stores the data, whether
> 5 bps or 12 bps -> it only really "stores" either 8 or 16 bits/sample, and
> converts all other bit depths to fit.
>

It does not matter how we define it, there are advantages and disadvantages
for both possibilities. The point is that is has to be defined!

We also can add a maxvalue item to the parameters block and let

> As a side note, it should be defined whether you have high-byte first (network
> byte order), or low byte first (intel order). I would vote for network byte
> order, since this is the same as PNG, and then you can just dump the data
> into a PNG file.
>

That already is defined in the sane api and hsould not be changed any more!

Bye
Oliver

--
EMAIL: Oliver.Rauch@Wolfsburg.DE
WWW: http://www.wolfsburg.de/~rauch

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