toxi.video.capture
Interface SimpleCapture

All Known Implementing Classes:
JMFSimpleCapture

public interface SimpleCapture

This is a minimal definition of a video capture interface as currently used by the LibCV library.

This generic interface is used to ensure a relative independence from various capture backends. It should be very straightforward to write a wrapper for the existing Processing Capture object implementing this interface to enable its use with the LibCV library.

Author:
Karsten Schmidt < i n f o [ a t ] t o x i . co . u k >

Method Summary
 java.lang.String getError()
          String description of an error occured previously.
 processing.core.PImage getFrame()
          Reads the current frame from the internal video capture and converts it into a PImage object
 int getHeight()
          Retrieves the pixel height of the capture instance
 int getWidth()
          Retrieves the pixel width of the capture instance
 boolean initVideo(java.lang.String deviceID, int width, int height, int fps)
          Initializes video capture for the given device.
 void shutdown()
          Handles freeing up any resources used by the SimpleCapture instance
 

Method Detail

getError

java.lang.String getError()
String description of an error occured previously.

Returns:
string or null if all is ok

getFrame

processing.core.PImage getFrame()
Reads the current frame from the internal video capture and converts it into a PImage object

Returns:
the most recent captured frame as PImage

getHeight

int getHeight()
Retrieves the pixel height of the capture instance

Returns:
image height

getWidth

int getWidth()
Retrieves the pixel width of the capture instance

Returns:
image width

initVideo

boolean initVideo(java.lang.String deviceID,
                  int width,
                  int height,
                  int fps)
Initializes video capture for the given device.

Parameters:
deviceID - device descriptor
width - capture frame width
height - capture frame height
fps - frame rate
Returns:
False, if the device could not be initialized. The exact reason can be found out via JMFSimpleCapture.getError().

shutdown

void shutdown()
Handles freeing up any resources used by the SimpleCapture instance