org.shapelogic.imageprocessing
Class SBSimpleCompare

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

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

Abstract class fro compare.

Author:
Sami Badawi

Field Summary
protected  java.util.BitSet bitSet
           
protected  int currentColor
           
protected  boolean fillWithOwnColor
           
protected  int handledColor
           
protected  ij.process.ImageProcessor ip
           
protected  int mask
           
protected  int maxDist
           
protected  int numberOfPixels
           
 
Constructor Summary
SBSimpleCompare()
           
 
Method Summary
static SBSimpleCompare factory(ij.process.ImageProcessor ip)
           
 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
 boolean isHandled(int index)
          Check if pixel at index already have been handled.
 boolean newSimilar(int index)
          Similar and not handled
 void setCurrentColor(int currentColor)
           
 void setHandled(int index)
          Mark that pixel at index has been handled
 void setHandledColor(int handledColor)
           
 void setMaxDist(int maxDist)
           
static int[] splitColor(int colorIn)
          split color coded as int into 3 int sould probably be moved to util class
 
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, similar
 

Field Detail

currentColor

protected int currentColor

handledColor

protected int handledColor

mask

protected int mask

ip

protected ij.process.ImageProcessor ip

maxDist

protected int maxDist

bitSet

protected java.util.BitSet bitSet

fillWithOwnColor

protected boolean fillWithOwnColor

numberOfPixels

protected int numberOfPixels
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)
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

factory

public static SBSimpleCompare factory(ij.process.ImageProcessor ip)
                               throws java.lang.Exception
Throws:
java.lang.Exception

splitColor

public static int[] splitColor(int colorIn)
split color coded as int into 3 int sould probably be moved to util class


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

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


Copyright © 2007. All Rights Reserved.