<HTML>
<HEAD>
<TITLE>colors - Methods to Count the Colors in an Image</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="#GetNumberColors">GetNumberColors</A>
		<LI><A HREF="#IsPseudoClass">IsPseudoClass</A>
		<LI><A HREF="#QueryColorName">QueryColorName</A>
	</UL>

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

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
colors - Methods to Count the Colors in an Image

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
number_colors=<STRONG>GetNumberColors</STRONG>(image,file)

<P>
status=<STRONG>IsPseudoClass</STRONG>(image)

<P>
distance=<STRONG>QueryColorName</STRONG>(color,name)

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG><A NAME="item_o">node_info:</A></STRONG><DD>
<P>
The address of a structure of type NodeInfo which points to a node in the
color cube tree that is to be pruned.

</DL></DL>
<P>
<HR>
<H2><A NAME="GetNumberColors">GetNumberColors</A></H2>
<P>
Method GetNumberColors returns the number of unique colors in an image.

<P>
The format of the GetNumberColors routine is:

<P>
<PRE>        number_colors=GetNumberColors(image,file)
</PRE>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG>number_colors:</STRONG><DD>
<P>
Method GetNumberColors returns the number of unique colors in the specified
image.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a byte (8 bits) array of run-length encoded pixel data of
your source image. The sum of the run-length counts in the source image
must be equal to or exceed the number of pixels.

<DT><STRONG>file:</STRONG><DD>
<P>
An pointer to a FILE. If it is non-null a list of unique pixel field values
and the number of times each occurs in the image is written to the file.

</DL></DL>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG>color_cube:</STRONG><DD>
<P>
A pointer to the CubeInfo structure.

<DT><STRONG>level:</STRONG><DD>
<P>
Specifies the level in the classification the node resides.

</DL></DL>
<P>
<HR>
<H2><A NAME="IsPseudoClass">IsPseudoClass</A></H2>
<P>
Method IsPseudoClass returns True if the image is PseudoClass and has 256
unique colors or less. If the image is DirectClass and has less 256 colors
or less, the image is demoted to PseudoClass.

<P>
The format of the IsPseudoClass routine is:

<P>
<PRE>        status=IsPseudoClass(image)
</PRE>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method IsPseudoClass returns True is the image is PseudoClass or has 256
color or less.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a byte (8 bits) array of run-length encoded pixel data of
your source image. The sum of the run-length counts in the source image
must be equal to or exceed the number of pixels.

</DL></DL>
<P>
<HR>
<H2><A NAME="QueryColorName">QueryColorName</A></H2>
<P>
Method QueryColorName returns the name of the color that is closest to the
supplied color in RGB space.

<P>
The format of the QueryColorName routine is:

<P>
<PRE>        distance=QueryColorName(color,name)
</PRE>
<P>
A description of each parameter follows.

<DL><DL>
<DT><STRONG>distance:</STRONG><DD>
<P>
Method QueryColorName returns the distance-squared in RGB space as well as
the color name that is at a minimum distance.

<DT><STRONG>color:</STRONG><DD>
<P>
This is a pointer to a ColorPacket structure that contains the color we are
searching for.

<DT><STRONG>name:</STRONG><DD>
<P>
The name of the color that is closest to the supplied color is returned in
this character buffer.

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

</HTML>
