Return-Path: owner-tiff@olympiakos.com
Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id g2EAFqfX015419
	for <dron@localhost>; Thu, 14 Mar 2002 13:33:53 +0300
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.9.0)
	for dron@localhost (single-drop); Thu, 14 Mar 2002 13:33:53 +0300 (MSK)
Received: from gate7.olympiakos.com ([64.32.199.150]) by shared1-mail.whowhere.com; Wed Mar 13 14:23:34 2002
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id RAA24958;
	Wed, 13 Mar 2002 17:11:04 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 13 Mar 2002 17:08:58 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id RAA24942
	for tiff-outgoing; Wed, 13 Mar 2002 17:08:58 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id RAA24939
	for <tiff@olympiakos.com>; Wed, 13 Mar 2002 17:08:57 -0500
Received: from adsl ([216.103.51.136])
 by mta6.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May  7 2001))
 with SMTP id <0GSX00KQTMUVFJ@mta6.snfc21.pbi.net> for tiff@olympiakos.com;
 Wed, 13 Mar 2002 14:08:56 -0800 (PST)
Date: Wed, 13 Mar 2002 14:04:18 -0800
From: Peter Montgomery <pjmonty@csi.com>
Subject: Re: How to use TIFFReadScanLine() method
To: tiff@olympiakos.com
Message-id: <006401c1cadb$b2fda360$0201a8c0@pacbell.net>
MIME-version: 1.0
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
X-Mailer: Microsoft Outlook Express 5.50.4807.1700
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7bit
X-Priority: 3
X-MSMail-priority: Normal
References: <LBEDIBKHPNLCJIHCOFEOCEGACGAA.shan@adsgroup.com>
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 1603
Lines: 63

Shan,

    Awfully vague question.  Here's a vague answer:

Assuming you've read the TIFF header and know A) how big scanlines are,
B) how big the image is, and C) have malloc'ed a scanline, just loop
through and read the scanline into your buffer


int CurrSL, // Current scanline being read
    ReturnVal,
    Height; // REad header to figure out how many scanlines are in the
TIFF image

TIFF* Tif; // This is your TIF file pointer.  Needs to be opened
tdata_t Buf; // Scanline buffer.  Needs to be malloc'ed


// Open the TIF file, read header, malloc "buf"
// Once that's done, read each scanline into the buffer

for (CurrSL = 0; CurrSL <Height; CurrSL++){
 if (Config == PLANARCONFIG_CONTIG){

 // Read a scanline of data
 ReturnVal = TIFFReadScanline(Tif, Buf, CurrSL, 0);
  if (ReturnVal == -1){
   printf("TiffRead() ERROR: Problem reading scanline %d.\n", CurrSL);
   break; // We have a problem, bail out now...
  }
 } else {
 printf("TiffRead() ERROR: 1/28/2000 - Can't handle TIFF's with
non-contiguous pixel channels.\n");
 break; // We have a problem, bail out now...
 }

 // Do something with the scanline you just read

}


    Thanks,
    PeterM


----- Original Message -----
From: "shan" <shan@adsgroup.com>
To: <tiff@olympiakos.com>
Sent: Wednesday, March 13, 2002 1:39 AM
Subject: How to use TIFFReadScanLine() method


>
> Someone please help me with the sample code to use TIFFReadScanLine()
> method.
>
> Thanks
> Shan
>


To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

