#include "worgen.h"
FUNCTION c_pxhist (ns, buf, dtype, hist, count)
long *ns; unsigned char *buf; long *dtype; long *hist; long *count;
The number of samples in the input buffer to be histogrammed.
An input array of pixel values to be histogrammed.
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
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.
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.
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.
c_pxhist() returns
E_SUCC --> successful completion TYPERR --> invalid data type specified E_FAIL --> failure
Real data is histogrammed in a sorted second array. There cannot be more than 16,384 different values.