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