Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua.colorchooser
Class ColorWheelImageProducer

java.lang.Object
  extended by java.awt.image.MemoryImageSource
      extended by ch.randelshofer.quaqua.colorchooser.ColorWheelImageProducer
All Implemented Interfaces:
java.awt.image.ImageProducer

public class ColorWheelImageProducer
extends java.awt.image.MemoryImageSource

Produces the image of a ColorWheel.

Version:
$Id: ColorWheelImageProducer.java 363 2010-11-21 17:41:04Z wrandelshofer $
Author:
Werner Randelshofer

Field Summary
protected  int[] alphas
          Lookup table for alphas.
protected  float brightness
           
protected  int h
           
protected  float[] hues
          Lookup table for hues.
protected  boolean isDirty
           
protected  int[] pixels
           
protected  float[] saturations
          Lookup table for saturations.
protected  int w
           
 
Constructor Summary
ColorWheelImageProducer(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(float hue, float saturation, float brightness, int width, int height)
           
 int getRadius()
           
 boolean needsGeneration()
           
 void regenerateColorWheel()
           
 void setBrightness(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

brightness

protected float brightness

isDirty

protected boolean isDirty

hues

protected float[] hues
Lookup table for hues.


saturations

protected float[] saturations
Lookup table for saturations.


alphas

protected int[] alphas
Lookup table for alphas. The alpha value is used for antialiasing the color wheel.

Constructor Detail

ColorWheelImageProducer

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

Method Detail

getRadius

public int getRadius()

generateLookupTables

protected void generateLookupTables()

setBrightness

public void setBrightness(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)

getColorAt

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

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.