From ff8e939e1781bf747b7a9f2d6a26a6f7ca1b9bee Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Thu, 3 Feb 2005 09:26:57 +0000 Subject: [PATCH] more affine silliness git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@658 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/plus/filter_affine.c | 2 ++ src/modules/plus/transition_affine.c | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/modules/plus/filter_affine.c b/src/modules/plus/filter_affine.c index a0d39a4..465e412 100644 --- a/src/modules/plus/filter_affine.c +++ b/src/modules/plus/filter_affine.c @@ -65,6 +65,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * char *name = mlt_properties_get( properties, "_unique_id" ); mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( this ), name ); mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this ); + mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "in", mlt_filter_get_in( filter ) ); + mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "out", mlt_filter_get_out( filter ) ); mlt_producer_seek( producer, position ); mlt_frame_set_position( this, position ); mlt_properties_pass( MLT_PRODUCER_PROPERTIES( producer ), properties, "producer." ); 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 ); -- 1.7.4.4