// Dartmouth CS 2, Winter 2009, Chris Bailey-Kellogg // Notes 19 | Sketch 4 // Uses movie file from Processing example Libraries | Video (Movie) | Loop import processing.video.*; Movie station; void setup() { size(480,360); station = new Movie(this, "station.mov"); station.loop(); } void draw() { if (station.available()) { // a movie frame is available for reading station.read(); // read it station.loadPixels(); // Create a mirror image PImage mirr = mirror(station); // Checkerboard regular and mirror image for (int j=0; j<3; j++) for (int i=0; i<3; i++) if ((i+j)%2 == 0) image(station,i*station.width,j*station.height); else image(mirr,i*mirr.width,j*mirr.height); } } // Returns a new image that is the mirror image of img PImage mirror(PImage img) { PImage m = createImage(img.width, img.height, RGB); for (int y=0; y