org.apache.batik.ext.awt.image.codec.png

Class PNGEncodeParam.RGB

public static class PNGEncodeParam.RGB extends PNGEncodeParam

Constructor Summary
RGB()
Constructs an instance of PNGEncodeParam.RGB.
Method Summary
int[]getBackgroundRGB()
Returns the RGB value of the suggested background color.
int[]getTransparentRGB()
Returns the RGB value to be used to denote transparency.
booleanisBackgroundSet()
Returns true if a 'bKGD' chunk will be output.
voidsetBackgroundRGB(int[] rgb)
Sets the RGB value of the suggested background color.
voidsetBitDepth(int bitDepth)
Sets the desired bit depth for an RGB image.
voidsetTransparentRGB(int[] transparentRGB)
Sets the RGB value to be used to denote transparency.
voidunsetBackground()
Suppresses the 'bKGD' chunk from being output.

Constructor Detail

RGB

public RGB()
Constructs an instance of PNGEncodeParam.RGB.

Method Detail

getBackgroundRGB

public int[] getBackgroundRGB()
Returns the RGB value of the suggested background color.

If the background color has not previously been set, or has been unset, an IllegalStateException will be thrown.

Throws: IllegalStateException if the background color is not set.

getTransparentRGB

public int[] getTransparentRGB()
Returns the RGB value to be used to denote transparency.

If the transparent color has not previously been set, or has been unset, an IllegalStateException will be thrown.

Throws: IllegalStateException if the transparent color is not set.

isBackgroundSet

public boolean isBackgroundSet()
Returns true if a 'bKGD' chunk will be output.

setBackgroundRGB

public void setBackgroundRGB(int[] rgb)
Sets the RGB value of the suggested background color. The rgb parameter should have 3 entries.

The 'bKGD' chunk will encode this information.

setBitDepth

public void setBitDepth(int bitDepth)
Sets the desired bit depth for an RGB image. The bit depth must be 8 or 16.

setTransparentRGB

public void setTransparentRGB(int[] transparentRGB)
Sets the RGB value to be used to denote transparency.

Setting this attribute will cause the alpha channel of the input image to be ignored.

The 'tRNS' chunk will encode this information.

unsetBackground

public void unsetBackground()
Suppresses the 'bKGD' chunk from being output.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.