Class DefaultInterpolator
java.lang.Object
com.github.weisj.jsvg.animation.interpolation.DefaultInterpolator
- All Implemented Interfaces:
FloatInterpolator, FloatListInterpolator, PaintInterpolator, TransformInterpolator
public final class DefaultInterpolator
extends Object
implements FloatInterpolator, FloatListInterpolator, PaintInterpolator, TransformInterpolator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate 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 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 Details
-
additive
-
valuesType
-
-
Constructor Details
-
DefaultInterpolator
-
-
Method Details
-
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
-
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
-
interpolate
@NotNull public @NotNull AffineTransform interpolate(@NotNull @NotNull MeasureContext context, @NotNull @NotNull TransformValue initial, @NotNull @NotNull TransformPart a, @NotNull @NotNull TransformPart b, float progress) - Specified by:
interpolatein interfaceTransformInterpolator
-