<HTML>
<HEAD>
<TITLE>mac - Macintosh Utility Methods for ImageMagick</TITLE>
<LINK REV="made" HREF="mailto:cristy@mystic.es.dupont.com">
</HEAD>

<body background="../../images/background.gif">

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A>
	<UL>

		<LI><A HREF="#BottleneckTest">BottleneckTest</A>
		<LI><A HREF="#closedir">closedir</A>
		<LI><A HREF="#Exit">Exit</A>
		<LI><A HREF="#FilenameToFSSpec">FilenameToFSSpec</A>
		<LI><A HREF="#MacGSExecuteCommand">MacGSExecuteCommand</A>
		<LI><A HREF="#MacGSLaunchApplicationCore">MacGSLaunchApplicationCore</A>
		<LI><A HREF="#MacGSLaunchApplication">MacGSLaunchApplication</A>
		<LI><A HREF="#MacGSLaunchApplicationToFront">MacGSLaunchApplicationToFront</A>
		<LI><A HREF="#MacGSQuitApplication">MacGSQuitApplication</A>
		<LI><A HREF="#MacGSSetWorkingFolder">MacGSSetWorkingFolder</A>
		<LI><A HREF="#MACSystemCommand">MACSystemCommand</A>
		<LI><A HREF="#MACWarningHandler">MACWarningHandler</A>
		<LI><A HREF="#opendir">opendir</A>
		<LI><A HREF="#ProcessPendingEvents">ProcessPendingEvents</A>
		<LI><A HREF="#readdir">readdir</A>
		<LI><A HREF="#ReadPICTImage">ReadPICTImage</A>
		<LI><A HREF="#SearchForFile">SearchForFile</A>
		<LI><A HREF="#seekdir">seekdir</A>
		<LI><A HREF="#SetApplicationType">SetApplicationType</A>
		<LI><A HREF="#telldir">telldir</A>
	</UL>

</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
mac - Macintosh Utility Methods for ImageMagick

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
<STRONG>BottleneckTest</STRONG>(picture,codec,depth,colormap_id)

<P>
<STRONG>Exit</STRONG>(status)

<P>
<STRONG>FilenameToFSSpec</STRONG>(filename,fsspec)

<P>
<STRONG>MACSystemCommand</STRONG>(command)

<P>
<STRONG>ProcessPendingEvents</STRONG>(text)

<P>
image=<STRONG>ReadPICTImage</STRONG>(image_info)

<P>
<STRONG>SetApplicationType</STRONG>(filename,magick,application)

<P>
<STRONG>closedir</STRONG>(entry)

<P>
<STRONG>opendir</STRONG>(entry)

<P>
<STRONG>readdir</STRONG>(entry)

<P>
<STRONG>seekdir</STRONG>(entry,position)

<P>
<STRONG>telldir</STRONG>(entry)

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
<HR>
<H2><A NAME="BottleneckTest">BottleneckTest</A></H2>
<P>
Method BottleneckTest intercepts any compressed images.

<P>
The format of the BottleneckTest routine is:

<P>
<PRE>        BottleneckTest(picture,codec,depth,colormap_id)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG><A NAME="item_o">picture:</A></STRONG><DD>
<P>
Specifies a pointer to a PicHandle structure.

<DT><STRONG>codec:</STRONG><DD>
<P>
The code type is returned in this CodecType pointer structure.

<DT><STRONG>depth:</STRONG><DD>
<P>
The image depth is returned as an integer pointer.

<DT><STRONG>colormap_id:</STRONG><DD>
<P>
The colormap ID is returned in this short pointer.

</DL></DL>
<P>
<HR>
<H2><A NAME="closedir">closedir</A></H2>
<P>
Method closedir closes the named directory stream and frees the DIR
structure.

<P>
The format of the closedir routine is:

<P>
<PRE>        closedir(entry)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a DIR structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="Exit">Exit</A></H2>
<P>
Method Exit exits the process.

<P>
The format of the Exit routine is:

<P>
<PRE>        Exit(status)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
an integer value representing the status of the terminating process.

</DL></DL>
<P>
<HR>
<H2><A NAME="FilenameToFSSpec">FilenameToFSSpec</A></H2>
<P>
Method FilenameToFSSpec sets the file type of an image.

<P>
The format of the FilenameToFSSpec routine is:

<P>
<PRE>        FilenameToFSSpec(filename,fsspec)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>filename:</STRONG><DD>
<P>
Specifies the name of the file.

<DT><STRONG>fsspec:</STRONG><DD>
<P>
A pointer to type FSSpec.

</DL></DL>
<P>
<HR>
<H2><A NAME="MacGSExecuteCommand">MacGSExecuteCommand</A></H2>
<P>
Method MacGSExecuteCommand executes the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplicationCore">MacGSLaunchApplicationCore</A></H2>
<P>
Method MacGSLaunchApplicationCore launches the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplication">MacGSLaunchApplication</A></H2>
<P>
Method MacGSLaunchApplication launches the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplicationToFront">MacGSLaunchApplicationToFront</A></H2>
<P>
Method MacGSLaunchApplicationToFront moves the Ghostscript window to the
front.

<P>
<HR>
<H2><A NAME="MacGSQuitApplication">MacGSQuitApplication</A></H2>
<P>
Method MacGSQuitApplication quits the Ghostscript application.

<P>
<HR>
<H2><A NAME="MacGSSetWorkingFolder">MacGSSetWorkingFolder</A></H2>
<P>
Method MacGSSetWorkingFolder set the Ghostscript working folder.

<P>
<HR>
<H2><A NAME="MACSystemCommand">MACSystemCommand</A></H2>
<P>
<PRE> Method MACSystemCommand executes the specified command and waits until it
</PRE>
<P>
<PRE> terminates.  The returned value is the exit status of the command.
</PRE>
<P>
The format of the MACSystemCommand routine is:

<P>
<PRE>        MACSystemCommand(command)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>command:</STRONG><DD>
<P>
This string is the command to execute.

</DL></DL>
<P>
<HR>
<H2><A NAME="MACWarningHandler">MACWarningHandler</A></H2>
<P>
Method MACWarningHandler displays a warning message.

<P>
The format of the MACWarningHandler routine is:

<P>
<HR>
<H2><A NAME="opendir">opendir</A></H2>
<P>
Method opendir opens the directory named by filename and associates a
directory stream with it.

<P>
The format of the opendir routine is:

<P>
<PRE>        opendir(entry)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a DIR structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="ProcessPendingEvents">ProcessPendingEvents</A></H2>
<P>
Method ProcessPendingEvents processes any pending events. This prevents
ImageMagick from monopolizing the processor.

<P>
The format of the ProcessPendingEvents routine is:

<P>
<PRE>        ProcessPendingEvents(text)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>text:</STRONG><DD>
<P>
A character string representing the current process.

</DL></DL>
<P>
<HR>
<H2><A NAME="readdir">readdir</A></H2>
<P>
Method readdir returns a pointer to a structure representing the directory
entry at the current position in the directory stream to which entry
refers.

<P>
The format of the readdir

<P>
<PRE>        readdir(entry)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a DIR structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="ReadPICTImage">ReadPICTImage</A></H2>
<P>
Method ReadPICTImage reads an Apple Macintosh QuickDraw/PICT image file
using MacOS QuickDraw routines and returns it. It allocates the memory
necessary for the new Image structure and returns a pointer to the new
image.

<P>
This routine was written and contributed by <A
HREF="mailto:spd@daphne.cps.unizar.es">spd@daphne.cps.unizar.es</A> (feel
free to copy and use it as you want. No warranty).

<P>
The format of the ReadPICTImage routine is:

<P>
<PRE>        image=ReadPICTImage(image_info)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>image:</STRONG><DD>
<P>
Method ReadPICTImage returns a pointer to the image after reading. A null
image is returned if there is a a memory shortage or if the image cannot be
read.

<DT><STRONG>image_info:</STRONG><DD>
<P>
Specifies a pointer to an ImageInfo structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="SearchForFile">SearchForFile</A></H2>
<P>
Method SearchForFile searches for a file.

<P>
<HR>
<H2><A NAME="seekdir">seekdir</A></H2>
<P>
Method seekdir sets the position of the next <CODE>readdir()</CODE>
operation on the directory stream.

<P>
The format of the seekdir routine is:

<P>
<PRE>        seekdir(entry,position)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a DIR structure.

<DT><STRONG>position:</STRONG><DD>
<P>
specifies the position associated with the directory stream.

</DL></DL>
<P>
<HR>
<H2><A NAME="SetApplicationType">SetApplicationType</A></H2>
<P>
Method SetApplicationType sets the file type of an image.

<P>
The format of the SetApplicationType routine is:

<P>
<PRE>        SetApplicationType(filename,magick,application)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>filename:</STRONG><DD>
<P>
Specifies the name of the file.

<DT><STRONG>filename:</STRONG><DD>
<P>
Specifies the file type.

<DT><STRONG>application:</STRONG><DD>
<P>
Specifies the type of the application.

</DL></DL>
<P>
<HR>
<H2><A NAME="telldir">telldir</A></H2>
<P>
<PRE> Method telldir returns the current location associated  with  the
</PRE>
<P>
<PRE> named directory stream.
</PRE>
<P>
The format of the telldir routine is:

<P>
<PRE>        telldir(entry)
</PRE>
<P>
A description of each parameter follows:

<DL><DL>
<DT><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a DIR structure.

</DL></DL>
</BODY>

</HTML>
