AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
August 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2009.08.15 03:45 "scanline size and image width", by Dave Sun
2009.08.15 05:50 "Re: scanline size and image width", by Scott Ribe

2009.08.15 03:45 "scanline size and image width", by Dave Sun

Question shor version:

why scanlinesize is 1024 while my image width is 512?

Long version of the question is following:


I have 16 bit gray image, 512x512,

when I checked


linesize = TIFFScanlineSize(image);

it gives me 1024;


to read in the image, I used following



buffer = (char*)_TIFFmalloc(linesize*height);

for(int i=0; i< height; i++)

TIFFReadScanline(image, &buffer[i*linesize], i);


It works well.


Now I want to get the pixel values and found that




for(int i=0; i < 512*512; i++){

//cout << i << "\t" << ((uint16 *)buffer)[i] << endl;

imageList.push_back(((uint16 *)buffer)[i]);

}


works. Note 512*512 (image width * image height, but not 1024*512,
scanlinesize*image height).


My question is why scanlinesize is twice bigger as the image width?




Thank you.
Any suggestion is welcome.