daily pastebin goal
45%
SHARE
TWEET

4Athena

a guest Jan 23rd, 2015 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import processing.video.*;
  2.  
  3. Capture athena;
  4.  
  5. int nbPix;
  6.  
  7. void setup() {
  8.  
  9.   size(640, 480);  
  10.   athena = new Capture(this, 320, 240);
  11.   nbPix = athena.width * athena.height;
  12.   athena.start();
  13.   frameRate(10);
  14. }
  15.  
  16. void draw() {
  17.  
  18.   if (athena.available() == true) {
  19.     athena.read();
  20.   }
  21.  
  22.   println(frameCount);
  23.  
  24.   for (int i = 0; i < nbPix; i++) {
  25.    
  26.     color youplala = athena.pixels[i];
  27.    
  28.     athena.pixels[i] = color(255, saturation(youplala), blue(youplala));
  29.   }
  30.  
  31.   image(athena, 0, 0, width, height);
  32.  
  33. }
RAW Paste Data
Top