Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
X-Original-To: filtered@awaresystems.be
Delivered-To: filtered@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 91AD8401F0C
	for <filtered@awaresystems.be>; Wed,  4 Jan 2012 17:10:44 +0100 (CET)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-r: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.160.48 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-pw0-f48.google.com (mail-pw0-f48.google.com [209.85.160.48])
	by mx-r.one.com (Postfix) with ESMTP id 117431ED5025
	for <filtered@awaresystems.be>; Wed,  4 Jan 2012 16:10:43 +0000 (UTC)
Received: by pbaa12 with SMTP id a12so10550608pba.21
        for <filtered@awaresystems.be>; Wed, 04 Jan 2012 08:10:43 -0800 (PST)
Received: by 10.68.213.138 with SMTP id ns10mr144518941pbc.53.1325693443049;
        Wed, 04 Jan 2012 08:10:43 -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 n12cs350134wfg;
        Wed, 4 Jan 2012 08:10:42 -0800 (PST)
Received: by 10.68.212.73 with SMTP id ni9mr143819221pbc.82.1325693440848;
        Wed, 04 Jan 2012 08:10:40 -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.58 as permitted sender) client-ip=91.198.169.58;
Received: by 10.68.3.172 with POP3 id d12mf13180835pbd.22;
        Wed, 04 Jan 2012 08:10:40 -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-k.one.com (mx-k.one.com [91.198.169.58])
	by mail9.b-one.net (Postfix) with ESMTP id 64290401F0C
	for <info@awaresystems.be>; Wed,  4 Jan 2012 16:51:38 +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-k.one.com (Postfix) with ESMTP id 091E2E7A7FB
	for <info@awaresystems.be>; Wed,  4 Jan 2012 15:51:37 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 1C6031EDA14;
	Wed,  4 Jan 2012 10:50:33 -0500 (EST)
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by lists.maptools.org (Postfix) with ESMTPS id 661091ED9FD
	for <tiff@lists.maptools.org>; Wed,  4 Jan 2012 10:24:43 -0500 (EST)
Received: from freddy.simplesystems.org (freddy.simplesystems.org
	[65.66.246.65])
	by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id
	q04FOf6N018236; Wed, 4 Jan 2012 09:24:41 -0600 (CST)
Date: Wed, 4 Jan 2012 09:24:41 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@freddy.simplesystems.org
To: Martin Alegre <tin.alegre@gmail.com>
In-Reply-To: <CAPKW8o2KUkb1A-ObBiYBHp-tbfMoBdUw--LCU01eYpQ5HO3Cxw@mail.gmail.com>
Message-ID: <alpine.GSO.2.01.1201040908400.15666@freddy.simplesystems.org>
References: <CAPKW8o0JcCJT4LRkVNDpnnEBjFaC23tASwwR6cCv6J_4S-xMaw@mail.gmail.com>
	<alpine.GSO.2.01.1201040826280.15666@freddy.simplesystems.org>
	<CAPKW8o2KUkb1A-ObBiYBHp-tbfMoBdUw--LCU01eYpQ5HO3Cxw@mail.gmail.com>
User-Agent: Alpine 2.01 (GSO 1266 2009-07-14)
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(blade.simplesystems.org [65.66.246.90]);
	Wed, 04 Jan 2012 09:24:41 -0600 (CST)
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, 4 Jan 2012, Martin Alegre wrote:

> Hi Bob,
> 
> Thanks for your suggestions on the high-level libraries. At the beginning, I was thniking to use Magick++
> for my application, but it seemed to me that it was going to be more faster to integrate the libtiff
> library into my code, also due to time constraints. If you have any illustrations on how to use libtiff
> for 16bits images, it will be great or if you also have some good webpointers where I could get more
> information? I found a very illustrative webpage on how to use libtiff
> (http://bitmiracle.com/libtiff/help/samples.aspx), but it was mainly for C#, and I'm currently working
> with C++.

It makes a huge difference if you plan to accept arbitrary TIFF files 
written by some other software or if you only plan to accept a very 
limited set of TIFF formats.  If the former, then you should expect to 
do quite a lot of development (e.g. weeks, months).

You can use TIFFReadRGBAStrip() to access strip-oriented files or 
TIFFReadTile() for tile-oriented files.  These interfaces provide 
"raw" decompressed + native-endian-swapped pixel sample data.  The 
swapping to native endian is only done if the sample bits are evenly 
divisible by 8 (e.g. 16-bit "short" is swapped to native format).

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
