Package de.pco.camera

Class Camera

java.lang.Object
de.pco.camera.Camera

public class Camera
extends Object
Camera class as the higher abstraction above the Recorder and Sdk classes
Author:
PCO
  • Field Details

    • sdk

      public Sdk sdk
      Sdk object wraps the pco.sdk native functions
    • recorder

      public Recorder recorder
      Recorder object wraps the pco.recorder native functions
  • Constructor Details

  • Method Details

    • setDefaultConfiguration

      public void setDefaultConfiguration() throws PcoException
      Sets default configuration for the camera.
      Throws:
      PcoException
    • getConfiguration

      public Map<ConfigurationParameter,​Object> getConfiguration() throws PcoException
      Gets the current configuration list for the camera.
      Returns:
      Map with the most usable camera parameters
      Throws:
      PcoException
    • setConfiguration

      public void setConfiguration​(Map<ConfigurationParameter,​Object> conf) throws PcoException
      Sets the camera a required number of configuration parameters by means of a Map.
      Parameters:
      conf - Map with camera parameters to be set
      Throws:
      PcoException
    • setConfiguration

      public void setConfiguration​(ConfigurationParameter param, Object value) throws PcoException
      Sets a particular configuration parameter for the camera.
      Parameters:
      param - Parameter of camera to be set
      value - Value of the parameter
      Throws:
      PcoException
    • record

      public void record​(long numberOfImages, ExtendedRecorderType type) throws PcoException, IllegalArgumentException
      Generates and configures a new recorder instance and starts recording.
      Parameters:
      numberOfImages - Number of images allocated in the driver. The RAM of the PC is limiting the maximum value.
      type - Recorder type to be used for the current record
      Throws:
      PcoException
      IllegalArgumentException - Thrown if numberOfImages <= 4 by recorder type FIFO or RING_BUFFER
    • stop

      public void stop() throws PcoException
      Stops recording.
      Throws:
      PcoException
    • close

      public void close() throws PcoException
      Closes the camera.
      Throws:
      PcoException
    • setExposureTime

      public void setExposureTime​(double exposureTime) throws PcoException
      Sets the exposure time of the camera. The underlying values for the sdk.setDelayExposureTime(0, Timebase.MS, time, timebase) function will be calculated automatically. The delay time is set to 0.
      Parameters:
      exposureTime - Desired exposure time in seconds
      Throws:
      PcoException
    • getExposureTime

      public double getExposureTime() throws PcoException
      Returns the exposure time in seconds
      Returns:
      Throws:
      PcoException
    • getImage

      public ImageData getImage​(int imageNumber) throws PcoException
      Returns an image from the recorder.
      Parameters:
      imageNumber - Number of recorder index to read. In "sequence" or "sequence non blocking" recorder type the recorder index matches the image number.
      Returns:
      Recorded image including its metadata.
      Throws:
      PcoException
    • getImage

      public ImageData getImage​(int imageNumber, Roi roi) throws PcoException
      Returns an image from the recorder in the given region of interest.
      Parameters:
      imageNumber - Number of recorder index to read. In "sequence" or "sequence non blocking" recorder type the recorder index matches the image number.
      roi - Region of interest. Only this region is returned.
      Returns:
      Recorded image including its metadata.
      Throws:
      PcoException
    • getImages

      public List<ImageData> getImages() throws PcoException
      Returns all recorded images from the recorder.
      Returns:
      List of all the recorded images.
      Throws:
      PcoException
    • getImages

      public List<ImageData> getImages​(Roi roi) throws PcoException
      Returns all recorded images from the recorder.
      Parameters:
      roi - Region of interest of all the images to be returned only
      Returns:
      List of all the recorded images.
      Throws:
      PcoException
    • waitForFirstImage

      public void waitForFirstImage() throws PcoException
      This function waits for the first available image. In recorder mode SEQUENCE_NON_BLOCKING, RING_BUFFER and FIFO the record() function returns immediately. The user is responsible to wait for images from the camera before getImage() / getImages() is called.
      Throws:
      PcoException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object