Invert and Flip
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,x2,y2;
color c;
for (y=0;y<camera.height/2;y++)
{
for (x=0;x< camera.width;x++)
{
// get current color of this pixel
c=camera.get(x,y);
// figure out the mirror image coords
x2=x; // x is the same
y2=camera.height - y; // flip the y
camera.set(x2,y2,c);
}
}
}
void draw()
{
image(camera,0,0,640,480)
}