Class Animation
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.skottie.Animation
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Animation extends Managed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnimation._FinalizerHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
Fields Modifier and Type Field Description @Nullable io.github.humbleui.types.Point_size-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Constructor Summary
Constructors Constructor Description Animation(long ptr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static float_nGetDuration(long ptr)static long_nGetFinalizer()static float_nGetFPS(long ptr)static float_nGetInPoint(long ptr)static float_nGetOutPoint(long ptr)static io.github.humbleui.types.Point_nGetSize(long ptr)static java.lang.String_nGetVersion(long ptr)static long_nMakeFromData(long dataPtr)static long_nMakeFromFile(java.lang.String path)static long_nMakeFromString(java.lang.String data)static void_nRender(long ptr, long canvasPtr, float left, float top, float right, float bottom, int flags)static void_nSeek(long ptr, float t, long icPtr)static void_nSeekFrame(long ptr, float t, long icPtr)static void_nSeekFrameTime(long ptr, float t, long icPtr)floatgetDuration()floatgetFPS()floatgetHeight()floatgetInPoint()floatgetOutPoint()@NotNull io.github.humbleui.types.PointgetSize()@NotNull java.lang.StringgetVersion()floatgetWidth()static @NotNull AnimationmakeFromData(@NotNull Data data)static @NotNull AnimationmakeFromFile(@NotNull java.lang.String path)static @NotNull AnimationmakeFromString(@NotNull java.lang.String data)@NotNull Animationrender(@NotNull Canvas canvas)Draws the current animation frame@NotNull Animationrender(@NotNull Canvas canvas, float left, float top)Draws the current animation frame@NotNull Animationrender(@NotNull Canvas canvas, @NotNull io.github.humbleui.types.Point offset)Draws the current animation frame@NotNull Animationrender(@NotNull Canvas canvas, @NotNull io.github.humbleui.types.Rect dst, RenderFlag... renderFlags)Draws the current animation frame@NotNull Animationseek(float t)Updates the animation state for |t|.@NotNull Animationseek(float t, @Nullable InvalidationController ic)Updates the animation state for |t|.@NotNull AnimationseekFrame(float t)Update the animation state to match |t|, specified as a frame index i.e.@NotNull AnimationseekFrame(float t, @Nullable InvalidationController ic)Update the animation state to match |t|, specified as a frame index i.e.@NotNull AnimationseekFrameTime(float t)Update the animation state to match t, specifed in frame time i.e.@NotNull AnimationseekFrameTime(float t, @Nullable InvalidationController ic)Update the animation state to match t, specifed in frame time i.e.-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
-
-
-
Method Detail
-
makeFromString
@NotNull @Contract("!null -> new; null -> fail") public static @NotNull Animation makeFromString(@NotNull @NotNull java.lang.String data)
-
makeFromFile
@NotNull @Contract("!null -> new; null -> fail") public static @NotNull Animation makeFromFile(@NotNull @NotNull java.lang.String path)
-
makeFromData
@NotNull @Contract("!null -> new; null -> fail") public static @NotNull Animation makeFromData(@NotNull @NotNull Data data)
-
render
@NotNull @Contract("!null -> this; null -> fail") public @NotNull Animation render(@NotNull @NotNull Canvas canvas)Draws the current animation frame
It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.
- Parameters:
canvas- destination canvas- Returns:
- this
-
render
@NotNull @Contract("_, _, _ -> this") public @NotNull Animation render(@NotNull @NotNull Canvas canvas, @NotNull @NotNull io.github.humbleui.types.Point offset)Draws the current animation frame
It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.
- Parameters:
canvas- destination canvasoffset- destination offset- Returns:
- this
-
render
@NotNull @Contract("_, _, _ -> this") public @NotNull Animation render(@NotNull @NotNull Canvas canvas, float left, float top)Draws the current animation frame
It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.
- Parameters:
canvas- destination canvasleft- destination offset lefttop- destination offset top- Returns:
- this
-
render
@NotNull @Contract("_, _, _ -> this") public @NotNull Animation render(@NotNull @NotNull Canvas canvas, @NotNull @NotNull io.github.humbleui.types.Rect dst, RenderFlag... renderFlags)Draws the current animation frame
It is undefined behavior to call render() on a newly created Animation before specifying an initial frame via one of the seek() variants.
- Parameters:
canvas- destination canvasdst- destination rectrenderFlags- render flags- Returns:
- this
-
seek
@NotNull @Contract("_ -> this") public @NotNull Animation seek(float t)Updates the animation state for |t|.
- Parameters:
t- normalized [0..1] frame selector (0 → first frame, 1 → final frame)- Returns:
- this
-
seek
@NotNull @Contract("_, _ -> this") public @NotNull Animation seek(float t, @Nullable @Nullable InvalidationController ic)Updates the animation state for |t|.
- Parameters:
t- normalized [0..1] frame selector (0 → first frame, 1 → final frame)ic- invalidation controller (dirty region tracking)- Returns:
- this
-
seekFrame
@NotNull @Contract("_ -> this") public @NotNull Animation seekFrame(float t)Update the animation state to match |t|, specified as a frame index i.e. relative to
getDuration()*getFPS().Fractional values are allowed and meaningful - e.g. 0.0 → first frame 1.0 → second frame 0.5 → halfway between first and second frame
- Parameters:
t- frame index- Returns:
- this
-
seekFrame
@NotNull @Contract("_, _ -> this") public @NotNull Animation seekFrame(float t, @Nullable @Nullable InvalidationController ic)Update the animation state to match |t|, specified as a frame index i.e. relative to
getDuration()*getFPS().Fractional values are allowed and meaningful - e.g. 0.0 → first frame 1.0 → second frame 0.5 → halfway between first and second frame
- Parameters:
t- frame indexic- invalidation controller (dirty region tracking)- Returns:
- this
-
seekFrameTime
@NotNull @Contract("_ -> this") public @NotNull Animation seekFrameTime(float t)Update the animation state to match t, specifed in frame time i.e. relative to
getDuration().- Parameters:
t- frame time- Returns:
- this
-
seekFrameTime
@NotNull @Contract("_, _ -> this") public @NotNull Animation seekFrameTime(float t, @Nullable @Nullable InvalidationController ic)Update the animation state to match t, specifed in frame time i.e. relative to
getDuration().- Parameters:
t- frame timeic- invalidation controller (dirty region tracking)- Returns:
- this
-
getDuration
public float getDuration()
- Returns:
- the animation duration in seconds
-
getFPS
public float getFPS()
- Returns:
- the animation frame rate (frames / second)
-
getInPoint
public float getInPoint()
- Returns:
- Animation in point, in frame index units
-
getOutPoint
public float getOutPoint()
- Returns:
- Animation out point, in frame index units
-
getVersion
@NotNull public @NotNull java.lang.String getVersion()
-
getSize
@NotNull public @NotNull io.github.humbleui.types.Point getSize()
-
getWidth
public float getWidth()
-
getHeight
public float getHeight()
-
_nGetFinalizer
@Internal public static long _nGetFinalizer()
-
_nMakeFromString
@Internal public static long _nMakeFromString(java.lang.String data)
-
_nMakeFromFile
@Internal public static long _nMakeFromFile(java.lang.String path)
-
_nMakeFromData
@Internal public static long _nMakeFromData(long dataPtr)
-
_nRender
@Internal public static void _nRender(long ptr, long canvasPtr, float left, float top, float right, float bottom, int flags)
-
_nSeek
@Internal public static void _nSeek(long ptr, float t, long icPtr)
-
_nSeekFrame
@Internal public static void _nSeekFrame(long ptr, float t, long icPtr)
-
_nSeekFrameTime
@Internal public static void _nSeekFrameTime(long ptr, float t, long icPtr)
-
_nGetDuration
@Internal public static float _nGetDuration(long ptr)
-
_nGetFPS
@Internal public static float _nGetFPS(long ptr)
-
_nGetInPoint
@Internal public static float _nGetInPoint(long ptr)
-
_nGetOutPoint
@Internal public static float _nGetOutPoint(long ptr)
-
_nGetVersion
@Internal public static java.lang.String _nGetVersion(long ptr)
-
_nGetSize
@Internal public static io.github.humbleui.types.Point _nGetSize(long ptr)
-
-