X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ftransition_region.c;h=e8391c5ce8e284f613151cc4c9381bcf86d181b4;hb=a4b667f3830a168d22a841e6d2eba73f641c087c;hp=2cbc97873c9c13f3d3f09a68b5cb15f867964cb7;hpb=b4db352cab396eb5179e2deaf58bb05dcdfb0c69;p=melted diff --git a/src/modules/core/transition_region.c b/src/modules/core/transition_region.c index 2cbc978..e8391c5 100644 --- a/src/modules/core/transition_region.c +++ b/src/modules/core/transition_region.c @@ -91,6 +91,8 @@ static int create_instance( mlt_transition this, char *name, char *value, int co static uint8_t *filter_get_alpha_mask( mlt_frame this ) { + uint8_t *alpha = NULL; + // Obtain properties of frame mlt_properties properties = mlt_frame_properties( this ); @@ -107,7 +109,24 @@ static uint8_t *filter_get_alpha_mask( mlt_frame this ) mlt_properties_set( mlt_frame_properties( shape_frame ), "distort", "true" ); mlt_frame_get_image( shape_frame, &image, &format, ®ion_width, ®ion_height, 0 ); - return mlt_frame_get_alpha_mask( shape_frame ); + alpha = mlt_frame_get_alpha_mask( shape_frame ); + + // Generate from the Y component of the image if no alpha available + if ( alpha == NULL ) + { + int size = region_width * region_height; + uint8_t *p = mlt_pool_alloc( size ); + alpha = p; + while ( size -- ) + { + *p ++ = *image ++; + image ++; + } + mlt_properties_set_data( mlt_frame_properties( shape_frame ), "alpha", alpha, + region_width * region_height, mlt_pool_release, NULL ); + } + + return alpha; } /** Do it :-).