?colors - Methods to Count the Colors in an Image;/


NAME



0colors - Methods to Count the Colors in an Image




(

SYNOPSIS



:number_colors=GetNumberColors(image,file)

,status=IsPseudoClass(image)

4distance=QueryColorName(color,name)




B

FUNCTION DESCRIPTIONS



(A description of each parameter follows.

8
node_info:


IThe address of a structure of type NodeInfo which points to a node in the%color cube tree that is to be pruned.






6

GetNumberColors



GMethod GetNumberColors returns the number of unique colors in an image.

-The format of the GetNumberColors routine is:

6

        number_colors=GetNumberColors(image,file)


(A description of each parameter follows.

'
number_colors:


KMethod GetNumberColors returns the number of unique colors in the specifiedimage.

image:


HThe address of a byte (8 bits) array of run-length encoded pixel data ofGyour source image. The sum of the run-length counts in the source image0must be equal to or exceed the number of pixels.

file:


KAn pointer to a FILE. If it is non-null a list of unique pixel field valuesHand the number of times each occurs in the image is written to the file.



(A description of each parameter follows.

$
color_cube:


$A pointer to the CubeInfo structure.

level:


;Specifies the level in the classification the node resides.






2

IsPseudoClass



IMethod IsPseudoClass returns True if the image is PseudoClass and has 256Junique colors or less. If the image is DirectClass and has less 256 colors-or less, the image is demoted to PseudoClass.

+The format of the IsPseudoClass routine is:

(

        status=IsPseudoClass(image)


(A description of each parameter follows.

status:


HMethod IsPseudoClass returns True is the image is PseudoClass or has 256color or less.

image:


HThe address of a byte (8 bits) array of run-length encoded pixel data ofGyour source image. The sum of the run-length counts in the source image0must be equal to or exceed the number of pixels.






4

QueryColorName



JMethod QueryColorName returns the name of the color that is closest to thesupplied color in RGB space.

,The format of the QueryColorName routine is:

0

        distance=QueryColorName(color,name)


(A description of each parameter follows.

"
distance:


JMethod QueryColorName returns the distance-squared in RGB space as well as-the color name that is at a minimum distance.

color:


KThis is a pointer to a ColorPacket structure that contains the color we aresearching for.

name:


JThe name of the color that is closest to the supplied color is returned inthis character buffer.