1 colors - Count the Colors in an Image��� �  0 




NAME

%colors - Count the Colors in an Image








SYNOPSIS

,status=IsPseudoClass(image)

)NumberColors(image,file)






9

FUNCTION DESCRIPTIONS






%

DestroyList

HProcedure DestroyList traverses the color cube tree and free the list ofunique colors.

)The format of the DestroyList routine is:






!

Histogram

HProcedure Histogram traverses the color cube tree and produces a list ofKunique pixel field values and the number of times each occurs in the image.

'The format of the Histogram routine is:






+

InitializeNode

IFunction InitializeNode allocates memory for a new node in the color cube$tree and presets all fields to zero.

,The format of the InitializeNode routine is:






)

IsPseudoClass

KFunction 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:
JFunction 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.






'

NumberColors

FFunction NumberColors returns the number of unique colors in an image.

*The format of the NumberColors routine is:

%

        NumberColors(image,file)


(A description of each parameter follows.




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.