|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.grelf.grip.ImBase
net.grelf.grip.Im
public class Im
This class holds an image, to be displayed by class ImPane in the content pane of an ImFrame. It may also hold metadata and thumbnail(s). The image is of class java.awt.BufferedImage. The present class handles loading and saving the image and its calibration. It also has a method for scaling the image down by an integer factor, which ImPane uses.
Field Summary |
---|
Fields inherited from class net.grelf.grip.ImBase |
---|
DEFAULT_COLOUR_IMAGE_TYPE, DEFAULT_MONO_IMAGE_TYPE, iioi, image, SCREEN_FRACTION |
Constructor Summary | |
---|---|
Im(java.awt.image.BufferedImage bim)
|
|
Im(javax.imageio.IIOImage iioi)
|
|
Im(Image image)
|
|
Im(int width,
int height,
boolean compatibleWithDisplay)
If the boolean is false an image of type java.awt.image.BufferedImage.TYPE_INT_RGB will be created. |
|
Im(int width,
int height,
boolean compatibleWithDisplay,
boolean monochrome)
|
|
Im(int width,
int height,
java.awt.image.ColorModel cm)
|
Method Summary | |
---|---|
void |
addMetadata(Metadata metadata)
Merge the metadata from the map, if the image supports the standard format, javax_imageio_1.0. |
void |
dispose()
Tidy up when the frame displaying this image is closed. |
void |
experiment(javax.imageio.metadata.IIOMetadataNode tree)
|
float |
getAperture()
Get aperture (f/) from the metadata if it is present, otherwise return 0. |
Calibration |
getCalibration()
Get a reference to the Calibration object for this image. |
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. |
java.lang.String |
getFilePath()
|
int |
getFocalLength()
Get focal length (mm) from the metadata if it is present, otherwise return 0. |
static java.lang.String |
getFormat(java.lang.String filename)
Get the format name as used by ImageIO readers, from the file extension. |
javax.imageio.metadata.IIOMetadata |
getIIOMetadata()
Get the metadata from the IIOImage. |
java.util.Map<java.lang.String,java.lang.String> |
getImageMetadataAsMap()
Get the image metadata as read from the file, as a Map. |
java.lang.StringBuffer |
getImageMetadataAsXML()
Get the image metadata as read from the file, as an XML document held in a StringBuffer. |
int |
getISO()
Get sensitivity (ISO) from the metadata if it is present, otherwise return 0. |
javax.imageio.metadata.IIOMetadata |
getStreamMetadata()
|
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. |
boolean |
isRaw()
Whether the image was loaded as a raw file and has not yet undergone interpolation to set all channels for every pixel. |
static Im |
load(java.io.File f)
Load an image and, if available, its metadata and thumbnail(s). |
static Im |
load(java.lang.String imFilePath)
Load an image and, if available, its metadata and thumbnail(s). |
static java.util.List<Im> |
loadAll(java.io.File f)
For cases where the file may contain more than one image, load all of them. |
static java.util.List<Im> |
loadAll(java.lang.String imFilePath)
For cases where the file may contain more than one image, load all of them. |
void |
save(java.io.File f)
Save the image in the given file, determining the format from the file's name. |
void |
save(java.io.File f,
Metadata metadata)
Save the image in the given file, determining the format from the file's name. |
void |
save(java.lang.String imFilePath)
Save the image in the given file, determining the format from the file's name. |
Im |
scaleDown(int factor)
Return a new image which is compatible with the display and contains the data from the current image scaled down by an integer factor in both x and y. |
Im |
scaleDown(int factor,
Pseudocolour ps)
Return a new image which is compatible with the display and contains the data from the current image scaled down by an integer factor in both x and y. |
void |
setCalibration(Calibration aCalib)
|
void |
setMetadata(javax.imageio.metadata.IIOMetadata md)
Set metadata from the given object. |
protected void |
setRaw(boolean raw)
|
static boolean |
testLittleEndian(java.lang.String path)
Read the start of a TIFF file to find out the byte order. |
Methods inherited from class net.grelf.grip.ImBase |
---|
create16BitImage, create16BitImage, getAccumulator, getBufferedImage, getGraphicsConfiguration, getHeight, getImage, getImageTypeAsString, getImageTypeAsString, getMaxLevel, getMaxLevel, getMetadata, getNBands, getNBands, getNBits, getNBits, getNBits, getThumbnail, getWidth, hasAccumulator, hasImage, setAccumulator, setBufferedImage, setImage, setImage, setMetadata |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Im(int width, int height, boolean compatibleWithDisplay)
public Im(int width, int height, boolean compatibleWithDisplay, boolean monochrome)
public Im(int width, int height, java.awt.image.ColorModel cm)
public Im(java.awt.image.BufferedImage bim)
public Im(javax.imageio.IIOImage iioi)
public Im(Image image)
Method Detail |
---|
public javax.imageio.metadata.IIOMetadata getStreamMetadata()
public java.lang.String getFilePath()
public boolean isRaw()
protected void setRaw(boolean raw)
public Calibration getCalibration()
public void setCalibration(Calibration aCalib)
public static java.lang.String getFormat(java.lang.String filename)
public void dispose()
public javax.imageio.metadata.IIOMetadata getIIOMetadata()
public void setMetadata(javax.imageio.metadata.IIOMetadata md)
public void addMetadata(Metadata metadata)
public java.lang.StringBuffer getImageMetadataAsXML()
public java.util.Map<java.lang.String,java.lang.String> getImageMetadataAsMap()
public int getFocalLength()
public float getExposure()
public float getAperture()
public int getISO()
public java.lang.String getDateTime()
public long getTimeInMillis()
public static Im load(java.lang.String imFilePath)
public static Im load(java.io.File f)
public static java.util.List<Im> loadAll(java.lang.String imFilePath)
public static java.util.List<Im> loadAll(java.io.File f)
public static boolean testLittleEndian(java.lang.String path)
public void save(java.lang.String imFilePath)
public void save(java.io.File f)
public void save(java.io.File f, Metadata metadata)
public Im scaleDown(int factor)
scaleDown
in class ImBase
public Im scaleDown(int factor, Pseudocolour ps)
public void experiment(javax.imageio.metadata.IIOMetadataNode tree)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |