public class XYZColor extends ColorSpaceDescriptor
CIE XYZ color space (also known as CIE 1931 color space), created by the International Commission on Illumination (CIE) in 1931.
The human eye has receptors for short (S), middle (M), and long (L) wavelengths, also known as blue, green, and red receptors. That means that one, in principle, needs three parameters to describe a color sensation. A specific method for associating three numbers (or tristimulus values) with each color is called a color space, of which the CIE XYZ color space is one of many such spaces. However, the CIE XYZ color space is special, because it is based on direct measurements of the human eye, and serves as the basis from which many other color spaces are defined.
In the CIE XYZ color space, the tristimulus values are not the S, M, and L stimuli of the human eye, but rather a set of tristimulus values called X, Y, and Z, which are also roughly red, green and blue, respectively. Two light sources may be made up of different mixtures of various colors, and yet have the same color (metamerism). If two light sources have the same apparent color, then they will have the same tristimulus values, no matter what different mixtures of light were used to produce them.
Modifier and Type | Field and Description |
---|---|
double |
X
Tristimulus value of X.
|
double |
Y
Tristimulus value of Y.
|
double |
Z
Tristimulus value of Z.
|
Constructor and Description |
---|
XYZColor(CIEColor that)
Creates a new instance of XYZColor using the values in CIEColor.
|
XYZColor(double newX,
double newY,
double newZ)
Creates a new instance of XYZColor.
|
XYZColor(XYZColor that)
Copy constructor that creates a copied instance of the passed in
XYZColor.
|
Modifier and Type | Method and Description |
---|---|
double |
getColorDifference(XYZColor that)
Computes the color difference between two XYZColor objects.
|
static ColorSpaceValue[] |
getColorSpaceValues()
Returns an array of ColorSpaceValue objects, each of which can be
displayed in a widget (e.g.
|
double |
getLittleX()
Chromaticity coordinate x of the spectral stimuli.
|
double |
getLittleY()
Chromaticity coordinate y of the spectral stimuli.
|
double |
getLittleZ()
Chromaticity coordinate z of the spectral stimuli.
|
double |
getX()
Getter for the tristimulus value of X.
|
double |
getY()
Getter for the tristimulus value of Y.
|
double |
getZ()
Getter for the tristimulus value of Z.
|
void |
makeReference(CIEColor that) |
java.lang.String |
toString()
Returns a string representation of the object.
|
getAllColorSpaceDescriptors
public double X
public double Y
public double Z
public XYZColor(double newX, double newY, double newZ)
newX
- the new tristimulus value of X.newY
- the new tristimulus value of Y.newZ
- the new tristimulus value of Z.public XYZColor(XYZColor that)
that
- the XYZColor to copy.public XYZColor(CIEColor that)
that
- the CIEColor object holding the tristimulus values to create
the XYZColor space.public double getX()
public double getY()
public double getZ()
public double getColorDifference(XYZColor that)
that
- the XYZColor space object used to compute the color
difference.public double getLittleX()
public double getLittleY()
public double getLittleZ()
public void makeReference(CIEColor that)
public java.lang.String toString()
toString
in class java.lang.Object
public static ColorSpaceValue[] getColorSpaceValues()
NOTE: do not change the name of this method without checking thoroughly for references to it. Other code will need to find this method by name at run-time given only a Class, so simple refactoring won't catch all references.
Copyright 2004-2006 Ocean Optics, Inc. All Rights Reserved.