Interface ImageEncoder
- All Known Implementing Classes:
ImageEncoderImpl
,PNGImageEncoder
,TIFFImageEncoder
public interface ImageEncoder
An 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.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(Raster ras, ColorModel cm) Encodes a Raster with a given ColorModel and writes the output to the OutputStream associated with this ImageEncoder.void
encode
(RenderedImage im) Encodes a RenderedImage and writes the output to the OutputStream associated with this ImageEncoder.Returns the OutputStream associated with this ImageEncoder.getParam()
Returns the current parameters as an instance of the ImageEncodeParam interface.void
setParam
(ImageEncodeParam param) Sets the current parameters to an instance of the ImageEncodeParam interface.
-
Method Details
-
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
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
OutputStream getOutputStream()Returns the OutputStream associated with this ImageEncoder. -
encode
Encodes a Raster with a given ColorModel and writes the output to the OutputStream associated with this ImageEncoder.- Throws:
IOException
-
encode
Encodes a RenderedImage and writes the output to the OutputStream associated with this ImageEncoder.- Throws:
IOException
-