You are wasting your time
(EN google-translate)
(PL google-translate)
Das ist ein erstes Programmbeispiel mit einem gewissen künstlerischen Anspruch im Sinne der Konzeptkunst.
Es ist dennoch ein ziemlich einfaches Beispiel. Unter Verwendung der Bibliothek mico kann der scetch unverändert sowohl auf einem PC, als auch auf einem Android-Gerät laufen.
Hier ist der Quelltext:
import info.kramann.extensions.mico; import processing.video.*; import ketai.camera.*; import java.util.Properties; int[] last_image=null; int COUNTER = 0; long TIME=0; public void setup() { fullScreen(); orientation(LANDSCAPE); frameRate(30); mico.cameraStart(this); } boolean SWITCHED = false; public void draw() { if(SWITCHED==false) { SWITCHED = mico.switchCamera(); } double difference = -1.0; background(255); int[] new_image = mico.cameraGetImage().pixels; if(new_image!=null && last_image!=null && last_image.length==new_image.length) { difference = 0.0; for(int i=0;i<new_image.length;i++) { difference += (double)abs(new_image[i] - last_image[i]); } difference/=Math.pow(10,10); } if(new_image!=null && (last_image==null || last_image.length!=new_image.length)) { last_image = new int[new_image.length]; } if(new_image!=null && last_image!=null && last_image.length==new_image.length) { for(int i=0;i<new_image.length;i++) { last_image[i] = new_image[i]; } } image(mico.cameraGetImage(),250,50); textSize(32); fill(0,0,255); text(""+difference,10,50); if(COUNTER>0) { textSize(32); fill(255,0,0); text("You are wasting your time",10,250); text("by looking on a mobile device",10,350); text("since "+(System.currentTimeMillis()-TIME)/1000+" seconds!",10,450); COUNTER--; } else { TIME = System.currentTimeMillis(); } if(difference>4.5) { COUNTER = 120; } } public void mousePressed() { mico.switchCamera(); }
Code 0-1: source code of mico_Camera_wasting_time
mico_Camera_wasting_time.zip -- sketch folder
mico_Camera_wasting_time_Android.zip -- same example but Android-mode
Bild 0-1: Screenshot from PC.