Class BitmapShape.EuclidianDistanceVectorization

  • All Implemented Interfaces:
    java.util.function.Supplier<VectorShape>
    Enclosing class:
    BitmapShape

    public static class BitmapShape.EuclidianDistanceVectorization
    extends java.lang.Object
    implements java.util.function.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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      VectorShape get()  
      void moveTo​(boolean plotFirst, java.awt.Point origin, java.awt.Point target)
      Move from origin to target.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EuclidianDistanceVectorization

        public EuclidianDistanceVectorization​(BitmapShape bitmapShape)
    • Method Detail

      • moveTo

        public void moveTo​(boolean plotFirst,
                           java.awt.Point origin,
                           java.awt.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