public class Metadata
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APERTURE_KEYWORD |
static java.lang.String |
CAMERA_KEYWORD |
static java.lang.String |
COPYRIGHT_KEYWORD |
static java.lang.String |
EXPOSURE_KEYWORD |
static java.lang.String |
FFT_IMAGINARY |
static java.lang.String |
FFT_KEYWORD |
static java.lang.String |
FFT_REAL |
static java.lang.String |
FIRST_KEYWORD |
static java.util.Map<java.lang.String,java.lang.String> |
FITS_KEYWORDS |
static java.lang.String |
FOCAL_LENGTH_KEYWORD |
static java.lang.String |
GRIP_COMBINED_IMAGE_ID |
static java.lang.String |
IMAGE_KIND_KEYWORD |
static java.lang.String |
ISO_KEYWORD |
static java.lang.String |
LAST_KEYWORD |
static java.lang.String |
METHOD_KEYWORD |
static java.lang.String |
NIMAGES_KEYWORD |
static java.lang.String |
OBSERVER_KEYWORD |
Constructor and Description |
---|
Metadata()
Construct an object holding no values, for the values to be added
individually through addValue.
|
Metadata(java.util.List<FITS_KeywordRecord> list)
Construct from a list of keywords as read from a FITS file.
|
Metadata(java.util.Map<java.lang.String,java.lang.String> values)
Construct from a map using the keys defined as static _KEYWORD values
in this class.
|
Metadata(java.lang.String value)
Construct by parsing the value obtained from
Image.getImageMetadataAsMap (), with key "ImageKind" - which may have
been constructed by this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(java.lang.String key,
java.lang.String value)
Only the keys defined as static _KEYWORD strings in this class are
recognised by its methods.
|
javax.imageio.metadata.IIOMetadataNode |
buildTree()
Build a tree fragment in standard (javax_imageio_1.0) format suitable
for merging into a javax.imageio.metadata.IIOMetadata object.
|
void |
clear()
Clear the metadata, for use when disposing an image.
|
boolean |
contains(java.lang.String keyword) |
void |
convertImageKindString() |
java.lang.StringBuffer |
formatForDisplay()
Assemble metadata from all known keys into lines separated by
HTML <br> elements.
|
float |
getAperture()
Get aperture (f/) from the metadata if it is present, otherwise return 0.
|
java.lang.String |
getCamera()
Get camera details from the metadata if present, otherwise return
empty String.
|
java.lang.String |
getCopyright()
Get copyright details from the metadata if present, otherwise return
empty String.
|
java.lang.String |
getDateTime()
Get date and time taken (yyyy:mm:dd hh:mm:ss) from the metadata if it is
present (with key "DateTimeOriginal"), otherwise return empty string.
|
float |
getExposure()
Get exposure (s) from the metadata if it is present, otherwise return 0.
|
int |
getFocalLength()
Get focal length (mm) from the metadata if it is present, otherwise
return 0.
|
int |
getISO()
Get sensitivity (ISO) from the metadata if it is present, otherwise
return 0.
|
java.util.List<FITS_KeywordRecord> |
getList() |
java.util.Map<java.lang.String,java.lang.String> |
getMap() |
java.lang.String |
getPhotographer()
Get photographer details from the metadata if present, otherwise return
empty String.
|
long |
getTimeInMillis()
Get date and time taken, in ms since 1970.0, or 0 if "DateTimeOriginal"
key was not present in the metadata or the value was invalid.
|
java.lang.String |
getValue(java.lang.String... possibleKeys)
For the first of the given keys found in the metadata, return the value.
|
java.lang.String |
getValue(java.lang.String key)
Get the value for the key, or null if the key is not found.
|
void |
mergeIntoIIOI(javax.imageio.IIOImage iioi)
Merge the metadata from the map into a JAI ImageIO image, if the image
supports the standard format, javax_imageio_1.0.
|
void |
remove(java.lang.String keyword) |
void |
removeTiffFields()
It is not always appropriate to keep hold of TIFF fields which describe
data layout in a file, eg when image is converted to different bit depth.
|
void |
replaceValue(java.lang.String keyword,
java.lang.String newValue) |
void |
setFocalLength(int focalLength) |
java.lang.String |
toFoldedString(java.lang.String lineEnd) |
public static final java.lang.String IMAGE_KIND_KEYWORD
public static final java.lang.String NIMAGES_KEYWORD
public static final java.lang.String METHOD_KEYWORD
public static final java.lang.String FIRST_KEYWORD
public static final java.lang.String LAST_KEYWORD
public static final java.lang.String EXPOSURE_KEYWORD
public static final java.lang.String APERTURE_KEYWORD
public static final java.lang.String FOCAL_LENGTH_KEYWORD
public static final java.lang.String ISO_KEYWORD
public static final java.lang.String CAMERA_KEYWORD
public static final java.lang.String OBSERVER_KEYWORD
public static final java.lang.String COPYRIGHT_KEYWORD
public static final java.lang.String FFT_KEYWORD
public static final java.lang.String FFT_REAL
public static final java.lang.String FFT_IMAGINARY
public static final java.lang.String GRIP_COMBINED_IMAGE_ID
public static final java.util.Map<java.lang.String,java.lang.String> FITS_KEYWORDS
public Metadata(java.util.Map<java.lang.String,java.lang.String> values)
public Metadata(java.util.List<FITS_KeywordRecord> list)
public Metadata()
public Metadata(java.lang.String value)
public java.util.Map<java.lang.String,java.lang.String> getMap()
public java.util.List<FITS_KeywordRecord> getList()
public void convertImageKindString()
public void addValue(java.lang.String key, java.lang.String value)
public boolean contains(java.lang.String keyword)
public void clear()
public java.lang.String getValue(java.lang.String key)
public java.lang.String getValue(java.lang.String... possibleKeys)
public float getAperture()
public java.lang.String getCamera()
public java.lang.String getCopyright()
public float getExposure()
public int getFocalLength()
public void setFocalLength(int focalLength)
public int getISO()
public java.lang.String getPhotographer()
public java.lang.String getDateTime()
public long getTimeInMillis()
public javax.imageio.metadata.IIOMetadataNode buildTree()
public java.lang.StringBuffer formatForDisplay()
public void mergeIntoIIOI(javax.imageio.IIOImage iioi)
public void remove(java.lang.String keyword)
public void removeTiffFields()
public void replaceValue(java.lang.String keyword, java.lang.String newValue)
public java.lang.String toFoldedString(java.lang.String lineEnd)