mlt_frame_get_image( a_frame, image, format, width, height, 1 );
// Calculate the region now
- composite_calculate( &result, this, a_frame, ( float )( position - in ) / ( out - in + 1 ) );
+ composite_calculate( &result, this, a_frame, ( float )( position ) / ( out - in + 1 ) );
// Fetch the b frame image
result.w = ( int )( result.w * *width / result.nw );
float sw, sh;
// Get values from the transition
+ float fix_rotate_x = mlt_properties_get_double( properties, "fix_rotate_x" );
+ float fix_rotate_y = mlt_properties_get_double( properties, "fix_rotate_y" );
+ float fix_rotate_z = mlt_properties_get_double( properties, "fix_rotate_z" );
float rotate_x = mlt_properties_get_double( properties, "rotate_x" );
float rotate_y = mlt_properties_get_double( properties, "rotate_y" );
float rotate_z = mlt_properties_get_double( properties, "rotate_z" );
int y_offset = ( int )result.h >> 1;
uint8_t *alpha = mlt_frame_get_alpha_mask( b_frame );
+ uint8_t *mask = mlt_pool_alloc( b_width * b_height );
+ uint8_t *pmask = mask;
float mix;
affine_t affine;
affine_init( affine.matrix );
- affine_rotate( affine.matrix, rotate_x * ( position - in ) );
- affine_rotate_y( affine.matrix, rotate_y * ( position - in ) );
- affine_rotate_z( affine.matrix, rotate_z * ( position - in ) );
+ affine_rotate( affine.matrix, fix_rotate_x + rotate_x * ( position - in ) );
+ affine_rotate_y( affine.matrix, fix_rotate_y + rotate_y * ( position - in ) );
+ affine_rotate_z( affine.matrix, fix_rotate_z + rotate_z * ( position - in ) );
affine_shear( affine.matrix,
fix_shear_x + shear_x * ( position - in ),
fix_shear_y + shear_y * ( position - in ),
dz = MapZ( affine.matrix, 0, 0 );
+ if ( mask != NULL )
+ memset( mask, 0, b_width * b_height );
+
for ( y = lower_y; y < upper_y; y ++ )
{
p = q;
{
if ( alpha == NULL )
{
+ *pmask ++ = 255;
dx += dx & 1;
*p ++ = *( b_image + dy * b_stride + ( dx << 1 ) );
*p ++ = *( b_image + dy * b_stride + ( dx << 1 ) + ( ( x & 1 ) << 1 ) + 1 );
}
else
{
+ *pmask ++ = *( alpha + dy * b_width + dx );
mix = ( float )*( alpha + dy * b_width + dx ) / 255.0;
dx += dx & 1;
- *p ++ = *p * ( 1 - mix ) + mix * *( b_image + dy * b_stride + ( dx << 1 ) );
- *p ++ = *p * ( 1 - mix ) + mix * *( b_image + dy * b_stride + ( dx << 1 ) + ( ( x & 1 ) << 1 ) + 1 );
+ *p = *p * ( 1 - mix ) + mix * *( b_image + dy * b_stride + ( dx << 1 ) );
+ p ++;
+ *p = *p * ( 1 - mix ) + mix * *( b_image + dy * b_stride + ( dx << 1 ) + ( ( x & 1 ) << 1 ) + 1 );
+ p ++;
}
}
else
{
p += 2;
+ pmask ++;
}
}
q += a_stride;
}
+
+ b_frame->get_alpha_mask = NULL;
+ mlt_properties_set_data( b_props, "alpha", mask, 0, mlt_pool_release, NULL );
}
return 0;
// Push the transition method
mlt_frame_push_get_image( a_frame, transition_get_image );
-
return a_frame;
}