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, setRandomAccessFile
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private void decodeScan(JPEGData jpegData)
public java.lang.String[] getFileExtensions()
ImageCodec
null
.
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 ImageCodec
public java.lang.String getFormatName()
ImageCodec
ImageCodec
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 ImageCodec
public java.lang.String[] getMimeTypes()
ImageCodec
null
if none are available.getMimeTypes
in class ImageCodec
public boolean isLoadingSupported()
ImageCodec
true
is returned this does not necessarily mean that all files in this
format can be read, but at least some.isLoadingSupported
in class ImageCodec
public boolean isSavingSupported()
ImageCodec
true
is returned this does not necessarily mean that all types files in this
format can be written, but at least some.isSavingSupported
in class ImageCodec
private void load() throws OperationFailedException, WrongFileFormatException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void process() throws MissingParameterException, OperationFailedException, WrongFileFormatException
Operation
process
in class Operation
MissingParameterException
- 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.)OperationFailedException
WrongFileFormatException
private void readMarker(JPEGData jpegData, int marker, int length) throws InvalidFileStructureException, java.io.IOException, UnsupportedTypeException
InvalidFileStructureException
java.io.IOException
UnsupportedTypeException
public java.lang.String suggestFileExtension(PixelImage image)
ImageCodec
PNMCodec
).
This default implementation always returns null
.suggestFileExtension
in class ImageCodec
image
- the image that is to be written to a filenull
if no file extension can be recommended