]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_types.h
Add Catmull-Rom spline smooth animation interpolation.
[mlt] / src / framework / mlt_types.h
index c1574d4471481d80ceca65fcb4223167d4886cf5..5261051f21d0dac048a95354ef84a3e5963d398f 100644 (file)
@@ -75,6 +75,15 @@ typedef enum
 }
 mlt_time_format;
 
+/** Interpolation methods for animation keyframes */
+
+typedef enum {
+       mlt_keyframe_discrete, //< non-interpolated; value changes instantaneously at the key frame
+       mlt_keyframe_linear,   //< simple, constant pace from this key frame to the next
+       mlt_keyframe_smooth    //< eased pacing from this keyframe to the next using a Catmull-Rom spline
+}
+mlt_keyframe_type;
+
 /** The relative time qualifiers */
 
 typedef enum
@@ -105,8 +114,12 @@ mlt_service_type;
 /* I don't want to break anyone's applications without warning. -Zach */
 #undef DOUBLE_MLT_POSITION
 #ifdef DOUBLE_MLT_POSITION
+#define MLT_POSITION_FMT "%f"
+#define MLT_POSITION_MOD(A, B) (A - B * ((int)(A / B)))
 typedef double mlt_position;
 #else
+#define MLT_POSITION_MOD(A, B) A % B
+#define MLT_POSITION_FMT "%d"
 typedef int32_t mlt_position;
 #endif