public class JPEGCodec extends ImageCodec
| Modifier and Type | Field and Description |
|---|---|
private java.io.DataInput |
in |
| Constructor and Description |
|---|
JPEGCodec() |
| Modifier and Type | Method and Description |
|---|---|
private void |
decodeScan(JPEGData jpegData) |
java.lang.String[] |
getFileExtensions()
Returns all file extensions that are typical for this file format.
|
java.lang.String |
getFormatName()
Returns the name of the file format supported by this codec.
|
java.lang.String[] |
getMimeTypes()
Return the MIME
(Multipurpose Internet Mail Extensions) type strings for this format, or
null
if none are available. |
boolean |
isLoadingSupported()
Returns if this codec is able to load images in the file format supported by this codec.
|
boolean |
isSavingSupported()
Returns if this codec is able to save images in the file format supported by this codec.
|
private void |
load() |
static void |
main(java.lang.String[] args) |
void |
process()
This method does the actual work of the operation.
|
private void |
readMarker(JPEGData jpegData,
int marker,
int length) |
java.lang.String |
suggestFileExtension(PixelImage image)
Attempts to suggest a filename extension.
|
appendComment, checkBounds, checkImageResolution, close, getBoundsHeight, getBoundsWidth, getBoundsX1, getBoundsX2, getBoundsY1, getBoundsY2, getComment, getDataInput, getDataOutput, getDpiX, getDpiY, getImage, getImageIndex, getInputAsDataInput, getInputStream, getMode, getNumComments, getOutputAsDataOutput, getOutputStream, getRandomAccessFile, hasBounds, initModeFromIOObjects, isRowRequired, isTileRequired, removeAllComments, removeBounds, setBounds, setBoundsIfNecessary, setDataInput, setDataOutput, setDpi, setFile, setFile, setImage, setImageIndex, setInputStream, setOutputStream, setRandomAccessFileaddProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgressprivate void decodeScan(JPEGData jpegData)
public java.lang.String[] getFileExtensions()
ImageCodecnull.
The file extension strings should include a leading dot
and are supposed to be lower case (if that is allowed for
the given file format).
Example: {".jpg", ".jpeg"} for the JPEG file format.getFileExtensions in class ImageCodecpublic java.lang.String getFormatName()
ImageCodecImageCodec must override this method.
When overriding, leave out any words in a particular language so
that this format name can be understood by everyone.
Usually it is enough to return the format creator plus a typical
abbreviation, e.g. Microsoft BMP or Portable Anymap (PNM).getFormatName in class ImageCodecpublic java.lang.String[] getMimeTypes()
ImageCodecnull
if none are available.getMimeTypes in class ImageCodecpublic boolean isLoadingSupported()
ImageCodectrue is returned this does not necessarily mean that all files in this
format can be read, but at least some.isLoadingSupported in class ImageCodecpublic boolean isSavingSupported()
ImageCodectrue is returned this does not necessarily mean that all types files in this
format can be written, but at least some.isSavingSupported in class ImageCodecprivate void load()
throws OperationFailedException,
WrongFileFormatException
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic void process()
throws MissingParameterException,
OperationFailedException,
WrongFileFormatException
Operationprocess in class OperationMissingParameterException - if any mandatory parameter was not given to the operationWrongParameterException - if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)OperationFailedExceptionWrongFileFormatExceptionprivate void readMarker(JPEGData jpegData, int marker, int length) throws InvalidFileStructureException, java.io.IOException, UnsupportedTypeException
InvalidFileStructureExceptionjava.io.IOExceptionUnsupportedTypeExceptionpublic java.lang.String suggestFileExtension(PixelImage image)
ImageCodecPNMCodec).
This default implementation always returns null.suggestFileExtension in class ImageCodecimage - the image that is to be written to a filenull if no file extension can be recommended