Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.image.codec.JPEGImageDecoder

java.lang.Object
    |
    +----java.awt.image.codec.JPEGImageDecoder

public class JPEGImageDecoder
extends Object
implements ImageProducer
This class describes a JPEG image 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 JPEGParam object. The resulting image data is returned in either a Raster or a BufferedImage.

See Also:
JPEGParam, Raster, BufferedImage

Constructor Summary
 JPEGImageDecoder(InputStream in, ImageConsumer ic)
Constructor for those wishing to push pixels one line at a time By design/assumption this will push packed int lines of pixels
 JPEGImageDecoder(InputStream in)
Constructs a JPEGImageDecoder that will decode the JPEG data found in the InputStream.
 JPEGImageDecoder(InputStream in, JPEGParam jp)
Constructs a JPEGImageDecoder that will decode the jpeg stream found in the input stream.
 

Method Summary
void  addConsumer(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image.
BufferedImage  decodeBufferedImage()
Decodes the JPEG data stream that was passed in the constructor.
BufferedImage  decodeBufferedImage(InputStream inStr)
Decodes the JPEG data stream thatis passed in as a parameter.
Raster  decodeRaster()
decodes the JPEG stream that was passed as part of construction.
Raster  decodeRaster(InputStream isIn)
Decodes the JPEG stream that is passed in as a parameter.
JPEGParam  getJPEGParam()
Returns the JPEGParam object containing the JPEG tables and parameters
boolean  isConsumer(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.
void  removeConsumer(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in data for this image.
void  requestTopDownLeftRightResend(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
void  setJPEGParam(JPEGParam jp)
Sets the JPEGParam object used to determine the features of the decompression performed on the JPEG encoded data.
void  startProduction(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately start delivery of the image data through the ImageConsumer interface.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPEGImageDecoder

public JPEGImageDecoder(InputStream in,
                        ImageConsumer ic)
Constructor for those wishing to push pixels one line at a time By design/assumption this will push packed int lines of pixels

JPEGImageDecoder

public JPEGImageDecoder(InputStream in)
Constructs a JPEGImageDecoder that will decode the JPEG data found in the InputStream. The default decompression parameters will be set.
Parameters:
in - an InputStream containing JPEG encoded data
See Also:
InputStream

JPEGImageDecoder

public JPEGImageDecoder(InputStream in,
                        JPEGParam jp)
Constructs a JPEGImageDecoder that will decode the jpeg stream found in the input stream. The decompression will be performed according to the values found in the JPEGParam passed.
Parameters:
in - an InputStream containing JPEG encoded data
jp - a JPEGParam object containing decompression information.
See Also:
InputStream, JPEGParam
Method Detail

getJPEGParam

public JPEGParam getJPEGParam()
Returns the JPEGParam object containing the JPEG tables and parameters

setJPEGParam

public void setJPEGParam(JPEGParam jp)
Sets the JPEGParam object used to determine the features of the decompression performed on the JPEG encoded data.
Parameters:
jp - JPEGParam object

decodeRaster

public Raster decodeRaster() throws ImageFormatException
decodes the JPEG stream that was passed as part of construction. The JPEG decompression will be performed according to the current settings of the JPEGParam object.
Returns:
Raster the resulting image will be returned in a byte component Raster of data. Colorspace and other pertinent information can be obtained from the JPEGParam object.
Throws:
ImageFormatException - if irregularities in the JPEG stream or an unknown condition was encountered an ImageFormatException is thrown.

decodeRaster

public Raster decodeRaster(InputStream isIn) throws ImageFormatException
Decodes the JPEG stream that is passed in as a parameter. This method is usually invoked when processing abbreviated JPEG data streams. The JPEG decompression will be performed according to the current settings of the JPEGParam object.
Returns:
Raster the resulting image will be returned in a byte component Raster of data. Colorspace and other pertinent information can be obtained from the JPEGParam object.
Throws:
ImageFormatException - if irregularities in the JPEG stream or an unknown condition was encountered an ImageFormatException is thrown.

decodeBufferedImage

public BufferedImage decodeBufferedImage() throws ImageFormatException
Decodes the JPEG data stream that was passed in the constructor. The result of decoding this InputStream is a BufferedImage that has a color model of argb.
Returns:
BufferedImage - contains the image data in an INT_ARGB format.
Throws:
ImageFormatException - - if irregularities in the JPEG stream or an unknown condition was encountered an ImageFormatException is thrown.

decodeBufferedImage

public BufferedImage decodeBufferedImage(InputStream inStr) throws ImageFormatException
Decodes the JPEG data stream thatis passed in as a parameter. The result of decoding this InputStream is a BufferedImage that has a color model of argb.
Returns:
BufferedImage - contains the image data in an INT_ARGB format.
Throws:
ImageFormatException - - if irregularities in the JPEG stream or an unknown condition was encountered an ImageFormatException is thrown.

addConsumer

public void addConsumer(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image.
Implements:
addConsumer in interface ImageProducer
See Also:
ImageConsumer

isConsumer

public boolean isConsumer(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.
Implements:
isConsumer in interface ImageProducer
Returns:
true if the ImageConsumer is on the list; false otherwise
See Also:
ImageConsumer

removeConsumer

public void removeConsumer(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in data for this image.
Implements:
removeConsumer in interface ImageProducer
See Also:
ImageConsumer

startProduction

public void startProduction(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately start delivery of the image data through the ImageConsumer interface.
Implements:
startProduction in interface ImageProducer
See Also:
ImageConsumer

requestTopDownLeftRightResend

public void requestTopDownLeftRightResend(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
Implements:
requestTopDownLeftRightResend in interface ImageProducer
See Also:
ImageConsumer

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.