|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.polygon.BaseAnnotatedShape org.shapelogic.imageprocessing.ChainCodeHandler
public class ChainCodeHandler
Chain Code For MultiLine. Assume that there is no intersection.
Field Summary | |
---|---|
protected int |
_accumulatedAbsoluteDirectionChange
|
protected int |
_accumulatedDirectionChange
|
protected BBox |
_bBox
|
protected byte[] |
_chainCodeForMultiLine
|
protected boolean |
_dirty
|
protected CPointInt |
_firstPoint
|
protected int |
_lastChain
|
protected CPointInt |
_lastPoint
|
protected java.util.List<LineProperties> |
_linePropertiesList
Line number N should have end point on point number N. |
protected MultiLine |
_multiLine
|
protected double |
_perimeter
|
protected java.util.TreeMap<java.lang.Integer,CPointInt> |
_pointMap
|
protected java.util.List<PointProperties> |
_pointPropertiesList
What should happen to the last point if the first and the last point is the same. |
protected static int |
CHAIN_CODE_FOR_MULTI_LINE_MAX_LENGTH
|
protected static double |
LIMIT_FOR_HARD_CORNER
|
protected static int |
SHORT_LINE_LENGTH
|
Fields inherited from class org.shapelogic.polygon.BaseAnnotatedShape |
---|
_annotatedShape |
Constructor Summary | |
---|---|
ChainCodeHandler(AnnotatedShapeImplementation annotatedShape)
|
Method Summary | |
---|---|
boolean |
addChainCode(byte chainCode)
|
void |
findAccumulatedDirectionChange()
Find the accumulated direction change, the sum of all turns. |
byte[] |
getChainCodeForMultiLine()
|
protected double |
getDistLimit(int pixelCountInCurrentLineInterval)
DistLimit is half based on the diameter of the polygon half on the length of the line. |
CPointInt |
getFirstPoint()
|
int |
getLastChain()
|
CPointInt |
getLastPoint()
|
double |
getPerimeter()
|
MultiLine |
getValue()
Starts a lazy calculation. |
MultiLine |
invoke()
|
boolean |
isClosed()
Last point is a running point so this will not always work. |
boolean |
isDirty()
When dirty is false that means that the calculated value can be used |
void |
setFirstPoint(IPoint2D firstPoint)
|
void |
setMultiLine(MultiLine line)
|
void |
setPerimeter(double perimeter)
|
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. |
void |
swapChainCodeInOppositeDirection()
Opposite Direction. |
Methods inherited from class org.shapelogic.polygon.BaseAnnotatedShape |
---|
getAnnotatedShape, getAnnotationForShapes, getMap, getShapesForAnnotation, putAllAnnotation, putAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int CHAIN_CODE_FOR_MULTI_LINE_MAX_LENGTH
protected static final int SHORT_LINE_LENGTH
protected static final double LIMIT_FOR_HARD_CORNER
protected byte[] _chainCodeForMultiLine
protected int _lastChain
protected CPointInt _firstPoint
protected CPointInt _lastPoint
protected MultiLine _multiLine
protected boolean _dirty
protected BBox _bBox
protected java.util.TreeMap<java.lang.Integer,CPointInt> _pointMap
protected int _accumulatedDirectionChange
protected int _accumulatedAbsoluteDirectionChange
protected java.util.List<PointProperties> _pointPropertiesList
protected java.util.List<LineProperties> _linePropertiesList
protected double _perimeter
Constructor Detail |
---|
public ChainCodeHandler(AnnotatedShapeImplementation annotatedShape)
Method Detail |
---|
public void setup()
LazyCalc
setup
in interface LazyCalc<MultiLine>
setup
in interface AnnotatedShape
setup
in class BaseAnnotatedShape
public MultiLine invoke()
invoke
in interface Calc0<MultiLine>
public MultiLine getValue()
CalcValue
getValue
in interface CalcValue<MultiLine>
public void findAccumulatedDirectionChange()
public boolean addChainCode(byte chainCode)
public void swapChainCodeInOppositeDirection()
public boolean isDirty()
LazyCalc
isDirty
in interface LazyCalc<MultiLine>
protected double getDistLimit(int pixelCountInCurrentLineInterval)
public void setFirstPoint(IPoint2D firstPoint)
public CPointInt getFirstPoint()
public byte[] getChainCodeForMultiLine()
public void setMultiLine(MultiLine line)
public boolean isClosed()
public int getLastChain()
public CPointInt getLastPoint()
public double getPerimeter()
public void setPerimeter(double perimeter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |