Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
X-Original-To: filtered@awaresystems.be
Delivered-To: filtered@awaresystems.be
Received: from mx-i.one.com (mx-i.one.com [91.198.169.56])
	by mail9.b-one.net (Postfix) with ESMTP id 0D217401F0C
	for <filtered@awaresystems.be>; Wed,  4 Jan 2012 15:32:44 +0100 (CET)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-i: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.210.48 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-pz0-f48.google.com (mail-pz0-f48.google.com [209.85.210.48])
	by mx-i.one.com (Postfix) with ESMTP id 7BA3911C6F04
	for <filtered@awaresystems.be>; Wed,  4 Jan 2012 14:32:43 +0000 (UTC)
Received: by dadi14 with SMTP id i14so14621727dad.21
        for <filtered@awaresystems.be>; Wed, 04 Jan 2012 06:32:42 -0800 (PST)
Received: by 10.68.73.104 with SMTP id k8mr141050493pbv.104.1325687562063;
        Wed, 04 Jan 2012 06:32:42 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.142.215.12 with SMTP id n12cs346593wfg;
        Wed, 4 Jan 2012 06:32:41 -0800 (PST)
Received: by 10.68.74.230 with SMTP id x6mr141150648pbv.49.1325687557710;
        Wed, 04 Jan 2012 06:32:37 -0800 (PST)
Received-SPF: softfail (google.com: best guess record for domain of transitioning tiff-bounces@lists.maptools.org does not designate 91.198.169.249 as permitted sender) client-ip=91.198.169.249;
Received: by 10.131.53.10 with POP3 id f10mf6247588dak.13;
        Wed, 04 Jan 2012 06:32:37 -0800 (PST)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-r.one.com (mx-r.one.com [91.198.169.249])
	by mail9.b-one.net (Postfix) with ESMTP id 2EE9D401F0C
	for <info@awaresystems.be>; Wed,  4 Jan 2012 15:28:41 +0100 (CET)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-r.one.com (Postfix) with ESMTP id E60931C49F60
	for <info@awaresystems.be>; Wed,  4 Jan 2012 14:28:40 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id B3F071ED9FC;
	Wed,  4 Jan 2012 09:27:27 -0500 (EST)
Received: from mail-we0-f172.google.com (mail-we0-f172.google.com
	[74.125.82.172])
	by lists.maptools.org (Postfix) with ESMTPS id E9A4C1ED9F9
	for <tiff@lists.maptools.org>; Wed,  4 Jan 2012 09:07:35 -0500 (EST)
Received: by werb14 with SMTP id b14so9340255wer.3
	for <tiff@lists.maptools.org>; Wed, 04 Jan 2012 06:07:34 -0800 (PST)
MIME-Version: 1.0
Received: by 10.216.138.27 with SMTP id z27mr16260779wei.32.1325686053974;
	Wed, 04 Jan 2012 06:07:33 -0800 (PST)
Received: by 10.223.160.15 with HTTP; Wed, 4 Jan 2012 06:07:33 -0800 (PST)
In-Reply-To: <CAPKW8o0JcCJT4LRkVNDpnnEBjFaC23tASwwR6cCv6J_4S-xMaw@mail.gmail.com>
References: <CAPKW8o0JcCJT4LRkVNDpnnEBjFaC23tASwwR6cCv6J_4S-xMaw@mail.gmail.com>
Date: Wed, 4 Jan 2012 09:07:33 -0500
Message-ID: <CAAcuQeaxAcfpi3WHBD_H6-txrcDxpt+pDwfhqA-q8WqX9T-uOg@mail.gmail.com>
From: Olivier Paquet <olivier.paquet@gmail.com>
To: Martin Alegre <tin.alegre@gmail.com>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] reading rgb values from 16 bits tif images
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Wed, Jan 4, 2012 at 5:54 AM, Martin Alegre <tin.alegre@gmail.com> wrote:
> I'm trying to read the RGB values of 16 bits tif images. To do that, I'm
> using the TIFFReadRGBAImage function to first load the data into memory and
> store it into a buffer. Then, by calling the TIFFGet{R,G,B} functions, I

I'm fairly certain the TIFFReadRGBAImage function will always load
8-bit data, converting whatever is in the image to that format. To get
to the 16-bit values, try TIFFReadScanline. You'll then need to check
various tags to interpret the data correctly: number of samples per
pixel, bits per sample, etc.

Olivier
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
