Class BitmapShape.EuclidianDistanceVectorization
- java.lang.Object
-
- io.github.applecommander.bastools.api.shapes.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.
-
-
Constructor Summary
Constructors Constructor Description EuclidianDistanceVectorization(BitmapShape bitmapShape)
-
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.
-
-
-
Constructor Detail
-
EuclidianDistanceVectorization
public EuclidianDistanceVectorization(BitmapShape bitmapShape)
-
-
Method Detail
-
get
public VectorShape get()
- Specified by:
get
in interfacejava.util.function.Supplier<VectorShape>
-
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 movesorigin
- Is the point of origin (which can be a plotted pixel)target
- Is the target point
-
-