Search processing.org:

Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

### Capture

Examples

    import processing.video.*;
    Capture myCapture;

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

      myCapture = new Capture(this, width, height, 30);

      // The name of the capture device is dependent those
      // plugged into the computer. To get a list of the
      // choices, uncomment the following line
      // println(Capture.list());
      // And to specify the camera, replace "Camera Name"
      // in the next line with one from Capture.list()
      // myCapture = new Capture(this, width, height, "Camera Name", 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 November 22, 2008 08:39:22pm PST