MLT 6.26.0
|
Property Animation class. More...
Public Member Functions | |
void | mlt_animation_close (mlt_animation self) |
Close the animation and deallocate all of its resources. | |
int | mlt_animation_get_item (mlt_animation self, mlt_animation_item item, int position) |
Load an animation item for an absolute position. | |
int | mlt_animation_get_length (mlt_animation self) |
Get the length of the animation. | |
int | mlt_animation_insert (mlt_animation self, mlt_animation_item item) |
Insert an animation item. | |
void | mlt_animation_interpolate (mlt_animation self) |
Re-interpolate non-keyframe nodes after a series of insertions or removals. | |
int | mlt_animation_key_count (mlt_animation self) |
Get the number of keyframes. | |
int | mlt_animation_key_get (mlt_animation self, mlt_animation_item item, int index) |
Get an animation item for the N-th keyframe. | |
int | mlt_animation_key_set_frame (mlt_animation self, int index, int frame) |
Change the frame number for the N-th keyframe. | |
int | mlt_animation_key_set_type (mlt_animation self, int index, mlt_keyframe_type type) |
Change the interpolation for the N-th keyframe. | |
mlt_animation | mlt_animation_new () |
Create a new animation object. | |
int | mlt_animation_next_key (mlt_animation self, mlt_animation_item item, int position) |
Get the keyfame at the position or the next following. | |
int | mlt_animation_parse (mlt_animation self, const char *data, int length, double fps, locale_t locale) |
Parse a string representing an animation. | |
int | mlt_animation_parse_item (mlt_animation self, mlt_animation_item item, const char *value) |
Parse a string representing an animation keyframe=value. | |
int | mlt_animation_prev_key (mlt_animation self, mlt_animation_item item, int position) |
Get the keyfame at the position or the next preceding. | |
int | mlt_animation_refresh (mlt_animation self, const char *data, int length) |
Conditionally refresh the animation if it is modified. | |
int | mlt_animation_remove (mlt_animation self, int position) |
Remove the keyframe at the specified position. | |
char * | mlt_animation_serialize (mlt_animation self) |
Serialize the animation. | |
char * | mlt_animation_serialize_cut (mlt_animation self, int in, int out) |
Serialize a cut of the animation. | |
char * | mlt_animation_serialize_cut_tf (mlt_animation self, int in, int out, mlt_time_format time_format) |
Serialize a cut of the animation (with time format). | |
char * | mlt_animation_serialize_tf (mlt_animation self, mlt_time_format time_format) |
Serialize the animation (with time format). | |
void | mlt_animation_set_length (mlt_animation self, int length) |
Set the length of the animation. | |
Data Fields | |
char * | data |
the string representing the animation | |
double | fps |
framerate to use when converting time clock strings to frame units | |
int | length |
the maximum number of frames to use when interpreting negative keyframe positions | |
locale_t | locale |
pointer to a locale to use when converting strings to numeric values | |
animation_node | nodes |
a linked list of keyframes (and possibly non-keyframe values) | |
Static Private Member Functions | |
static void | mlt_animation_clean (mlt_animation self) |
Reset an animation and free all strings and properties. | |
static int | mlt_animation_drop (mlt_animation self, animation_node node) |
Remove a node from the linked list. | |
Property Animation class.
This is the animation engine for a Property object. It is dependent upon the mlt_property API and used by the various mlt_property_anim_* functions.
|
staticprivate |
Reset an animation and free all strings and properties.
self | an animation |
void mlt_animation_close | ( | mlt_animation | self | ) |
Close the animation and deallocate all of its resources.
self | the animation to destroy |
|
staticprivate |
Remove a node from the linked list.
self | an animation |
node | the node to remove |
int mlt_animation_get_item | ( | mlt_animation | self, |
mlt_animation_item | item, | ||
int | position | ||
) |
Load an animation item for an absolute position.
This performs interpolation if there is no keyframe at the position
.
self | an animation |
item | an already allocated animation item that will be filled in |
position | the frame number for the point in time |
int mlt_animation_get_length | ( | mlt_animation | self | ) |
Get the length of the animation.
If the animation was initialized with a zero or negative value, then this gets the maximum frame number from animation's list of nodes.
self | an animation |
int mlt_animation_insert | ( | mlt_animation | self, |
mlt_animation_item | item | ||
) |
Insert an animation item.
self | an animation |
item | an animation item |
void mlt_animation_interpolate | ( | mlt_animation | self | ) |
Re-interpolate non-keyframe nodes after a series of insertions or removals.
self | an animation |
int mlt_animation_key_count | ( | mlt_animation | self | ) |
Get the number of keyframes.
self | an animation |
int mlt_animation_key_get | ( | mlt_animation | self, |
mlt_animation_item | item, | ||
int | index | ||
) |
Get an animation item for the N-th keyframe.
self | an animation |
item | an already allocated animation item that will be filled in |
index | the N-th keyframe (0 based) in this animation |
int mlt_animation_key_set_frame | ( | mlt_animation | self, |
int | index, | ||
int | frame | ||
) |
Change the frame number for the N-th keyframe.
self | an animation |
index | the N-th keyframe (0 based) in this animation |
frame | the position of this keyframe in frame units |
int mlt_animation_key_set_type | ( | mlt_animation | self, |
int | index, | ||
mlt_keyframe_type | type | ||
) |
Change the interpolation for the N-th keyframe.
self | an animation |
index | the N-th keyframe (0 based) in this animation |
type | the method of interpolation for this key frame |
mlt_animation mlt_animation_new | ( | ) |
Create a new animation object.
int mlt_animation_next_key | ( | mlt_animation | self, |
mlt_animation_item | item, | ||
int | position | ||
) |
Get the keyfame at the position or the next following.
self | an animation |
item | an already allocated animation item which will be updated |
position | the frame number at which to start looking for the next animation node |
int mlt_animation_parse | ( | mlt_animation | self, |
const char * | data, | ||
int | length, | ||
double | fps, | ||
locale_t | locale | ||
) |
Parse a string representing an animation.
A semicolon is the delimiter between keyframe=value items in the string.
self | an animation |
data | the string representing an animation |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
fps | the framerate to use when evaluating time strings |
locale | the locale to use when converting strings to numbers |
int mlt_animation_parse_item | ( | mlt_animation | self, |
mlt_animation_item | item, | ||
const char * | value | ||
) |
Parse a string representing an animation keyframe=value.
This function does not affect the animation itself! But it will use some state of the animation for the parsing (e.g. fps, locale). It parses into a mlt_animation_item that you provide. item->frame
should be specified if the string does not have an equal sign and time field. If an exclamation point (!) or vertical bar (|) character precedes the equal sign, then the keyframe interpolation is set to discrete. If a tilde (~) precedes the equal sign, then the keyframe interpolation is set to smooth (spline).
self | an animation |
item | an already allocated animation item |
value | the string representing an animation |
int mlt_animation_prev_key | ( | mlt_animation | self, |
mlt_animation_item | item, | ||
int | position | ||
) |
Get the keyfame at the position or the next preceding.
self | an animation |
item | an already allocated animation item which will be updated |
position | the frame number at which to start looking for the previous animation node |
int mlt_animation_refresh | ( | mlt_animation | self, |
const char * | data, | ||
int | length | ||
) |
Conditionally refresh the animation if it is modified.
self | an animation |
data | the string representing an animation |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
int mlt_animation_remove | ( | mlt_animation | self, |
int | position | ||
) |
Remove the keyframe at the specified position.
self | an animation |
position | the frame number of the animation node to remove |
char * mlt_animation_serialize | ( | mlt_animation | self | ) |
Serialize the animation.
This version outputs the key frames' position as a frame number. The caller is responsible for free-ing the returned string.
self | an animation |
char * mlt_animation_serialize_cut | ( | mlt_animation | self, |
int | in, | ||
int | out | ||
) |
Serialize a cut of the animation.
This version outputs the key frames' position as a frame number. The caller is responsible for free-ing the returned string.
self | an animation |
in | the frame at which to start serializing animation nodes |
out | the frame at which to stop serializing nodes |
char * mlt_animation_serialize_cut_tf | ( | mlt_animation | self, |
int | in, | ||
int | out, | ||
mlt_time_format | time_format | ||
) |
Serialize a cut of the animation (with time format).
The caller is responsible for free-ing the returned string.
self | an animation |
in | the frame at which to start serializing animation nodes |
out | the frame at which to stop serializing nodes |
time_format | the time format to use for the key frames |
char * mlt_animation_serialize_tf | ( | mlt_animation | self, |
mlt_time_format | time_format | ||
) |
Serialize the animation (with time format).
The caller is responsible for free-ing the returned string.
self | an animation |
time_format | the time format to use for the key frames |
void mlt_animation_set_length | ( | mlt_animation | self, |
int | length | ||
) |
Set the length of the animation.
The length is used for interpreting negative keyframe positions as relative to the length. It is also used when serializing an animation as a string.
self | an animation |
length | the length of the animation in frame units |
char* mlt_animation_s::data |
the string representing the animation
double mlt_animation_s::fps |
framerate to use when converting time clock strings to frame units
int mlt_animation_s::length |
the maximum number of frames to use when interpreting negative keyframe positions
locale_t mlt_animation_s::locale |
pointer to a locale to use when converting strings to numeric values
animation_node mlt_animation_s::nodes |
a linked list of keyframes (and possibly non-keyframe values)