+ // Remove all items from the stack
+ while( mlt_deque_pop_back( self->stack_image ) ) ;
+
+ // Update the information
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( self ), "image", image, 0, NULL, NULL );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( self ), "width", width );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( self ), "height", height );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( self ), "format", format );
+ self->get_alpha_mask = NULL;
+}
+
+/** Get the short name for an image format.
+ *
+ * \public \memberof mlt_frame_s
+ * \param format the image format
+ * \return a string
+ */
+
+const char * mlt_image_format_name( mlt_image_format format )
+{
+ switch ( format )
+ {
+ case mlt_image_none: return "none";
+ case mlt_image_rgb24: return "rgb24";
+ case mlt_image_rgb24a: return "rgb24a";
+ case mlt_image_yuv422: return "yuv422";
+ case mlt_image_yuv420p: return "yuv420p";
+ case mlt_image_opengl: return "opengl";
+ }
+ return "invalid";
+}
+
+/** Get the image associated to the frame.
+ *
+ * You should express the desired format, width, and height as inputs. As long
+ * as the loader producer was used to generate this or the imageconvert filter
+ * was attached, then you will get the image back in the format you desire.
+ * However, you do not always get the width and height you request depending
+ * on properties and filters. You do not need to supply a pre-allocated
+ * buffer, but you should always supply the desired image format.
+ *
+ * \public \memberof mlt_frame_s
+ * \param self a frame
+ * \param[out] buffer an image buffer
+ * \param[in,out] format the image format
+ * \param[in,out] width the horizontal size in pixels
+ * \param[in,out] height the vertical size in pixels
+ * \param writable whether or not you will need to be able to write to the memory returned in \p buffer
+ * \return true if error
+ * \todo Better describe the width and height as inputs.
+ */
+
+int mlt_frame_get_image( mlt_frame self, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_properties properties = MLT_FRAME_PROPERTIES( self );
+ mlt_get_image get_image = mlt_frame_pop_get_image( self );