org.jhotdraw.color
Class PolarColorWheelImageProducer
java.lang.Object
java.awt.image.MemoryImageSource
org.jhotdraw.color.AbstractColorWheelImageProducer
org.jhotdraw.color.PolarColorWheelImageProducer
- All Implemented Interfaces:
- java.awt.image.ImageProducer
- Direct Known Subclasses:
- HSLHarmonicColorWheelImageProducer, HSVHarmonicColorWheelImageProducer
public class PolarColorWheelImageProducer
- extends AbstractColorWheelImageProducer
Produces the image of a JColorWheel
by interpreting two components
of a ColorSpace
as polar coordinates (angle and radius).
- Version:
- $Id: PolarColorWheelImageProducer.java 717 2010-11-21 12:30:57Z rawcoder $
- Author:
- Werner Randelshofer
Field Summary |
protected int[] |
alphas
Lookup table for alphas. |
protected float[] |
angulars
Lookup table for angular component values. |
protected float[] |
radials
Lookup table for radial component values. |
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 |
angulars
protected float[] angulars
- Lookup table for angular component values.
radials
protected float[] radials
- Lookup table for radial component values.
alphas
protected int[] alphas
- Lookup table for alphas.
The alpha value is used for antialiasing the
color wheel.
PolarColorWheelImageProducer
public PolarColorWheelImageProducer(java.awt.color.ColorSpace sys,
int w,
int h)
- Creates a new instance.
generateLookupTables
protected void generateLookupTables()
generateColorWheel
public void generateColorWheel()
- Specified by:
generateColorWheel
in class AbstractColorWheelImageProducer
getColorLocation
public java.awt.Point getColorLocation(java.awt.Color c)
- Overrides:
getColorLocation
in class AbstractColorWheelImageProducer
getColorLocation
public java.awt.Point getColorLocation(float[] components)
- Specified by:
getColorLocation
in class AbstractColorWheelImageProducer
getColorAt
public float[] getColorAt(int x,
int y)
- Specified by:
getColorAt
in class AbstractColorWheelImageProducer