public class

KeypointPNGEncoderAdapter

extends Object
implements ImageEncoder
java.lang.Object
   ↳ org.jfree.chart.encoders.KeypointPNGEncoderAdapter

Class Overview

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.

Summary

Public Constructors
KeypointPNGEncoderAdapter()
Public Methods
byte[] encode(BufferedImage bufferedImage)
Encodes an image in PNG format.
void encode(BufferedImage bufferedImage, OutputStream outputStream)
Encodes an image in PNG format and writes it to an OutputStream.
float getQuality()
Get the quality of the image encoding.
boolean isEncodingAlpha()
Get whether the encoder should encode alpha transparency.
void setEncodingAlpha(boolean encodingAlpha)
Set whether the encoder should encode alpha transparency (supported).
void setQuality(float quality)
Set the quality of the image encoding (supported).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.jfree.chart.encoders.ImageEncoder

Public Constructors

public KeypointPNGEncoderAdapter ()

Public Methods

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

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

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).

Returns
  • A float representing the quality.

public boolean isEncodingAlpha ()

Get whether the encoder should encode alpha transparency.

Returns
  • Whether the encoder is encoding alpha transparency.

public void setEncodingAlpha (boolean encodingAlpha)

Set whether the encoder should encode alpha transparency (supported).

Parameters
encodingAlpha Whether the encoder should encode alpha transparency.

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).

Parameters
quality A float representing the quality.