|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Color ui.recognizer.MonochromaticColor
public class MonochromaticColor
Represents the color of visible light for a given wavelenth between between 380 nm and 780 nm. Originally from a program by Dan Bruton at http://www.physics.sfasu.edu/astro/color/spectra.html
Field Summary | |
---|---|
static double |
BLUE_SENSITIVITY_DROP
|
static double |
MAXIMUM_INTENSITY
|
static double |
MAXIMUM_WAVELENGTH
|
static double |
MINIMUM_WAVELENGTH
|
static double |
RED_SENSITIVITY_DROP
|
static double |
TYPICAL_GAMMA
|
static double |
WAVELENGTH_BLUE
|
static double |
WAVELENGTH_CYAN
|
static double |
WAVELENGTH_GREEN
|
static double |
WAVELENGTH_RED
|
static double |
WAVELENGTH_YELLOW
|
Fields inherited from class java.awt.Color |
---|
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW |
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
MonochromaticColor(double aWavelength)
Construct a monochromatic color based on a wavelength between 380 nm and 780 nm |
|
MonochromaticColor(double aWavelength,
double intensity)
Construct a monochromatic color based on a wavelength between 380 nm and 780 nm and enhance the contrast using a gamma value. |
|
MonochromaticColor(double aWavelength,
double intensity,
double aGamma)
Construct a monochromatic color based on a wavelength between 380 nm and 780 nm and enhance the contrast using a gamma value. |
Method Summary | |
---|---|
static float[] |
getColorComponents(double aWavelength,
double intensity,
double aGamma)
Get a monochromatic color based on a wavelength between 380 nm and 780 nm and scale the brightness by an intensity parameter between zero and one. |
double |
getGamma()
Get the gamma, a number which can be used to enhance the contrast of darker colors. |
double |
getWavelength()
Get the wavelength in meters which this color represents. |
static void |
main(String[] args)
|
void |
setGamma(double aGamma)
Set the gamma, a number which can be used to enhance the contrast of darker colors. |
void |
setWavelength(double aWavelength)
Set the wavelength in meters, and change this color to the closest color match. |
void |
setWavelengthInAngtroms(double aWavelengthInAngtroms)
Set the wavelength in angstrom units and change this color to the closest color match. |
void |
setWavelengthInNanoMeters(double aWavelengthInNanoMeters)
Set the wavelength in nanometers and change this color to the closest color match. |
Methods inherited from class java.awt.Color |
---|
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double MINIMUM_WAVELENGTH
public static final double WAVELENGTH_BLUE
public static final double WAVELENGTH_CYAN
public static final double WAVELENGTH_GREEN
public static final double WAVELENGTH_YELLOW
public static final double WAVELENGTH_RED
public static final double MAXIMUM_WAVELENGTH
public static final double BLUE_SENSITIVITY_DROP
public static final double RED_SENSITIVITY_DROP
public static final double TYPICAL_GAMMA
public static final double MAXIMUM_INTENSITY
Constructor Detail |
---|
public MonochromaticColor(double aWavelength)
aWavelength
- the wavelength of the visible radiation in meterspublic MonochromaticColor(double aWavelength, double intensity)
aWavelength
- the wavelength of the visible radiation in metersintensity
- a number between 0 and 1.0 (MAXIMUM_INTENSITY) which is to multiply the colorpublic MonochromaticColor(double aWavelength, double intensity, double aGamma)
aWavelength
- the wavelength of the visible radiation in metersintensity
- a number between 0 and 1.0 (MAXIMUM_INTENSITY) which is to multiply the coloraGamma
- a number which can be used to enhance the contrast of darker colorsMethod Detail |
---|
public static float[] getColorComponents(double aWavelength, double intensity, double aGamma)
aWavelength
- the wavelength of the visible radiation in metersintensity
- a number between 0 and 1.0 which is to multiply the coloraGamma
- a number which can be used to enhance the contrast of darker colors
public static void main(String[] args)
public double getWavelength()
public void setWavelength(double aWavelength)
aWavelength
- a floating point number representing the wavelength in meterspublic void setWavelengthInNanoMeters(double aWavelengthInNanoMeters)
aWavelengthInNanoMeters
- a floating point number representing the wavelength in meterspublic void setWavelengthInAngtroms(double aWavelengthInAngtroms)
aWavelengthInAngtroms
- a floating point number representing the wavelength in meterspublic void setGamma(double aGamma)
aGamma
- a number representing the gamma of the colorpublic double getGamma()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |