From: dron@ak4719.spb.edu (Andrey Kiselev)
Date: Mon, 3 Nov 2003 22:14:43 +0300
Subject: [Tiff] Re: Using libtiff for 16-bit tiff
In-Reply-To: <20031103174313.7214.qmail@web9808.mail.yahoo.com>
References: <20031103174313.7214.qmail@web9808.mail.yahoo.com>
Message-ID: <20031103191443.GA1053@ak4719.spb.edu>

On Mon, Nov 03, 2003 at 06:43:13PM +0100, A dog wrote:
> I am trying to use libtiff to open 16-bit tiff images but it appears
> black. Is it possible ? I am currently using the function
> TIFFReadRGBAImage(tif, w, h, raster, 0) but it returns -1. Do I have
> to call another function ?

Yes, you need other approach. TIFFReadRGBAImage() was introduced to work
well with 8-bit images only. It can handle 16-bit ones, but in very dumb
way: by rejecting the least significant part of the word. It is equal to
division by 256. It works well for wide dynamic ranges only.

You should use low-level functions such as TIFFReadScanline(),
TIFFReadEncodedStrip() and TIFFReadTile().

> And my last question, do you have an example in Visual c++ ?

Look at the tools directory, there are many examples there.

					Best regards,
					Andrey

PS.
tiff@olimpiacos.org is not functional any more. Please, address your
questions to the tiff@remotesensing.org. You can subscribe to the list
here:

 http://remotesensing.org/mailman/listinfo/tiff/

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517

