public interface IWebcam
IWebcam
- webcam interface.Modifier and Type | Interface and Description |
---|---|
static class |
IWebcam.FrameFormat
FrameFormat - frame format. |
static interface |
IWebcam.IListener
IListener - webcam listener. |
Modifier and Type | Method and Description |
---|---|
VideoFrame |
capture()
Captures single frame.
|
void |
close()
Closes webcam.
|
IWebcam.FrameFormat[] |
getFormats(java.lang.Object... args)
Returns supported formats.
|
java.lang.String |
getId()
Returns device id.
|
java.lang.String |
getName()
Returns device name.
|
boolean |
isOpen()
Checks if webcam is open in the current application.
|
void |
open(IWebcam.FrameFormat format,
IWebcam.IListener listener)
Opens webcam using
format . |
boolean |
setFrameFormat(IWebcam.FrameFormat format)
Sets capture frame format.
|
void |
setFrameRate(float frameRate)
Sets capture frame rate (in frames per second).
|
void |
startCapture()
Starts capture.
|
void |
stopCapture()
Stops capture.
|
java.lang.String getId()
java.lang.String getName()
IWebcam.FrameFormat[] getFormats(java.lang.Object... args)
Note:
- method returns valid formats only after successful IWebcam#open()
invocation
- returned null
means that supported formats enumeration functionality
is not supported
args
- boolean isOpen()
true
if open; false
if closedvoid open(IWebcam.FrameFormat format, IWebcam.IListener listener) throws java.lang.Exception
format
.
Note:
- The method opens webcam asynchronously.
isOpen()
method returns true
after webcam is opened successfully
format
- initial frame format to use,
if null
then default webcam frame format is usedlistener
- webcam listenerjava.lang.Exception
- if failed to initialize webcam deviceboolean setFrameFormat(IWebcam.FrameFormat format)
Note:
- This method should be called after the webcam is opened.
format
- new frame format for webcam capturetrue
if format was set successfully;
false
if failed to set formatvoid setFrameRate(float frameRate)
frameRate
- frame rate (in frames per second)void startCapture()
Note:
- This method should be called after the webcam is opened.
void stopCapture()
VideoFrame capture()
Note:
- This method should be called after the webcam is opened.
void close()