JHotDraw 7.4.1

org.jhotdraw.color
Class ColorWheelImageProducer

java.lang.Object
  extended by java.awt.image.MemoryImageSource
      extended by org.jhotdraw.color.ColorWheelImageProducer
All Implemented Interfaces:
java.awt.image.ImageProducer
Direct Known Subclasses:
HSLHarmonicColorWheelImageProducer, HSVHarmonicColorWheelImageProducer

public class ColorWheelImageProducer
extends java.awt.image.MemoryImageSource

Produces the image of a ColorWheel.

Version:
$Id: ColorWheelImageProducer.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer
See Also:
JColorWheel

Field Summary
protected  int[] alphas
          Lookup table for alphas.
protected  int angularIndex
           
protected  float[] angulars
          Lookup table for angular component values.
protected  ColorSystem colorSystem
           
protected  int h
           
protected  boolean isLookupValid
           
protected  boolean isPixelsValid
           
protected  int[] pixels
           
protected  int radialIndex
           
protected  float[] radials
          Lookup table for radial component values.
protected  int verticalIndex
           
protected  float verticalValue
           
protected  int w
           
 
Constructor Summary
ColorWheelImageProducer(ColorSystem sys, int w, int h)
          Creates a new instance.
 
Method Summary
 void generateColorWheel()
           
protected  void generateLookupTables()
           
protected  float[] getColorAt(int x, int y, int width, int height)
           
protected  java.awt.Point getColorLocation(java.awt.Color c, int width, int height)
           
protected  java.awt.Point getColorLocation(CompositeColor c, int width, int height)
           
protected  java.awt.Point getColorLocation(float[] components, int width, int height)
           
protected  java.awt.Point getColorLocation(float hue, float saturation, float brightness, int width, int height)
           
 int getRadius()
           
 boolean needsGeneration()
           
 void regenerateColorWheel()
           
 void setAngularComponentIndex(int newValue)
           
 void setRadialComponentIndex(int newValue)
           
 void setVerticalComponentIndex(int newValue)
           
 void setVerticalValue(float newValue)
           
 
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
 

Field Detail

pixels

protected int[] pixels

w

protected int w

h

protected int h

verticalValue

protected float verticalValue

isLookupValid

protected boolean isLookupValid

isPixelsValid

protected boolean isPixelsValid

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.


colorSystem

protected ColorSystem colorSystem

radialIndex

protected int radialIndex

angularIndex

protected int angularIndex

verticalIndex

protected int verticalIndex
Constructor Detail

ColorWheelImageProducer

public ColorWheelImageProducer(ColorSystem sys,
                               int w,
                               int h)
Creates a new instance.

Method Detail

getRadius

public int getRadius()

setRadialComponentIndex

public void setRadialComponentIndex(int newValue)

setAngularComponentIndex

public void setAngularComponentIndex(int newValue)

setVerticalComponentIndex

public void setVerticalComponentIndex(int newValue)

generateLookupTables

protected void generateLookupTables()

setVerticalValue

public void setVerticalValue(float newValue)

needsGeneration

public boolean needsGeneration()

regenerateColorWheel

public void regenerateColorWheel()

generateColorWheel

public void generateColorWheel()

getColorLocation

protected java.awt.Point getColorLocation(java.awt.Color c,
                                          int width,
                                          int height)

getColorLocation

protected java.awt.Point getColorLocation(float hue,
                                          float saturation,
                                          float brightness,
                                          int width,
                                          int height)

getColorLocation

protected java.awt.Point getColorLocation(CompositeColor c,
                                          int width,
                                          int height)

getColorLocation

protected java.awt.Point getColorLocation(float[] components,
                                          int width,
                                          int height)

getColorAt

protected float[] getColorAt(int x,
                             int y,
                             int width,
                             int height)

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.