|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 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 | |
|---|---|
void |
addChainCode(byte chainCode)
|
MultiLine |
calc()
|
void |
findAccumulatedDirectionChange()
Find the accumulated direction change, the sum of all turns. |
MultiLine |
getCalcValue()
If dirty do calc() else return cached value. |
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()
|
boolean |
isClosed()
Last point is a running point so this will not always work. |
boolean |
isDirty()
|
void |
setFirstPoint(IPoint2D firstPoint)
|
void |
setMultiLine(MultiLine line)
|
void |
setup()
|
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
| Constructor Detail |
|---|
public ChainCodeHandler(AnnotatedShapeImplementation annotatedShape)
| Method Detail |
|---|
public void setup()
setup in interface LazyCalc<MultiLine>setup in interface AnnotatedShapesetup in class BaseAnnotatedShapepublic MultiLine calc()
calc in interface Calc<MultiLine>public MultiLine getCalcValue()
Calc
getCalcValue in interface Calc<MultiLine>public void findAccumulatedDirectionChange()
public void addChainCode(byte chainCode)
public void swapChainCodeInOppositeDirection()
public boolean isDirty()
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()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||