AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.12.07 12:25 "[Tiff] Fetching pixel data from 4bit tiff", by Dan Field
2004.12.07 11:32 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris
2004.12.07 12:38 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Dan Field
2004.12.07 11:48 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris
2004.12.07 12:57 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Dan Field
2004.12.07 12:21 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris
2004.12.07 13:02 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris
2004.12.07 15:50 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Dan Field
2004.12.07 15:52 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Bob Friesenhahn
2004.12.07 17:46 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Dan Field
2004.12.07 17:04 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Bob Friesenhahn
2004.12.07 20:00 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris
2004.12.07 20:41 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Bob Friesenhahn

2004.12.07 12:21 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Joris

Dan,

TIFF Directory at offset 0x8

That certainly is indeed a grayscale TIFF.

Basically I'm trying to take a sample of pixels across the middle of the image, both horizontal and vertical (yes I know the sample algo is wrong for the horizontal.. I've yet to get to that :) )

I'm no C guru myself (Delphi coder instead), but from a quick scan through the code, it seems that the initialization, loop condition, and increment of i in both loops is wrong. Try this instead:

for (i =TheImage.width/2*4;
      i < (TheImage.width*TheImage.height*4);
      i +=TheImage.width*4) {
for (i =TheImage.width*(TheImage.height/2)*4;
      i <TheImage.width*(TheImage.height/2+1)*4;
      i+=4) {

Quite possible I made a mistake myself, though, I'm not a C coder, sorry.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be

Download your free TIFF tag viewer for windows here: http://www.awaresystems.be/imaging/tiff/astifftagviewer.html