public class MarchingSquares
extends java.lang.Object
| Constructor and Description |
|---|
MarchingSquares(int width,
int height,
byte[] data)
Creates a new object that can locate perimeter paths in the supplied
data.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData() |
int |
getHeight() |
java.util.ArrayList<Path> |
getPathList() |
int |
getWidth() |
java.util.ArrayList<Path> |
identifyPerimeter()
A convenience method that locates at least one perimeter in the data with
which this object was constructed.
|
Path |
identifyPerimeter(int initialX,
int initialY)
Finds the perimeter between a set of zero and non-zero values which
begins at the specified data element.
|
public MarchingSquares(int width,
int height,
byte[] data)
width - the width of the data matrixheight - the height of the data matrixdata - the data elementspublic int getWidth()
public int getHeight()
public byte[] getData()
public Path identifyPerimeter(int initialX, int initialY)
initialX - the column of the data matrix at which to start tracing the
perimeterinitialY - the row of the data matrix at which to start tracing the
perimeterjava.lang.IllegalArgumentException - if there is no perimeter at the specified initial point.public java.util.ArrayList<Path> identifyPerimeter()
public java.util.ArrayList<Path> getPathList()