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 class
Camera.Frame
static class
Camera.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.Frame
captureFrame()
Captures a frame from the camera, returning it as a JISA Camera.Frame object.java.awt.image.BufferedImage
getBufferedImage()
Captures a frame from the camera, returning it as a BufferedImage object.double
getFrameRate()
Returns how many frames the camera is/can capture each second.default javafx.scene.image.Image
getImage()
Captures a frame from the camera, returning it as a JavaFX Image object.Camera.Mode
getMode()
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.boolean
isOn()
Returns whether the camera is switched on or off.void
setMode(Camera.Mode mode)
Sets the resolution mode the camera is to use.default void
setOn(boolean on)
Sets whether the camera is on (capturing) or off (not capturing).void
turnOff()
Turns the camera off (stops capturing).void
turnOn()
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, DeviceException
Turns the camera on (starts capturing).- Throws:
java.io.IOException
- Upon communications errorDeviceException
- Upon device incompatibility
-
turnOff
void turnOff() throws java.io.IOException, DeviceException
Turns 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, DeviceException
Sets 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, DeviceException
Returns 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, DeviceException
Returns 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, DeviceException
Captures 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, DeviceException
Captures 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
-
-