Package org.jfree.chart.encoders
Class SunPNGEncoderAdapter
java.lang.Object
org.jfree.chart.encoders.SunPNGEncoderAdapter
- All Implemented Interfaces:
ImageEncoder
Adapter class for the Sun 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+ and is being run using a JDK 1.4+.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode(BufferedImage bufferedImage) Encodes an image in PNG format.voidencode(BufferedImage bufferedImage, OutputStream outputStream) Encodes an image in PNG format and writes it to an OutputStream.floatGet the quality of the image encoding (always 0.0).booleanGet whether the encoder should encode alpha transparency (always false).voidsetEncodingAlpha(boolean encodingAlpha) Set whether the encoder should encode alpha transparency (not supported in this ImageEncoder).voidsetQuality(float quality) Set the quality of the image encoding (not supported in this ImageEncoder).
-
Constructor Details
-
SunPNGEncoderAdapter
public SunPNGEncoderAdapter()
-
-
Method Details
-
getQuality
Get the quality of the image encoding (always 0.0).- Specified by:
getQualityin interfaceImageEncoder- Returns:
- A float representing the quality.
-
setQuality
Set the quality of the image encoding (not supported in this ImageEncoder).- Specified by:
setQualityin interfaceImageEncoder- Parameters:
quality- A float representing the quality.
-
isEncodingAlpha
Get whether the encoder should encode alpha transparency (always false).- Specified by:
isEncodingAlphain interfaceImageEncoder- Returns:
- Whether the encoder is encoding alpha transparency.
-
setEncodingAlpha
Set whether the encoder should encode alpha transparency (not supported in this ImageEncoder).- Specified by:
setEncodingAlphain interfaceImageEncoder- Parameters:
encodingAlpha- Whether the encoder should encode alpha transparency.
-
encode
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:
IOException- if there is an IO problem.
-
encode
Encodes an image in PNG format and writes it to an OutputStream.- Specified by:
encodein interfaceImageEncoder- Parameters:
bufferedImage- The image to be encoded.outputStream- The OutputStream to write the encoded image to.- Throws:
IOException- if there is an IO problem.
-