org.shapelogic.color
Class SimpleColorHypothesis

java.lang.Object
  extended by org.shapelogic.color.SimpleColorHypothesis
All Implemented Interfaces:
ColorHypothesis

public class SimpleColorHypothesis
extends java.lang.Object
implements ColorHypothesis

SimpleColorHypothesis is a color hypothesis.

Author:
Sami Badawi

Field Summary
protected  IColorAndVariance _background
           
protected  java.util.Collection<IColorAndVariance> _colors
           
protected  double _maxDistance
           
 
Constructor Summary
SimpleColorHypothesis()
           
 
Method Summary
 boolean addColor(IColorAndVariance color)
          If the color is identical merge else add.
 IColorAndVariance getBackground()
           
 java.util.Collection<IColorAndVariance> getColors()
           
 double getMaxDistance()
          There will not always be a global maxDistance.
 boolean mergable(IColorAndVariance color1, IColorAndVariance color2)
          Is it possible to merge the 2 colors in the given context.
 void setBackground(IColorAndVariance color)
           
 void setMaxDistance(double tolerance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_colors

protected java.util.Collection<IColorAndVariance> _colors

_maxDistance

protected double _maxDistance

_background

protected IColorAndVariance _background
Constructor Detail

SimpleColorHypothesis

public SimpleColorHypothesis()
Method Detail

addColor

public boolean addColor(IColorAndVariance color)
If the color is identical merge else add.

Specified by:
addColor in interface ColorHypothesis

getColors

public java.util.Collection<IColorAndVariance> getColors()
Specified by:
getColors in interface ColorHypothesis

getBackground

public IColorAndVariance getBackground()
Specified by:
getBackground in interface ColorHypothesis

setBackground

public void setBackground(IColorAndVariance color)
Specified by:
setBackground in interface ColorHypothesis

getMaxDistance

public double getMaxDistance()
Description copied from interface: ColorHypothesis
There will not always be a global maxDistance.

Specified by:
getMaxDistance in interface ColorHypothesis

setMaxDistance

public void setMaxDistance(double tolerance)
Specified by:
setMaxDistance in interface ColorHypothesis

mergable

public boolean mergable(IColorAndVariance color1,
                        IColorAndVariance color2)
Description copied from interface: ColorHypothesis
Is it possible to merge the 2 colors in the given context.

Specified by:
mergable in interface ColorHypothesis


Copyright © 2009. All Rights Reserved.