Class BitmapShape.EuclidianDistanceVectorization

java.lang.Object
io.github.applecommander.bastools.api.shapes.BitmapShape.EuclidianDistanceVectorization
All Implemented Interfaces:
Supplier<VectorShape>
Enclosing class:
BitmapShape

public static class BitmapShape.EuclidianDistanceVectorization extends Object implements Supplier<VectorShape>
Encode a bitmap shape by using the Euclidean distance between plotted points to determine which vectors take precedence. Most of the math is captured in the Point class, which makes this much more straight-forward.
  • Constructor Details

    • EuclidianDistanceVectorization

      public EuclidianDistanceVectorization(BitmapShape bitmapShape)
  • Method Details

    • get

      public VectorShape get()
      Specified by:
      get in interface Supplier<VectorShape>
    • moveTo

      public void moveTo(boolean plotFirst, Point origin, Point target)
      Move from origin to target. General strategy is to work from distance between points and bias the one that "loses" each time while resetting the one that "won". Hopefully this draws more of a jagged line than something entirely straight. (The goal being to prevent a bunch of plot up's in the worst case that doesn't encode nicely.)
      Parameters:
      plotFirst - Indicates if the first vector needs to plot; otherwise all other vectors will be moves
      origin - Is the point of origin (which can be a plotted pixel)
      target - Is the target point