Class PictureColor

java.lang.Object
  extended byPictureColor

public class PictureColor
extends java.lang.Object

PictureColor - A color of a picture element (pixel)

Author:
Ben Bederson, Bill Pugh Copyright (C) 2003 University of Maryland
See Also:
Picture, Image, PictureUtil

Field Summary
static PictureColor BLACK
           
static PictureColor BLUE
           
static PictureColor CYAN
           
static PictureColor GRAY
           
static PictureColor GREEN
           
static PictureColor MAGENTA
           
static PictureColor RED
           
static PictureColor WHITE
           
static PictureColor YELLOW
           
 
Constructor Summary
PictureColor(double red, double green, double blue)
          Construct a new color from red, green and blue components each in the range [0.0 - 1.0]
PictureColor(int rgb)
          Primarily for internal use.
 
Method Summary
 double getBlue()
          Determines the blue color component of this pixel.
 double getGreen()
          Determines the green color component of this pixel.
 double getRed()
          Determines the red color component of this pixel.
 int getRGB()
          Primarily for internal use.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WHITE

public static PictureColor WHITE

BLACK

public static PictureColor BLACK

RED

public static PictureColor RED

BLUE

public static PictureColor BLUE

GREEN

public static PictureColor GREEN

YELLOW

public static PictureColor YELLOW

CYAN

public static PictureColor CYAN

MAGENTA

public static PictureColor MAGENTA

GRAY

public static PictureColor GRAY
Constructor Detail

PictureColor

public PictureColor(double red,
                    double green,
                    double blue)
Construct a new color from red, green and blue components each in the range [0.0 - 1.0]


PictureColor

public PictureColor(int rgb)
Primarily for internal use. Constructs a new color from a packed rgb representation of red, green and blue.

Method Detail

getRGB

public int getRGB()
Primarily for internal use. Returns the color in packed rgb format.

Returns:
rgb

getRed

public double getRed()
Determines the red color component of this pixel.

Returns:
The red color component of this pixel in the range [0.0 - 1.0] (from black to red)

getGreen

public double getGreen()
Determines the green color component of this pixel.

Returns:
The green color component of this pixel in the range [0.0 - 1.0] (from black to green)

getBlue

public double getBlue()
Determines the blue color component of this pixel.

Returns:
The blue color component of this pixel in the range [0.0 - 1.0] (from black to blue)

toString

public java.lang.String toString()