org.jhotdraw.color
Class CIEXYChromaticityDiagramImageProducer
java.lang.Object
java.awt.image.MemoryImageSource
org.jhotdraw.color.CIEXYChromaticityDiagramImageProducer
- All Implemented Interfaces:
- java.awt.image.ImageProducer
public class CIEXYChromaticityDiagramImageProducer
- extends java.awt.image.MemoryImageSource
Produces a CIE xy Chromaticity Diagram.
The diagram shows a projection of the CIE XYZ cube on a xy plane.
The projection is based on the following equations:
x = X / (X + Y + Z), y = Y / (X + Y + Z), z = 1 - x - y.
The equations can be rewritten as:
X = (x*(Y+Z)/(1-x), Y = (y*(X+Z)/(1-y).
- Version:
- $Id: CIEXYChromaticityDiagramImageProducer.java 717 2010-11-21 12:30:57Z rawcoder $
- Author:
- Werner Randelshofer
Methods inherited from class java.awt.image.MemoryImageSource |
addConsumer, isConsumer, newPixels, newPixels, newPixels, newPixels, newPixels, removeConsumer, requestTopDownLeftRightResend, setAnimated, setFullBufferUpdates, startProduction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pixels
protected int[] pixels
w
protected int w
h
protected int h
colorSpace
protected java.awt.color.ColorSpace colorSpace
radialIndex
protected int radialIndex
angularIndex
protected int angularIndex
verticalIndex
protected int verticalIndex
isPixelsValid
protected boolean isPixelsValid
verticalValue
protected float verticalValue
isLookupValid
protected boolean isLookupValid
CIEXYChromaticityDiagramImageProducer
public CIEXYChromaticityDiagramImageProducer(int w,
int h)
needsGeneration
public boolean needsGeneration()
regenerateDiagram
public void regenerateDiagram()
generateImage
public void generateImage()
getColorLocation
@Nullable
public java.awt.Point getColorLocation(java.awt.Color c)
getColorLocation
@Nullable
public java.awt.Point getColorLocation(float[] components)
getColorAt
@Nullable
public float[] getColorAt(int x,
int y)
getWidth
public int getWidth()
getHeight
public int getHeight()
toRGB
public void toRGB(float[] ciexyz,
float[] rgb)