Package org.jfree.chart.encoders
Class KeypointPNGEncoderAdapter
- java.lang.Object
-
- org.jfree.chart.encoders.KeypointPNGEncoderAdapter
-
- All Implemented Interfaces:
ImageEncoder
public class KeypointPNGEncoderAdapter extends java.lang.Object implements ImageEncoder
Adapter class for the Keypoint PNG Encoder. The ImageEncoderFactory will only return a reference to this class by default if the library has been compiled under a JDK < 1.4 or is being run using a JDK < 1.4.
-
-
Constructor Summary
Constructors Constructor Description KeypointPNGEncoderAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]encode(java.awt.image.BufferedImage bufferedImage)Encodes an image in PNG format.voidencode(java.awt.image.BufferedImage bufferedImage, java.io.OutputStream outputStream)Encodes an image in PNG format and writes it to anOutputStream.floatgetQuality()Get the quality of the image encoding.booleanisEncodingAlpha()Get whether the encoder should encode alpha transparency.voidsetEncodingAlpha(boolean encodingAlpha)Set whether the encoder should encode alpha transparency (supported).voidsetQuality(float quality)Set the quality of the image encoding (supported).
-
-
-
Constructor Detail
-
KeypointPNGEncoderAdapter
public KeypointPNGEncoderAdapter()
-
-
Method Detail
-
getQuality
public float getQuality()
Get the quality of the image encoding. The underlying encoder uses int values: 0 for no compression, and values 1 through 9 for various levels of compression (1 is best speed, 9 is best compression).- Specified by:
getQualityin interfaceImageEncoder- Returns:
- A float representing the quality.
-
setQuality
public void setQuality(float quality)
Set the quality of the image encoding (supported). The underlying encoder uses int values: 0 for no compression, and values 1 through 9 for various levels of compression (1 is best speed, 9 is best compression).- Specified by:
setQualityin interfaceImageEncoder- Parameters:
quality- A float representing the quality.
-
isEncodingAlpha
public boolean isEncodingAlpha()
Get whether the encoder should encode alpha transparency.- Specified by:
isEncodingAlphain interfaceImageEncoder- Returns:
- Whether the encoder is encoding alpha transparency.
-
setEncodingAlpha
public void setEncodingAlpha(boolean encodingAlpha)
Set whether the encoder should encode alpha transparency (supported).- Specified by:
setEncodingAlphain interfaceImageEncoder- Parameters:
encodingAlpha- Whether the encoder should encode alpha transparency.
-
encode
public byte[] encode(java.awt.image.BufferedImage bufferedImage) throws java.io.IOException
Encodes an image in PNG format.- Specified by:
encodein interfaceImageEncoder- Parameters:
bufferedImage- The image to be encoded.- Returns:
- The byte[] that is the encoded image.
- Throws:
java.io.IOException- if there is an IO problem.
-
encode
public void encode(java.awt.image.BufferedImage bufferedImage, java.io.OutputStream outputStream) throws java.io.IOException
Encodes an image in PNG format and writes it to anOutputStream.- Specified by:
encodein interfaceImageEncoder- Parameters:
bufferedImage- The image to be encoded.outputStream- The OutputStream to write the encoded image to.- Throws:
java.io.IOException- if there is an IO problem.
-
-