AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.05.18 09:35 "Further doubt on bits per sample", by <mayankg@iiitb.ac.in>
2004.05.18 13:13 "Re: Further doubt on bits per sample", by Frank Warmerdam
2004.05.19 05:35 "Re: Further doubt on bits per sample", by <mayankg@iiitb.ac.in>
2004.05.19 14:02 "Re: Further doubt on bits per sample", by Bob Friesenhahn
2004.05.19 08:35 "Further doubt on bits per sample", by <mayankg@iiitb.ac.in>
2004.05.19 09:49 "Re: Further doubt on bits per sample", by Andrey Kiselev
2004.05.18 13:53 "Re: Further doubt on bits per sample", by Bob Friesenhahn
2004.05.21 10:16 "Re: Further doubt on bits per sample", by Gerben Vos

2004.05.18 13:53 "Re: Further doubt on bits per sample", by Bob Friesenhahn

On Tue, 18 May 2004 mayankg@iiitb.ac.in wrote:

> I further have a doubt,
> 1. How does the bits per sample cases of 1,4 or 5 are handled by the libtiff
> library? Does the readstrip/readtile functions return the data, such that, the
> pixel values are always packed in byte boundaries?

Nope.  For strips, pixel values are packed without any padding.

> i.e. for bits per sample case of 4, are two pixel values clubbed into one byte
> or one byte always contains one pixel value only?

Yes, both will be in one byte.  For bits per sample of three (a very
odd number), two pixels will be entirely represented in a byte, along
with two bits of the next pixel sample.

My comments apply to strips.  I am unsure about tiles.

See GraphicsMagick (http://www.graphicsmagick.org/) for some free
source code which makes unpacking/packing samples of any size (up to
32 bits) from a byte stream a trivial operation.  There is some
similar code in libogg, but the Ogg version seems to be much more
complex/lengthy.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen