toxi.color
Class Histogram

java.lang.Object
  extended by toxi.color.Histogram
All Implemented Interfaces:
java.lang.Iterable<HistEntry>

public class Histogram
extends java.lang.Object
implements java.lang.Iterable<HistEntry>


Constructor Summary
Histogram(ColorList palette)
           
 
Method Summary
 java.util.List<HistEntry> getEntries()
           
 ColorList getPalette()
           
 java.util.Iterator<HistEntry> iterator()
           
static Histogram newFromARGBArray(int[] pixels, int numSamples, float tolerance, boolean blendCols)
          Creates a new histogram of color samples taken from the given ARGB array in order to identify the primary colors in the image.
 void setPalette(ColorList palette)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Histogram

public Histogram(ColorList palette)
Method Detail

newFromARGBArray

public static Histogram newFromARGBArray(int[] pixels,
                                         int numSamples,
                                         float tolerance,
                                         boolean blendCols)
Creates a new histogram of color samples taken from the given ARGB array in order to identify the primary colors in the image.

Parameters:
pixels -
numSamples -
tolerance -
blendCols -
Returns:
histogram instance

getEntries

public java.util.List<HistEntry> getEntries()
Returns:
the entries

getPalette

public ColorList getPalette()
Returns:
the palette

iterator

public java.util.Iterator<HistEntry> iterator()
Specified by:
iterator in interface java.lang.Iterable<HistEntry>

setPalette

public void setPalette(ColorList palette)
Parameters:
palette - the palette to set