public class PSDCodec extends ImageCodec
.psd
.Modifier and Type | Field and Description |
---|---|
private int |
channels |
private static int |
COLOR_MODE_GRAYSCALE |
private static int |
COLOR_MODE_INDEXED |
private static int |
COLOR_MODE_RGB_TRUECOLOR |
private int |
colorMode |
private short |
compression |
private static short |
COMPRESSION_NONE |
private static short |
COMPRESSION_PACKBITS |
private int |
depth |
private Gray8Image |
gray8Image |
private int |
height |
private java.io.DataInput |
in |
private int |
magic |
private static int |
MAGIC_8BPS |
private Palette |
palette |
private Paletted8Image |
paletted8Image |
private RGB24Image |
rgb24Image |
private int |
width |
Constructor and Description |
---|
PSDCodec() |
Modifier and Type | Method and Description |
---|---|
private void |
allocate() |
private static java.lang.String |
getColorTypeName(int colorMode) |
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()
Attempts to load an Image from argument stream
in (which
could, as an example, be a RandomAccessFile instance, it
implements the DataInput interface). |
private void |
loadHeader()
Reads the PSD header to private members of this class instance.
|
private void |
loadImageData() |
private void |
loadPackbitsCompressedData(byte[] data,
int offset,
int num) |
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, getFileExtensions, 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
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private static final int MAGIC_8BPS
private static final int COLOR_MODE_GRAYSCALE
private static final int COLOR_MODE_INDEXED
private static final int COLOR_MODE_RGB_TRUECOLOR
private static final short COMPRESSION_NONE
private static final short COMPRESSION_PACKBITS
private int magic
private int channels
private int height
private int width
private int depth
private int colorMode
private short compression
private java.io.DataInput in
private Gray8Image gray8Image
private Palette palette
private Paletted8Image paletted8Image
private RGB24Image rgb24Image
private void allocate()
private static java.lang.String getColorTypeName(int colorMode)
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 InvalidFileStructureException, java.io.IOException, UnsupportedTypeException, WrongFileFormatException
in
(which
could, as an example, be a RandomAccessFile
instance, it
implements the DataInput
interface).
Checks a magic byte sequence and then reads all chunks as they appear
in the IFF file.
Will return the resulting image or null if no image body chunk was
encountered before end-of-stream.
Will throw an exception if the file is corrupt, information is missing
or there were reading errors.InvalidFileStructureException
java.io.IOException
UnsupportedTypeException
WrongFileFormatException
private void loadHeader() throws java.io.IOException, WrongFileFormatException
java.io.IOException
- if there were reading errorsWrongFileFormatException
private void loadPackbitsCompressedData(byte[] data, int offset, int num) throws InvalidFileStructureException, java.io.IOException
InvalidFileStructureException
java.io.IOException
private void loadImageData() throws InvalidFileStructureException, java.io.IOException
InvalidFileStructureException
java.io.IOException
public void process() throws OperationFailedException
Operation
process
in class Operation
WrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)MissingParameterException
- if any mandatory parameter was not given to the operationOperationFailedException