ij2x.plugin.color
Class AbstractColorWheel

java.lang.Object
  extended by java.awt.image.MemoryImageSource
      extended by ij2x.plugin.color.AbstractColorWheel
All Implemented Interfaces:
java.awt.image.ImageProducer
Direct Known Subclasses:
ColorWheelPolar

public abstract class AbstractColorWheel
extends java.awt.image.MemoryImageSource

Title:

Description:

Copyright: Copyright (c) 2011

Company:


Field Summary
protected  int angularIndex
           
protected  java.awt.color.ColorSpace colorSpace
           
protected  int h
           
protected  boolean isLookupValid
           
protected  boolean isPixelsValid
           
protected  int[] pixels
           
protected  int radialIndex
           
protected  int verticalIndex
           
protected  float verticalValue
           
protected  int w
           
 
Constructor Summary
AbstractColorWheel(java.awt.color.ColorSpace sys, int[] pixels, int w, int h)
           
AbstractColorWheel(java.awt.color.ColorSpace sys, int w, int h)
           
 
Method Summary
static float[] fromColor(java.awt.color.ColorSpace colorSpace, java.awt.Color c)
          Returns the color components in the specified color space from a Color object.
static float[] fromRGB(java.awt.color.ColorSpace colorSpace, int rgb)
          Returns the color components in the specified color space from an rgb value.
static float[] fromRGB(java.awt.color.ColorSpace colorSpace, int r, int g, int b)
          Returns the color components in the specified color space from RGB values.
protected abstract  void generateColorWheel()
           
abstract  float[] getColorAt(int x, int y)
           
 java.awt.Point getColorLocation(java.awt.Color c)
           
abstract  java.awt.Point getColorLocation(float[] components)
           
 int getRadius()
           
static boolean isEqual(java.awt.color.ColorSpace a, java.awt.color.ColorSpace b)
          Returns true, if the two color spaces are equal.
 boolean needsGeneration()
           
 void regenerateColorWheel()
           
 void setAngularComponentIndex(int newValue)
           
 void setRadialComponentIndex(int newValue)
           
 void setVerticalComponentIndex(int newValue)
           
 void setVerticalValue(float newValue)
           
static int toRGB(java.awt.color.ColorSpace colorSpace, float... components)
          Returns an rgb value from color components in the specified color space.
 
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

colorSpace

protected java.awt.color.ColorSpace colorSpace

radialIndex

protected int radialIndex

angularIndex

protected int angularIndex

verticalIndex

protected int verticalIndex

isPixelsValid

protected boolean isPixelsValid

verticalValue

protected float verticalValue

isLookupValid

protected boolean isLookupValid
Constructor Detail

AbstractColorWheel

public AbstractColorWheel(java.awt.color.ColorSpace sys,
                          int w,
                          int h)

AbstractColorWheel

public AbstractColorWheel(java.awt.color.ColorSpace sys,
                          int[] pixels,
                          int w,
                          int h)
Method Detail

setRadialComponentIndex

public void setRadialComponentIndex(int newValue)

setAngularComponentIndex

public void setAngularComponentIndex(int newValue)

setVerticalComponentIndex

public void setVerticalComponentIndex(int newValue)

setVerticalValue

public void setVerticalValue(float newValue)

needsGeneration

public boolean needsGeneration()

regenerateColorWheel

public void regenerateColorWheel()

getRadius

public int getRadius()

generateColorWheel

protected abstract void generateColorWheel()

getColorLocation

public java.awt.Point getColorLocation(java.awt.Color c)

getColorLocation

public abstract java.awt.Point getColorLocation(float[] components)

getColorAt

public abstract float[] getColorAt(int x,
                                   int y)

fromColor

public static float[] fromColor(java.awt.color.ColorSpace colorSpace,
                                java.awt.Color c)
Returns the color components in the specified color space from a Color object.


isEqual

public static boolean isEqual(java.awt.color.ColorSpace a,
                              java.awt.color.ColorSpace b)
Returns true, if the two color spaces are equal.


fromRGB

public static float[] fromRGB(java.awt.color.ColorSpace colorSpace,
                              int rgb)
Returns the color components in the specified color space from an rgb value.


fromRGB

public static float[] fromRGB(java.awt.color.ColorSpace colorSpace,
                              int r,
                              int g,
                              int b)
Returns the color components in the specified color space from RGB values.


toRGB

public static int toRGB(java.awt.color.ColorSpace colorSpace,
                        float... components)
Returns an rgb value from color components in the specified color space.