JHotDraw 7rev733

org.jhotdraw.color
Class Specrend

java.lang.Object
  extended by org.jhotdraw.color.Specrend

public class Specrend
extends java.lang.Object

Color rendering of spectra, based on specrend by John Walker.

Version:
1.0 2011-02-25 Created.
Author:
Werner Randelshofer

Nested Class Summary
static class Specrend.ColourSystem
          A colour system is defined by the CIE x and y coordinates of its three primary illuminants and the x and y coordinates of the white point.
static interface Specrend.SpecIntens
          Interface for the spectral intensity function used by spectrum_to_xyz.
 
Field Summary
static Specrend.ColourSystem CIEsystem
           
static Specrend.ColourSystem EBUsystem
           
static Specrend.ColourSystem HDTVsystem
           
static Specrend.ColourSystem NTSCsystem
           
static Specrend.ColourSystem Rec709system
           
static Specrend.ColourSystem SMPTEsystem
           
 
Constructor Summary
Specrend()
           
 
Method Summary
static double bb_spectrum(double wavelength, double bbTemp)
           
static void bb_to_xyz(double bbTemp, double[] xyz)
          Returns the XYZ color for a black body of temperature bbTemp.
static boolean constrain_rgb(double[] rgb)
           
static void gamma_correct_rgb(Specrend.ColourSystem cs, double[] r, double[] g, double[] b)
           
static void gamma_correct(Specrend.ColourSystem cs, double[] c)
           
static boolean inside_gamut(double[] rgb)
           
static void main(java.lang.String[] args)
          Built-in test program which displays the x, y, and Z and RGB values for black body spectra from 1000 to 10000 degrees kelvin.
static void norm_rgb(double[] rgb)
           
static void spectrum_to_xyz(Specrend.SpecIntens spec_intens, double[] xyz)
           
 void upvp_to_xy(double up, double vp, double[] xyc)
           
 void xy_to_upvp(double xc, double yc, double[] upvp)
           
static void xyz_to_rgb(Specrend.ColourSystem cs, double[] xyzc, double[] rgb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NTSCsystem

public static final Specrend.ColourSystem NTSCsystem

EBUsystem

public static final Specrend.ColourSystem EBUsystem

SMPTEsystem

public static final Specrend.ColourSystem SMPTEsystem

HDTVsystem

public static final Specrend.ColourSystem HDTVsystem

CIEsystem

public static final Specrend.ColourSystem CIEsystem

Rec709system

public static final Specrend.ColourSystem Rec709system
Constructor Detail

Specrend

public Specrend()
Method Detail

upvp_to_xy

public void upvp_to_xy(double up,
                       double vp,
                       double[] xyc)

xy_to_upvp

public void xy_to_upvp(double xc,
                       double yc,
                       double[] upvp)

xyz_to_rgb

public static void xyz_to_rgb(Specrend.ColourSystem cs,
                              double[] xyzc,
                              double[] rgb)

inside_gamut

public static boolean inside_gamut(double[] rgb)

constrain_rgb

public static boolean constrain_rgb(double[] rgb)

gamma_correct

public static void gamma_correct(Specrend.ColourSystem cs,
                                 double[] c)

gamma_correct_rgb

public static void gamma_correct_rgb(Specrend.ColourSystem cs,
                                     double[] r,
                                     double[] g,
                                     double[] b)

norm_rgb

public static void norm_rgb(double[] rgb)

spectrum_to_xyz

public static void spectrum_to_xyz(Specrend.SpecIntens spec_intens,
                                   double[] xyz)

bb_spectrum

public static double bb_spectrum(double wavelength,
                                 double bbTemp)

bb_to_xyz

public static void bb_to_xyz(double bbTemp,
                             double[] xyz)
Returns the XYZ color for a black body of temperature bbTemp.

Parameters:
bbTemp - The temperature of the black body in kelvin.

main

public static void main(java.lang.String[] args)
Built-in test program which displays the x, y, and Z and RGB values for black body spectra from 1000 to 10000 degrees kelvin. When run, this program should produce the following output: Temperature x y z R G B ----------- ------ ------ ------ ----- ----- ----- 1000 K 0.6528 0.3444 0.0028 1.000 0.007 0.000 (Approximation) 1500 K 0.5857 0.3931 0.0212 1.000 0.126 0.000 (Approximation) 2000 K 0.5267 0.4133 0.0600 1.000 0.234 0.010 2500 K 0.4770 0.4137 0.1093 1.000 0.349 0.067 3000 K 0.4369 0.4041 0.1590 1.000 0.454 0.151 3500 K 0.4053 0.3907 0.2040 1.000 0.549 0.254 4000 K 0.3805 0.3768 0.2428 1.000 0.635 0.370 4500 K 0.3608 0.3636 0.2756 1.000 0.710 0.493 5000 K 0.3451 0.3516 0.3032 1.000 0.778 0.620 5500 K 0.3325 0.3411 0.3265 1.000 0.837 0.746 6000 K 0.3221 0.3318 0.3461 1.000 0.890 0.869 6500 K 0.3135 0.3237 0.3628 1.000 0.937 0.988 7000 K 0.3064 0.3166 0.3770 0.907 0.888 1.000 7500 K 0.3004 0.3103 0.3893 0.827 0.839 1.000 8000 K 0.2952 0.3048 0.4000 0.762 0.800 1.000 8500 K 0.2908 0.3000 0.4093 0.711 0.766 1.000 9000 K 0.2869 0.2956 0.4174 0.668 0.738 1.000 9500 K 0.2836 0.2918 0.4246 0.632 0.714 1.000 10000 K 0.2807 0.2884 0.4310 0.602 0.693 1.000


Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.