Created
February 3, 2015 21:18
-
-
Save gregberger/fffc30c5fd18a1f946a6 to your computer and use it in GitHub Desktop.
bitshift.me
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 w = 800; | |
int h = 800; | |
void setup() { | |
background(0); | |
size(w, h); | |
c=new Capture(this, w, h); | |
c.start(); | |
} | |
void draw() { | |
if (c.available()) { | |
c.read(); | |
loadPixels(); | |
int t = millis()/1000; | |
newVal=modif; | |
for (int i=0; i<pixels.length; i+=2) { | |
if (i>2 && i<c.pixels.length-width) { | |
pixels[(i+width)/4] = c.pixels[i]>>t*(int(sin(t)*100))>>3|t<<24; | |
pixels[i/4]=1<<(t%4)<<0|(frameCount%2)<<8|(frameCount)<<16&c.pixels[i]; | |
pixels[(i+width)/2] = i<<16>>t|i&c.pixels[i]; | |
pixels[i+1]=(frameCount%64)<<16|i>>millis()<<0&c.pixels[i]; | |
} | |
} | |
updatePixels(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment