🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #15693

Using UnpackBits to decode MacPaint files

#15693
From: tk
Date: Wed, 22 Apr 1987 22:21
41 lines
1907 bytes
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
Technical Details
Message-ID: <2159@cvl.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!seismo!decuac!cvl!tk

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!seismo!decuac!cvl!tk
From: tk@cvl.UUCP
Newsgroups: comp.sys.mac
Subject: Using UnpackBits to decode MacPaint files
Message-ID: <2159@cvl.umd.edu>
Date: Wed, 22-Apr-87 17:21:05 EST
Article-I.D.: cvl.2159
Posted: Wed Apr 22 17:21:05 1987
Date-Received: Fri, 24-Apr-87 03:13:50 EST
Organization: Center for Automation Research, Univ. of Md.
Lines: 41