| Modifier and Type | Class and Description |
|---|---|
static class |
ScreenWebcam.ScreenFrameFormat
ScreenFrameFormat |
IWebcam.FrameFormat, IWebcam.IListener| Constructor and Description |
|---|
ScreenWebcam(java.lang.String name,
java.awt.GraphicsDevice device)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
VideoFrame |
capture()
Captures single frame.
|
void |
close()
Closes webcam.
|
static java.awt.Rectangle |
createRectangleByFormat(IWebcam.FrameFormat format)
Creates
Rectangle equivalent to the format. |
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 |
toString() |
public ScreenWebcam(java.lang.String name,
java.awt.GraphicsDevice device)
throws java.lang.Exception
name - device - java.lang.Exceptionpublic static java.awt.Rectangle createRectangleByFormat(IWebcam.FrameFormat format)
Rectangle equivalent to the format.format - frame formatnull if format is nullpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getId()
IWebcampublic java.lang.String getName()
IWebcampublic IWebcam.FrameFormat[] getFormats(java.lang.Object... args)
IWebcam Note:
- method returns valid formats only after successful IWebcam#open() invocation
- returned null means that supported formats enumeration functionality
is not supported
getFormats in interface IWebcampublic boolean isOpen()
IWebcampublic void open(IWebcam.FrameFormat format, IWebcam.IListener listener) throws java.lang.Exception
IWebcamformat.
Note:
- The method opens webcam asynchronously.
IWebcam.isOpen() method returns true after webcam is opened successfully
public boolean setFrameFormat(IWebcam.FrameFormat format)
IWebcam Note:
- This method should be called after the webcam is opened.
setFrameFormat in interface IWebcamformat - new frame format for webcam capturetrue if format was set successfully;
false if failed to set formatpublic void setFrameRate(float frameRate)
IWebcamsetFrameRate in interface IWebcamframeRate - frame rate (in frames per second)public void startCapture()
IWebcam Note:
- This method should be called after the webcam is opened.
startCapture in interface IWebcampublic void stopCapture()
IWebcamstopCapture in interface IWebcampublic VideoFrame capture()
IWebcam Note:
- This method should be called after the webcam is opened.