public class IFFCodec extends ImageCodec
.lbm
and .iff
.
IFFCodec codec = new IFFCodec(); codec.setFile("image.iff", CodecMode.LOAD); codec.process(); PixelImage image = codec.getImage();
Modifier and Type | Field | Description |
---|---|---|
private int |
camg |
|
private byte |
compression |
|
private static byte |
COMPRESSION_NONE |
|
private static byte |
COMPRESSION_RLE |
|
private boolean |
ehb |
|
private boolean |
ham |
|
private boolean |
ham6 |
|
private boolean |
ham8 |
|
private int |
height |
|
private static int |
MAGIC_BMHD |
|
private static int |
MAGIC_BODY |
|
private static int |
MAGIC_CAMG |
|
private static int |
MAGIC_CMAP |
|
private static int |
MAGIC_FORM |
|
private static int |
MAGIC_ILBM |
|
private static int |
MAGIC_PBM |
|
private int |
numPlanes |
|
private Palette |
palette |
|
private boolean |
rgb24 |
|
private static int |
SIZE_BMHD |
|
private int |
type |
|
private int |
width |
Constructor | Description |
---|---|
IFFCodec() |
Modifier and Type | Method | Description |
---|---|---|
private void |
checkAndLoad() |
|
private void |
convertRow(byte[][] sourcePlaneData,
byte[][] dest) |
Converts input planes to index or truecolor output values.
|
private void |
createExtraHalfbritePalette() |
|
private static String |
getChunkName(int name) |
|
String[] |
getFileExtensions() |
Returns all file extensions that are typical for this file format.
|
String |
getFormatName() |
Returns the name of the file format supported by this codec.
|
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 |
loadBytes(DataInput in,
byte[] data,
int num,
int y) |
Loads data.length bytes from the input stream to the data array,
regarding the compression type.
|
private PixelImage |
loadImage(DataInput in) |
Loads an image from given input stream in, regarding the compression
type.
|
void |
process() |
This method does the actual work of the operation.
|
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, suggestFileExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private static final int MAGIC_BMHD
private static final int MAGIC_BODY
private static final int MAGIC_CMAP
private static final int MAGIC_CAMG
private static final int MAGIC_FORM
private static final int MAGIC_ILBM
private static final int MAGIC_PBM
private static final int SIZE_BMHD
private static final byte COMPRESSION_NONE
private static final byte COMPRESSION_RLE
private int camg
private byte compression
private boolean ehb
private boolean ham
private boolean ham6
private boolean ham8
private int height
private int numPlanes
private Palette palette
private boolean rgb24
private int type
private int width
private void checkAndLoad() throws InvalidFileStructureException, IOException, MissingParameterException, UnsupportedTypeException, WrongFileFormatException, WrongParameterException
private void convertRow(byte[][] sourcePlaneData, byte[][] dest)
sourcePlanes
- dest
- private void createExtraHalfbritePalette()
private static String getChunkName(int name)
public 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 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 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 loadBytes(DataInput in, byte[] data, int num, int y) throws InvalidFileStructureException, IOException
private PixelImage loadImage(DataInput in) throws InvalidFileStructureException, IOException, UnsupportedTypeException, WrongParameterException
public void process() throws InvalidFileStructureException, MissingParameterException, OperationFailedException, UnsupportedTypeException, 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
InvalidFileStructureException
UnsupportedTypeException
WrongFileFormatException