Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
yeriel
yeriel's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Problem with Video blending using GSVideo
[0 Replies]
10-Dec-2012 11:09 AM
Forum:
Contributed Library Questions
Hello,
I'm a very beginner and would like to get your help for the problem of video blending.
I'm currently trying to blend two movies using the examples of GSVideo and GLGraphics libraries.
However, nothing happens when I run the sketch.
Here is the code.
import processing.opengl.*;
import codeanticode.glgraphics.*;
import codeanticode.gsvideo.*;
GSMovie movieA;
GSMovie movieB;
GLTexture bottomLayer, topLayer, resultLayer;
LayerBlend current;
void setup()
{
size(640,480, GLConstants.GLGRAPHICS);
background(255);
current = new LayerBlend(this, "Darken", "BlendDarken.xml");
movieA = new GSMovie(this, "arm.mov");
bottomLayer = new GLTexture(this);
movieA.setPixelDest(bottomLayer);
movieA.loop();
movieB = new GSMovie(this, "Digidelic.mov");
topLayer = new GLTexture(this);
movieB.setPixelDest(topLayer);
movieB.loop();
resultLayer = new GLTexture(this, topLayer.width,topLayer.height);
}
void movieEvent(GSMovie movie) {
movie.read();
}
void draw()
{
if((bottomLayer.putPixelsIntoTexture()) && (topLayer.putPixelsIntoTexture())) {
current.apply();
resultLayer.render(0,0);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
class LayerBlend {
String name;
GLTextureFilter filter;
LayerBlend(PApplet Parent,String Name,String XmlFile) {
name = Name;
filter = new GLTextureFilter(Parent,XmlFile);
}
void apply() {
filter.apply(new GLTexture[]{bottomLayer, topLayer}, resultLayer);
}
}
Any advice and help would be appreciated.
Thank you for your time.
«Prev
Next »
Moderate user : yeriel
Forum