|
|||||||||
| Home >> All >> non_com >> media >> jai >> [ codec overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
non_com.media.jai.codec
Class PNMCodec

java.lang.Objectnon_com.media.jai.codec.ImageCodec
non_com.media.jai.codec.PNMCodec
- public final class PNMCodec
- extends ImageCodec
A subclass of ImageCodec that handles the PNM family of formats
(PBM, PGM, PPM).
The PBM format encodes a single-banded, 1-bit image. The PGM format encodes a single-banded image of any bit depth between 1 and 32. The PPM format encodes three-banded images of any bit depth between 1 and 32. All formats have an ASCII and a raw representation.
| Field Summary |
| Fields inherited from class non_com.media.jai.codec.ImageCodec |
|
| Constructor Summary | |
PNMCodec()
Constructs an instance of PNMCodec. |
|
| Method Summary | |
boolean |
canEncodeImage(java.awt.image.RenderedImage im,
ImageEncodeParam param)
Description of the Method |
protected ImageDecoder |
createImageDecoder(java.io.InputStream src,
ImageDecodeParam param)
Instantiates a PNMImageDecoder to read from the given InputStream
. |
protected ImageDecoder |
createImageDecoder(SeekableStream src,
ImageDecodeParam param)
Instantiates a PNMImageDecoder to read from the given SeekableStream
. |
protected ImageEncoder |
createImageEncoder(java.io.OutputStream dst,
ImageEncodeParam param)
Instantiates a PNMImageEncoder to write to the given OutputStream
. |
java.lang.Class |
getDecodeParamClass()
Gets the DecodeParamClass attribute of the PNMCodec object |
java.lang.Class |
getEncodeParamClass()
Gets the EncodeParamClass attribute of the PNMCodec object |
java.lang.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 PNM format. |
boolean |
isFormatRecognized(byte[] header)
Returns true if the header bytes indicate PNM format. |
| Methods inherited from class non_com.media.jai.codec.ImageCodec |
createComponentColorModel, createGrayIndexColorModel, createImageDecoder, createImageDecoder, createImageDecoder, createImageDecoder, createImageEncoder, getCodec, getCodecs, getDecoderNames, getEncoderNames, isFormatRecognized, registerCodec, unregisterCodec |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
PNMCodec
public PNMCodec()
- Constructs an instance of
PNMCodec.
| Method Detail |
getFormatName
public java.lang.String getFormatName()
- Returns the name of the format handled by this codec.
- Specified by:
getFormatNamein classImageCodec
getEncodeParamClass
public java.lang.Class getEncodeParamClass()
- Gets the EncodeParamClass attribute of the PNMCodec object
- Specified by:
getEncodeParamClassin classImageCodec
getDecodeParamClass
public java.lang.Class getDecodeParamClass()
- Gets the DecodeParamClass attribute of the PNMCodec object
- Specified by:
getDecodeParamClassin classImageCodec
getNumHeaderBytes
public int getNumHeaderBytes()
- Returns the number of bytes from the beginning of the data required to
recognize it as being in PNM format.
- Overrides:
getNumHeaderBytesin classImageCodec
isFormatRecognized
public boolean isFormatRecognized(byte[] header)
- Returns
trueif the header bytes indicate PNM format.- Overrides:
isFormatRecognizedin classImageCodec
canEncodeImage
public boolean canEncodeImage(java.awt.image.RenderedImage im, ImageEncodeParam param)
- Description of the Method
- Specified by:
canEncodeImagein classImageCodec
createImageEncoder
protected ImageEncoder createImageEncoder(java.io.OutputStream dst, ImageEncodeParam param)
- Instantiates a
PNMImageEncoderto write to the givenOutputStream.- Specified by:
createImageEncoderin classImageCodec
createImageDecoder
protected ImageDecoder createImageDecoder(java.io.InputStream src, ImageDecodeParam param)
- Instantiates a
PNMImageDecoderto read from the givenInputStream.By overriding this method,
PNMCodecis able to ensure that aForwardSeekableStreamis used to wrap the sourceInputStreaminstead of the a general (and more expensive) subclass ofSeekableStream. Since the PNM decoder does not require the ability to seek backwards in its input, this allows for greater efficiency.- Overrides:
createImageDecoderin classImageCodec
createImageDecoder
protected ImageDecoder createImageDecoder(SeekableStream src, ImageDecodeParam param)
- Instantiates a
PNMImageDecoderto read from the givenSeekableStream.- Specified by:
createImageDecoderin classImageCodec
|
|||||||||
| Home >> All >> non_com >> media >> jai >> [ codec overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC