Kdenlive   bug tracker Home page

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000885KdenliveEffectspublic2009-06-02 11:112009-07-23 21:04
ReporterGranjow 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product VersionRecent git 
Target VersionFixed in Version 
Summary0000885: Allow non-linear movements for Composite effect
DescriptionAt the moment moving/scrolling a clip is linear, the speed changes from 0 directly to e.g. 4 Pixel per second and stays there.

Non-linear movements would be nice here. Cosine and sine look kind of natural.
Additional InformationExample Java code I've used for one of my projects.
HILL goes a little bit over the target position and floats back again. SINE2 is just the square sine, it stops a little faster.


    /**
     * Paints the currently visible part of the image.

     * If the animation has been started, the position will be calculated
     * by looking at the passed time, the total time an animation should take,
     * and the selected transition.
     * @see #setAnimationType
     */
    public void paintComponent(Graphics g) {
    g.clearRect(0, 0, (int)windowSize.getWidth(), (int)windowSize.getHeight());

    int x = animationSrc * (int)windowSize.getWidth();
    long timeDiff = System.currentTimeMillis() - animationStart;

    if (timeDiff < animationTime) {
        int d = (animationDest - animationSrc) * (int) windowSize.getWidth();
        float completedFrac = (float)(System.currentTimeMillis() - animationStart) / animationTime;
        double multiplier;

        switch (animationType) {
        case LINEAR:
        multiplier = completedFrac;
        break;
        case COSINE:
        multiplier = cos(PI/2 * completedFrac);
        break;
        case COSINE_FULL:
        multiplier = cos(PI * completedFrac)/2;
        break;
        case SINE:
        multiplier = sin(PI/2 * completedFrac);
        break;
        case SINE2:
        multiplier = sin(PI/2 * completedFrac) * sin(PI/2 * completedFrac);
        break;
        case SINE_:
        multiplier = Math.pow(sin(PI/2 * completedFrac), 1.5);
        case SQUARE:
        multiplier = sqrt(completedFrac);
        break;
        case HILL:
        multiplier = -2.5*completedFrac*completedFrac + 3.5*completedFrac;
        break;
        default:
        multiplier = completedFrac;
        break;
        }
        x += multiplier * d;
    }
    x = -x;
    g.drawImage(pic, x, 0, null);
    }
TagsNo tags attached.
Build/Install Method(select)
Attached Files

- Relationships
related to 0001026new Dynamic, keyframable clip speed 

-  Notes
(0003709)
Granjow (developer)
2009-07-23 20:45

Supplementing: Linear sliding looks terrible.
(0003710)
j-b-m (administrator)
2009-07-23 21:02

If we want that feature, it should be implemented in MLT.
I think Dan has been doing some work on the keyframe handling in MLT, not sure what is going on on that side.
The best would probably be to improve the "geometry" parameter in MLT to be able to specify how the path between keyframes should be calculated...

- Issue History
Date Modified Username Field Change
2009-06-02 11:11 Granjow New Issue
2009-06-02 11:11 Granjow Build/Install Method => (select)
2009-06-02 11:16 Granjow Additional Information Updated
2009-07-23 20:45 Granjow Note Added: 0003709
2009-07-23 21:02 j-b-m Note Added: 0003710
2009-07-23 21:04 j-b-m Relationship added related to 0001026


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker