AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.12.12 14:24 "[Tiff] how about the pixel order if I use TIFFReadScanline?", by Zuyuan Wang
2005.12.12 22:58 "Re: [Tiff] how about the pixel order if I use TIFFReadScanline?", by Bob Friesenhahn

2005.12.12 14:24 "[Tiff] how about the pixel order if I use TIFFReadScanline?", by Zuyuan Wang

Dear all,

    I try to use the TIFFReadScanline to read the TIFF image. What I did is:

  1) use the TIFFScanline for read the image row by row
           for (row = 0; row < height; row++){
        result = TIFFReadScanline(tif, scanline, row,0); }

2) later on, put each line to a whole buffer RGB:
          for (i=0;i<width;i++){

        *(RGB+row*width*3+i*3)=*(scanline+i*3);
        *(RGB+row*width*3+i*3+1)=*(scanline+i*3+1);
        *(RGB+row*width*3+i*3+2)=*(scanline+i*3+2);}}

But when I open the RGB buffer pixel by pixel, it seems that it is not the original image( I mean top to bottom, left to right). I think that I must misunderstand the pixel order of the TIFFScanline, but I have no idea about it. Any suggestion will be appreciated.

  Regards!
  Chanchan

- - - - - -
Dr. 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