public final class FITSCodec
extends com.sun.media.jai.codec.ImageCodec
ImageCodec
that handles
the FITS image format.Constructor and Description |
---|
FITSCodec()
Constructs an instance of
FITSCodec . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEncodeImage(RenderedImage im,
com.sun.media.jai.codec.ImageEncodeParam param)
Returns true if the image is encodable by this codec.
|
protected com.sun.media.jai.codec.ImageDecoder |
createImageDecoder(InputStream src,
com.sun.media.jai.codec.ImageDecodeParam param)
Instantiates a
FITSDecoder to read from the
given InputStream . |
protected com.sun.media.jai.codec.ImageDecoder |
createImageDecoder(com.sun.media.jai.codec.SeekableStream src,
com.sun.media.jai.codec.ImageDecodeParam param)
Instantiates a
FITSDecoder to read from the
given SeekableStream . |
protected com.sun.media.jai.codec.ImageEncoder |
createImageEncoder(OutputStream dst,
com.sun.media.jai.codec.ImageEncodeParam param)
Instantiates a
FITSEncoder to write to the
given OutputStream . |
Class |
getDecodeParamClass()
Returns
Object.class since no DecodeParam
object is required for decoding. |
Class |
getEncodeParamClass()
Returns
null since no encoder exists. |
String |
getFormatName()
Returns the name of the format handled by this codec.
|
int |
getNumHeaderBytes()
Returns the number of bytes from the beginning of the data required
to recognize it as being in FITS format.
|
boolean |
isFormatRecognized(byte[] header)
Returns
true if the header bytes indicate FITS format. |
createComponentColorModel, createComponentColorModel, createGrayIndexColorModel, createImageDecoder, createImageDecoder, createImageDecoder, createImageDecoder, createImageEncoder, getCodec, getCodecs, getDecoderNames, getEncoderNames, isFormatRecognized, isIndicesForGrayscale, registerCodec, unregisterCodec
public String getFormatName()
getFormatName
in class com.sun.media.jai.codec.ImageCodec
public Class getDecodeParamClass()
Object.class
since no DecodeParam
object is required for decoding.getDecodeParamClass
in class com.sun.media.jai.codec.ImageCodec
public Class getEncodeParamClass()
null
since no encoder exists.getEncodeParamClass
in class com.sun.media.jai.codec.ImageCodec
public boolean canEncodeImage(RenderedImage im, com.sun.media.jai.codec.ImageEncodeParam param)
canEncodeImage
in class com.sun.media.jai.codec.ImageCodec
protected com.sun.media.jai.codec.ImageEncoder createImageEncoder(OutputStream dst, com.sun.media.jai.codec.ImageEncodeParam param)
FITSEncoder
to write to the
given OutputStream
.createImageEncoder
in class com.sun.media.jai.codec.ImageCodec
dst
- the OutputStream
to write to.param
- an instance of FITSEncodeParam
used to
control the encoding process, or null
. A
ClassCastException
will be thrown if
param
is non-null but not an instance of
FITSEncodeParam
.protected com.sun.media.jai.codec.ImageDecoder createImageDecoder(InputStream src, com.sun.media.jai.codec.ImageDecodeParam param)
FITSDecoder
to read from the
given InputStream
.
By overriding this method, FITSCodec
is able to
ensure that a ForwardSeekableStream
is used to
wrap the source InputStream
instead of the a
general (and more expensive) subclass of
SeekableStream
. Since the FITS decoder does not
require the ability to seek backwards in its input, this allows
for greater efficiency.
createImageDecoder
in class com.sun.media.jai.codec.ImageCodec
src
- the InputStream
to read from.param
- an instance of ImageDecodeParam
used to
control the decoding process, or null
.protected com.sun.media.jai.codec.ImageDecoder createImageDecoder(com.sun.media.jai.codec.SeekableStream src, com.sun.media.jai.codec.ImageDecodeParam param)
FITSDecoder
to read from the
given SeekableStream
.createImageDecoder
in class com.sun.media.jai.codec.ImageCodec
src
- the SeekableStream
to read from.param
- an instance of ImageDecodeParam
used to
control the decoding process, or null
.public int getNumHeaderBytes()
getNumHeaderBytes
in class com.sun.media.jai.codec.ImageCodec
public boolean isFormatRecognized(byte[] header)
true
if the header bytes indicate FITS format.isFormatRecognized
in class com.sun.media.jai.codec.ImageCodec
header
- an array of bytes containing the initial bytes of the
input data.Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.