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
-
amax
- Bounding box for the slice
-
amin
- Bounding box for the slice
-
bmax
- Bounding box for the slice
-
bmin
- Bounding box for the slice
-
image
- Image of the slice.
-
pix
- Pixel array used for image computaion.
-
scheduler
- Scheduler used to improve response time.
-
xyz
- Prec
protected float frac; // = (L + 16) / 116
/**
RGB-XYZ-LAB converter.
-
CompLABCanvas(XYZSet)
- Constructs the LAB drawing canvas.
-
computeImage()
- This method computes the image of the LAB slice.
-
doJob()
- This method implements the Job interface.
-
drawCross(Graphics, float, float)
- Draws the current (a,b) position marker.
-
getBoundingBox()
- Computes the bounding box for the image to improve performance.
-
minimumSize()
- Overrides the default minimumSize() method.
-
paint(Graphics)
- The paint method.
-
preferredSize()
- Overrides the default preferredSize() method.
-
update()
- Self-update method.
-
update(Graphics)
- Overrides the default update(Graphics) method
in order not to clear screen to avoid flicker.
image
Image image
- Image of the slice.
pix
int pix[]
- Pixel array used for image computaion.
xyz
XYZSet xyz
- Prec
protected float frac; // = (L + 16) / 116
/**
RGB-XYZ-LAB converter.
amin
protected int amin
- Bounding box for the slice
amax
protected int amax
- Bounding box for the slice
bmin
protected int bmin
- Bounding box for the slice
bmax
protected int bmax
- Bounding box for the slice
scheduler
Scheduler scheduler
- Scheduler used to improve response time.
CompLABCanvas
public CompLABCanvas(XYZSet xyz)
- Constructs the LAB drawing canvas.
- Parameters:
- xyz - RGB-XYZ-LAB converter.
- See Also:
- Scheduler
update
public void update()
- Self-update method. It is called when the component has
to be updated. Invoked by the job scheduler.
doJob
public void doJob()
- This method implements the Job interface.
Called by Scheduler.
- See Also:
- Job
getBoundingBox
protected void getBoundingBox()
- Computes the bounding box for the image to improve performance.
Image is guaranteed to be within it.
computeImage
void computeImage()
- This method computes the image of the LAB slice.
minimumSize
public Dimension minimumSize()
- Overrides the default minimumSize() method.
- Returns:
- new Dimension
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Overrides the default preferredSize() method.
- Returns:
- new Dimension
- Overrides:
- preferredSize in class Component
paint
public void paint(Graphics g)
- The paint method.
- Overrides:
- paint in class Canvas
drawCross
public void drawCross(Graphics g,
float a,
float b)
- Draws the current (a,b) position marker.
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