|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttoxi.color.ColorList
public class ColorList
| Field Summary | |
|---|---|
protected java.util.ArrayList<Color> |
colors
|
| Constructor Summary | |
|---|---|
ColorList()
Creates an empty list. |
|
ColorList(java.util.ArrayList<Color> colours)
Creates a ColorList by wrapping the given ArrayList of colours. |
|
ColorList(Color c)
Creates a color list with the supplied color as first entry. |
|
ColorList(Color[] colourArray)
Creates new ColorList from the given array of colors. |
|
ColorList(ColorList list)
Creates a deep copy of the given ColorList. |
|
ColorList(int[] argbArray)
Creates a new colour list from the array of ARGB values. |
|
| Method Summary | |
|---|---|
ColorList |
add(Color c)
Adds the given color to the list |
ColorList |
addAll(java.util.Collection<Color> collection)
Add the all entries of the Color collection to the list. |
ColorList |
clusterSort(ColorAccessCriteria clusterCriteria,
ColorAccessCriteria subClusterCriteria,
int numClusters,
boolean isReversed)
Sorts the list based on two criteria to create clusters/segments within the list. |
boolean |
contains(Color col)
Checks if the given color is part of the list. |
static ColorList |
createFromARGBArray(int[] pixels,
int num,
boolean uniqueOnly)
Creates a new ColorList of colors sampled from the given ARGB image array. |
static ColorList |
createUsingStrategy(ColorTheoryStrategy strategy,
Color c)
Creates a ColorList based on the ColorTheoryStrategy instance and
the given source color. |
static ColorList |
createUsingStrategy(java.lang.String name,
Color c)
Creates a ColorList based on the ColorTheoryStrategy name and the
given source color. |
Color |
get(int i)
Returns the color at the given index. |
Color |
getAverage()
Calculates and returns the average color of the list. |
ColorList |
getBlended(float amount)
Creates a new ColorList by blending all colors in the list with each other (successive indices only) |
Color |
getDarkest()
Finds and returns the darkest color of the list. |
Color |
getLightest()
Finds and returns the lightest color of the list. |
ColorList |
getReverse()
Returns a reversed copy of the current list. |
java.util.Iterator<Color> |
iterator()
Returns an iterator over the internal list. |
ColorList |
reverse()
Reverses the current order of the list. |
ColorList |
sort()
Convenience method. |
protected ColorList |
sortByComparator(java.util.Comparator<Color> comp,
boolean isReversed)
Sorts the list using the given comparator. |
ColorList |
sortByCriteria(ColorAccessCriteria criteria,
boolean isReversed)
Sorts the list using the given ColorAccessCriteria. |
ColorList |
sortByDistance(boolean isReversed)
Sorts the list by relative distance to each predecessor, starting with the darkest colour in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<Color> colors
| Constructor Detail |
|---|
public ColorList()
public ColorList(Color c)
c - colorpublic ColorList(ColorList list)
list - source listpublic ColorList(java.util.ArrayList<Color> colours)
colours - public ColorList(Color[] colourArray)
colourArray - public ColorList(int[] argbArray)
argbArray - | Method Detail |
|---|
public java.util.Iterator<Color> iterator()
iterator in interface java.lang.Iterable<Color>
public static final ColorList createUsingStrategy(ColorTheoryStrategy strategy,
Color c)
ColorTheoryStrategy instance and
the given source color.
strategy - c -
public static final ColorList createUsingStrategy(java.lang.String name,
Color c)
ColorTheoryStrategy name and the
given source color.
name - c -
public static final ColorList createFromARGBArray(int[] pixels,
int num,
boolean uniqueOnly)
pixels - num - number of colors samples (clipped automatically to number of
pixels in the image)uniqueOnly - flag if only unique samples are to be taken (doesn't guarantee
unique colors though)
public ColorList add(Color c)
c -
public ColorList addAll(java.util.Collection<Color> collection)
collection -
public Color getDarkest()
public Color getLightest()
public Color getAverage()
public ColorList getBlended(float amount)
amount - blend amount
public ColorList sortByDistance(boolean isReversed)
isReversed - true, if list is to be sorted in reverse.
protected ColorList sortByComparator(java.util.Comparator<Color> comp,
boolean isReversed)
comp - isReversed -
public ColorList sortByCriteria(ColorAccessCriteria criteria,
boolean isReversed)
ColorAccessCriteria.
criteria - isReversed -
public ColorList sort()
public ColorList clusterSort(ColorAccessCriteria clusterCriteria,
ColorAccessCriteria subClusterCriteria,
int numClusters,
boolean isReversed)
clusterCriteria - subClusterCriteria - numClusters - isReversed -
public ColorList reverse()
public ColorList getReverse()
public Color get(int i)
i -
public boolean contains(Color col)
col -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||