video
Interface SimpleCapture


public interface SimpleCapture

This is a minimal definition of a video capture interface .

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.
 java.awt.Image 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

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.

shutdown

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


getFrame

java.awt.Image 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

getWidth

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

Returns:
image width

getHeight

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

Returns:
image height

getError

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

Returns:
string or null if all is ok