org.apache.batik.transcoder.image
Class PNGTranscoder
java.lang.Object
|
+--org.apache.batik.transcoder.TranscoderSupport
|
+--org.apache.batik.transcoder.AbstractTranscoder
|
+--org.apache.batik.transcoder.XMLAbstractTranscoder
|
+--org.apache.batik.transcoder.image.ImageTranscoder
|
+--org.apache.batik.transcoder.image.PNGTranscoder
- All Implemented Interfaces:
- Transcoder
- public class PNGTranscoder
- extends ImageTranscoder
This class is an ImageTranscoder that produces a PNG image.
Fields inherited from class org.apache.batik.transcoder.image.ImageTranscoder |
FEATURES, KEY_ALTERNATE_STYLESHEET, KEY_AOI, KEY_BACKGROUND_COLOR, KEY_EXECUTE_ONLOAD, KEY_HEIGHT, KEY_LANGUAGE, KEY_MEDIA, KEY_PIXEL_TO_MM, KEY_USER_STYLESHEET_URI, KEY_WIDTH, userAgent |
Constructor Summary |
PNGTranscoder()
Constructs a new transcoder that produces png images. |
Method Summary |
java.awt.image.BufferedImage |
createImage(int width,
int height)
Creates a new ARGB image with the specified dimension. |
void |
writeImage(java.awt.image.BufferedImage img,
TranscoderOutput output)
Writes the specified image to the specified output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 PNG is displayed in a browser which does not support PNG
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. |
KEY_GAMMA
public static final TranscodingHints.Key KEY_GAMMA
- The gamma correction key.
Key: |
KEY_GAMMA |
Value: |
Float |
Default: |
PNGEncodeParam.INTENT_PERCEPTUAL |
Required: |
No |
Description: |
Controls the gamma correction of the png image. |
PNGTranscoder
public PNGTranscoder()
- Constructs a new transcoder that produces png images.
createImage
public java.awt.image.BufferedImage createImage(int width,
int height)
- Creates a new ARGB image with the specified dimension.
- Overrides:
createImage
in class ImageTranscoder
- Parameters:
width
- the image width in pixelsheight
- the image height in pixels
writeImage
public void writeImage(java.awt.image.BufferedImage img,
TranscoderOutput output)
throws TranscoderException
- Writes the specified image to the specified output.
- Overrides:
writeImage
in class ImageTranscoder
- Parameters:
img
- the image to writeoutput
- the output where to store the imageTranscoderException
- if an error occured while storing the image
Copyright © 2002 Apache Software Foundation. All Rights Reserved.