|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.j3d.util.graphics.RGB
public class RGB
An RGB object represents a color defined by three channels: red, green, and blue. An RGB object stores these channels as double values between 0.0 (no color) and 1.0 (strongest color).
| Field Summary | |
|---|---|
static long |
byteMask
|
static int |
defaultDepth
|
| Constructor Summary | |
|---|---|
RGB()
Constructs an RGB object with all channels set to 0.0. |
|
RGB(double nanom)
|
|
RGB(double r,
double g,
double b)
Constructs an RGB object with the specified red (r), green (g), and blue (b) channel values. |
|
RGB(int model)
Constructs an RGB object with all channels set to 0.0. |
|
RGB(int model,
double nanom)
|
|
RGB(int model,
double r,
double g,
double b)
Constructs an RGB object with the specified red (r), green (g), and blue (b) channel values. |
|
| Method Summary | |
|---|---|
RGB |
add(RGB rgb)
Returns the sum of the RGB value represented by this RGB object and that of the specified RGB object as an RGB object. |
void |
addTo(RGB rgb)
Adds the specified RGB object to this RGB object. |
Object |
clone()
|
static RGB |
decode(char[] data)
|
static RGB |
decode(char[] data,
int index)
|
RGB |
divide(double value)
Returns the quotient of the division of the RGB value represented by this RGB object as an RGB object. |
RGB |
divide(RGB rgb)
Returns the quotient of the division of the RGB value represented by this RGB object and that of the specified RGB object as an RGB object. |
void |
divideBy(double value)
Divides this RGB object by the specified value. |
void |
divideBy(RGB rgb)
Divides this RGB object by the specified RGB object. |
char[] |
encode()
|
boolean |
equals(RGB rgb)
Returns true if the color represented by this RGB object is the same as the color represented by the specified RGB object, false otherwise. |
RGB |
evaluate(Object[] args)
Produces a color using the specified arguments. |
double |
getBlue()
Returns the value of the blue channel of this RGB object as a double value. |
double |
getGreen()
Returns the value of the green channel of this RGB object as a double value. |
double |
getRed()
Returns the value of the red channel of this RGB object as a double value. |
int |
hashCode()
Returns an integer hash code for this RGB object. |
double |
length()
|
RGB |
multiply(double value)
|
RGB |
multiply(RGB rgb)
Returns the product of the RGB value represented by this RGB object and that of the specified RGB object as an RGB object. |
void |
multiplyBy(double value)
Multiplies this RGB object by the specified double value. |
void |
multiplyBy(RGB rgb)
Multiplies this RGB object by the specified RGB object. |
static RGB |
parseRGB(String s)
Parses a string representation of an RGB object of the format produced by the toString method. |
void |
readExternal(ObjectInput in)
|
void |
setBlue(double b)
Sets the value of the blue channel of this RGB object to the specified double value. |
void |
setGreen(double g)
Sets the value of the green channel of this RGB to the specified double value. |
void |
setRed(double r)
Sets the value of the red channel of this RGB object to the specified double value. |
RGB |
subtract(RGB rgb)
Returns the difference of the RGB value represented by this RGB object and that of the specified RGB object as an RGB object. |
void |
subtractFrom(RGB rgb)
Subtracts the specified RGB object from this RGB object. |
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long byteMask
public static int defaultDepth
| Constructor Detail |
|---|
public RGB()
public RGB(int model)
public RGB(double r,
double g,
double b)
public RGB(int model,
double r,
double g,
double b)
public RGB(double nanom)
public RGB(int model,
double nanom)
| Method Detail |
|---|
public void setRed(double r)
public void setGreen(double g)
public void setBlue(double b)
public double length()
public double getRed()
public double getGreen()
public double getBlue()
public RGB add(RGB rgb)
public void addTo(RGB rgb)
rgb - Value to add.public RGB subtract(RGB rgb)
public void subtractFrom(RGB rgb)
rgb - Value to subtract.public RGB multiply(double value)
public void multiplyBy(double value)
value - Value to multiply by.public RGB multiply(RGB rgb)
public void multiplyBy(RGB rgb)
rgb - Value to multiply by.public RGB divide(double value)
public void divideBy(double value)
value - Value to divide by.public RGB divide(RGB rgb)
public void divideBy(RGB rgb)
rgb - Value to divide by.public RGB evaluate(Object[] args)
ColorProducer
evaluate in interface ColorProducerargs - Arguments.
public boolean equals(RGB rgb)
public int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic static RGB parseRGB(String s)
s - String representation of RGB.
public char[] encode()
public static RGB decode(char[] data)
public static RGB decode(char[] data,
int index)
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOExceptionExternalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionExternalizable.readExternal(java.io.ObjectInput)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||