![JAR search and dependency download from the Maven repository](/logo.png)
com.github.sarxos.webcam.WebcamDevice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webcam-capture Show documentation
Show all versions of webcam-capture Show documentation
This library allows you to use your PC webcam, IP or network cameras directly from Java. It's compatible with most operating systems (Windows, Linux, MacOS).
package com.github.sarxos.webcam;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
/**
* Webcam device abstraction.
*
* @author Bartosz Firyn (SarXos)
*/
public interface WebcamDevice {
/**
* Get device name.
*
* @return Device name
*/
String getName();
/**
* Get the list of all possible image resolutions.
*
* @return Possible resolutions
*/
Dimension[] getSizes();
/**
* Get currently set image size.
*
* @return The size which is currently set
*/
Dimension getSize();
/**
* Set new expected image size.
*
* @param size the size to be set
*/
void setSize(Dimension size);
/**
* Fetch image from underlying camera.
*
* @return Image
*/
BufferedImage getImage();
/**
* Open device, it can be closed any time.
*/
void open();
/**
* Close device, however it can be open again.
*/
void close();
/**
* Dispose device. After device is disposed it cannot be open again.
*/
void dispose();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy