|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.color.quantization.RGBColor
public class RGBColor
Encapsulates a single color from RGB (red, green, blue) color space plus a frequency counter. Each of the three RGB samples is of type int. Also stores a counter of type int.
Field Summary |
---|
Fields inherited from interface net.sourceforge.jiu.data.RGBIndex |
---|
INDEX_BLUE, INDEX_GREEN, INDEX_RED |
Constructor Summary | |
---|---|
RGBColor(int red,
int green,
int blue)
Creates an instance of this class and initializes it to the given intensity values. |
|
RGBColor(int red,
int green,
int blue,
int counter)
Creates an instance of this class and initializes it to the given intensity values. |
Method Summary | |
---|---|
int |
compareTo(RGBColor c,
int sortOrder)
Compares this color to the argument color, using the sortOrder argument (which is one of the three index values defined in RGBIndex . |
static double |
computeDistance(int r1,
int g1,
int b1,
int r2,
int g2,
int b2)
For two RGB triplets (r1, g1, b1) and (r2, g2, b2) this will return the distance between those colors in RGB color space. |
boolean |
equals(Object obj)
Compares this color with another instance of RGBColor and returns true if all intensity values are equal, false otherwise. |
int |
getCounter()
|
int |
getSample(int index)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RGBColor(int red, int green, int blue)
public RGBColor(int red, int green, int blue, int counter)
Method Detail |
---|
public int compareTo(RGBColor c, int sortOrder)
RGBIndex
.
That way, the two sample values for one component (e.g. red if sortOrder == INDEX_RED) are
compared.
c
- the color to which this color is comparedsortOrder
- the component used for the comparison
public static double computeDistance(int r1, int g1, int b1, int r2, int g2, int b2)
public boolean equals(Object obj)
equals
in class Object
public int getCounter()
public int getSample(int index)
public String toString()
toString
in class Object
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |