Class 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 the VectorShape.optimize() should be used. Note that this class is setup to be dynamic in the chosen corner.
    • 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 converted
        initialMovement - is the initial sweep movement
        next - is the direction to advance for each line
    • Method Detail

      • findStartPosition

        public void findStartPosition()
      • scanRow

        public void scanRow()
      • onOrAtEdge

        public boolean onOrAtEdge​(VectorCommand vector)