Class BitmapShape.SweepVectorization
- java.lang.Object
-
- io.github.applecommander.bastools.api.shapes.BitmapShape.SweepVectorization
-
- All Implemented Interfaces:
java.util.function.Supplier<VectorShape>
- Enclosing class:
- BitmapShape
public static class BitmapShape.SweepVectorization extends java.lang.Object implements java.util.function.Supplier<VectorShape>
Encode a bitmap shape by going to a corner and sweeping back-and-forth across the image. The resulting shape is not optimal, so theVectorShape.optimize()
should be used. Note that this class is setup to be dynamic in the chosen corner.
-
-
Constructor Summary
Constructors Constructor Description SweepVectorization(BitmapShape bitmapShape, VectorCommand initialMovement, VectorCommand next)
Create an instance of the sweep method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
findStartPosition()
VectorShape
get()
boolean
onOrAtEdge(VectorCommand vector)
void
plotOrMove(VectorCommand vector)
void
scanRow()
-
-
-
Constructor Detail
-
SweepVectorization
public SweepVectorization(BitmapShape bitmapShape, VectorCommand initialMovement, VectorCommand next)
Create an instance of the sweep method.- Parameters:
bitmapShape
- is the shape to be convertedinitialMovement
- is the initial sweep movementnext
- is the direction to advance for each line
-
-
Method Detail
-
get
public VectorShape get()
- Specified by:
get
in interfacejava.util.function.Supplier<VectorShape>
-
findStartPosition
public void findStartPosition()
-
scanRow
public void scanRow()
-
plotOrMove
public void plotOrMove(VectorCommand vector)
-
onOrAtEdge
public boolean onOrAtEdge(VectorCommand vector)
-
-