edu.berkeley.guir.papier_mache.vision
Class ColorRange
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
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