org.apache.batik.transcoder.image

Class JPEGTranscoder

public class JPEGTranscoder extends ImageTranscoder

This class is an ImageTranscoder that produces a JPEG image.
Field Summary
static TranscodingHints.KeyKEY_QUALITY
The encoder quality factor key.
Constructor Summary
JPEGTranscoder()
Constructs a new transcoder that produces jpeg images.
Method Summary
BufferedImagecreateImage(int width, int height)
Creates a new ARGB image with the specified dimension.
voidwriteImage(BufferedImage img, TranscoderOutput output)
Writes the specified image to the specified output.

Field Detail

KEY_QUALITY

public static final TranscodingHints.Key KEY_QUALITY
The encoder quality factor key.

Key:

KEY_QUALITY

Value:

Float (between 0 and 1)

Default:

1 (no lossy)

Required:

Recommended

Description:

Specify the JPEG image encoding quality.

Constructor Detail

JPEGTranscoder

public JPEGTranscoder()
Constructs a new transcoder that produces jpeg images.

Method Detail

createImage

public BufferedImage createImage(int width, int height)
Creates a new ARGB image with the specified dimension.

Parameters: width the image width in pixels height the image height in pixels

writeImage

public void writeImage(BufferedImage img, TranscoderOutput output)
Writes the specified image to the specified output.

Parameters: img the image to write output the output where to store the image

Throws: TranscoderException if an error occured while storing the image

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.