Class ChromaCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ChromaCanvas

class ChromaCanvas
extends Canvas
This class produces a Canvas that holds the chromaticity diagram.


Variable Index

 o arr
array of computed pixels.
 o gamutCnt
Count of gamut vertices
 o gamutPoint
Array of (three) color gamut vertices
 o HEIGHT
Height of chromaticity diagram
 o WIDTH
Width of chromaticity diagram

Constructor Index

 o ChromaCanvas(ImgTest)
Constructs a Canvas that holds the chromaticity diagram.

Method Index

 o drawAxes(Graphics)
Draw the axes of the chromaticity diagram.
 o drawCursor(Graphics)
Draws the current color marker in current graphics context.
 o drawGamut(Graphics)
Draws the gamut triangle in current graphics context.
 o drawWavelengths(Graphics)
Draws the wavelengths along the spectral locus.
 o mouseDown(Event, int, int)
Processes mouse click event on the chromaticity diagram canvas.
 o paint(Graphics)
Draws the image, axes, wavelengths, gamut and marker.
 o pointColor(Point)
Gets color of a point.
 o update(Graphics)
Overrides the default update(Graphics) method to draw current color marker.

Variables

 o arr
 int arr[][]
array of computed pixels.

 o WIDTH
 public static final int WIDTH
Width of chromaticity diagram

 o HEIGHT
 public static final int HEIGHT
Height of chromaticity diagram

 o gamutPoint
 Point gamutPoint[]
Array of (three) color gamut vertices

 o gamutCnt
 int gamutCnt
Count of gamut vertices

Constructors

 o ChromaCanvas
 public ChromaCanvas(ImgTest imgTest)
Constructs a Canvas that holds the chromaticity diagram.

Parameters:
imgTest - reference to the parent applet.

Methods

 o pointColor
 public Color pointColor(Point p)
Gets color of a point.

Parameters:
p - point coordinates.
Returns:
point's color
 o mouseDown
 public boolean mouseDown(Event e,
                          int x,
                          int y)
Processes mouse click event on the chromaticity diagram canvas. Handles selection of gamut vertices. Overrides the default mouseDown() method.

Overrides:
mouseDown in class Component
 o drawGamut
 void drawGamut(Graphics g)
Draws the gamut triangle in current graphics context.

 o drawCursor
 void drawCursor(Graphics g)
Draws the current color marker in current graphics context.

 o update
 public void update(Graphics g)
Overrides the default update(Graphics) method to draw current color marker.

Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Draws the image, axes, wavelengths, gamut and marker.

Overrides:
paint in class Canvas
 o drawAxes
 void drawAxes(Graphics g)
Draw the axes of the chromaticity diagram.

 o drawWavelengths
 void drawWavelengths(Graphics g)
Draws the wavelengths along the spectral locus.