Invert
import processing.video.*;
Capture camera;
void setup()
{
size(640, 480);
println(Capture.list());
camera = new Capture(this, 80, 60, 12);
}
void captureEvent(Capture camera)
{
camera.read();
float r,g,b;
int x,y;
color c;
for (y=0;y<camera.height;y++)
{
for (x=0;x<camera.width;x++)
{
// get current color of this pixel
c=camera.get(x,y);
r=red(c);
g=green(c);
b=blue(c);
r=255-r;
g=255-g;
b=255-b;
c=color(r,g,b);
camera.set(x,y,c);
}
}
}
void draw()
{
image(camera,0,0,640,480)
}