Interface ImageEncoder
-
- All Known Implementing Classes:
ImageEncoderImpl,PNGImageEncoder
public interface ImageEncoderAn interface describing objects that transform a BufferedImage or Raster into an OutputStream.This interface is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.
- Version:
- $Id: ImageEncoder.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidencode(java.awt.image.Raster ras, java.awt.image.ColorModel cm)Encodes a Raster with a given ColorModel and writes the output to the OutputStream associated with this ImageEncoder.voidencode(java.awt.image.RenderedImage im)Encodes a RenderedImage and writes the output to the OutputStream associated with this ImageEncoder.java.io.OutputStreamgetOutputStream()Returns the OutputStream associated with this ImageEncoder.ImageEncodeParamgetParam()Returns the current parameters as an instance of the ImageEncodeParam interface.voidsetParam(ImageEncodeParam param)Sets the current parameters to an instance of the ImageEncodeParam interface.
-
-
-
Method Detail
-
getParam
ImageEncodeParam getParam()
Returns the current parameters as an instance of the ImageEncodeParam interface. Concrete implementations of this interface will return corresponding concrete implementations of the ImageEncodeParam interface. For example, a JPEGImageEncoder will return an instance of JPEGEncodeParam.
-
setParam
void setParam(ImageEncodeParam param)
Sets the current parameters to an instance of the ImageEncodeParam interface. Concrete implementations of ImageEncoder may throw a RuntimeException if the params argument is not an instance of the appropriate subclass or subinterface. For example, a JPEGImageEncoder will expect param to be an instance of JPEGEncodeParam.
-
getOutputStream
java.io.OutputStream getOutputStream()
Returns the OutputStream associated with this ImageEncoder.
-
encode
void encode(java.awt.image.Raster ras, java.awt.image.ColorModel cm) throws java.io.IOExceptionEncodes a Raster with a given ColorModel and writes the output to the OutputStream associated with this ImageEncoder.- Throws:
java.io.IOException
-
encode
void encode(java.awt.image.RenderedImage im) throws java.io.IOExceptionEncodes a RenderedImage and writes the output to the OutputStream associated with this ImageEncoder.- Throws:
java.io.IOException
-
-