Received: by whizzer.wpd.sgi.com (/911001.SGI)
	 id AA14712; Thu, 2 Dec 93 15:20:07 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA14705; Thu, 2 Dec 93 07:20:05 -0800
Received: from monge.brunel.ac.uk by sgi.sgi.com via SMTP (931110.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA19521; Thu, 2 Dec 93 07:20:00 -0800
Received: from brunel.ac.uk by monge.brunel.ac.uk with SMTP (PP) 
          id <11604-0@monge.brunel.ac.uk>; Thu, 2 Dec 1993 15:16:03 +0000
From: Amy P Tai <ci92apt@brunel.ac.uk>
Message-Id: <19936.9312021515@saturn.brunel.ac.uk>
Subject: Help in TIFF tools software ?? (fwd)
To: tiff@sgi.sgi.com
Date: Thu, 2 Dec 1993 15:15:51 +0000 (GMT)
Cc: ci92apt@brunel.ac.uk (Amy P Tai)
X-Mailer: ELM [version 2.4 PL21]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1564
Sender: tiff-owner@sgi.sgi.com

Forwarded message:
> From mailer-daemon@brunel.ac.uk Thu Dec  2 15:13:27 1993
> From: Amy P Tai <ci92apt@brunel.ac.uk>
> Message-Id: <11097.9312021512@monge.brunel.ac.uk>
> Subject: Help in TIFF tools software ??
> To: sam@sgi.com
> Date: Thu, 2 Dec 1993 15:12:54 +0000 (GMT)
> Cc: ci92apt (Amy P Tai)@brunel.ac.uk
> X-Mailer: ELM [version 2.4 PL21]
> Mime-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> Content-Length: 996
> 
> Hello,
> 
> I have a probelm in the software that I got from the v3.0.tar.Z.
> 
> One of the TIFF tools file tiffdither.c cannot provide clear explanation.
> Even after looking through the man1/tiffdither.1 which still cannot answer
> my questions.
> 
> In the file tiffdither.c, it converts the image from greyscale to bilevel.
> 
> The following is the bit I don't understand :
> 
> for (j = 0; j < imagewidth; ++j){
> 	register int v;
> 
> 	lastpixel = (j==jmax);
> 	v = *thisptr;
> 	if(v<0)
> 		v = 0;
> 	else if ( v > 255 )
> 		v = 255;
> 
> 	if ( v > threshold ){
> 		*outptr |= bit;
> 		v -= 255;	???
> 	}
> 	bit >>= 1;		???
> 	if( bit == 0 ) {
> 		output++;
> 		bit = 0x80;
> 	}			???
> 
> Where it has ???, I don't understand why this line is needed and what is it
> doing ?
> 
> Please help me with this problems or any comments will help.
> 
> Thank you.
> 
> 
> ************************************************
> *	Amy Tai,  ci92apt@brunel.ac.uk
> *	Brunel University, United Kingdom.
> *	Department of Computer Science.
> ************************************************
> 



