FileDocCategorySizeDatePackage
JPEGImageDecoder.javaAPI DocJava SE 5 API5848Fri Aug 26 14:54:40 BST 2005com.sun.image.codec.jpeg

JPEGImageDecoder

public interface JPEGImageDecoder
This interface describes a JPEG data stream decoder. This decoder takes an InputStream that contains JPEG encoded image data. The JPEGImageDecoder will decode the JPEG image data according to the parameters set in a JPEGDecodeParam object. The resulting image data is returned in either a Raster or a BufferedImage.

Note that the classes in the com.sun.image.codec.jpeg package are not part of the core Java APIs. They are a part of Sun's JDK and JRE distributions. Although other licensees may choose to distribute these classes, developers cannot depend on their availability in non-Sun implementations. We expect that equivalent functionality will eventually be available in a core API or standard extension.

see
JPEGCodec
see
JPEGDecodeParam
see
Raster
see
BufferedImage
version
4 December 1997

Fields Summary
Constructors Summary
Methods Summary
public java.awt.image.BufferedImagedecodeAsBufferedImage()
Decodes the current JPEG data stream. The result of decoding this InputStream is a BufferedImage the ColorModel associated with this BufferedImage is determined based on the encoded COLOR_ID of the JPEGDecodeParam object. For a tables only stream this will return null.

return
BufferedImage containing the image data.
exception
ImageFormatException if irregularities in the JPEG stream or an unknown condition is encountered.

public java.awt.image.RasterdecodeAsRaster()
Decode the JPEG stream that was passed as part of construction. The JPEG decompression will be performed according to the current settings of the JPEGDecodeParam object. For a tables only stream this will return null.

return
Raster containg the image data. Colorspace and other pertinent information can be obtained from the JPEGDecodeParam object.
exception
ImageFormatException if irregularities in the JPEG stream or an unknown condition is encountered.

public java.io.InputStreamgetInputStream()
Get the input stream that decoding will occur from.

return
The stream that the decoder is currently assciated with.

public JPEGDecodeParamgetJPEGDecodeParam()
Returns the JPEGDecodeParam object that resulted from the most recent decoding event.

public voidsetJPEGDecodeParam(JPEGDecodeParam jdp)
Sets the JPEGDecodeParam object used to determine the features of the decompression performed on the JPEG encoded data. This is ussually only needed for decoding abbreviated JPEG data streams.

param
jdp JPEGDecodeParam object