|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmediautil.gen.BasicIo
mediautil.image.jpeg.BasicJpegIo
mediautil.image.jpeg.AbstractImageInfo<F>
public abstract class AbstractImageInfo<F extends LLJTran>
This class represent additional information about image, such information usually supplied with an image in additional headers. Currently only Exif among derived classes provides the full capability to view and modify the Thumbnail and to modify Image Header Information through the methods writeInfo, getThumbnailOffset and getThumbnailLength. To provide more common solution, this calss has to extend javax.imageio.metadata.IIOMetadata
| Field Summary | |
|---|---|
static double[] |
AV_TO_FSTOP
|
static byte[] |
BMP_SIG
|
static int |
BMP24_HDR_SIZE
|
static DateFormat |
dateformat
|
static Dimension |
DEFAULT_THUMB_SIZE
Default Thumbnail Size |
static DecimalFormat |
fnumberformat
|
static String |
NA
|
static Rational[] |
TV_TO_SEC
|
| Fields inherited from class mediautil.image.jpeg.BasicJpegIo |
|---|
M_DHP, M_DHT, M_DNL, M_DQT, M_DRI, M_EXP |
| Fields inherited from class mediautil.gen.BasicIo |
|---|
FACTOR_ABVS |
| Constructor Summary | |
|---|---|
AbstractImageInfo()
|
|
AbstractImageInfo(InputStream is,
byte[] data,
int offset,
String name,
String comments,
F format)
Loads the ImageInfo using information supplied. |
|
| Method Summary | |
|---|---|
float |
apertureToFnumber(float aperture)
|
AdvancedImage |
getAdvancedImage()
|
Object |
getAttribute(String name)
|
boolean |
getBoolAttribute(String name)
|
String |
getComments()
|
abstract String |
getDataTimeOriginalString()
|
Date |
getDateTimeOriginal()
|
double |
getDoubleAttribute(String name)
|
abstract int |
getExpoProgram()
|
Object[] |
getFiveMajorAttributes()
returns for format such attributes as: title, artist, album, year, file |
float |
getFloatAttribute(String name)
|
abstract float |
getFNumber()
|
abstract float |
getFocalLength()
|
abstract String |
getFormat()
|
File |
getImageFile()
|
int |
getIntAttribute(String name)
|
long |
getLongAttribute(String name)
|
abstract String |
getMake()
|
abstract int |
getMetering()
|
abstract String |
getModel()
|
String |
getName()
|
abstract String |
getQuality()
|
abstract String |
getReport()
|
abstract int |
getResolutionX()
|
abstract int |
getResolutionY()
|
abstract Rational |
getShutter()
|
String |
getThumbnailExtension()
Gets the extension of the Thumbnail Image format. |
Icon |
getThumbnailIcon()
|
abstract Icon |
getThumbnailIcon(Dimension size)
|
int |
getThumbnailLength()
Method to get the length of the Thumbnail. |
int |
getThumbnailOffset()
Method to get the offset of the Thumbnail within the imageInfo data. |
abstract boolean |
isFlash()
|
abstract void |
readInfo()
Reads the imageInfo from the Input supplied in Constructor. |
boolean |
removeThumbnailTags()
Removes the Thumbnail Tags in the imageInfo. |
boolean |
saveThumbnailImage(OutputStream os)
saves thumbnail image to specified path |
void |
setAdvancedImage(AdvancedImage advancedImage)
|
void |
setAttribute(String name,
Object value)
|
void |
setName(String name)
|
void |
setThumbnail(byte[] newThumbnailData,
int startIndex,
int len,
String thumbnailExt,
OutputStream newAppHdrOp)
Method to write the imageInfo with a new Thumbnail. |
String |
toString()
|
void |
writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo)
writeInfo method without actual imageWidth and imageHeight |
void |
writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo,
int imageWidth,
int imageHeight)
writeInfo method using default encoding of ISO8859_1 |
void |
writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo,
int imageWidth,
int imageHeight,
String encoding)
Writes modified or not Exif to out. |
| Methods inherited from class mediautil.gen.BasicIo |
|---|
asInt, asString, bn2s, bn2s, convertLength, in2s, isSignature, read, read, s2n, skip |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Dimension DEFAULT_THUMB_SIZE
public static final DateFormat dateformat
public static final DecimalFormat fnumberformat
public static final String NA
public static final byte[] BMP_SIG
public static final int BMP24_HDR_SIZE
public static final double[] AV_TO_FSTOP
public static final Rational[] TV_TO_SEC
| Constructor Detail |
|---|
public AbstractImageInfo()
public AbstractImageInfo(InputStream is,
byte[] data,
int offset,
String name,
String comments,
F format)
throws FileFormatException
readInfo() by the deriving class.
is - Image input. Note that LLJTran does not pass the actual
ImageInput but only the Marker Data. This is because LLJTran
will have to read further from the same Input Stream.data - Image Header Information Marker Data excluding the 4 jpeg
marker bytesoffset - Offset of marker within Image Inputname - Name of the Image Filecomments - Image commentsformat - Image Object of type LLJTran
FileFormatException| Method Detail |
|---|
public String getName()
public void setName(String name)
public void setAdvancedImage(AdvancedImage advancedImage)
public AdvancedImage getAdvancedImage()
public void writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo)
throws IOException
IOExceptionwriteInfo(byte[],OutputStream,int,int,boolean,int,int,String)
public void writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo,
int imageWidth,
int imageHeight)
throws IOException
IOExceptionwriteInfo(byte[],OutputStream,int,int,boolean,int,int,String)
public void writeInfo(byte[] markerData,
OutputStream out,
int op,
int options,
boolean modifyImageInfo,
int imageWidth,
int imageHeight,
String encoding)
throws IOException
This method is mainly for use by LLJTran to regenerate the Appx marker Data for the imageInfo. The default implementation does nothing and is expected to be implemented by the deriving class.
markerData - The existing markerDataout - Output Stream to write out the new markerDataop - The transformation option. This is used to switch the width and
height in imageInfo if op is a ROT_90 like transform and transform
the orientation tag and Thumbnail if opted for.options - OPT_XFORM_.. options of LLJTran. LLJTran passes its
options directly to this method. This uses the imageInfo related flags
LLJTran.OPT_XFORM_THUMBNAIL and
LLJTran.OPT_XFORM_ORIENTATION and makes the necessary
changes to imageInfo depending on the transform specified by op
before writing.modifyImageInfo - If true the changes made to imageInfo are
retained, otherwise the state is restored at the end of the call.imageWidth - Actual Image Width. If this and imageHeight are
positive then they are used for the width and height in imageInfo and no
switching of width and height is done for ROT_90 like transforms.imageHeight - Actaul Image Heightencoding - Encoding to be used when for writing out Character
information like comments.
IOException
public abstract void readInfo()
throws FileFormatException
FileFormatExceptionpublic abstract String getFormat()
public abstract int getResolutionX()
public abstract int getResolutionY()
public abstract String getMake()
public abstract String getModel()
public abstract String getDataTimeOriginalString()
public abstract float getFNumber()
public abstract Rational getShutter()
public abstract boolean isFlash()
public abstract String getQuality()
public abstract float getFocalLength()
public abstract int getMetering()
public abstract int getExpoProgram()
public abstract String getReport()
public int getThumbnailOffset()
The default implementation returns -1 since this method is expected to be implemented by the deriving class.
public int getThumbnailLength()
The default implementation returns -1 since this method is expected to be implemented by the deriving class.
public void setThumbnail(byte[] newThumbnailData,
int startIndex,
int len,
String thumbnailExt,
OutputStream newAppHdrOp)
throws IOException
This method changes the imageInfo for the new Thumbnail and writes out the corresponding Appx header data (without jpeg markers) with the new Thumbnail.
The default implementation does nothing since this method is expected to be implemented by the deriving class.
newThumbnailData - New Thumbnail image datastartIndex - Offset within newThumbnailData where the image startslen - Length of Thumbnail ImagethumbnailExt - Extension of the Thumbnail Image from
ImageResources
which identifies the format of the Thumbnail image.newAppHdrOp - Output to write out the new Appx data
IOExceptionpublic boolean removeThumbnailTags()
writeInfo(..)
it will be without a Thumbnail.
public abstract Icon getThumbnailIcon(Dimension size)
public String toString()
toString in class Objectpublic Object[] getFiveMajorAttributes()
getFiveMajorAttributes in interface MediaInfopublic Icon getThumbnailIcon()
public String getThumbnailExtension()
ImageResourcespublic String getComments()
public File getImageFile()
public boolean saveThumbnailImage(OutputStream os)
throws IOException
IOExceptionpublic Date getDateTimeOriginal()
public float apertureToFnumber(float aperture)
public void setAttribute(String name,
Object value)
setAttribute in interface MediaInfopublic Object getAttribute(String name)
getAttribute in interface MediaInfopublic int getIntAttribute(String name)
getIntAttribute in interface MediaInfopublic float getFloatAttribute(String name)
getFloatAttribute in interface MediaInfopublic long getLongAttribute(String name)
getLongAttribute in interface MediaInfopublic double getDoubleAttribute(String name)
getDoubleAttribute in interface MediaInfopublic boolean getBoolAttribute(String name)
getBoolAttribute in interface MediaInfo
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||