org.jfree.chart.encoders

Class SunPNGEncoderAdapter

public class SunPNGEncoderAdapter extends Object implements 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+.
Method Summary
byte[]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.
floatgetQuality()
Get the quality of the image encoding (always 0.0).
booleanisEncodingAlpha()
Get 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).

Method Detail

encode

public byte[] encode(BufferedImage bufferedImage)
Encodes an image in PNG format.

Parameters: bufferedImage The image to be encoded.

Returns: The byte[] that is the encoded image.

Throws: IOException

encode

public void encode(BufferedImage bufferedImage, OutputStream outputStream)
Encodes an image in PNG format and writes it to an OutputStream.

Parameters: bufferedImage The image to be encoded. outputStream The OutputStream to write the encoded image to.

Throws: IOException

getQuality

public float getQuality()
Get the quality of the image encoding (always 0.0).

Returns: A float representing the quality.

isEncodingAlpha

public boolean isEncodingAlpha()
Get whether the encoder should encode alpha transparency (always false).

Returns: Whether the encoder is encoding alpha transparency.

setEncodingAlpha

public void setEncodingAlpha(boolean encodingAlpha)
Set whether the encoder should encode alpha transparency (not supported in this ImageEncoder).

Parameters: encodingAlpha Whether the encoder should encode alpha transparency.

setQuality

public void setQuality(float quality)
Set the quality of the image encoding (not supported in this ImageEncoder).

Parameters: quality A float representing the quality.