c_pxhist - Accumulates values in a histogram array

SYNTAX

#include "worgen.h"

FUNCTION c_pxhist (ns, buf, dtype, hist, count)

     long               *ns;
     unsigned char      *buf;
     long               *dtype;
     long               *hist;
     long               *count;

PARAMETERS

ns (input, integer)

The number of samples in the input buffer to be histogrammed.

buf (input, 'dtype')

An input array of pixel values to be histogrammed.

dtype (input, integer)

An integer value that represents the type of data to be histogrammed. Legal values include:

     = EBYTE(1):     unsigned byte data
     = EWORD(2):     signed two byte data
     = ELONG(3):     signed four byte data
     = EREAL(4):     four byte floating point data

hist (output, long or real)

The histogram array to be accumulated. The histogram array must be initialized to zero at the start of processing in the application program. For real data, the array must be dimensioned to [16384,2] in the application program. The first dimension is the unique pixel values and the second dimension is the number of each unique pixel value.

count (output, integer)

The total number of values the histogram array contains. Only returned for real*4 and integer*4 data. Note that the count must be initialized to zero at the start of processing in the application program.

DESCRIPTION

The c_pxhist() call is used to create a histogram array hist from the values of ns samples of a pixel array buf of type dtype. The array will contain count number of values.

RETURN VALUE

c_pxhist() returns

     E_SUCC -->  successful completion 
     TYPERR -->  invalid data type specified
     E_FAIL -->  failure

SPECIAL CONSIDERATIONS

Real data is histogrammed in a sorted second array. There cannot be more than 16,384 different values.