public class JpegImageEncoder extends java.lang.Object implements ImageEncoder
Constructor and Description |
---|
JpegImageEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
encodeImage(java.awt.Image image,
java.io.OutputStream outputStream) |
void |
encodeImage(java.awt.Image image,
java.io.OutputStream outputStream,
float quality,
boolean encodeAlpha)
Encodes the given image using the given encoder-specific quality and alpha-channel settings and writes
the encoded image-data to the given stream.
|
java.lang.String |
getMimeType()
Returns the mime-type of the encoded data.
|
static boolean |
isJpegEncodingAvailable() |
public void encodeImage(java.awt.Image image, java.io.OutputStream outputStream, float quality, boolean encodeAlpha) throws java.io.IOException, UnsupportedEncoderException
ImageEncoder
encodeImage
in interface ImageEncoder
image
- the image to be encoded.outputStream
- the output stream, where to write the image data to.quality
- the quality of the encoding.encodeAlpha
- a flag controlling whether the alpha-channel should be encoded as well.java.io.IOException
- if there was an IO error while generating or writing the image data.UnsupportedEncoderException
- if the encoder is not supported.public void encodeImage(java.awt.Image image, java.io.OutputStream outputStream) throws java.io.IOException, UnsupportedEncoderException
java.io.IOException
UnsupportedEncoderException
public java.lang.String getMimeType()
ImageEncoder
getMimeType
in interface ImageEncoder
public static boolean isJpegEncodingAvailable()