MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


mediaLib Library Functions            mlibImageHistogram2(3MLIB)



NAME
     mlibImageHistogram2 - histogram

SYNOPSIS
     cc [ flag... ] file... -lmlib [ library... ]
     #include 

     mlibstatus mlibImageHistogram2(mlibs32 **histo, const mlibimage *img,
          const mlibs32 *numBins, const mlibs32 *lowValue,
          const mlibs32 *highValue, mlibs32 xStart, mlibs32 yStart,
          mlibs32 xPeriod, mlibs32 yPeriod);


DESCRIPTION
     The mlibImageHistogram2() function creates a  histogram  by
     scanning  an  image,  counting the number of pixels within a
     given range for each channel of the image, and then generat-
     ing a histogram.


     The image can have 1, 2, 3 or 4 channels. The data  type  of
     the  image  can  be  MLIBYTE,  MLIBSHORT, MLIBUSHORT, or
     MLIBINT. The histogram must have the same number  of  chan-
     nels as the image has.


     One entry of the histogram, or a bin, is used to  accumulate
     the  number  of pixels within a certain sub-range. The legal
     pixel range  and  the  number  of  bins  may  be  controlled
     separately.


     If binWidth is defined as (highValue  -  lowValue  )/numBins
     then bin i counts pixel values in the following range:

       lowValue ] i*binWidth < x < lowValue ] (i ] 1)*binWidth



     The set of pixels scanned  may  furthermore  be  reduced  by
     specifying  xPeriod  and yPeriod parameters that specify the
     sampling rate along each axis.


     The set of pixels to be accumulated may be obtained from the
     following equation:

       x = xStart ] p*xPeriod;  0 < p < (w - xStart)/xPeriod
       y = yStart ] q*yPeriod;  0 < q < (h - yStart)/yPeriod






SunOS 5.11           Last change: 2 Mar 2007                    1






mediaLib Library Functions            mlibImageHistogram2(3MLIB)



     It is the user's responsibility to clear the histogram table
     before this function is called and to ensure that the histo-
     gram table supplied is suitable for the source image and the
     parameters.  Otherwise, the result of this function is unde-
     fined.


     The range from lowValue[k] to (highValue[k] - 1) must  be  a
     valid subrange of the image type range.

PARAMETERS
     The function takes the following arguments:

     histo        Pointer to histogram. The format of the  histo-
                  gram is histo[channel][index]. The index values
                  for channel i can be 0, 1, ..., numBins[i]-1.


     img          Pointer to source image.


     numBins      The number of bins  for  each  channel  of  the
                  image.


     lowValue     The lowest pixel value checked for  each  chan-
                  nel.


     highValue    The highest pixel value checked for each  chan-
                  nel.  When counting the pixel values, highValue
                  is not included.


     xStart       The initial X sample coordinate.


     yStart       The initial Y sample coordinate.


     xPeriod      The X sampling rate. xPeriod > 1.


     yPeriod      The Y sampling rate. yPeriod > 1.


RETURN VALUES
     The function returns MLIBSUCES if  successful.  Otherwise
     it returns MLIBFAILURE.

ATRIBUTES




SunOS 5.11           Last change: 2 Mar 2007                    2






mediaLib Library Functions            mlibImageHistogram2(3MLIB)



     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     MT-Safe                     
    


SEE ALSO
     mlibImageHistogram(3MLIB), attributes(5)







































SunOS 5.11           Last change: 2 Mar 2007                    3



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™