MLT  7.38.0
Multimedia Framework
Public Member Functions | Private Attributes
Mlt::Animation Class Reference

C++ wrapper for mlt_animation — keyframe animation data. More...

#include <MltAnimation.h>

Collaboration diagram for Mlt::Animation:
Collaboration graph
[legend]

Public Member Functions

 Animation ()
 
 Animation (const Animation &)
 
 Animation (mlt_animation animation)
 Wrap an existing mlt_animation handle (does not take ownership). More...
 
mlt_animation get_animation () const
 
int get_item (int position, bool &is_key, mlt_keyframe_type &)
 Get the interpolated value and keyframe type at position. More...
 
void interpolate ()
 Recalculate intermediate values between keyframes. More...
 
bool is_key (int position)
 Return true if position is exactly a keyframe. More...
 
bool is_valid () const
 Return true if the underlying handle is non-null. More...
 
int key_count ()
 Return the total number of keyframes. More...
 
int key_get (int index, int &frame, mlt_keyframe_type &)
 Get the frame and type of the keyframe at index. More...
 
int key_get_frame (int index)
 Return the frame number of the keyframe at index. More...
 
mlt_keyframe_type key_get_type (int index)
 Return the interpolation type of the keyframe at index. More...
 
int key_set_frame (int index, int frame)
 Move the keyframe at index to frame. More...
 
int key_set_type (int index, mlt_keyframe_type type)
 Set the interpolation type of the keyframe at index. More...
 
mlt_keyframe_type keyframe_type (int position)
 Return the interpolation type of the keyframe at position. More...
 
int length ()
 Return the animation length in frames. More...
 
int next_key (int position)
 Return the next keyframe position at or after position. More...
 
bool next_key (int position, int &key)
 Get the keyfame at the position or the next following. More...
 
Animationoperator= (const Animation &)
 
int previous_key (int position)
 Return the previous keyframe position at or before position. More...
 
bool previous_key (int position, int &key)
 Get the keyfame at the position or the previous before. More...
 
int remove (int position)
 Remove the keyframe at position. More...
 
char * serialize_cut (int in=-1, int out=-1)
 Serialize the animation as a string, optionally clipped to [in, out]. More...
 
char * serialize_cut (mlt_time_format format, int in=-1, int out=-1)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void set_length (int length)
 Set a new total length, scaling keyframe positions proportionally. More...
 
void shift_frames (int shift)
 Shift all keyframe positions by shift frames. More...
 
 ~Animation ()
 

Private Attributes

mlt_animation instance
 

Detailed Description

C++ wrapper for mlt_animation — keyframe animation data.

An animation holds a set of keyframes that define how a property value changes over time. Obtain one from Properties via the anim_get / anim_set family of methods.

See also
mlt_animation_s

Constructor & Destructor Documentation

◆ Animation() [1/3]

Animation::Animation ( )

◆ Animation() [2/3]

Animation::Animation ( mlt_animation  animation)

Wrap an existing mlt_animation handle (does not take ownership).

◆ Animation() [3/3]

Animation::Animation ( const Animation animation)

◆ ~Animation()

Animation::~Animation ( )

Member Function Documentation

◆ get_animation()

mlt_animation Animation::get_animation ( ) const

◆ get_item()

int Animation::get_item ( int  position,
bool &  is_key,
mlt_keyframe_type type 
)

Get the interpolated value and keyframe type at position.

◆ interpolate()

void Animation::interpolate ( )

Recalculate intermediate values between keyframes.

◆ is_key()

bool Animation::is_key ( int  position)

Return true if position is exactly a keyframe.

◆ is_valid()

bool Animation::is_valid ( ) const

Return true if the underlying handle is non-null.

◆ key_count()

int Animation::key_count ( )

Return the total number of keyframes.

◆ key_get()

int Animation::key_get ( int  index,
int &  frame,
mlt_keyframe_type type 
)

Get the frame and type of the keyframe at index.

◆ key_get_frame()

int Animation::key_get_frame ( int  index)

Return the frame number of the keyframe at index.

◆ key_get_type()

mlt_keyframe_type Animation::key_get_type ( int  index)

Return the interpolation type of the keyframe at index.

◆ key_set_frame()

int Animation::key_set_frame ( int  index,
int  frame 
)

Move the keyframe at index to frame.

◆ key_set_type()

int Animation::key_set_type ( int  index,
mlt_keyframe_type  type 
)

Set the interpolation type of the keyframe at index.

◆ keyframe_type()

mlt_keyframe_type Animation::keyframe_type ( int  position)

Return the interpolation type of the keyframe at position.

◆ length()

int Animation::length ( )

Return the animation length in frames.

◆ next_key() [1/2]

int Animation::next_key ( int  position)

Return the next keyframe position at or after position.

Get the keyfame at the position or the next following.

If no keyframe exists at or after the position, the return value is invalid

Deprecated:
Prefer bool Animation::next_key( int position, int& key )
Parameters
positionthe frame number at which to start looking for the next keyframe
Returns
the position of the next keyframe

◆ next_key() [2/2]

bool Animation::next_key ( int  position,
int &  key 
)

Get the keyfame at the position or the next following.

On error, key is not modified.

Parameters
positionthe frame number at which to start looking for the next keyframe
keythe returned position of the next keyframe
Returns
true if there was an error

◆ operator=()

Animation & Animation::operator= ( const Animation animation)

◆ previous_key() [1/2]

int Animation::previous_key ( int  position)

Return the previous keyframe position at or before position.

Get the keyfame at the position or the previous keyframe before.

If no keyframe exists at or before the position, the return value is invalid

Deprecated:
Prefer bool Animation::previous_key( int position, int& key )
Parameters
positionthe frame number at which to start looking for the previous keyframe
Returns
the position of the previous keyframe

◆ previous_key() [2/2]

bool Animation::previous_key ( int  position,
int &  key 
)

Get the keyfame at the position or the previous before.

On error, key is not modified.

Parameters
positionthe frame number at which to start looking for the previous keyframe
keythe returned position of the previous keyframe
Returns
true if there was an error

◆ remove()

int Animation::remove ( int  position)

Remove the keyframe at position.

◆ serialize_cut() [1/2]

char * Animation::serialize_cut ( int  in = -1,
int  out = -1 
)

Serialize the animation as a string, optionally clipped to [in, out].

Caller must free() the returned string.

◆ serialize_cut() [2/2]

char * Animation::serialize_cut ( mlt_time_format  format,
int  in = -1,
int  out = -1 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ set_length()

void Animation::set_length ( int  length)

Set a new total length, scaling keyframe positions proportionally.

◆ shift_frames()

void Animation::shift_frames ( int  shift)

Shift all keyframe positions by shift frames.

Field Documentation

◆ instance

mlt_animation Mlt::Animation::instance
private

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