images
Class Pixel

java.lang.Object
  extended by images.Pixel

public class Pixel
extends java.lang.Object

This class represents a pixel that contains an RGB value.


Constructor Summary
Pixel(int i)
          LICENSE: This is open-source software released under the terms of the
GPL (http://www.gnu.org/licenses/gpl.html).

zz8 Creates a Pixel from an integer value.
Pixel(int r, int g, int b)
          Creates a Pixel from RGB values.
 
Method Summary
 Pixel clone()
          Returns a copy of the pixel.
 int getBlue()
          Returns the blue value of the pixel.
 int getGreen()
          Returns the green value of the pixel.
 int getRed()
          Returns the red value of the pixel.
 int getValue()
          Returns the integer value of the pixel.
 void setBlue(int b)
          Resets the pixel's blue value.
 void setGreen(int g)
          Resets the pixel's green value.
 void setRed(int r)
          Resets the pixel's red value.
 java.lang.String toString()
          Returns the string representation of the of the pixel.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pixel

public Pixel(int i)
LICENSE: This is open-source software released under the terms of the
GPL (http://www.gnu.org/licenses/gpl.html).

zz8 Creates a Pixel from an integer value.

Parameters:
i - the integer value

Pixel

public Pixel(int r,
             int g,
             int b)
Creates a Pixel from RGB values.

Parameters:
r - the red value
g - the green value
b - the blue value
Method Detail

getValue

public int getValue()
Returns the integer value of the pixel.

Returns:
the pixel's integer value

getRed

public int getRed()
Returns the red value of the pixel.

Returns:
the pixel's red value

getGreen

public int getGreen()
Returns the green value of the pixel.

Returns:
the pixel's green value

getBlue

public int getBlue()
Returns the blue value of the pixel.

Returns:
the pixel's blue value

setRed

public void setRed(int r)
Resets the pixel's red value.

Parameters:
r - the red value

setGreen

public void setGreen(int g)
Resets the pixel's green value.

Parameters:
g - the green value

setBlue

public void setBlue(int b)
Resets the pixel's blue value.

Parameters:
b - the blue value

clone

public Pixel clone()
Returns a copy of the pixel.

Overrides:
clone in class java.lang.Object
Returns:
Pixel representing a copy of this pixel

toString

public java.lang.String toString()
Returns the string representation of the of the pixel.

Overrides:
toString in class java.lang.Object
Returns:
a string containing the RGB values