|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.color.quantization.MedianCutNode
An instance of this node class represents a cuboid part of the color cube representing the three-dimensional RGB color space.
MedianCutQuantizer
Field Summary |
Fields inherited from interface net.sourceforge.jiu.data.RGBIndex |
INDEX_BLUE, INDEX_GREEN, INDEX_RED |
Constructor Summary | |
MedianCutNode(MedianCutNode parent,
int index1,
int index2)
Creates a node for a Median Cut tree of nodes with index values for some external color array and the parent node. |
Method Summary | |
boolean |
canBeSplit()
Returns if this node can be split into two. |
double |
computeRgbDistance(MedianCutNode node)
Computes the distance in RGB color space between the representative color of this node and the argument node and returns it as non-negative value. |
int |
getAxisOfLargestDistribution()
Returns the axis of the channel whose samples are most widely distributed among the colors that belong to this node. |
int |
getDifferenceOfLargestDistribution()
|
int |
getLeftIndex()
|
MedianCutNode |
getLeftSuccessor()
Returns left successor node (or null if this node is a leaf). |
int |
getMaxColorSample(int index)
|
int |
getMedianValue()
|
int |
getMiddleIndex()
|
int |
getMinColorSample(int index)
|
int |
getNumColors()
|
int |
getPaletteIndex()
|
MedianCutNode |
getParentNode()
Returns parent node (or null if this node is the root node). |
int[] |
getRepresentativeColor()
|
int |
getRightIndex()
|
MedianCutNode |
getRightSuccessor()
Returns right successor node (or null if this node is a leaf). |
MedianCutNode |
getSuccessor(int[] rgb)
|
boolean |
isAxisDetermined()
|
boolean |
isLeaf()
Returns if this node is a leaf by checking if both successors are null. |
void |
setLargestDistribution(int newAxis,
int newDifference)
|
void |
setMaxColor(int red,
int green,
int blue)
|
void |
setMaxColorSample(int index,
int value)
|
void |
setMedianValue(int newMedianValue)
|
void |
setMinColor(int red,
int green,
int blue)
|
void |
setMinColorSample(int index,
int value)
|
void |
setPaletteIndex(int newPaletteIndex)
|
void |
setRepresentativeColor(int[] aRepresentativeColor)
|
void |
setSuccessors(MedianCutNode left,
MedianCutNode right)
Sets the successor nodes for this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MedianCutNode(MedianCutNode parent, int index1, int index2)
parent
- the parent node of this new node, should be null only for the root nodeindex1
- the index value of the first element of colors in the color listindex2
- the index value of the last element of colors in the color list; must be larger than or equal to index1
IllegalArgumentException
- if index1 is larger than index2Method Detail |
public boolean canBeSplit()
public double computeRgbDistance(MedianCutNode node)
public int getAxisOfLargestDistribution()
RGBIndex
constants
IllegalArgumentException
- if that axis has not been determinedpublic int getDifferenceOfLargestDistribution()
public int getLeftIndex()
public MedianCutNode getLeftSuccessor()
public int getMaxColorSample(int index)
public int getMedianValue()
public int getMiddleIndex()
public int getMinColorSample(int index)
public int getNumColors()
public int getPaletteIndex()
public MedianCutNode getParentNode()
public int[] getRepresentativeColor()
public int getRightIndex()
public MedianCutNode getRightSuccessor()
public MedianCutNode getSuccessor(int[] rgb)
public boolean isAxisDetermined()
public boolean isLeaf()
public void setLargestDistribution(int newAxis, int newDifference)
public void setMaxColor(int red, int green, int blue)
public void setMaxColorSample(int index, int value)
public void setMedianValue(int newMedianValue)
public void setMinColor(int red, int green, int blue)
public void setMinColorSample(int index, int value)
public void setPaletteIndex(int newPaletteIndex)
public void setRepresentativeColor(int[] aRepresentativeColor)
public void setSuccessors(MedianCutNode left, MedianCutNode right)
left
- the left successor noderight
- the left successor node
|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |