@Namespace(value="cv") @NoOffset public static class opencv_imgcodecs.Animation extends Pointer
/** \brief Represents an animation with multiple frames.
The 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.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
Animation() |
Animation(int loopCount,
Scalar bgColor)
\brief Constructs an Animation object with optional loop count and background color.
|
Animation(long size)
Native array allocator.
|
Animation(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Scalar |
bgcolor()
Background color of the animation in BGRA format.
|
opencv_imgcodecs.Animation |
bgcolor(Scalar setter) |
IntPointer |
durations()
Duration for each frame in milliseconds.
|
opencv_imgcodecs.Animation |
durations(IntPointer setter) |
MatVector |
frames()
Vector of frames, where each Mat represents a single frame.
|
opencv_imgcodecs.Animation |
frames(MatVector setter) |
opencv_imgcodecs.Animation |
getPointer(long i) |
int |
loop_count()
Number of times the animation should loop.
|
opencv_imgcodecs.Animation |
loop_count(int setter) |
opencv_imgcodecs.Animation |
position(long position) |
Mat |
still_image()
image that can be used for the format in addition to the animation or if animation is not supported in the reader (like in PNG).
|
opencv_imgcodecs.Animation |
still_image(Mat setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zeropublic Animation(Pointer p)
Pointer(Pointer).public Animation(long size)
Pointer.position(long).public Animation(int loopCount,
@ByVal(nullValue="cv::Scalar()")
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.
- Positive values denote finite repeat counts, allowing the animation to play a limited number of times.
- If a negative value or a value beyond the maximum of 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:
- Defaults to Scalar(), indicating an empty color (usually transparent if supported).
- This background color provides a solid fill behind frames that have transparency, ensuring a consistent display appearance.public Animation()
public opencv_imgcodecs.Animation position(long position)
public opencv_imgcodecs.Animation getPointer(long i)
getPointer in class Pointerpublic int loop_count()
public opencv_imgcodecs.Animation loop_count(int setter)
public opencv_imgcodecs.Animation bgcolor(Scalar setter)
@StdVector public IntPointer durations()
public opencv_imgcodecs.Animation durations(IntPointer setter)
public opencv_imgcodecs.Animation frames(MatVector setter)
@ByRef public Mat still_image()
public opencv_imgcodecs.Animation still_image(Mat setter)
Copyright © 2026. All rights reserved.