public class Animation extends Object
Animation struct is designed to store and manage data for animated sequences such as those from animated formats (e.g., GIF, AVIF, APNG, WebP).
It provides support for looping, background color settings, frame timing, and frame storage.| Modifier and Type | Field and Description |
|---|---|
protected long |
nativeObj |
| Modifier | Constructor and Description |
|---|---|
|
Animation()
Constructs an Animation object with optional loop count and background color.
|
|
Animation(int loopCount)
Constructs an Animation object with optional loop count and background color.
|
|
Animation(int loopCount,
Scalar bgColor)
Constructs an Animation object with optional loop count and background color.
|
protected |
Animation(long addr) |
| Modifier and Type | Method and Description |
|---|---|
static Animation |
__fromPtr__(long addr) |
protected void |
finalize() |
Scalar |
get_bgcolor() |
MatOfInt |
get_durations() |
List<Mat> |
get_frames() |
int |
get_loop_count() |
Mat |
get_still_image() |
long |
getNativeObjAddr() |
void |
set_bgcolor(Scalar bgcolor) |
void |
set_durations(MatOfInt durations) |
void |
set_frames(List<Mat> frames) |
void |
set_loop_count(int loop_count) |
void |
set_still_image(Mat still_image) |
protected Animation(long addr)
public Animation(int loopCount,
Scalar bgColor)
loopCount - An integer representing the number of times the animation should loop:
0 (default) indicates infinite looping, meaning the animation will replay continuously.
0xffff (65535) is provided, it is reset to 0
(infinite looping) to maintain valid bounds.
bgColor - A Scalar object representing the background color in BGR format:
Scalar(), indicating an empty color (usually transparent if supported).
public Animation(int loopCount)
loopCount - An integer representing the number of times the animation should loop:
0 (default) indicates infinite looping, meaning the animation will replay continuously.
0xffff (65535) is provided, it is reset to 0
(infinite looping) to maintain valid bounds.
Scalar(), indicating an empty color (usually transparent if supported).
public Animation()
0 (default) indicates infinite looping, meaning the animation will replay continuously.
0xffff (65535) is provided, it is reset to 0
(infinite looping) to maintain valid bounds.
Scalar(), indicating an empty color (usually transparent if supported).
public long getNativeObjAddr()
public static Animation __fromPtr__(long addr)
public int get_loop_count()
public void set_loop_count(int loop_count)
public Scalar get_bgcolor()
public void set_bgcolor(Scalar bgcolor)
public MatOfInt get_durations()
public void set_durations(MatOfInt durations)
public Mat get_still_image()
public void set_still_image(Mat still_image)
Copyright © 2026. All rights reserved.