Module com.github.weisj.jsvg
Class DefaultInterpolator
- java.lang.Object
-
- com.github.weisj.jsvg.animation.interpolation.DefaultInterpolator
-
- All Implemented Interfaces:
FloatInterpolator,FloatListInterpolator,PaintInterpolator,TransformInterpolator
public final class DefaultInterpolator extends java.lang.Object implements FloatInterpolator, FloatListInterpolator, PaintInterpolator, TransformInterpolator
-
-
Field Summary
Fields Modifier and Type Field Description private Additiveadditiveprivate AnimationValuesTypevaluesType
-
Constructor Summary
Constructors Constructor Description DefaultInterpolator(AnimationValuesType valuesType, Additive additive)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static float @NotNull []arrayLerp(float @Nullable [] cache, float @NotNull [] from, float @Nullable [] to, float progress)private SVGPaintdiscreteAnimation(@NotNull SVGPaint initial, @NotNull SVGPaint a, @NotNull SVGPaint b, float progress)private static float @NotNull []ensureCacheCapacity(float @Nullable [] cache, int length)private static @Nullable RGBColorextractColor(@NotNull SVGPaint p)float @NotNull []interpolate(float @NotNull [] initial, float @NotNull [] a, float @Nullable [] b, float progress, float @Nullable [] cache)floatinterpolate(float initial, float a, float b, float progress)@NotNull SVGPaintinterpolate(@NotNull SVGPaint initial, @NotNull SVGPaint a, @NotNull SVGPaint b, float progress)@NotNull java.awt.geom.AffineTransforminterpolate(@NotNull MeasureContext context, @NotNull TransformValue initial, @NotNull TransformPart a, @NotNull TransformPart b, float progress)private static float @NotNull []saxpy(float @Nullable [] cache, float @NotNull [] b, float @Nullable [] x, float a)This method is used to calculate the result of the following operation: result_i = a * x_i + b_i If b_i is shorter than a_i, b_i is repeated.
-
-
-
Field Detail
-
additive
private final Additive additive
-
valuesType
private final AnimationValuesType valuesType
-
-
Constructor Detail
-
DefaultInterpolator
public DefaultInterpolator(AnimationValuesType valuesType, Additive additive)
-
-
Method Detail
-
interpolate
public float interpolate(float initial, float a, float b, float progress)- Specified by:
interpolatein interfaceFloatInterpolator
-
ensureCacheCapacity
private static float @NotNull [] ensureCacheCapacity(float @Nullable [] cache, int length)
-
arrayLerp
private static float @NotNull [] arrayLerp(float @Nullable [] cache, float @NotNull [] from, float @Nullable [] to, float progress)
-
saxpy
private static float @NotNull [] saxpy(float @Nullable [] cache, float @NotNull [] b, float @Nullable [] x, float a)This method is used to calculate the result of the following operation: result_i = a * x_i + b_i- If b_i is shorter than a_i, b_i is repeated.
- If b_i is longer than a_i, the extra values are ignored.
-
interpolate
public float @NotNull [] interpolate(float @NotNull [] initial, float @NotNull [] a, float @Nullable [] b, float progress, float @Nullable [] cache)- Specified by:
interpolatein interfaceFloatListInterpolator
-
extractColor
@Nullable private static @Nullable RGBColor extractColor(@NotNull @NotNull SVGPaint p)
-
interpolate
@NotNull public @NotNull SVGPaint interpolate(@NotNull @NotNull SVGPaint initial, @NotNull @NotNull SVGPaint a, @NotNull @NotNull SVGPaint b, float progress)
- Specified by:
interpolatein interfacePaintInterpolator
-
discreteAnimation
private SVGPaint discreteAnimation(@NotNull @NotNull SVGPaint initial, @NotNull @NotNull SVGPaint a, @NotNull @NotNull SVGPaint b, float progress)
-
interpolate
@NotNull public @NotNull java.awt.geom.AffineTransform interpolate(@NotNull @NotNull MeasureContext context, @NotNull @NotNull TransformValue initial, @NotNull @NotNull TransformPart a, @NotNull @NotNull TransformPart b, float progress)- Specified by:
interpolatein interfaceTransformInterpolator
-
-