Package com.idrsolutions.image.jpeg
Class JpegEncoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.jpeg.JpegEncoder
- All Implemented Interfaces:
com.idrsolutions.image.Encoder
public class JpegEncoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Encoder
Class writes BufferedImages as Baseline JPEGs
Example:
JpegEncoder encoder = new JpegEncoder();
encoder.getEncoderOptions().setQuality(75); //50 is default
encoder.write(bufferedImage, outputStream);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.- usevoid
setQuality
(int percentage) Deprecated.- usevoid
write
(BufferedImage image, OutputStream out) Writes BufferedImage as Baseline JPEG to an OutputStreamMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImage
-
Constructor Details
-
JpegEncoder
public JpegEncoder(com.idrsolutions.image.encoder.options.EncoderOptions format) -
JpegEncoder
public JpegEncoder()
-
-
Method Details
-
getEncoderOptions
- Specified by:
getEncoderOptions
in interfacecom.idrsolutions.image.Encoder
-
write
Writes BufferedImage as Baseline JPEG to an OutputStreamThis method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream.
- Specified by:
write
in interfacecom.idrsolutions.image.Encoder
- Parameters:
image
- BufferedImage The image to writeout
- The stream to write to- Throws:
IOException
- if the image wasn't written
-
setQuality
Deprecated.- usegetEncoderOptions().setQuality(int percentage);
- Parameters:
percentage
- value used for image compression- See Also:
-
getQuality
Deprecated.- usegetEncoderOptions().getQuality();
- Returns:
- value used for image compression
-