// Simple Slit-Scan Program for QT Video // Written for Processing version 123. // Golan Levin, December 2006. // // This demonstration depends on the canvas height being equal // to the movie height. If you would prefer otherwise, // consider using the image copy() function rather than the // direct pixel-accessing approach I have used here. -- GL // Load a movie using Processing's QT library. import processing.video.*; Movie myMovie; int draw_position_x; boolean b_newFrame = false; // fresh-frame flag //-------------------------------------------- void setup(){ myMovie = new Movie(this, "titanic.mov"); myMovie.loop(); size(600, 120); draw_position_x = width - 1; background(0,0,0); } //-------------------------------------------- void movieEvent(Movie m) { m.read(); b_newFrame = true; } //-------------------------------------------- void draw() { if (b_newFrame) { int vWidth = myMovie.width; int vHeight = myMovie.height; int video_slice_x = myMovie.width/2; // Copy a column of pixels from the middle of the video // To a location moving slowly across the canvas. loadPixels(); for (int y=0; y