| Modifier and Type | Field and Description |
|---|---|
private RGBColor[] |
list |
private int |
numEntries |
INDEX_BLUE, INDEX_GREEN, INDEX_RED| Modifier | Constructor and Description |
|---|---|
|
RGBColorList(Histogram3D hist)
Creates a new list and initializes it with the argument histogram.
|
private |
RGBColorList(int NUM_ENTRIES)
Creates a color list with room for a fixed number of entries.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
findExtrema(int i1,
int i2)
In a given interval of the list this method searches for the color axis
that has the largest distribution of values.
|
RGBColor |
getColor(int index)
Returns an
RGBColor object from this list, given by its zero-based
index value. |
int |
getNumEntries()
Returns the number of color objects in this list.
|
void |
sortByAxis(int index1,
int index2,
int axis)
Sorts an interval of the array of colors by one of the three components (RGB).
|
void |
sortByCounter(int index1,
int index2)
Sorts an interval of the array of colors by their counters.
|
private RGBColor[] list
private final int numEntries
private RGBColorList(int NUM_ENTRIES)
numberOfEntries - the number of entries in the new list (must be larger than zero)java.lang.IllegalArgumentException - if the argument is smaller than onepublic RGBColorList(Histogram3D hist)
hist - the histogram from which the list will be initializedjava.lang.IllegalArgumentException - thrown if no histogram entry has a non-zero counterpublic int[] findExtrema(int i1,
int i2)
public RGBColor getColor(int index)
RGBColor object from this list, given by its zero-based
index value.index - zero-based index into the list; must be smaller than getNumEntries()public int getNumEntries()
public void sortByAxis(int index1,
int index2,
int axis)
index1 - the index of the first element in the intervalindex2 - the index of the last element in the intervalaxis - the color component by which the interval is to be sorted, RGBIndex.INDEX_RED, RGBIndex.INDEX_GREEN or RGBIndex.INDEX_BLUEpublic void sortByCounter(int index1,
int index2)
index1 - the index of the first element in the intervalindex2 - the index of the last element in the interval