]> git.sesse.net Git - mlt/commitdiff
Add mlt.Frame.get_image for Python.
authorDan Dennedy <dan@dennedy.org>
Sat, 28 May 2011 07:31:27 +0000 (00:31 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 28 May 2011 07:31:27 +0000 (00:31 -0700)
src/swig/mlt.i

index 20434e448ce86ce3b664b874e22c8518a6091b54..4bb129638f125fa0157048e0a0dc3fb73e60f3c0 100644 (file)
@@ -62,6 +62,16 @@ namespace Mlt {
 %newobject Repository::languages( );
 %newobject Profile::list();
 %newobject Repository::presets();
+
+#if defined(SWIGPYTHON)
+%feature("shadow") Frame::get_waveform(int, int) %{
+    def get_waveform(*args): return _mlt.frame_get_waveform(*args)
+%}
+%feature("shadow") Frame::get_image(mlt_image_format&, int&, int&) %{
+    def get_image(*args): return _mlt.frame_get_image(*args)
+%}
+#endif
+
 }
 
 /** Classes to wrap.
@@ -169,6 +179,15 @@ binary_data frame_get_waveform( Mlt::Frame &frame, int w, int h )
        return result;
 }
 
+binary_data frame_get_image( Mlt::Frame &frame, mlt_image_format format, int w, int h )
+{
+       binary_data result = {
+               mlt_image_format_size( format, w, h, NULL ),
+               (char*) frame.get_image( format, w, h )
+       };
+       return result;
+}
+
 %}
 
 %typemap(out) binary_data {
@@ -176,5 +195,6 @@ binary_data frame_get_waveform( Mlt::Frame &frame, int w, int h )
 }
 
 binary_data frame_get_waveform(Mlt::Frame&, int, int);
+binary_data frame_get_image(Mlt::Frame&, mlt_image_format, int, int);
 
 #endif