X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fplus%2Ftransition_affine.c;h=896fe084a294ae6e4d3c95ed097b14277f2b422e;hb=ff8e939e1781bf747b7a9f2d6a26a6f7ca1b9bee;hp=42c03a28c5b4fc41f959e0f1cddc9b73ce2d3b01;hpb=a718f7848696034f1e1b37e715fffaffafa7adad;p=melted diff --git a/src/modules/plus/transition_affine.c b/src/modules/plus/transition_affine.c index 42c03a2..896fe08 100644 --- a/src/modules/plus/transition_affine.c +++ b/src/modules/plus/transition_affine.c @@ -497,11 +497,16 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f mlt_position position = mlt_properties_get_position( a_props, name ); mlt_position in = mlt_properties_get_position( properties, "in" ); mlt_position out = mlt_properties_get_position( properties, "out" ); + int mirror = mlt_properties_get_position( properties, "mirror" ); + int length = out - in + 1; // Structures for geometry struct geometry_s *start = mlt_properties_get_data( properties, "geometries", NULL ); struct geometry_s result; + if ( mirror && position > length / 2 ) + position = abs( position - length ); + // Now parse the geometries if ( start == NULL ) { @@ -517,7 +522,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f mlt_frame_get_image( a_frame, image, format, width, height, 1 ); // Calculate the region now - composite_calculate( &result, this, a_frame, ( float )( position ) / ( out - in + 1 ) ); + composite_calculate( &result, this, a_frame, ( float )position / length ); // Fetch the b frame image result.w = ( int )( result.w * *width / result.nw ); @@ -593,13 +598,13 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f affine_t affine; affine_init( affine.matrix ); - 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_rotate( affine.matrix, fix_rotate_x + rotate_x * position ); + affine_rotate_y( affine.matrix, fix_rotate_y + rotate_y * position ); + affine_rotate_z( affine.matrix, fix_rotate_z + rotate_z * position ); affine_shear( affine.matrix, - fix_shear_x + shear_x * ( position - in ), - fix_shear_y + shear_y * ( position - in ), - fix_shear_z + shear_z * ( position - in ) ); + fix_shear_x + shear_x * position, + fix_shear_y + shear_y * position, + fix_shear_z + shear_z * position ); affine_offset( affine.matrix, ox, oy ); lower_x -= ( lower_x & 1 );