|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectthreeD.raytracer.graphics.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).
| Constructor Summary | |
RGB()
Constructs an RGB object with all channels set to 0.0. |
|
RGB(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. |
java.lang.Object |
clone()
|
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. |
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(java.lang.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. |
RGB |
multiply(double value)
Returns the product of the RGB value represented by this RGB object and the specified double value as an RGB object. |
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. |
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. |
java.lang.String |
toString()
Returns a String representation of this RGB object. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RGB()
public RGB(double r,
double g,
double b)
| Method Detail |
public void setRed(double r)
public void setGreen(double g)
public void setBlue(double b)
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(java.lang.Object[] args)
ColorProducer
evaluate in interface ColorProducerargs - Arguments.
public boolean equals(RGB rgb)
public int hashCode()
public java.lang.Object clone()
public java.lang.String toString()
|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||