2003.10.31 00:45 "ask for suggestions....", by Zuyuan Wang

2003.11.03 15:23 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang

Dear Andrey V. Kiselev,

Thanks a lot for your mail. As to my problem, I realy not know how to write the TIFF image with the TIFFWriteScanline. For example, I write the following code just to test whether TIFFWriteScanline can works:

*******
   OUT_tif = TIFFOpen(OUT_filename, "w");
   row=1;

   TIFFSetField(OUT_tif, TIFFTAG_IMAGEWIDTH,tileWidth);   //tileWidth=256
   TIFFSetField(OUT_tif, TIFFTAG_IMAGELENGTH,row);
   TIFFSetField(OUT_tif, TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);
   TIFFSetField(OUT_tif, TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_RGB);
   TIFFSetField(OUT_tif, TIFFTAG_BITSPERSAMPLE,8);
   TIFFSetField(OUT_tif, TIFFTAG_SAMPLEFORMAT,3);
   TIFFSetField(OUT_tif, TIFFTAG_COMPRESSION,COMPRESSION_NONE);

   bufscanline_8= (uint32 *) malloc(tileWidth*3*sizeof(uint32));

   for(x=0;x<tileWidth;x++)
           *(bufscanline_8+x)=23;  // just set the buffer to a constant

   TIFFWriteScanline(OUT_tif,bufscanline_8, row,0);

*********

And at last, I can't open the OUT_tif file.

Would you please tell me that what't wrong with the above code? What's the data format of the TIFFWriteScanline? Is the data arrange shoulc be ' RGBRGB.....'? All data is uint32 or not?

Thanks a lot for your kind help.....

Best regards...
Zuyuan

------
Zuyuan Wang
Swiss Federal Research Institute WSL
Zuercherstr. 111, CH-8903 Birmensdorf, SWITZERLAND
Phone: +41 1 739 2691 Fax: +41 1 739 2215
Email: zuyuan.wang@wsl.ch