AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2003.09.30 14:38 "[Tiff] how can i show the different TIFF tile image on the computer screen?", by Zuyuan Wang
[...]
2003.10.31 10:41 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang
2003.10.31 11:35 "[Tiff] Re: ask for suggestions....", by Andrey Kiselev
2003.10.31 16:40 "[Tiff] Re: ask for suggestions....", by
2003.10.31 16:45 "[Tiff] Re: ask for suggestions....", by
[...]

2003.10.31 16:40 "[Tiff] Re: ask for suggestions....", by

Dear Frank,

Thanks a lot for your reply. As to the image I deal with, the other tag
informaiton is:
************
TIFFTAG_SAMPLESPERPIXEL: 3
TIFFTAG_BITSPERSAMPLE:8
TIFFTAG_PLANARCONFIG: PLANARCONFIG_CONTIG
*************
And I read the tile as the following:
*************
# define uint8_T unsigned int
TIFFGetFieldDefaulted(IN_tif, TIFFTAG_SAMPLESPERPIXEL, &spp);
TIFFGetFieldDefaulted(IN_tif, TIFFTAG_BITSPERSAMPLE, &bps);
col=0;
row=0;
if(config==PLANARCONFIG_CONTIG) {
       /* Chunky mode - RGBRGBRGB... */
        if (bps==8) {
        buf_8 = (uint8_T *) malloc(tileSize*sizeof(uint8_T));
       if (TIFFReadRGBATile(IN_tif, buf_8,col,row,0,0 )==-1){
       exit;}
       for (x=0;x<tileLength;x++)
      { position=0;
         bufscanline_8= (uint8_T *) malloc(tileWidth*spp*sizeof(uint8_T));
          for (y=0;y<tileWidth;y++)
          {
            bufscanline_8[position]=buf_8[((x+y*tileWidth)*3]);
              bufscanline_8[position+1]=buf_8[(x+y*tileWidth)*3+1]);
              bufscanline_8[position+2]=buf_8([(x+y*tileWidth)*3+2]);

  //          printf(" %d  \n",bufscanline_8[position]);

             position=position+3;
           }
         TIFFWriteScanline(OUT_tif,bufscanline_8, x, 0);
         free(bufscanline_8);
       }
     free(buf_8);
       }
    }
  ************
Would you please tell me what's wrong with the above code?
Waiting for you kind suggestions eagerly!


Editor's note: This mail was not originally archived, and has been reconstructed from quotes.