Created
June 18, 2014 03:19
-
-
Save ktuite/4baf32874e8ed6a7e692 to your computer and use it in GitHub Desktop.
slit-scan video code from http://www.flong.com/texts/lists/slit_scan/ updated to work with processing 2.2.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.video.*; | |
Capture C; | |
int X=0; | |
void setup() { | |
size(640, 480); | |
String[] cameras = Capture.list(); | |
if (cameras.length == 0) { | |
println("There are no cameras available for capture."); | |
exit(); | |
} else { | |
println("Available cameras:"); | |
for (int i = 0; i < cameras.length; i++) { | |
println(cameras[i]); | |
} | |
// The camera can be initialized directly using an | |
// element from the array returned by list(): | |
C = new Capture(this, cameras[0]); | |
C.start(); | |
} | |
} | |
void draw() { | |
if (C.available()) { | |
C.read(); | |
copy(C, (C.width/2),0,1,C.height, (X++%width),0,1,height); | |
} else { | |
System.out.println("not avail"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment