mediautil.image.jpeg
Class BasicJpeg
java.lang.Object
mediautil.gen.BasicIo
mediautil.image.jpeg.BasicJpegIo
mediautil.image.jpeg.LLJTran
mediautil.image.jpeg.BasicJpeg
- All Implemented Interfaces:
- Serializable, IterativeReader, IterativeWriter, MediaFormat
public class BasicJpeg
- extends LLJTran
- implements MediaFormat
- See Also:
- Serialized Form
Fields inherited from class mediautil.image.jpeg.LLJTran |
COMMENT, CROP, dummyExifHeader, FLIP_H, FLIP_V, FPXR, IMPERFECT_X, IMPERFECT_Y, JFIF, JPEG, NONE, OPT_DEFAULTS, OPT_WRITE_ALL, OPT_WRITE_APPXS, OPT_WRITE_COMMENTS, OPT_WRITE_OPTIMIZE_HUFF, OPT_XFORM_ADJUST_EDGES, OPT_XFORM_APPX, OPT_XFORM_ORIENTATION, OPT_XFORM_THUMBNAIL, OPT_XFORM_TRIM, READ_ALL, READ_HEADER, READ_INFO, READ_NONE, REMOVE, REPLACE, RETAIN, ROT_180, ROT_270, ROT_90, TRANSPOSE, TRANSVERSE |
Method Summary |
void |
freeMemory()
This method can be called at anytime the LLJTran object is not required. |
AdvancedImage |
getAdvancedImage()
|
InputStream |
getAsStream()
|
BufferedImage |
getBufferedImage()
|
Rectangle |
getCropRect()
|
Date |
getDateTimeOriginal()
|
long |
getFileSize()
|
Icon |
getIcon()
|
Image |
getImage()
|
static Dimension |
getImageSize(Image image,
boolean sizeOnly)
|
MediaInfo |
getMediaInfo()
|
String |
getParentPath()
|
static Image |
getScaled(Image image,
Dimension newSize,
int method,
double[] stretchFactor)
|
static Dimension |
getScaledSize(Image image,
Dimension newSize,
double[] stretchFactor)
|
Icon |
getThumbnail(Dimension size)
returns thumbnail of image, if size is null, no thumbnail generation will happen
and original thumbnail if any will be returned |
byte[] |
getThumbnailData(Dimension size)
|
String |
getThumbnailType()
|
String |
getType()
|
URL |
getUrl()
|
boolean |
isValid()
|
long |
length()
|
static void |
main(String[] args)
|
boolean |
renameTo(File dest)
|
void |
saveMarkers(OutputStream os)
|
void |
setAdvancedImage(AdvancedImage advancedImage)
|
void |
setArtist(String val)
|
void |
setComment(String comment)
Sets the jpeg comment to be written. |
void |
setCropRect(Rectangle cr)
|
boolean |
transform(OutputStream outStream,
int op,
boolean preserve_appxs,
Class custom_appx)
|
boolean |
transform(String destname,
int op)
|
boolean |
transform(String destname,
int op,
boolean preserve_appxs)
|
boolean |
transform(String destname,
int op,
boolean preserve_appxs,
Class custom_appx)
|
Methods inherited from class mediautil.image.jpeg.LLJTran |
addAppx, checkPerfect, closeInternalInputStream, equals, getAppx, getAppxLen, getAppxMarker, getComment, getEncoding, getErrorMsg, getException, getFile, getHeight, getHeightInMCU, getHSamplingFactor, getImageInfo, getImageInfoAppxIndex, getLocationName, getMaxHSamplingFactor, getMaxVSamplingFactor, getMCUHeight, getMCUWidth, getName, getNumAppxs, getNumComponents, getNumQTables, getPendingErrorMsg, getQTable, getQTableIndexForComponent, getReadProgressCallback, getReadUpto, getRequestSize, getRestartInterval, getThumbnailAsStream, getVSamplingFactor, getWidth, getWidthInMCU, getWriteProgressCallback, initRead, initWrite, initWrite, insertAppx, nextRead, nextWrite, read, read, refreshAppx, removeAppx, removeThumbnail, resetInput, resetInput, save, save, save, setAppx, setEncoding, setReadProgressCallback, setThumbnail, setWriteProgressCallback, toString, transform, transform, transform, transform, transform, transform, transform, wrapupIterativeWrite, writeThumbnail, xferInfo |
Methods inherited from class mediautil.gen.BasicIo |
asInt, asString, bn2s, bn2s, convertLength, in2s, isSignature, read, read, s2n, skip |
PROGRAMNAME
public static final String PROGRAMNAME
- See Also:
- Constant Field Values
BasicJpeg
public BasicJpeg(File file)
BasicJpeg
public BasicJpeg(InputStream inStream)
isValid
public boolean isValid()
- Specified by:
isValid
in interface MediaFormat
getAsStream
public InputStream getAsStream()
- Specified by:
getAsStream
in interface MediaFormat
getParentPath
public String getParentPath()
getFileSize
public long getFileSize()
- Specified by:
getFileSize
in interface MediaFormat
length
public long length()
getUrl
public URL getUrl()
- Specified by:
getUrl
in interface MediaFormat
getDateTimeOriginal
public Date getDateTimeOriginal()
renameTo
public boolean renameTo(File dest)
- Specified by:
renameTo
in interface MediaFormat
getMediaInfo
public MediaInfo getMediaInfo()
- Specified by:
getMediaInfo
in interface MediaFormat
getType
public String getType()
- Specified by:
getType
in interface MediaFormat
getThumbnailType
public String getThumbnailType()
- Specified by:
getThumbnailType
in interface MediaFormat
getThumbnailData
public byte[] getThumbnailData(Dimension size)
- Specified by:
getThumbnailData
in interface MediaFormat
getImage
public Image getImage()
getBufferedImage
public BufferedImage getBufferedImage()
throws IOException
- Throws:
IOException
getThumbnail
public Icon getThumbnail(Dimension size)
- returns thumbnail of image, if size is null, no thumbnail generation will happen
and original thumbnail if any will be returned
- Specified by:
getThumbnail
in interface MediaFormat
setAdvancedImage
public void setAdvancedImage(AdvancedImage advancedImage)
getAdvancedImage
public AdvancedImage getAdvancedImage()
getIcon
public Icon getIcon()
setComment
public void setComment(String comment)
- Description copied from class:
LLJTran
- Sets the jpeg comment to be written.
- Overrides:
setComment
in class LLJTran
- Parameters:
comment
- Comment to be written or null if none is to be written
transform
public boolean transform(String destname,
int op)
transform
public boolean transform(String destname,
int op,
boolean preserve_appxs)
transform
public boolean transform(String destname,
int op,
boolean preserve_appxs,
Class custom_appx)
transform
public boolean transform(OutputStream outStream,
int op,
boolean preserve_appxs,
Class custom_appx)
saveMarkers
public void saveMarkers(OutputStream os)
throws IOException
- Throws:
IOException
freeMemory
public void freeMemory()
- Description copied from class:
LLJTran
- This method can be called at anytime the LLJTran object is not required.
Frees internal structures for Garbage collection by setting them to null
and also closes any open Internal Input Stream.
- Overrides:
freeMemory
in class LLJTran
setArtist
public void setArtist(String val)
getImageSize
public static Dimension getImageSize(Image image,
boolean sizeOnly)
getScaled
public static Image getScaled(Image image,
Dimension newSize,
int method,
double[] stretchFactor)
getScaledSize
public static Dimension getScaledSize(Image image,
Dimension newSize,
double[] stretchFactor)
main
public static void main(String[] args)
setCropRect
public void setCropRect(Rectangle cr)
getCropRect
public Rectangle getCropRect()