public class IlvJPEGEncoder extends Object implements IlvImageEncoder
IlvJPEGEncoder encodes an Image in JPEG format
onto an HttpServletResponse. This implementation uses the
com.sun.image.codec.jpeg.JPEGImageEncoder class that is
supplied as part of all JavaSoft JVM distributions.| Modifier and Type | Field and Description |
|---|---|
static String |
QUALITY_PARAM
The JPEG quality parameter.
|
| Constructor and Description |
|---|
IlvJPEGEncoder()
Creates a new
IlvJPEGEncoder instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(BufferedImage image,
javax.servlet.http.HttpServletResponse response,
IlvServletParameters params)
Encodes the specified image in JPEG format onto a servlet response.
|
float |
getJPEGQuality()
Returns the quality of the produced JPEG image.
|
void |
setJPEGQuality(float quality)
Sets the quality of the produced JPEG image.
|
public static final String QUALITY_PARAM
encode time, it overrides the current
quality property of the encoder.public final void setJPEGQuality(float quality)
quality - The quality of the JPEG image. The value can be in the
range [0,1]. The value 0 represents bad quality
and high compression. The value 1 represents high quality and
poor compression. The default value is 0.75.getJPEGQuality()public final float getJPEGQuality()
0.75.setJPEGQuality(float)public void encode(BufferedImage image, javax.servlet.http.HttpServletResponse response, IlvServletParameters params) throws IOException, javax.servlet.ServletException
encode in interface IlvImageEncoderimage - The image to encode.response - The HTTP response.params - Parameters that specify the encoding behavior.IOExceptionjavax.servlet.ServletException© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.