Class GeometryUtil
java.lang.Object
com.github.weisj.jsvg.geometry.util.GeometryUtil
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Rectangle2D
adjustForAliasing
(@NotNull Rectangle2D r) static boolean
approximatelyEqual
(double a, double b) static boolean
approximatelyNegative
(double a) static boolean
approximatelyZero
(double a) static float
bottom
(@NotNull Rectangle2D rect) static @NotNull String
compactRepresentation
(@NotNull Rectangle2D rect) static @NotNull Rectangle2D
containingBoundsAfterTransform
(@NotNull AffineTransform transform, @NotNull Rectangle2D rect) static @NotNull Rectangle2D
convertBounds
(@NotNull RenderContext context, @NotNull Rectangle2D r, @NotNull GeometryUtil.Space from, @NotNull GeometryUtil.Space to) static @NotNull AffineTransform
createInverse
(@NotNull AffineTransform at) static double
distanceSquared
(double x1, double y1, double x2, double y2) static double
static double
distanceSquared
(Point2D.Float p1, Point2D.Float p2, float scaleX, float scaleY) static @NotNull Point2D
getLocation
(@NotNull Rectangle2D r) static @NotNull Rectangle2D
grow
(@NotNull Rectangle2D bounds, double increase) static @NotNull Rectangle2D
grow
(@NotNull Rectangle2D bounds, FloatInsets grow) static float
left
(@NotNull Rectangle2D rect) static float
lerp
(float t, float a, float b) static Point2D.Float
lerp
(float t, Point2D.Float a, Point2D.Float b) static double
lineLength
(double x1, double y1, double x2, double y2) static @NotNull FloatInsets
max
(@NotNull FloatInsets in1, @NotNull FloatInsets in2) static Point2D.Float
static @NotNull FloatInsets
min
(@NotNull FloatInsets in1, @NotNull FloatInsets in2) static boolean
notablyGreater
(double a, double b) static @NotNull FloatInsets
overhangInsets
(@NotNull Rectangle2D reference, @NotNull Rectangle2D bounds) static double
pathLength
(@NotNull Shape shape) static float
right
(@NotNull Rectangle2D rect) static double
scaleXOfTransform
(@Nullable AffineTransform at) static double
scaleYOfTransform
(@Nullable AffineTransform at) static @NotNull Rectangle2D
toIntegerBounds
(@NotNull Rectangle2D in, @NotNull Rectangle2D out) static float
top
(@NotNull Rectangle2D rect) static @NotNull Rectangle2D
userBoundsToDeviceBounds
(@NotNull RenderContext context, @NotNull Rectangle2D r)
-
Field Details
-
EPS
private static final float EPS- See Also:
-
-
Constructor Details
-
GeometryUtil
private GeometryUtil()
-
-
Method Details
-
approximatelyEqual
public static boolean approximatelyEqual(double a, double b) -
approximatelyZero
public static boolean approximatelyZero(double a) -
notablyGreater
public static boolean notablyGreater(double a, double b) -
approximatelyNegative
public static boolean approximatelyNegative(double a) -
scaleXOfTransform
-
scaleYOfTransform
-
midPoint
-
lerp
@NotNull public static Point2D.Float lerp(float t, @NotNull Point2D.Float a, @NotNull Point2D.Float b) -
lerp
public static float lerp(float t, float a, float b) -
distanceSquared
public static double distanceSquared(@NotNull Point2D.Float p1, @NotNull Point2D.Float p2, float scaleX, float scaleY) -
distanceSquared
-
distanceSquared
public static double distanceSquared(double x1, double y1, double x2, double y2) -
pathLength
-
lineLength
public static double lineLength(double x1, double y1, double x2, double y2) -
containingBoundsAfterTransform
@NotNull public static @NotNull Rectangle2D containingBoundsAfterTransform(@NotNull @NotNull AffineTransform transform, @NotNull @NotNull Rectangle2D rect) -
left
-
top
-
right
-
bottom
-
grow
@NotNull public static @NotNull Rectangle2D grow(@NotNull @NotNull Rectangle2D bounds, FloatInsets grow) -
grow
@NotNull public static @NotNull Rectangle2D grow(@NotNull @NotNull Rectangle2D bounds, double increase) -
max
@NotNull public static @NotNull FloatInsets max(@NotNull @NotNull FloatInsets in1, @NotNull @NotNull FloatInsets in2) -
min
@NotNull public static @NotNull FloatInsets min(@NotNull @NotNull FloatInsets in1, @NotNull @NotNull FloatInsets in2) -
overhangInsets
@NotNull public static @NotNull FloatInsets overhangInsets(@NotNull @NotNull Rectangle2D reference, @NotNull @NotNull Rectangle2D bounds) -
compactRepresentation
-
toIntegerBounds
@NotNull public static @NotNull Rectangle2D toIntegerBounds(@NotNull @NotNull Rectangle2D in, @NotNull @NotNull Rectangle2D out) -
adjustForAliasing
-
createInverse
-
convertBounds
@NotNull public static @NotNull Rectangle2D convertBounds(@NotNull @NotNull RenderContext context, @NotNull @NotNull Rectangle2D r, @NotNull @NotNull GeometryUtil.Space from, @NotNull @NotNull GeometryUtil.Space to) -
userBoundsToDeviceBounds
@NotNull public static @NotNull Rectangle2D userBoundsToDeviceBounds(@NotNull @NotNull RenderContext context, @NotNull @NotNull Rectangle2D r) -
getLocation
-