org.apache.batik.transcoder.image

Class TIFFTranscoder

public class TIFFTranscoder extends ImageTranscoder

This class is an ImageTranscoder that produces a TIFF image.
Nested Class Summary
interfaceTIFFTranscoder.WriteAdapter
This interface is used by TIFFTranscoder to write TIFF images through different codecs.
Field Summary
static TranscodingHints.KeyKEY_COMPRESSION_METHOD
The compression method for the image.
static TranscodingHints.KeyKEY_FORCE_TRANSPARENT_WHITE
The forceTransparentWhite key.
Constructor Summary
TIFFTranscoder()
Constructs a new transcoder that produces tiff images.
Method Summary
BufferedImagecreateImage(int width, int height)
Creates a new ARGB image with the specified dimension.
UserAgentgetUserAgent()
voidwriteImage(BufferedImage img, TranscoderOutput output)
Writes the specified image to the specified output.

Field Detail

KEY_COMPRESSION_METHOD

public static final TranscodingHints.Key KEY_COMPRESSION_METHOD
The compression method for the image.

Key:

KEY_COMPRESSION_METHOD

Value:

String ("none", "packbits", "jpeg" etc.)

Default:

"none" (no compression)

Required:

Recommended

Description:

Specify the compression method used to encode the image.

KEY_FORCE_TRANSPARENT_WHITE

public static final TranscodingHints.Key KEY_FORCE_TRANSPARENT_WHITE
The forceTransparentWhite key.

Key:

KEY_FORCE_TRANSPARENT_WHITE

Value:

Boolean

Default:

false

Required:

No

Description:

It controls whether the encoder should force the image's fully transparent pixels to be fully transparent white instead of fully transparent black. This is usefull when the encoded TIFF is displayed in a viewer which does not support TIFF transparency and lets the image display with a white background instead of a black background.
However, note that the modified image will display differently over a white background in a viewer that supports transparency.

Constructor Detail

TIFFTranscoder

public TIFFTranscoder()
Constructs a new transcoder that produces tiff 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

getUserAgent

public UserAgent getUserAgent()

Returns: the transcoder's user agent

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.