Class CompLABCanvas

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

public class CompLABCanvas
extends Canvas
implements Job
This class draws a slice of the LAB color space on a canvas.

See Also:
Job, Scheduler, XYZSet

Variable Index

 o amax
Bounding box for the slice
 o amin
Bounding box for the slice
 o bmax
Bounding box for the slice
 o bmin
Bounding box for the slice
 o image
Image of the slice.
 o pix
Pixel array used for image computaion.
 o scheduler
Scheduler used to improve response time.
 o xyz
Prec protected float frac; // = (L + 16) / 116 /** RGB-XYZ-LAB converter.

Constructor Index

 o CompLABCanvas(XYZSet)
Constructs the LAB drawing canvas.

Method Index

 o computeImage()
This method computes the image of the LAB slice.
 o doJob()
This method implements the Job interface.
 o drawCross(Graphics, float, float)
Draws the current (a,b) position marker.
 o getBoundingBox()
Computes the bounding box for the image to improve performance.
 o minimumSize()
Overrides the default minimumSize() method.
 o paint(Graphics)
The paint method.
 o preferredSize()
Overrides the default preferredSize() method.
 o update()
Self-update method.
 o update(Graphics)
Overrides the default update(Graphics) method in order not to clear screen to avoid flicker.

Variables

 o image
 Image image
Image of the slice.

 o pix
 int pix[]
Pixel array used for image computaion.

 o xyz
 XYZSet xyz
Prec protected float frac; // = (L + 16) / 116 /** RGB-XYZ-LAB converter.

 o amin
 protected int amin
Bounding box for the slice

 o amax
 protected int amax
Bounding box for the slice

 o bmin
 protected int bmin
Bounding box for the slice

 o bmax
 protected int bmax
Bounding box for the slice

 o scheduler
 Scheduler scheduler
Scheduler used to improve response time.

Constructors

 o CompLABCanvas
 public CompLABCanvas(XYZSet xyz)
Constructs the LAB drawing canvas.

Parameters:
xyz - RGB-XYZ-LAB converter.
See Also:
Scheduler

Methods

 o update
 public void update()
Self-update method. It is called when the component has to be updated. Invoked by the job scheduler.

 o doJob
 public void doJob()
This method implements the Job interface. Called by Scheduler.

See Also:
Job
 o getBoundingBox
 protected void getBoundingBox()
Computes the bounding box for the image to improve performance. Image is guaranteed to be within it.

 o computeImage
 void computeImage()
This method computes the image of the LAB slice.

 o minimumSize
 public Dimension minimumSize()
Overrides the default minimumSize() method.

Returns:
new Dimension
Overrides:
minimumSize in class Component
 o preferredSize
 public Dimension preferredSize()
Overrides the default preferredSize() method.

Returns:
new Dimension
Overrides:
preferredSize in class Component
 o paint
 public void paint(Graphics g)
The paint method.

Overrides:
paint in class Canvas
 o drawCross
 public void drawCross(Graphics g,
                       float a,
                       float b)
Draws the current (a,b) position marker.

 o update
 public void update(Graphics g)
Overrides the default update(Graphics) method in order not to clear screen to avoid flicker.

Overrides:
update in class Component