edu.berkeley.guir.papier_mache.vision
Class ColorRange

java.lang.Object
  extended by edu.berkeley.guir.papier_mache.vision.ColorRange
All Implemented Interfaces:
edu.berkeley.guir.lib.util.ToShortStringable

public class ColorRange
extends java.lang.Object
implements edu.berkeley.guir.lib.util.ToShortStringable

Represents a range of colors. Internally uses the IHS color space. Also provides methods for handling colors in RGB.

Author:
Ana Ramirez ( anar(AT)cs.berkeley.edu ), Scott Klemmer ( srk(AT)cs.berkeley.edu )

Constructor Summary
ColorRange(java.awt.Color rgbColor)
          Creates a new ColorRange with the specified color and default tolerance values.
ColorRange(IHSColor ihsColor, float intensityTol, float hueTol, float saturationTol)
          Creates a new ColorRange with the specified color and tolerance values.
 
Method Summary
static javax.swing.Icon createIcon(java.awt.Color color)
           
 IHSColor getIHSColor()
           
 float[] getIHSTolerance()
           
 java.awt.Color getRGBColor()
           
 void setHue(float hue)
           
 void setHueTolerance(float hueTolerance)
           
 void setIHSColor(IHSColor ihsColor)
           
 void setIHSTolerance(float intensityTol, float hueTol, float saturationTol)
           
 void setIntensity(float intensity)
           
 void setIntTolerance(float intTolerance)
           
 void setRGBColor(java.awt.Color rgbColor)
           
 void setSatTolerance(float satTolerance)
           
 void setSaturation(float saturation)
           
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorRange

public ColorRange(IHSColor ihsColor,
                  float intensityTol,
                  float hueTol,
                  float saturationTol)
Creates a new ColorRange with the specified color and tolerance values. Intensity and Saturation are on the interval [0,1]. Hue is on the interval [0,HUE_MAX]


ColorRange

public ColorRange(java.awt.Color rgbColor)
Creates a new ColorRange with the specified color and default tolerance values.

Method Detail

getIHSColor

public IHSColor getIHSColor()

getRGBColor

public java.awt.Color getRGBColor()

setIHSColor

public void setIHSColor(IHSColor ihsColor)

setIHSTolerance

public void setIHSTolerance(float intensityTol,
                            float hueTol,
                            float saturationTol)

setRGBColor

public void setRGBColor(java.awt.Color rgbColor)

getIHSTolerance

public float[] getIHSTolerance()

setIntensity

public void setIntensity(float intensity)

setHue

public void setHue(float hue)

setSaturation

public void setSaturation(float saturation)

setIntTolerance

public void setIntTolerance(float intTolerance)

setHueTolerance

public void setHueTolerance(float hueTolerance)

setSatTolerance

public void setSatTolerance(float satTolerance)

createIcon

public static javax.swing.Icon createIcon(java.awt.Color color)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toShortString

public java.lang.String toShortString()
Specified by:
toShortString in interface edu.berkeley.guir.lib.util.ToShortStringable