Class PamImage

java.lang.Object
PamguardMVC.PamDataUnit
videoRangePanel.pamImage.PamImage
All Implemented Interfaces:
Comparable

public class PamImage extends PamDataUnit
Class which holds photos or other images and reads metadata.
Author:
Jamie Macaulay
  • Constructor Details

    • PamImage

      public PamImage(File imageFile, ImageTimeParser timeParser)
      Open a photo and extract metadata information.
      Parameters:
      imageFile -
      Throws:
      com.drew.imaging.ImageProcessingException
      IOException
    • PamImage

      public PamImage(javafx.scene.image.Image imageFX, long time)
      Create image from writable image and time stamp.
      Parameters:
      imageFX - - the image
      time - - time stamp in millis.
    • PamImage

      public PamImage(BufferedImage bufferedImage)
      Sometimes a photo will have no metadata. In this case the constructor can just consist of the image.
      Parameters:
      bufferedImage -
  • Method Details

    • processPhotoData

      public void processPhotoData()
      Find the relevant data within the photos meta data.
    • getImage

      public BufferedImage getImage()
      Get the buffered image. Used to display in swing.
      Returns:
      get the image.
    • getImageFX

      public javafx.scene.image.WritableImage getImageFX()
      Get the Image (JavaFX). Note that this converts from a buffered image on every call.
      Returns:
      the FX version of the Bufferred image.
    • imageOK

      public boolean imageOK()
      Check whether the image is Ok. This indicates the image has been successfully loaded from a file
      Returns:
      true if the image has been loaded properly
    • getImageFile

      public File getImageFile()
      Get the file of the image. This can null if the image was directly set.
      Returns:
      the image file
    • setImageFile

      public void setImageFile(File currentFile)
      Set the image file.
      Parameters:
      currentFile - - the file of the image.
    • getMetaDataText

      public ArrayList<String> getMetaDataText()
      Get an array of strings describing meta data for this photograph.
      Returns:
      arraylist of strings containi9ng meta data.
    • getName

      public String getName()
      Get the name of the image
      Returns:
      the name of the image
    • getGeoTag

      public LatLong getGeoTag()
      Get the geotag for this image contained in the metadata. Returns null if no geotag is avalaible.
      Returns:
      the location of the image in latitude and longitude.
    • getDate

      @Deprecated public Date getDate()
      Deprecated.
      Get the date of the image
      Returns:
      the image date
    • setDate

      public void setDate(Date date)
      Set the date of the image
      Parameters:
      date - - the date to set
    • setTimeMilliseconds

      public void setTimeMilliseconds(long time)
      Description copied from class: PamDataUnit
      Set the millisecond time of the data unit using the standard Java time system of milliseconds since midnight, January 1, 1970 UTC
      Overrides:
      setTimeMilliseconds in class PamDataUnit
      Parameters:
      time - time in milliseconds.
    • getImageTimeParsers

      public static ArrayList<ImageTimeParser> getImageTimeParsers()
      Image time parsers. These can be used to get the filetime from filenames.
      Returns:
      list of possible time parsers.
    • recalcTime

      public void recalcTime(ImageTimeParser imageTimeParser)
      Recalculate the image time with a specified time parser.
      Parameters:
      imageTimeParser - - the time parser index