-/** Get the image.
-*/
-
-static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
-{
- // Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
-
- // Get the b frame from the stack
- mlt_frame b_frame = mlt_frame_pop_frame( a_frame );
-
- // Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
-
- // Arbitrary composite defaults
- float mix = mlt_properties_get_double( b_props, "image.mix" );
- float frame_delta = mlt_properties_get_double( b_props, "luma.delta" );
- int luma_width = mlt_properties_get_int( b_props, "luma.width" );
- int luma_height = mlt_properties_get_int( b_props, "luma.height" );
- uint16_t *luma_bitmap = mlt_properties_get_data( b_props, "luma.bitmap", NULL );
- float luma_softness = mlt_properties_get_double( b_props, "luma.softness" );
- int progressive = mlt_properties_get_int( b_props, "progressive" ) ||
- mlt_properties_get_int( a_props, "consumer_progressive" ) ||
- mlt_properties_get_int( b_props, "luma.progressive" );
-
- int top_field_first = mlt_properties_get_int( b_props, "top_field_first" );
- int reverse = mlt_properties_get_int( b_props, "luma.reverse" );
-
- // Since we are the consumer of the b_frame, we must pass along this
- // consumer property from the a_frame
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- mlt_properties_set_double( b_props, "consumer_scale", mlt_properties_get_double( a_props, "consumer_scale" ) );
-
- // Honour the reverse here
- if ( mix >= 1.0 )
- mix -= floor( mix );
-
- mix = reverse ? 1 - mix : mix;
- frame_delta *= reverse ? -1.0 : 1.0;
-
- // Ensure we get scaling on the b_frame
- mlt_properties_set( b_props, "rescale.interp", "nearest" );
-
- if ( luma_width > 0 && luma_height > 0 && luma_bitmap != NULL )
- // Composite the frames using a luma map
- luma_composite( a_frame, b_frame, luma_width, luma_height, luma_bitmap, mix, frame_delta,
- luma_softness, progressive ? -1 : top_field_first, width, height );
- else
- // Dissolve the frames using the time offset for mix value
- dissolve_yuv( a_frame, b_frame, mix, *width, *height );
-
- // Extract the a_frame image info
- *width = mlt_properties_get_int( a_props, "width" );
- *height = mlt_properties_get_int( a_props, "height" );
- *image = mlt_properties_get_data( a_props, "image", NULL );
-
- return 0;
-}
-