com.github.sarxos.webcam.ds.buildin
Class WebcamDefaultDevice

java.lang.Object
  extended by com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice
All Implemented Interfaces:
WebcamDevice

public class WebcamDefaultDevice
extends Object
implements WebcamDevice


Constructor Summary
protected WebcamDefaultDevice(Device device)
           
 
Method Summary
 void close()
          Close device, however it can be open again.
 void dispose()
          Dispose device.
 BufferedImage getImage()
          Fetch image from underlying camera.
 String getName()
          Get device name.
 Dimension getResolution()
          Get currently set image size.
 Dimension[] getResolutions()
          Get the list of all possible image resolutions.
 boolean isOpen()
          Is webcam device open?
 void open()
          Open device, it can be closed any time.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebcamDefaultDevice

protected WebcamDefaultDevice(Device device)
Method Detail

getName

public String getName()
Description copied from interface: WebcamDevice
Get device name.

Specified by:
getName in interface WebcamDevice
Returns:
Device name

getResolutions

public Dimension[] getResolutions()
Description copied from interface: WebcamDevice
Get the list of all possible image resolutions.

Specified by:
getResolutions in interface WebcamDevice
Returns:
Possible resolutions

getResolution

public Dimension getResolution()
Description copied from interface: WebcamDevice
Get currently set image size.

Specified by:
getResolution in interface WebcamDevice
Returns:
The size which is currently set

setResolution

public void setResolution(Dimension size)
Description copied from interface: WebcamDevice
Set new expected image size.

Specified by:
setResolution in interface WebcamDevice
Parameters:
size - the size to be set

getImage

public BufferedImage getImage()
Description copied from interface: WebcamDevice
Fetch image from underlying camera.

Specified by:
getImage in interface WebcamDevice
Returns:
Image

open

public void open()
Description copied from interface: WebcamDevice
Open device, it can be closed any time.

Specified by:
open in interface WebcamDevice

close

public void close()
Description copied from interface: WebcamDevice
Close device, however it can be open again.

Specified by:
close in interface WebcamDevice

dispose

public void dispose()
Description copied from interface: WebcamDevice
Dispose device. After device is disposed it cannot be open again.

Specified by:
dispose in interface WebcamDevice

setFailOnSizeMismatch

public void setFailOnSizeMismatch(boolean fail)
Determines if device should fail when requested image size is different than actually received.

Parameters:
fail - the fail on size mismatch flag, true or false

isOpen

public boolean isOpen()
Description copied from interface: WebcamDevice
Is webcam device open?

Specified by:
isOpen in interface WebcamDevice
Returns:
True if webcam device is open, false otherwise


Copyright © 2012-2013 Bartosz Firyn (SarXos). All Rights Reserved.