j2d.color
Class WavelengthUtils

java.lang.Object
  extended by j2d.color.WavelengthUtils

public class WavelengthUtils
extends java.lang.Object

User: lyon Date: May 29, 2006 Time: 7:27:25 AM Copyright DocJava, Inc. 2005.


Constructor Summary
WavelengthUtils()
           
 
Method Summary
static double getBlue(double lambda)
          assume that the lambda is ranging from 400 to 800 nm, so don't bother with light below 110 nm.
static java.awt.Color getColor(int lambda)
           
static java.awt.Color[] getColors(int n)
          return an array that contains colors in the 400 to 800 nm band.
static double getGreen(double lambda)
           
static int[][] getLambdaMap(java.awt.Image img)
           
static java.awt.Image getRainbow(int w, int h)
           
static double getRed(double lambda)
           
static int getScaledColor(double d)
           
static FloatImageBean getYiqWavelengthMap()
          The Yiq wavelength map is a float image bean that contains a 400 wide line of Yiq coordinates.
static void main(java.lang.String[] args)
           
static void testGetBlue()
           
static void testGetColors()
           
static void testGetGreen()
           
static void testGetLambdaMap()
           
static void testGetRainbow()
           
static void testGetRed()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WavelengthUtils

public WavelengthUtils()
Method Detail

main

public static void main(java.lang.String[] args)

testGetLambdaMap

public static void testGetLambdaMap()

getLambdaMap

public static int[][] getLambdaMap(java.awt.Image img)

getYiqWavelengthMap

public static FloatImageBean getYiqWavelengthMap()
The Yiq wavelength map is a float image bean that contains a 400 wide line of Yiq coordinates. Each x coordinate cooresponds to a lambda = x + 400 nm.

Returns:
FloatImageBean used for lambda mapping

testGetRainbow

public static void testGetRainbow()

getRainbow

public static java.awt.Image getRainbow(int w,
                                        int h)

testGetColors

public static void testGetColors()

getColors

public static java.awt.Color[] getColors(int n)
return an array that contains colors in the 400 to 800 nm band.

Parameters:
n - number of colors
Returns:
colors that range from 0..255

getColor

public static java.awt.Color getColor(int lambda)

getScaledColor

public static int getScaledColor(double d)

testGetGreen

public static void testGetGreen()

testGetRed

public static void testGetRed()

testGetBlue

public static void testGetBlue()

getGreen

public static double getGreen(double lambda)
Parameters:
lambda - wavelength of light
Returns:
normalized PSD for green as a function of wavelength

getBlue

public static double getBlue(double lambda)
assume that the lambda is ranging from 400 to 800 nm, so don't bother with light below 110 nm.

Parameters:
lambda - wavelength of light
Returns:
normalized PSD for green as a function of wavelength

getRed

public static double getRed(double lambda)