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.
-
arr
- array of computed pixels.
-
gamutCnt
- Count of gamut vertices
-
gamutPoint
- Array of (three) color gamut vertices
-
HEIGHT
- Height of chromaticity diagram
-
WIDTH
- Width of chromaticity diagram
-
ChromaCanvas(ImgTest)
- Constructs a Canvas that holds the chromaticity diagram.
-
drawAxes(Graphics)
- Draw the axes of the chromaticity diagram.
-
drawCursor(Graphics)
- Draws the current color marker in current graphics context.
-
drawGamut(Graphics)
- Draws the gamut triangle in current graphics context.
-
drawWavelengths(Graphics)
- Draws the wavelengths along the spectral locus.
-
mouseDown(Event, int, int)
- Processes mouse click event on the chromaticity diagram canvas.
-
paint(Graphics)
- Draws the image, axes, wavelengths, gamut and marker.
-
pointColor(Point)
- Gets color of a point.
-
update(Graphics)
- Overrides the default update(Graphics) method to draw
current color marker.
arr
int arr[][]
- array of computed pixels.
WIDTH
public static final int WIDTH
- Width of chromaticity diagram
HEIGHT
public static final int HEIGHT
- Height of chromaticity diagram
gamutPoint
Point gamutPoint[]
- Array of (three) color gamut vertices
gamutCnt
int gamutCnt
- Count of gamut vertices
ChromaCanvas
public ChromaCanvas(ImgTest imgTest)
- Constructs a Canvas that holds the chromaticity diagram.
- Parameters:
- imgTest - reference to the parent applet.
pointColor
public Color pointColor(Point p)
- Gets color of a point.
- Parameters:
- p - point coordinates.
- Returns:
- point's color
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
drawGamut
void drawGamut(Graphics g)
- Draws the gamut triangle in current graphics context.
drawCursor
void drawCursor(Graphics g)
- Draws the current color marker in current graphics context.
update
public void update(Graphics g)
- Overrides the default update(Graphics) method to draw
current color marker.
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Draws the image, axes, wavelengths, gamut and marker.
- Overrides:
- paint in class Canvas
drawAxes
void drawAxes(Graphics g)
- Draw the axes of the chromaticity diagram.
drawWavelengths
void drawWavelengths(Graphics g)
- Draws the wavelengths along the spectral locus.