Quote:import processing.video.*;
Capture myCapture;
void setup()
{
frameRate(30);
size(640, 480);
String[] devices = Capture.list();
myCapture = new Capture(this, width, height ,devices[0],30);
}
void captureEvent(Capture myCapture) {
myCapture.read();
}
void draw() {
loadPixels();
for (int x = 0; x < myCapture.width; x++) {
for (int y = 0; y < myCapture.height; y++ ) {
// Calculate the 1D location from a 2D grid
int loc = x + y*myCapture.width;
// Get the R,G,B values from image
float r,g,b;
r = red (myCapture.pixels[loc]);
g = green (myCapture.pixels[loc]);
b = blue (myCapture.pixels[loc]);
// Calculate an amount to change brightness based on proximity to the mouse
float maxdist = 50; // somewhat arbitrary value
float d = dist(x,y,mouseX,mouseY);
float adjustbrightness = 255*(maxdist-d)/maxdist;
r += adjustbrightness;
g += adjustbrightness;
b += adjustbrightness;
// Constrain RGB to make sure they are within 0-255 color range
r = constrain(r,0,255);
g = constrain(g,0,255);
b = constrain(b,0,255);
// Make a new color and set pixel in the window
color c = color(r,g,b);
pixels[loc] = c;
}
}
updatePixels();
}
....
i have been reading the reference
but i do not manage to get image and capture working together
if i declare image then capture does not work
in the end
this works
but now what if i want to record 2 cameras into 2 images ...
is there a way to set this working with naming the image ?
...
i feel really lost with the video and image libs
the reference is bizarre ....
...
so for now : why is there no Pimage in this code....
how to name the images
thanks