Annonce

>>> Bienvenue sur codelab! >>> Première visite ? >>> quelques mots sur codelab //// une carte des membres//// (apéros) codelab


#1 2016-05-01 19:36:44 Transitions photos

VTT85
membre
Date d'inscription: 2016-04-23
Messages: 33

Transitions photos



Bonjour à tous,

Quelqu'un aurait-il une démarche à me proposer pour entamer la programmation de ces transitions présentées dans cette vidéo : https://www.youtube.com/watch?v=vn3iesgMsbA.

Je ne sais pas du tout comment faire ? Comment partir... ?

Merci d'avance à vous tous ! cool

Hors ligne

 

#2 2016-05-02 13:18:25 Re : Transitions photos

sakramh
membre
Lieu: clichy-sous-bois
Date d'inscription: 2008-12-02
Messages: 829
Site web

Re: Transitions photos



tu peux tjs fouiller dans le code source de logiciel genre :
kinodv kdenlive cinerella etc... (y a des chances que ce soit du C/ C++) pour avoir une idée .
Mais le principe du masque proposé par Mushussu est une bonne voie .
Des tutos de the gimp (voire photoshop) t'expliqueront mieux que moi ce que c'est .


le code est l'alchimie de l'âge du silicium

Hors ligne

 

#3 2016-05-02 19:35:34 Re : Transitions photos

VTT85
membre
Date d'inscription: 2016-04-23
Messages: 33

Re: Transitions photos



j'ai réussi à trouver une transition en code java, mais le problème c'est qu'il me réclame un package que je n'ai pas...

Voici le code :

/*
 * @(#)ScribbleTransition2D.java
 *
 * $Date$
 *
 * Copyright (c) 2011 by Jeremy Wood.
 * All rights reserved.
 *
 * The copyright of this software is owned by Jeremy Wood. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jeremy Wood. For details see accompanying license terms.
 * 
 * This software is probably, but not necessarily, discussed here:
 * https://javagraphics.java.net/
 * 
 * That site should also contain the most recent official version
 * of this software.  (See the SVN repository for more details.)
 */
package com.bric.image.transition;

import java.awt.BasicStroke;
import java.awt.Dimension;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;

import com.bric.geom.RectangularTransform;
import com.bric.geom.ShapeStringUtils;
import com.bric.geom.ShapeUtils;
import com.bric.geom.TransformUtils;

/** This reveals the next frame as if a giant eraser is
 * scribbling away the current frame.  (Or as if a coin is
 * scratching a scratch-and-win game ticket.) Here are playback samples:
 * <p><table summary="Sample Animations of ScribbleTransition2D" cellspacing="50" border="0"><tr>
 * <td align="center">
 * <img src="https://javagraphics.java.net/resources/transition/ScribbleTransition2D/Scribble.gif" alt="Scribble">
 * <p>Scribble
 * </td>
 * <td align="center">
 * <img src="https://javagraphics.java.net/resources/transition/ScribbleTransition2D/ScribbleTwice.gif" alt="Scribble Twice">
 * <p>Scribble Twice
 * </td>
 * </tr></table>
 * 
 */
public class ScribbleTransition2D extends Transition2D {
	
	/** This public static method is used by the 
	 * {@link com.bric.image.transition.Transition2DDemoHelper}
	 * class to create sample animations of this transition.
	 * @return the transitions that should be used to demonstrate this
	 * transition.
	 */
	public static Transition[] getDemoTransitions() {
		return new Transition[] {
				new ScribbleTransition2D(false), 
				new ScribbleTransition2D(true)
		};
	}
	Shape scribble;
	Rectangle2D shapeBounds;
	
	/** Meh.  I don't really like the left-to-right option...
	 */
	int direction = RIGHT;
	
	boolean twoPasses;
	
	/** Creates a new scribble transition.
	 * 
	 * @param twoPasses whether this transition is depicted in two scribbles or one.
	 */
	public ScribbleTransition2D(boolean twoPasses) {
		scribble = ShapeStringUtils.createGeneralPath("m -6.286 19.763 l 10.03 -2.175 l 2.183 58.034 l 24.854 -3.692 l 18.468 60.811 l 39.862 -5.543 l 35.711 58.651 l 53.273 -4.926 l 48.934 54.989 l 55.852 27.084 l 60.936 55.565 z");
		this.twoPasses = twoPasses;
		shapeBounds = new Rectangle2D.Float(0,0,60,60);
	}
	
	@Override
	public Transition2DInstruction[] getInstructions(float progress,Dimension size) {
		Rectangle2D bigRect = new Rectangle2D.Float(0,0,size.width,size.height);
		AffineTransform t;
		if(direction==RIGHT) {
			t = RectangularTransform.create(shapeBounds,bigRect);
		} else {
			//flip horizontal
			Rectangle2D r1 = shapeBounds;
			t = TransformUtils.createAffineTransform(r1.getX(), r1.getY(),
					r1.getX()+r1.getWidth(), r1.getY(), 
					r1.getX(), r1.getY()+r1.getHeight(), 
					bigRect.getX()+bigRect.getWidth(), bigRect.getY(), 
					bigRect.getX(), bigRect.getY(), 
					bigRect.getX()+bigRect.getWidth(), bigRect.getY()+bigRect.getHeight());
		}
		
		if(twoPasses==false) {
			BasicStroke stroke = new BasicStroke(16.7f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND);
			Shape subShape = ShapeUtils.traceShape(scribble,progress);
			subShape = stroke.createStrokedShape(subShape);
			subShape = t.createTransformedShape(subShape);
			
			return new Transition2DInstruction[] {
					new ImageInstruction(true),
					new ImageInstruction(false,null,subShape) };
		} else {
			float progress1 = progress/.5f;
			if(progress1>1) progress1 = 1;
			Shape subShape1 = ShapeUtils.traceShape(scribble,progress1);
			BasicStroke stroke = new BasicStroke(16.7f*.5f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND);
			subShape1 = stroke.createStrokedShape(subShape1);
			t.translate(2,5);
			subShape1 = t.createTransformedShape(subShape1);
			t.translate(-2,-5);
	
			stroke = new BasicStroke(16.7f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND);
			float progress2 = (progress-.5f)/.5f;
			if(progress2<0) progress2 = 0;
			Shape subShape2 = ShapeUtils.traceShape(scribble,progress2);
			subShape2 = stroke.createStrokedShape(subShape2);
			subShape2 = t.createTransformedShape(subShape2);
			
			
			return new Transition2DInstruction[] {
					new ImageInstruction(true),
					new ImageInstruction(false,null,subShape1),
					new ImageInstruction(false,null,subShape2)
			};
		}
	}
	
	@Override
	public String toString() {
        if(twoPasses)
            return "Scribble Twice";
		return "Scribble";
	}

}

Hors ligne

 

#4 2016-05-03 16:44:42 Re : Transitions photos

VTT85
membre
Date d'inscription: 2016-04-23
Messages: 33

Re: Transitions photos



En gros voici la transition que je veux utiliser :

https://javagraphics.java.net/doc/com/b … ion2D.html

mais je n'arrive pas à la mettre en place sur processing, je ne comprend pas pourquoi... sad

Hors ligne

 

#5 2016-05-05 10:02:04 Re : Transitions photos

Mushussu
membre
Lieu: Orléans
Date d'inscription: 2012-05-24
Messages: 802

Re: Transitions photos



J'ai complètement changer de paradigmes. J'utilise toujours la réflexion pour gérer dynamiquement les transitions, mais chaque transition est une classe indépendante. Ainsi il est plus aisé de construire de nouvelles transitions.

Hors ligne

 

#6 2016-05-06 10:54:37 Re : Transitions photos

VTT85
membre
Date d'inscription: 2016-04-23
Messages: 33

Re: Transitions photos



Oh super Mushussu, c'est le top, bravo à toi ! smile

Il n'y a pas moyen d'utiliser les codes déja fait sur le site pour les utiliser au lieu de recoder la transition car j'aurais voulu utiliser plusieurs transitions proposées sur ce site : https://javagraphics.java.net/doc/com/b … mmary.html

Puis que les transitions soient aléatoire, c'est un projet vraiment pas facile et assez pharaonique... Merci beaucoup à vous en tout cas ! smile

Hors ligne

 

fil rss de cette discussion : rss

Pied de page des forums

Powered by FluxBB

codelab, graphisme & code : emoc / 2008-2024