Strabo.Core.ImageProcessing.ColorHistogram.getNumberOfColors C# (CSharp) Method

getNumberOfColors() public method

public getNumberOfColors ( ) : int
return int
        public int getNumberOfColors()
        {
            if (colorArray == null)
                return 0;
            else
                return colorArray.Length;
        }

Usage Example

        public void getRGBData(ColorHistogram colorHist, double[][] data)
        {
            int size = colorHist.getNumberOfColors();

            for (int x = 0; x < size; x++)
            {
                data[x] = new double[3];
                int rgb = colorHist.getColor(x);
                data[x][0] = ((rgb & 0xFF0000) >> 16);
                data[x][1] = ((rgb & 0xFF00) >> 8);
                data[x][2] = (rgb & 0xFF);
            }
        }
All Usage Examples Of Strabo.Core.ImageProcessing.ColorHistogram::getNumberOfColors