public class WebcamDefaultDevice extends Object implements WebcamDevice, WebcamDevice.BufferAccess, Runnable, WebcamDevice.FPSSource
WebcamDevice.BufferAccess, WebcamDevice.FPSSource| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close device, however it can be open again.
|
void |
dispose()
Dispose device.
|
double |
getFPS()
Get current device FPS.
|
BufferedImage |
getImage()
Fetch image from underlying camera.
|
ByteBuffer |
getImageBytes()
Get image in form of raw bytes.
|
String |
getName()
Get device name.
|
Dimension |
getResolution()
Get currently set image size.
|
Dimension[] |
getResolutions()
Get the list of all possible image resolutions.
|
int |
getTimeout()
Get timeout for image acquisition.
|
boolean |
isOpen()
Is webcam device open?
|
void |
open()
Open device, it can be closed any time.
|
void |
run() |
void |
setFailOnSizeMismatch(boolean fail)
Determines if device should fail when requested image size is different
than actually received.
|
void |
setResolution(Dimension size)
Set new expected image size.
|
void |
setTimeout(int timeout)
Set timeout for image acquisition.
|
public String getName()
WebcamDevicegetName in interface WebcamDevicepublic Dimension[] getResolutions()
WebcamDevicegetResolutions in interface WebcamDevicepublic Dimension getResolution()
WebcamDevicegetResolution in interface WebcamDevicepublic void setResolution(Dimension size)
WebcamDevicesetResolution in interface WebcamDevicesize - the size to be setpublic ByteBuffer getImageBytes()
WebcamDevice.BufferAccessgetImageBytes in interface WebcamDevice.BufferAccesspublic BufferedImage getImage()
WebcamDevicegetImage in interface WebcamDevicepublic void open()
WebcamDeviceopen in interface WebcamDevicepublic void close()
WebcamDeviceclose in interface WebcamDevicepublic void dispose()
WebcamDevicedispose in interface WebcamDevicepublic void setFailOnSizeMismatch(boolean fail)
fail - the fail on size mismatch flag, true or falsepublic boolean isOpen()
WebcamDeviceisOpen in interface WebcamDevicepublic int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout value in millisecondspublic double getFPS()
WebcamDevice.FPSSourcegetFPS in interface WebcamDevice.FPSSourceCopyright © 2012-2014 Bartosz Firyn (SarXos). All Rights Reserved.