Class Webcam

  • All Implemented Interfaces:
    Camera, Instrument

    public class Webcam
    extends java.lang.Object
    implements Camera
    • Method Detail

      • turnOn

        public void turnOn()
                    throws java.io.IOException,
                           DeviceException
        Description copied from interface: Camera
        Turns the camera on (starts capturing).
        Specified by:
        turnOn in interface Camera
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • turnOff

        public void turnOff()
                     throws java.io.IOException,
                            DeviceException
        Description copied from interface: Camera
        Turns the camera off (stops capturing).
        Specified by:
        turnOff in interface Camera
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • isOn

        public boolean isOn()
                     throws java.io.IOException,
                            DeviceException
        Description copied from interface: Camera
        Returns whether the camera is switched on or off.
        Specified by:
        isOn in interface Camera
        Returns:
        Is it on?
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • getMode

        public Camera.Mode getMode()
                            throws java.io.IOException,
                                   DeviceException
        Description copied from interface: Camera
        Returns the resolution mode the camera is currently using.
        Specified by:
        getMode in interface Camera
        Returns:
        Resolution mode
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • setMode

        public void setMode​(Camera.Mode mode)
                     throws java.io.IOException,
                            DeviceException
        Description copied from interface: Camera
        Sets the resolution mode the camera is to use.
        Specified by:
        setMode in interface Camera
        Parameters:
        mode - Mode to use
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • getFrameRate

        public double getFrameRate()
        Description copied from interface: Camera
        Returns how many frames the camera is/can capture each second.
        Specified by:
        getFrameRate in interface Camera
        Returns:
        Current framerate
      • getBufferedImage

        public java.awt.image.BufferedImage getBufferedImage()
        Description copied from interface: Camera
        Captures a frame from the camera, returning it as a BufferedImage object.
        Specified by:
        getBufferedImage in interface Camera
        Returns:
        Captured frame
      • getModes

        public java.util.List<Camera.Mode> getModes()
                                             throws java.io.IOException,
                                                    DeviceException
        Description copied from interface: Camera
        Returns a list of all available resolution modes for the camera.
        Specified by:
        getModes in interface Camera
        Returns:
        List of modes
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon device incompatibility
      • getIDN

        public java.lang.String getIDN()
                                throws java.io.IOException,
                                       DeviceException
        Description copied from interface: Instrument
        Returns an identifying String of the instrument.
        Specified by:
        getIDN in interface Instrument
        Returns:
        Identifying String
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon incompatibility with device
      • getName

        public java.lang.String getName()
        Description copied from interface: Instrument
        Returns the name of the instrument or channel.
        Specified by:
        getName in interface Instrument
        Returns:
        Name
      • close

        public void close()
                   throws java.io.IOException,
                          DeviceException
        Description copied from interface: Instrument
        Closes the connection to the instrument.
        Specified by:
        close in interface Instrument
        Throws:
        java.io.IOException - Upon communications error
        DeviceException - Upon incompatibility with device
      • getAddress

        public Address getAddress()
        Description copied from interface: Instrument
        Returns any Address object used to connect to this instrument.
        Specified by:
        getAddress in interface Instrument
        Returns:
        Address object, null if none