Interface Camera

  • All Superinterfaces:
    Instrument
    All Known Implementing Classes:
    Webcam

    public interface Camera
    extends Instrument
    Instrument interface for implementing cameras.
    • Method Detail

      • turnOn

        void turnOn()
             throws java.io.IOException,
                    DeviceException
        Turns the camera on (starts capturing).
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • turnOff

        void turnOff()
              throws java.io.IOException,
                     DeviceException
        Turns the camera off (stops capturing).
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - 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 error
        DeviceException - Upon device incompatibility