Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-h.b-one.net (mx-h.one.com [91.198.169.55])
	by mail9.b-one.net (Postfix) with ESMTP id BFBE640014C
	for <info@awaresystems.be>; Tue,  7 Dec 2010 00:41:20 +0100 (CET)
Received: by mx-h.b-one.net (Postfix, from userid 106)
	id B83A615A930; Tue,  7 Dec 2010 00:41:20 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-h.b-one.net (Postfix) with ESMTP id F38BE15A930 for
 <info@awaresystems.be>; Tue,  7 Dec 2010 00:41:19 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 657C21D0E5293; Mon,  6 Dec 2010
 18:40:44 -0500 (EST)
Received: from exprod6og112.obsmtp.com (exprod6og112.obsmtp.com [64.18.1.29])
 by lists.maptools.org (Postfix) with ESMTPS id 7E7ED1D0E5293 for
 <tiff@lists.maptools.org>; Mon,  6 Dec 2010 18:40:12 -0500 (EST)
Received: from source ([192.150.8.22]) by exprod6ob112.postini.com
 ([64.18.5.12]) with SMTP ID DSNKTP10W6Au63TlqmtZGpdG+OtMXfbma6N0@postini.com;
 Mon, 06 Dec 2010 15:40:28 PST
Received: from inner-relay-1.corp.adobe.com (inner-relay-1.corp.adobe.com
 [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP
 id oB6Ne9U5000532; Mon, 6 Dec 2010 15:40:10 -0800 (PST)
Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99])
 by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
 oB6Ne8tm016842; Mon, 6 Dec 2010 15:40:08 -0800 (PST)
Received: from nambx03.corp.adobe.com ([10.8.189.93]) by
 nacas01.corp.adobe.com ([10.8.189.99]) with mapi; Mon, 6 Dec 2010 15:40:08
 -0800
From: Chris Cox <ccox@adobe.com>
To: "Jamie L. Finch" <wi6f@cruzio.com>, TIFF <tiff@lists.maptools.org>
Date: Mon, 6 Dec 2010 15:40:06 -0800
Thread-Topic: [Tiff] 16 bit gray scale conversion
Thread-Index: AcuVnayh3njFFngNRR+FU22wpo/v9QAATyT3
Message-ID: <C922B456.3AAF9%ccox@adobe.com>
In-Reply-To: <4CFD7178.2090708@cruzio.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: Microsoft-Entourage/13.7.0.100913
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Tiff] 16 bit gray scale conversion
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

Different results in what application?

How exactly are they showing differently?

Are they confusing gamma encodings (normally applied to 16 bit/channel ints,
but not to 32 bit/channel floats)?

Yes, normally the linear scaling you are doing should be just fine -- as
long as gamma encoding has been resolve beforehand.

Chris



On 12/6/10 3:27 PM, "Jamie L. Finch" <wi6f@cruzio.com> wrote:

> Dear Tiff Group,
> 
> I was assigned a bug in LightWaves bump mapping.
> The complaint was that 16 bit tiffs do not show the same results as 32
> bit tiffs.
> I wanted to make sure that I am converting the tiffs to floating point
> correctly.
> I am most interested in 16 bit PHOTOMETRIC_MINISBLACK, which is the else
> case.   Can anyone confirm that the conversion from short to float is
> correct ?
> This conversion is before any color correction is applied.
> 
> Jamie Finch
> NewTek, Inc.
> 
> 
>                  /* Extract pixel values and send to LW... */
> 
>                  for( i = 0; i < Height; i++ ) {
>                      TIFFReadScanline( tif, InBuf, i, 0 );
>                      Sorc.SS = (short *) InBuf;
>                      Dest.FP = (float *) IndexLine;
>                      switch( BitsPerSample ) {
> 
>                          /* Grayscale. */
> 
>                          case 16:
>                              if( Photometric == PHOTOMETRIC_MINISWHITE )
> {       /* Gotta reverse values. */
>                                  for( j = 0; j < Width; j++ )
>                                      *Dest.FP++ = ( 65535.0F - (float)
> *Sorc.US++ ) / 65535.0F;
>                                  }
>                              else {
>                                  for( j = 0; j < Width; j++ )
>                                      *Dest.FP++ = ( (float) *Sorc.US++ )
> / 65535.0F;
>                                  }
>                              break;
> 
>                          /* Grayscale. */
> 
>                          case 32:
>                              if( Photometric == PHOTOMETRIC_MINISWHITE )
> {       /* Gotta reverse values. */
>                                  for( j = 0; j < Width; j++ )
>                                      *Dest.FP++ = 1.0F - *Sorc.FP++;
>                                  }
>                              else {
>                                  for( j = 0; j < Width; j++ )
>                                      *Dest.FP++ = *Sorc.FP++;
>                                  }
>                              break;
>                          }
>                      if( LWIP_SENDLINE( ip, i, IndexLine ) != 0 )
>                          break;
>                      }
> 
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

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