Package jisa.devices.interfaces
Interface Camera
-
- All Superinterfaces:
Instrument
- All Known Implementing Classes:
Webcam
public interface Camera extends Instrument
Instrument interface for implementing cameras.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCamera.Framestatic classCamera.Mode-
Nested classes/interfaces inherited from interface jisa.devices.interfaces.Instrument
Instrument.AutoQuantity<S>, Instrument.OptionalQuantity<S>, Instrument.Parameter<S>, Instrument.Setter<S>, Instrument.TableQuantity
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Camera.FramecaptureFrame()Captures a frame from the camera, returning it as a JISA Camera.Frame object.java.awt.image.BufferedImagegetBufferedImage()Captures a frame from the camera, returning it as a BufferedImage object.doublegetFrameRate()Returns how many frames the camera is/can capture each second.default javafx.scene.image.ImagegetImage()Captures a frame from the camera, returning it as a JavaFX Image object.Camera.ModegetMode()Returns the resolution mode the camera is currently using.java.util.List<Camera.Mode>getModes()Returns a list of all available resolution modes for the camera.booleanisOn()Returns whether the camera is switched on or off.voidsetMode(Camera.Mode mode)Sets the resolution mode the camera is to use.default voidsetOn(boolean on)Sets whether the camera is on (capturing) or off (not capturing).voidturnOff()Turns the camera off (stops capturing).voidturnOn()Turns the camera on (starts capturing).-
Methods inherited from interface jisa.devices.interfaces.Instrument
close, getAddress, getConfigurationParameters, getConfigurationParameters, getIDN, getLockObject, getName, setTimeout
-
-
-
-
Method Detail
-
turnOn
void turnOn() throws java.io.IOException, DeviceExceptionTurns the camera on (starts capturing).- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
turnOff
void turnOff() throws java.io.IOException, DeviceExceptionTurns the camera off (stops capturing).- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
setOn
default void setOn(boolean on) throws java.io.IOException, DeviceExceptionSets whether the camera is on (capturing) or off (not capturing).- Parameters:
on- Should it be on?- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
isOn
boolean isOn() throws java.io.IOException, DeviceExceptionReturns whether the camera is switched on or off.- Returns:
- Is it on?
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
getMode
Camera.Mode getMode() throws java.io.IOException, DeviceException
Returns the resolution mode the camera is currently using.- Returns:
- Resolution mode
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
setMode
void setMode(Camera.Mode mode) throws java.io.IOException, DeviceException
Sets the resolution mode the camera is to use.- Parameters:
mode- Mode to use- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
getFrameRate
double getFrameRate() throws java.io.IOException, DeviceExceptionReturns how many frames the camera is/can capture each second.- Returns:
- Current framerate
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
getBufferedImage
java.awt.image.BufferedImage getBufferedImage() throws java.io.IOException, DeviceExceptionCaptures a frame from the camera, returning it as a BufferedImage object.- Returns:
- Captured frame
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
getImage
default javafx.scene.image.Image getImage() throws java.io.IOException, DeviceExceptionCaptures a frame from the camera, returning it as a JavaFX Image object.- Returns:
- Captured frame
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
captureFrame
default Camera.Frame captureFrame() throws java.io.IOException, DeviceException
Captures a frame from the camera, returning it as a JISA Camera.Frame object.- Returns:
- Captured frame
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
getModes
java.util.List<Camera.Mode> getModes() throws java.io.IOException, DeviceException
Returns a list of all available resolution modes for the camera.- Returns:
- List of modes
- Throws:
java.io.IOException- Upon communications errorDeviceException- Upon device incompatibility
-
-