]> git.sesse.net Git - mlt/commitdiff
more affine silliness
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 3 Feb 2005 09:26:57 +0000 (09:26 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 3 Feb 2005 09:26:57 +0000 (09:26 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@658 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/plus/filter_affine.c
src/modules/plus/transition_affine.c

index a0d39a4787644142764edec726c1fe227c25d504..465e412909fed53109d81b6e77f3ed922984d605 100644 (file)
@@ -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." );
index 42c03a28c5b4fc41f959e0f1cddc9b73ce2d3b01..896fe084a294ae6e4d3c95ed097b14277f2b422e 100644 (file)
@@ -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 );