org.shapelogic.imageprocessing
Class SBSimpleCompare

java.lang.Object
  extended by org.shapelogic.imageprocessing.SBSimpleCompare
All Implemented Interfaces:
SBPixelCompare
Direct Known Subclasses:
SBByteCompare, SBColorCompare, SBShortCompare

public abstract class SBSimpleCompare
extends java.lang.Object
implements SBPixelCompare

Abstract class for compare.

Author:
Sami Badawi

Field Summary
protected  int _currentColor
           
protected  boolean _farFromReferenceColor
           
protected  int _maxDistance
           
protected  boolean _modifying
           
protected  SLImage _slImage
           
protected  java.util.BitSet bitSet
           
protected  boolean fillWithOwnColor
           
protected  int handledColor
           
protected  int mask
           
protected  int numberOfPixels
           
 
Constructor Summary
SBSimpleCompare()
           
 
Method Summary
 int getCurrentColor()
           
 int getHandledColor()
           
 int getMaxDist()
           
 int getNumberOfPixels()
           
 void grabColorFromPixel(int startX, int startY)
           
 void init(ij.process.ImageProcessor ip)
          Call at start, this might also work as a reset
 void init(SLImage image)
          Call at start, this might also work as a reset
 boolean isFarFromReferencColor()
           
 boolean isHandled(int index)
          Check if pixel at index already have been handled.
 boolean isModifying()
          Should pixels be modified.
 boolean newSimilar(int index)
          Similar and not handled
 void setCurrentColor(int currentColor)
           
 void setFarFromReferencColor(boolean farFromColor)
           
 void setHandled(int index)
          Mark that pixel at index has been handled
 void setHandledColor(int handledColor)
           
 void setMaxDist(int maxDist)
           
 void setMaxDistance(int maxDistance)
           
 void setModifying(boolean input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.shapelogic.imageprocessing.SBPixelCompare
action, colorDistance, getColorAsInt, similar
 

Field Detail

_currentColor

protected int _currentColor

handledColor

protected int handledColor

mask

protected int mask

_slImage

protected SLImage _slImage

_maxDistance

protected int _maxDistance

bitSet

protected java.util.BitSet bitSet

fillWithOwnColor

protected boolean fillWithOwnColor

numberOfPixels

protected int numberOfPixels

_modifying

protected boolean _modifying

_farFromReferenceColor

protected boolean _farFromReferenceColor
Constructor Detail

SBSimpleCompare

public SBSimpleCompare()
Method Detail

newSimilar

public boolean newSimilar(int index)
Similar and not handled

Specified by:
newSimilar in interface SBPixelCompare

getCurrentColor

public int getCurrentColor()
Returns:
Returns the currentColor.

setCurrentColor

public void setCurrentColor(int currentColor)
Specified by:
setCurrentColor in interface SBPixelCompare
Parameters:
currentColor - The currentColor to set.

getHandledColor

public int getHandledColor()
Returns:
Returns the handledColor.

setHandledColor

public void setHandledColor(int handledColor)
Parameters:
handledColor - The handledColor to set.

getMaxDist

public int getMaxDist()
Returns:
Returns the maxDist.

setMaxDist

public void setMaxDist(int maxDist)
Parameters:
maxDist - The maxDist to set.

grabColorFromPixel

public void grabColorFromPixel(int startX,
                               int startY)
Specified by:
grabColorFromPixel in interface SBPixelCompare

init

public void init(ij.process.ImageProcessor ip)
          throws java.lang.Exception
Call at start, this might also work as a reset

Specified by:
init in interface SBPixelCompare
Throws:
java.lang.Exception

init

public void init(SLImage image)
          throws java.lang.Exception
Call at start, this might also work as a reset

Throws:
java.lang.Exception

isHandled

public boolean isHandled(int index)
Check if pixel at index already have been handled.

Specified by:
isHandled in interface SBPixelCompare

setHandled

public void setHandled(int index)
Mark that pixel at index has been handled

Specified by:
setHandled in interface SBPixelCompare

getNumberOfPixels

public int getNumberOfPixels()
Specified by:
getNumberOfPixels in interface SBPixelCompare

isModifying

public boolean isModifying()
Should pixels be modified.

Specified by:
isModifying in interface SBPixelCompare

setModifying

public void setModifying(boolean input)
Specified by:
setModifying in interface SBPixelCompare

setMaxDistance

public void setMaxDistance(int maxDistance)
Specified by:
setMaxDistance in interface SBPixelCompare

isFarFromReferencColor

public boolean isFarFromReferencColor()
Specified by:
isFarFromReferencColor in interface SBPixelCompare

setFarFromReferencColor

public void setFarFromReferencColor(boolean farFromColor)
Specified by:
setFarFromReferencColor in interface SBPixelCompare


Copyright © 2009. All Rights Reserved.