Reference+
Name
captureEvent()
Description
This event function is run when a new camera frame is available. Use the read() method to capture this frame. If there is more than one capture device in the program, captureEvent() is called each time any of the devices has a new frame available. Use an if within the function to determine which device is triggering the event.
This function is for people who want to process the image data separately from drawing (and as quickly as possible.) You cannot draw to the screen inside the captureEvent() function. If you want to draw immediately based on the new image, then use the Capture.available() method.
Examples
import processing.video.*; Capture cam; void setup() { size(200, 200); cam = new Capture(this); cam.start(); } void draw() { image(cam, 0, 0); } void captureEvent(Capture c) { c.read(); }
Syntax
void captureEvent(Capture which) { statements }
Parameters
statements
any valid statementswhich
the camera with the event
Related
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.