|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Pixel
public class Pixel
The Pixel is the underlying data-structure in a Picture
.
Each Pixel represents a color, stored as separate integer values
for red, green and blue. Each value is between 0 and 255.
Collectively, these RGB (Red-Green-Blue) values form the color of
the Pixel.
Constructor Summary | |
---|---|
Pixel(int r,
int g,
int b)
Create a Pixel with the specified RGB values. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Determine if this Pixel is equal to another Object. |
int |
getBlue()
Returns the blue component of the Pixel. |
int[] |
getComponents()
Returns the RGB components of this Pixel as a 3-place int array. |
int |
getGreen()
Returns the green component of the Pixel. |
int |
getRed()
Returns the red component of the Pixel. |
void |
setBlue(int blue)
Set the blue component of the Pixel. |
void |
setGreen(int green)
Set the green component of the Pixel. |
void |
setRed(int red)
Set the red component of the Pixel. |
String |
toString()
Return the String representation of this Pixel as a triple (R, G, B). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pixel(int r, int g, int b)
r
- the red component of the Pixelg
- the green component of the Pixelb
- the blue component of the PixelMethod Detail |
---|
public int getRed()
public int getGreen()
public int getBlue()
public void setRed(int red)
red
- the new value of this Pixel's red component.public void setGreen(int green)
green
- the new value of this Pixel's green component.public void setBlue(int blue)
blue
- the new value of this Pixel's blue component.public int[] getComponents()
public String toString()
toString
in class Object
public boolean equals(Object other)
equals
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |