|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.color.RGB
public class RGB
Class RGB provides a color represented as floating point red, green, and blue components.
Class RGB includes methods for packing and unpacking a floating point RGB color object into and from an integer. The packed color representation uses 8 bits for each component, with the red component in bits 23-16, the green component in bits 15-8, and the blue component in bits 7-0.
| Field Summary | |
|---|---|
float |
blue
The blue component in the range 0.0 through 1.0. |
float |
green
The green component in the range 0.0 through 1.0. |
float |
red
The red component in the range 0.0 through 1.0. |
| Constructor Summary | |
|---|---|
RGB()
Construct a new floating point RGB color. |
|
RGB(float red,
float green,
float blue)
Construct a new floating point RGB color with the given red, green, and blue components. |
|
RGB(int color)
Construct a new floating point RGB color from the given packed color. |
|
| Method Summary | |
|---|---|
int |
pack()
Pack this floating point RGB color into a packed color. |
static int |
pack(float red,
float green,
float blue)
Pack the given red, green, and blue components into a packed color. |
void |
unpack(int color)
Unpack this floating point RGB color from a packed color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float red
public float green
public float blue
| Constructor Detail |
|---|
public RGB()
public RGB(float red,
float green,
float blue)
red - Red component.green - Green component.blue - Blue component.public RGB(int color)
color - Packed color.| Method Detail |
|---|
public int pack()
public static int pack(float red,
float green,
float blue)
red - Red component.green - Green component.blue - Blue component.
public void unpack(int color)
color - Packed color.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||