org.jfree.chart.encoders

Class ImageEncoderFactory

public class ImageEncoderFactory extends Object

Factory class for returning ImageEncoders for different ImageFormats.
Method Summary
static ImageEncodernewInstance(String format)
Used to retrieve an ImageEncoder for a specific image format.
static ImageEncodernewInstance(String format, float quality)
Used to retrieve an ImageEncoder for a specific image format.
static ImageEncodernewInstance(String format, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.
static ImageEncodernewInstance(String format, float quality, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.
static voidsetImageEncoder(String format, String imageEncoderClassName)
Used to set additional encoders or replace default ones.

Method Detail

newInstance

public static ImageEncoder newInstance(String format)
Used to retrieve an ImageEncoder for a specific image format.

Parameters: format The image format required.

Returns: The ImageEncoder or null if none available.

newInstance

public static ImageEncoder newInstance(String format, float quality)
Used to retrieve an ImageEncoder for a specific image format.

Parameters: format The image format required. quality The quality to be set before returning.

Returns: The ImageEncoder or null if none available.

newInstance

public static ImageEncoder newInstance(String format, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.

Parameters: format The image format required. encodingAlpha Sets whether alpha transparency should be encoded.

Returns: The ImageEncoder or null if none available.

newInstance

public static ImageEncoder newInstance(String format, float quality, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.

Parameters: format The image format required. quality The quality to be set before returning. encodingAlpha Sets whether alpha transparency should be encoded.

Returns: The ImageEncoder or null if none available.

setImageEncoder

public static void setImageEncoder(String format, String imageEncoderClassName)
Used to set additional encoders or replace default ones.

Parameters: format The image format name. imageEncoderClassName The name of the ImageEncoder class.