disclaimer contact

Name

Capture

Examples
import processing.video.*;
Capture myCapture;

void setup() 
{
  size(200, 200);

  // The name of the capture device is dependent on
  // the cameras that are currently attached to your 
  // computer. To get a list of the 
  // choices, uncomment the following line 
  // println(Capture.list());
  
  // To select the camera, replace "Camera Name" 
  // in the next line with one from Capture.list()
  // myCapture = new Capture(this, width, height, "Camera Name", 30);
  
  // This code will try to use the camera used
  myCapture = new Capture(this, width, height, 30);
}

void captureEvent(Capture myCapture) {
  myCapture.read();
}

void draw() {
  image(myCapture, 0, 0);
}
Description Datatype for storing and manipulating video frames from an attached capture device such as a camera. Use Capture.list() to show the names of any attached devices. Using the version of the constructor without name will attempt to use the last device used by a QuickTime program.
Methods
read() Reads the current image
available() Returns true when a new image is available
list() Lists the devices current attached and on
frameRate() Sets how often new frames are read
stop() Stops capturing frames
Constructor
Capture(parent, width, height)
Capture(parent, width, height, fps)
Capture(parent, width, height, name, )
Capture(parent, width, height, name, fps)
Parameters
parent PApplet: typically use "this"
width int: width of the frame
height int: height of the frame
fps int: number of frames to read per second
name String: name of the camera
Usage Application
Related captureEvent()
Updated on June 21, 2011 01:16:31pm EDT

Creative Commons License