AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.01.14 06:32 "TIFFWriteScanline - write band orders", by Gis Geo
2008.01.14 07:25 "Re: TIFFWriteScanline - write band orders", by Rob Van Den Tillaart
2008.01.14 12:02 "=?gb2312?q?=BB=D8=B8=B4=A3=BA=20RE:=20[Tiff]=20TIFFWriteScanline=20-=20wr?= =?gb2312?q?ite=20band=20orders?=", by Gis Geo

2008.01.14 12:02 "=?gb2312?q?=BB=D8=B8=B4=A3=BA=20RE:=20[Tiff]=20TIFFWriteScanline=20-=20wr?= =?gb2312?q?ite=20band=20orders?=", by Gis Geo

Thanks Rob.

Basically in the filter output, I wish to copy the same buffer from the 2nd
row (j=1) to the 1st row (j=0), and copy the buffer from the last second row
(j=height-2) to the last row (j=height-1). During the data read, I used this

for (j = 1; j < height-1;    j++)
{
...
}

to omit the read of the first row (j=0) and the last row (j=height-1), using
other buffer variables. From this loop, j will never reach j=height-1.

I feel the code I included in the post does make a complete buffer write,
from j=0 to j=height-1.

TIM



"Tillaart, Rob van den" <rob.vandentillaart@oce.com> дµÀ£º     Hi
 Think the error is in the line 
        if (j ==height-2  )
  
   It should be 
     if (j == height-1)
 as otherwise the last line (j==height) isn't wriiten.  
  
 give it a try
 rob
  
 
 

       
---------------------------------
   From: tiff-bounces@lists.maptools.org   
   [mailto:tiff-bounces@lists.maptools.org] On Behalf Of gis    geo
Sent: maandag 14 januari 2008 7:33
To:    tiff@lists.maptools.org
Subject: [Tiff] TIFFWriteScanline - write    band orders


   
   Hi All,
    
   I am learning and testing TIFF Lib, and have experienced the following   
   problem:
    
   I wish to write a 16-bit RGB imagery with separate planes, using the   
   following codes
    
   ...
     TIFFSetField(out, TIFFTAG_IMAGEWIDTH,    width);  
  TIFFSetField(out, TIFFTAG_IMAGELENGTH,    height);
     TIFFSetField(out, TIFFTAG_BITSPERSAMPLE,    16);
  TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL,    3);
  TIFFSetField(out, TIFFTAG_PLANARCONFIG,    2);
  TIFFSetField(out, TIFFTAG_PHOTOMETRIC,    2);
  TIFFSetField(out, TIFFTAG_COMPRESSION,    COMPRESSION_NONE); 
     TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,    TIFFDefaultStripSize(out,
     1)); 
   
    for (j = 0; j < height;    j++)
      {
    ...
       TIFFWriteScanline(out, buf_r, j,    0);
    TIFFWriteScanline(out, buf_g, j,    1);
    TIFFWriteScanline(out, buf_b, j,    2);
  } 
 
   The output is fine and works. I can verify that.
    
   But, after I have applied a 3*3 filter analysis, and I wish to output the
      same row-by-row data in this form, and the output tiff file is wrong:
    
      for (j = 1; j < height-1;    j++)
   {
    ...
   
   if (j ==1    )
   {
    TIFFWriteScanline(out, buf_r,    j-1, 0);
    TIFFWriteScanline(out, buf_g, j-1,    1);
    TIFFWriteScanline(out, buf_b, j-1,    2);
   }
    
       TIFFWriteScanline(out, buf_r, j,    0);
    TIFFWriteScanline(out, buf_g, j,    1);
    TIFFWriteScanline(out, buf_b, j,    2);
 
   if (j ==height-2    )
   {
    TIFFWriteScanline(out, buf_r,    j+1, 0);
    TIFFWriteScanline(out, buf_g, j+1,    1);
    TIFFWriteScanline(out, buf_b, j+1,    2);
   }
     }
    
   I could not figure out why. This might to related to TIFFWriteScanline() 
     and some expectation from the Tiff Lib that I did not specify.
    
   THANK you in advance.
    
    
   
 
    
    
      

---------------------------------
   ÑÅ»¢ÓÊÏä´«µÝÐÂÄê×£¸££¬¸öÐԺؿ¨ËÍÇ×Åó£¡  
 This message and attachment(s) are intended solely for use by the addressee
 and may contain information that is privileged, confidential or otherwise
 exempt from disclosure under applicable law.    If you are not the intended
 recipient or agent thereof responsible for delivering this message to the
 intended recipient, you are hereby notified that any dissemination,
 distribution or copying of this communication is strictly prohibited.   If
 you have received this communication in error, please notify the sender
 immediately by telephone and with a 'reply' message.    Thank you for your
 co-operation. 

       
---------------------------------
ÑÅ»¢ÓÊÏä´«µÝÐÂÄê×£¸££¬¸öÐԺؿ¨ËÍÇ×Åó£¡