org.shapelogic.imageprocessing
Class PixelTypeCalculator

java.lang.Object
  extended by org.shapelogic.imageprocessing.PixelTypeCalculator
All Implemented Interfaces:
Calc0<PixelType>, CalcInvoke<PixelType>, CalcValue<PixelType>, LazyCalc<PixelType>

public class PixelTypeCalculator
extends java.lang.Object
implements CalcInvoke<PixelType>

PixelTypeCalculator stores some values for points and calculated the type of points based on them.

Author:
Sami Badawi

Field Summary
 int pixelIndex
          This is for debugging so you can see what pixel this was last run for
 
Constructor Summary
PixelTypeCalculator()
           
 
Method Summary
 PixelType getValue()
          Starts a lazy calculation.
 PixelType invoke()
           
 boolean isDirty()
          Just look at the center point and see if different from foreground unknown I do not think this is right for the priority based version.
 void setup()
          Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pixelIndex

public int pixelIndex
This is for debugging so you can see what pixel this was last run for

Constructor Detail

PixelTypeCalculator

public PixelTypeCalculator()
Method Detail

setup

public void setup()
Description copied from interface: LazyCalc
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.

Specified by:
setup in interface LazyCalc<PixelType>

isDirty

public boolean isDirty()
Just look at the center point and see if different from foreground unknown I do not think this is right for the priority based version. Since you can run more times.

Specified by:
isDirty in interface LazyCalc<PixelType>

invoke

public PixelType invoke()
Specified by:
invoke in interface Calc0<PixelType>

getValue

public PixelType getValue()
Description copied from interface: CalcValue
Starts a lazy calculation. If dirty do calc() else return cached value. This should maybe be moved up in the hierarchy

Specified by:
getValue in interface CalcValue<PixelType>


Copyright © 2009. All Rights Reserved.