|
|||||||||
| Home >> All >> org >> ydp >> [ jai overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.ydp.jai
Class PNGCodec

java.lang.Objectorg.ydp.jai.ImageCodec
org.ydp.jai.PNGCodec
- public final class PNGCodec
- extends ImageCodec
| Field Summary |
| Fields inherited from class org.ydp.jai.ImageCodec |
|
| Constructor Summary | |
PNGCodec()
|
|
| Method Summary | |
boolean |
canEncodeImage(java.awt.image.RenderedImage im,
ImageEncodeParam param)
Returns true if the given image and encoder param
object are suitable for encoding by this ImageCodec. |
protected ImageDecoder |
createImageDecoder(java.io.File src,
ImageDecodeParam param)
Returns an implementation of the ImageDecoder
interface appropriate for that codec. |
protected ImageDecoder |
createImageDecoder(java.io.InputStream src,
ImageDecodeParam param)
Returns an implementation of the ImageDecoder
interface appropriate for that codec. |
protected ImageDecoder |
createImageDecoder(SeekableStream src,
ImageDecodeParam param)
In a concrete subclass of ImageCodec, returns an
implementation of the ImageDecoder interface
appropriate for that codec. |
protected ImageEncoder |
createImageEncoder(java.io.OutputStream dst,
ImageEncodeParam param)
In a concrete subclass of ImageCodec, returns an
implementation of the ImageEncoder interface
appropriate for that codec. |
java.lang.Class |
getDecodeParamClass()
Returns a Class object indicating the proper
subclass of ImageDecodeParam to be used with this
ImageCodec. |
java.lang.Class |
getEncodeParamClass()
Returns a Class object indicating the proper
subclass of ImageEncodeParam to be used with this
ImageCodec. |
java.lang.String |
getFormatName()
Returns the name of this image format. |
int |
getNumHeaderBytes()
Returns the number of bytes of header needed to recognize the format, or 0 if an arbitrary number of bytes may be needed. |
boolean |
isFormatRecognized(byte[] header)
Returns true if the format is recognized in the
initial portion of a stream. |
| Methods inherited from class org.ydp.jai.ImageCodec |
createComponentColorModel, createGrayIndexColorModel, 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 |
PNGCodec
public PNGCodec()
| Method Detail |
getFormatName
public java.lang.String getFormatName()
- Description copied from class:
ImageCodec - Returns the name of this image format.
- Specified by:
getFormatNamein classImageCodec
getEncodeParamClass
public java.lang.Class getEncodeParamClass()
- Description copied from class:
ImageCodec - Returns a
Classobject indicating the proper subclass ofImageEncodeParamto be used with thisImageCodec. If encoding is not supported by this codec,nullis returned. If encoding is supported, but a parameter object is not used during encoding, Object.class is returned to signal this fact.- Specified by:
getEncodeParamClassin classImageCodec
getDecodeParamClass
public java.lang.Class getDecodeParamClass()
- Description copied from class:
ImageCodec - Returns a
Classobject indicating the proper subclass ofImageDecodeParamto be used with thisImageCodec. If encoding is not supported by this codec,nullis returned. If decoding is supported, but a parameter object is not used during decoding, Object.class is returned to signal this fact.- Specified by:
getDecodeParamClassin classImageCodec
canEncodeImage
public boolean canEncodeImage(java.awt.image.RenderedImage im, ImageEncodeParam param)
- Description copied from class:
ImageCodec - Returns
trueif the given image and encoder param object are suitable for encoding by thisImageCodec. For example, some codecs may only deal with images with a certain number of bands; an attempt to encode an image with an unsupported number of bands will fail.- Specified by:
canEncodeImagein classImageCodec
createImageEncoder
protected ImageEncoder createImageEncoder(java.io.OutputStream dst, ImageEncodeParam param)
- Description copied from class:
ImageCodec - In a concrete subclass of
ImageCodec, returns an implementation of theImageEncoderinterface appropriate for that codec.- Specified by:
createImageEncoderin classImageCodec
createImageDecoder
protected ImageDecoder createImageDecoder(java.io.InputStream src, ImageDecodeParam param)
- Description copied from class:
ImageCodec - Returns an implementation of the
ImageDecoderinterface appropriate for that codec. Subclasses ofImageCodecmay override this method if they wish to accept data directly from anInputStream; otherwise, this method will convert the source into a backwards-seekableSeekableStreamand call the appropriate version ofcreateImageDecoderfor that data type.Instances of
ImageCodecthat do not require the ability to seek backwards in their sourceSeekableStreamshould override this method in order to avoid the default call toSeekableStream.wrapInputStream(src, true).- Overrides:
createImageDecoderin classImageCodec
createImageDecoder
protected ImageDecoder createImageDecoder(java.io.File src, ImageDecodeParam param) throws java.io.IOException
- Description copied from class:
ImageCodec - Returns an implementation of the
ImageDecoderinterface appropriate for that codec. Subclasses ofImageCodecmay override this method if they wish to accept data directly from aFile; otherwise, this method will convert the source into aSeekableStreamand call the appropriate version ofcreateImageDecoderfor that data type.- Overrides:
createImageDecoderin classImageCodec
createImageDecoder
protected ImageDecoder createImageDecoder(SeekableStream src, ImageDecodeParam param)
- Description copied from class:
ImageCodec - In a concrete subclass of
ImageCodec, returns an implementation of theImageDecoderinterface appropriate for that codec.- Specified by:
createImageDecoderin classImageCodec
getNumHeaderBytes
public int getNumHeaderBytes()
- Description copied from class:
ImageCodec - Returns the number of bytes of header needed to recognize the
format, or 0 if an arbitrary number of bytes may be needed.
The default implementation returns 0.
The return value must be a constant for all instances of each particular subclass of
ImageCodec.Although it is legal to always return 0, in some cases processing may be more efficient if the number of bytes needed is known in advance.
- Overrides:
getNumHeaderBytesin classImageCodec
isFormatRecognized
public boolean isFormatRecognized(byte[] header)
- Description copied from class:
ImageCodec - Returns
trueif the format is recognized in the initial portion of a stream. The header will be passed in as abytearray of lengthgetNumHeaderBytes(). This method should be called only ifgetNumHeaderBytes()returns a value greater than 0.The default implementation throws an exception to indicate that it should never be called.
- Overrides:
isFormatRecognizedin classImageCodec
|
|||||||||
| Home >> All >> org >> ydp >> [ jai overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC