Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
org.skia.jetski.SkottieAnimation Class Reference

Public Member Functions

 SkottieAnimation (String animation_json)
 
double getDuration ()
 
double getFrameCount ()
 
float getWidth ()
 
float getHeight ()
 
void seekTime (double t)
 
void seekFrame (double f)
 
void render (Canvas canvas)
 
void release ()
 

Protected Member Functions

void finalize () throws Throwable
 

Detailed Description

Definition at line 10 of file SkottieAnimation.java.

Constructor & Destructor Documentation

◆ SkottieAnimation()

org.skia.jetski.SkottieAnimation.SkottieAnimation ( String  animation_json)
inline

Create an animation from the provided JSON string.

Definition at line 16 of file SkottieAnimation.java.

16 {
17 mNativeInstance = nCreate(animation_json);
18 }

Member Function Documentation

◆ finalize()

void org.skia.jetski.SkottieAnimation.finalize ( ) throws Throwable
inlineprotected

Definition at line 87 of file SkottieAnimation.java.

◆ getDuration()

double org.skia.jetski.SkottieAnimation.getDuration ( )
inline

Returns the animation duration in seconds.

Definition at line 23 of file SkottieAnimation.java.

23 {
24 return nGetDuration(mNativeInstance);
25 }

◆ getFrameCount()

double org.skia.jetski.SkottieAnimation.getFrameCount ( )
inline

Returns the animation frame count. This is normally an integral value, but both the JSON encoding and Skottie's frame-based APIs support fractional frames.

Definition at line 31 of file SkottieAnimation.java.

31 {
32 return nGetFrameCount(mNativeInstance);
33 }

◆ getHeight()

float org.skia.jetski.SkottieAnimation.getHeight ( )
inline

Returns the intrinsic animation height.

Definition at line 45 of file SkottieAnimation.java.

45 {
46 return nGetHeight(mNativeInstance);
47 }

◆ getWidth()

float org.skia.jetski.SkottieAnimation.getWidth ( )
inline

Returns the intrinsic animation width.

Definition at line 38 of file SkottieAnimation.java.

38 {
39 return nGetWidth(mNativeInstance);
40 }

◆ release()

void org.skia.jetski.SkottieAnimation.release ( )
inline

Releases any resources associated with this Animation.

Definition at line 81 of file SkottieAnimation.java.

81 {
82 nRelease(mNativeInstance);
83 mNativeInstance = 0;
84 }

◆ render()

void org.skia.jetski.SkottieAnimation.render ( Canvas  canvas)
inline

Draw the current frame to the Canvas.

Definition at line 74 of file SkottieAnimation.java.

74 {
75 nRender(mNativeInstance, canvas.getNativeInstance());
76 }

◆ seekFrame()

void org.skia.jetski.SkottieAnimation.seekFrame ( double  f)
inline

Update the animation state to match |f|, specified as a frame index in the [0..frameCount) domain.

Fractional values are allowed and meaningful - e.g.

0.0 -> first frame 1.0 -> second frame 0.5 -> halfway between first and second frame

Definition at line 67 of file SkottieAnimation.java.

67 {
68 nSeekFrame(mNativeInstance, f);
69 }

◆ seekTime()

void org.skia.jetski.SkottieAnimation.seekTime ( double  t)
inline

Update the animation state to match |t|, specifed in seconds. The input is clamped to [0..duration).

Definition at line 53 of file SkottieAnimation.java.

53 {
54 nSeekTime(mNativeInstance, t);
55 }

The documentation for this class was generated from the following file: