| Constructor and Description |
|---|
ColorCluster(RColor mean)
Builds a new cluster without any member but with a set mean.
|
ColorCluster(RColor mean,
ColorDifferenceMeasure m)
Builds a new cluster without any member but with a set mean.
|
| Modifier and Type | Method and Description |
|---|---|
Cluster |
addElement(java.lang.Object newMember)
Adds an element to the cluster.
|
ColorCluster |
addElement(RColor newMember)
Adds an element to the cluster.
|
void |
drawMean(processing.core.PApplet parent,
float x,
float y,
float w,
float h)
Draws the mean color (colored rectangle with given parameters).
|
void |
drawMean(processing.core.PGraphics g,
float x,
float y,
float w,
float h)
Draws the mean color (colored rectangle with given parameters).
|
void |
drawMembers(processing.core.PApplet parent,
float x,
float y,
float w,
float h)
Draws the members of the cluster (colored horizontal stripes within a
rectangular area defined by the given parameters).
|
void |
drawMembers(processing.core.PGraphics g,
float x,
float y,
float w,
float h)
Draws the members of the cluster (colored horizontal stripes within a
rectangular area defined by the given parameters).
|
ColorDifferenceMeasure |
getColorDifferenceMeasure()
Returns the current ColorDifferenceMeasure.
|
java.util.ArrayList<RColor> |
getElements()
Returns all cluster members.
|
java.lang.Float |
getLoss()
Caculates the loss / error of the cluster.
|
RColor |
getMean()
Returns the current mean of the cluster.
|
RColor |
getRepresentative()
Finds and returns the representative of this cluster.
|
Cluster |
removeElement(java.lang.Object member)
Removes an element from the cluster (if the given element is a member).
|
ColorCluster |
removeElement(RColor member)
Removes an element from the cluster (if the given element is a member).
|
ColorCluster |
setColorDifferenceMeasure(ColorDifferenceMeasure m)
Sets a new ColorDifferenceMeasure.
|
int |
size()
Returns the number of cluster members.
|
boolean |
switchElement(java.lang.Object member,
Cluster newCluster)
The given element member switches to another cluster under certain
circumstances.
|
boolean |
switchElement(RColor member,
ColorCluster newCluster)
The given element member switches to another cluster under certain
circumstances.
|
ColorCluster |
updateMean()
Updates the mean value based on the current cluster members.
|
public ColorCluster(RColor mean)
mean - The mean value for this cluster.public ColorCluster(RColor mean, ColorDifferenceMeasure m)
mean - The mean value for this cluster.m - The ColorDifferenceMeasure.public ColorDifferenceMeasure getColorDifferenceMeasure()
public ColorCluster setColorDifferenceMeasure(ColorDifferenceMeasure m)
m - The new ColorDifferenceMeasure.public int size()
public Cluster addElement(java.lang.Object newMember)
ClusteraddElement in interface ClusternewMember - The new cluster member.public ColorCluster addElement(RColor newMember)
newMember - The new cluster member.public Cluster removeElement(java.lang.Object member)
ClusterremoveElement in interface Clustermember - The element which should be removed.public ColorCluster removeElement(RColor member)
member - The element which should be removed.public boolean switchElement(java.lang.Object member,
Cluster newCluster)
ClusterswitchElement in interface Clustermember - The element which might switch the cluster.newCluster - The cluster where the element might switch to.public boolean switchElement(RColor member, ColorCluster newCluster)
member - The element which might switch the cluster.newCluster - The cluster where the element might switch to.public ColorCluster updateMean()
ClusterupdateMean in interface Clusterpublic RColor getRepresentative()
public RColor getMean()
Clusterpublic java.util.ArrayList<RColor> getElements()
ClustergetElements in interface Clusterpublic java.lang.Float getLoss()
Clusterpublic void drawMean(processing.core.PGraphics g,
float x,
float y,
float w,
float h)
g - A recorder.x - The x-position (top left corner) of the rectangle.y - The y-position (top left corner) of the rectangle.w - The width of the rectangle.h - The height of the rectangle.public void drawMean(processing.core.PApplet parent,
float x,
float y,
float w,
float h)
parent - A recorder.x - The x-position (top left corner) of the rectangle.y - The y-position (top left corner) of the rectangle.w - The width of the rectangle.h - The height of the rectangle.public void drawMembers(processing.core.PApplet parent,
float x,
float y,
float w,
float h)
parent - A recorder.x - The x-position (top left corner) of the rectangle.y - The y-position (top left corner) of the rectangle.w - The width of the rectangle.h - The height of the rectangle.public void drawMembers(processing.core.PGraphics g,
float x,
float y,
float w,
float h)
g - A recorder.x - The x-position (top left corner) of the rectangle.y - The y-position (top left corner) of the rectangle.w - The width of the rectangle.h - The height of the rectangle.