Package videoRangePanel.pamImage
Class PamImage
java.lang.Object
PamguardMVC.PamDataUnit
videoRangePanel.pamImage.PamImage
- All Implemented Interfaces:
Comparable
Class which holds photos or other images and reads metadata.
- Author:
- Jamie Macaulay
-
Constructor Summary
ConstructorDescriptionPamImage
(BufferedImage bufferedImage) Sometimes a photo will have no metadata.PamImage
(File imageFile, ImageTimeParser timeParser) Open a photo and extract metadata information.PamImage
(javafx.scene.image.Image imageFX, long time) Create image from writable image and time stamp. -
Method Summary
Modifier and TypeMethodDescriptiongetDate()
Deprecated.Get the geotag for this image contained in the metadata.getImage()
Get the buffered image.Get the file of the image.javafx.scene.image.WritableImage
Get the Image (JavaFX).static ArrayList<ImageTimeParser>
Image time parsers.Get an array of strings describing meta data for this photograph.getName()
Get the name of the imageboolean
imageOK()
Check whether the image is Ok.void
Find the relevant data within the photos meta data.void
recalcTime
(ImageTimeParser imageTimeParser) Recalculate the image time with a specified time parser.void
Set the date of the imagevoid
setImageFile
(File currentFile) Set the image file.void
setTimeMilliseconds
(long time) Set the millisecond time of the data unit using the standard Java time system of milliseconds since midnight, January 1, 1970 UTCMethods inherited from class PamguardMVC.PamDataUnit
addDataAnnotation, addSuperDetection, amplifyMeasuredAmplitudeByDB, amplifyMeasuredAmplitudeByLinear, calcSnapshotGeometry, clearOandAngles, clearUpdateCount, compareTo, findDataAnnotation, findDataAnnotation, freeData, getAbsBlockIndex, getAmplitudeDB, getAnnotationsSummaryString, getBasicData, getCalculatedAmlitudeDB, getChannelBitmap, getColourIndex, getDataAnnotation, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getDataUnitPopupMenu, getDurationInMilliseconds, getEndTimeInMilliseconds, getFrequency, getFrequencyOverlap, getHydrophoneBitmap, getHydrophoneHeading, getLastChangeTime, getLastSample, getLastUpdateTime, getLocalisation, getMeasuredAmplitude, getMeasuredAmplitudeType, getNoiseBackground, getNumDataAnnotations, getOriginLatLong, getParentDataBlock, getSampleDuration, getSampleDurationAsInt, getSeconds, getSequenceBitmap, getSequenceBitmapObject, getSignalExcess, getSignalSPL, getSnapshotGeometry, getStartSample, getSummaryString, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetectionsCount, getSuperDetectionSyncronisation, getSuperId, getTimeDelaysSeconds, getTimeMilliseconds, getTimeNanoseconds, getTimeOverlap, getUID, getUpdateCount, isEmbryonic, isForceAmpRecalc, linAmplitudeToDB, removeDataAnnotation, removeDataAnnotation, removeSuperDetection, setAbsBlockIndex, setCalculatedAmlitudeDB, setChannelBitmap, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setDurationInMilliseconds, setEmbryonic, setForceAmpRecalc, setFrequency, setInfo, setLastUpdateTime, setLocalisation, setMeasuredAmpAndType, setMeasuredAmplitude, setMeasuredAmplitudeType, setNoiseBackground, setParentDataBlock, setSampleDuration, setSequenceBitmap, setSignalExcess, setSignalSPL, setSnapshotGeometry, setStartSample, setTimeDelaysSeconds, setUID, setUniqueSuperDetection, sortOutputMaps, updateDataUnit
-
Constructor Details
-
PamImage
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 imagetime
- - time stamp in millis.
-
PamImage
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
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
Get the file of the image. This can null if the image was directly set.- Returns:
- the image file
-
setImageFile
Set the image file.- Parameters:
currentFile
- - the file of the image.
-
getMetaDataText
Get an array of strings describing meta data for this photograph.- Returns:
- arraylist of strings containi9ng meta data.
-
getName
Get the name of the image- Returns:
- the name of the image
-
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.Get the date of the image- Returns:
- the image date
-
setDate
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 classPamDataUnit
- Parameters:
time
- time in milliseconds.
-
getImageTimeParsers
Image time parsers. These can be used to get the filetime from filenames.- Returns:
- list of possible time parsers.
-
recalcTime
Recalculate the image time with a specified time parser.- Parameters:
imageTimeParser
- - the time parser index
-