added WebCam
This commit is contained in:
11
source.pde
11
source.pde
@@ -38,7 +38,8 @@ class SourceManager { //no constructor
|
||||
void setImage(PImage img) { //set image to source
|
||||
imageChanged = true;
|
||||
source = img.get();
|
||||
if(!webcamMode)fallbackImage = source;
|
||||
//if(!webcamMode) fallbackImage = source;
|
||||
fallbackImage = source;
|
||||
nativeResoX = source.width;
|
||||
nativeResoY = source.height;
|
||||
//println(nativeResoX);
|
||||
@@ -48,7 +49,7 @@ class SourceManager { //no constructor
|
||||
println("Fallback");
|
||||
setImage(fallbackImage); //fallbackImage should always be a copy of the last image that worked
|
||||
}
|
||||
|
||||
/*
|
||||
void startWebcam() {
|
||||
String[] cameras = Capture.list();
|
||||
println(cameras);
|
||||
@@ -58,15 +59,17 @@ class SourceManager { //no constructor
|
||||
void stopWebcam() {
|
||||
cam.stop();
|
||||
webcamMode = false;
|
||||
}
|
||||
}*/
|
||||
|
||||
void update() {
|
||||
/*
|
||||
if (webcamMode) {
|
||||
if (cam.available()) {
|
||||
cam.read();
|
||||
setImage(cam);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (source == null) {
|
||||
fallback();
|
||||
@@ -123,7 +126,7 @@ class SourceManager { //no constructor
|
||||
if (isImage(path) || isVideo(path)) {
|
||||
println("Importing file " + path);
|
||||
if (moviePlaying) movie.stop();
|
||||
if (webcamMode) gui.webcam.setValue(false);
|
||||
//if (webcamMode) gui.webcam.setValue(false);
|
||||
if (isImage(path)) {
|
||||
moviePlaying = false;
|
||||
setImage(loadImage(path));
|
||||
|
||||
Reference in New Issue
Block a user