[comp.sys.mac] Using UnpackBits to decode MacPaint files

tk@cvl.UUCP (04/23/87)

Hello,
	I'm trying to decode a MacPaint file to create a binary image for
some image processing work.  I read in the TechNotes that MacPaint files
were packed using the PackBits function in the Toolbox.  To unpack the file
the TN said to use UnpackBits with the length argument of 72 bytes.  In IM
it says that UnpackBits will always increments the destination pointer by this
length argument.  When I do this, it works fine for about the first 100 or so
rows of the image.  The next row gets messed up.  UnpackBits increments the
destination pointer by some number other then the number I passed it (ie 72).

My question:  Is there something wrong in UnpackBits? 
	      Am I using it wrong(see code below)? 

---------------------------------

what happened before :
skip first 512 bytes of file.
allocate input and output arrays of size 57000 bytes.
read in image from file.

the code fragment:

	for(i=0;i<720;i++)
		UnpackBits(&src,&dest,72);

what happens after:
write the dest array to a file.
--------------------------------------

thanks for any help

-tk

 Tharakesh Siddalingaiah ---
      University of Maryland Computer Vision Lab,     (301) 454-5858
      ARPA:tk@cvl.umd.ed UUCP:{seismo,allegra,brl-bmd}!mimsy!cvl!tk
-- 
 Tharakesh Siddalingaiah ---
      University of Maryland Computer Vision Lab,     (301) 454-5858
      ARPA:tk@cvl.umd.ed UUCP:{seismo,allegra,brl-bmd}!mimsy!cvl!tk