|
| icv_anim_t * | icv_anim_create (icv_anim_format_t format, uint32_t width, uint32_t height, int fps) |
| |
| icv_anim_t * | icv_anim_read (const char *filename) |
| |
| int | icv_anim_write (const icv_anim_t *anim, const char *filename) |
| |
| int | icv_anim_destroy (icv_anim_t *anim) |
| |
| int | icv_anim_add_frame (icv_anim_t *anim, const icv_image_t *img) |
| |
| int | icv_anim_insert_frame (icv_anim_t *anim, size_t index, const icv_image_t *img) |
| |
| int | icv_anim_replace_frame (icv_anim_t *anim, size_t index, const icv_image_t *img) |
| |
| int | icv_anim_remove_frame (icv_anim_t *anim, size_t index) |
| |
| icv_image_t * | icv_anim_get_frame (const icv_anim_t *anim, size_t index) |
| |
| size_t | icv_anim_num_frames (const icv_anim_t *anim) |
| |
| int | icv_anim_set_fps (icv_anim_t *anim, int fps) |
| |
| int | icv_anim_set_frame_delay (icv_anim_t *anim, size_t index, uint32_t delay_usec) |
| |
Functions for creating and manipulating animations (APNG, MJPG) provided by the LIBICV image processing library.
Functions provided by the LIBICV image processing library.
◆ icv_anim_t
Opaque animation object
Definition at line 45 of file anim.h.
◆ icv_anim_format_t
Supported animation formats
| Enumerator |
|---|
| ICV_ANIM_UNKNOWN | |
| ICV_ANIM_APNG | |
| ICV_ANIM_MJPG | |
Definition at line 38 of file anim.h.
◆ icv_anim_create()
Create a new empty animation object.
- Parameters
-
| format | The output format (ICV_ANIM_APNG or ICV_ANIM_MJPG). |
| width | The canvas width (can be 0 to auto-detect based on frames). |
| height | The canvas height (can be 0 to auto-detect based on frames). |
| fps | The default frames per second for the animation. |
◆ icv_anim_read()
Read an animation from file into an animation object.
- Parameters
-
| filename | The path to the animation file. |
◆ icv_anim_write()
Write the animation object to a file.
- Parameters
-
| anim | The animation object. |
| filename | The output file path. |
◆ icv_anim_destroy()
Free an animation object.
- Parameters
-
| anim | The animation object. |
- Returns
- 0 on success.
◆ icv_anim_add_frame()
Append a frame to the end of the animation.
- Parameters
-
| anim | The animation object. |
| img | The frame image data. |
◆ icv_anim_insert_frame()
Insert a frame into the animation at the specified 0-based index.
- Parameters
-
| anim | The animation object. |
| index | The 0-based insertion index. |
| img | The frame image data. |
◆ icv_anim_replace_frame()
Replace a frame in the animation at the specified 0-based index.
- Parameters
-
| anim | The animation object. |
| index | The 0-based replacement index. |
| img | The frame image data. |
◆ icv_anim_remove_frame()
Remove a frame from the animation at the specified 0-based index.
- Parameters
-
| anim | The animation object. |
| index | The 0-based removal index. |
◆ icv_anim_get_frame()
Extract a specific frame from the animation.
- Parameters
-
| anim | The animation object. |
| index | The 0-based index of the frame to extract. |
- Returns
- A newly allocated icv_image_t containing the frame. Must be freed by caller.
◆ icv_anim_num_frames()
Get the number of frames currently in the animation.
- Parameters
-
| anim | The animation object. |
- Returns
- The number of frames.
◆ icv_anim_set_fps()
| int icv_anim_set_fps |
( |
icv_anim_t * |
anim, |
|
|
int |
fps |
|
) |
| |
|
extern |
Set the global frames per second for the animation.
- Parameters
-
| anim | The animation object. |
| fps | The frames per second. |
- Returns
- 0 on success, -1 on invalid input.
◆ icv_anim_set_frame_delay()
Set a specific frame's delay in microseconds. This overrides the global FPS for this specific frame. (Note: Only fully supported by APNG format. MJPG will use the global FPS and generally ignore per-frame delays).
- Parameters
-
| anim | The animation object. |
| index | The 0-based index of the frame. |
| delay_usec | The delay in microseconds (1,000,000 = 1 second). |