Class PNGEncodeParam.RGB
java.lang.Object
org.apache.xmlgraphics.image.codec.png.PNGEncodeParam
org.apache.xmlgraphics.image.codec.png.PNGEncodeParam.RGB
- All Implemented Interfaces:
Serializable,Cloneable,ImageDecodeParam,ImageEncodeParam
- Enclosing class:
PNGEncodeParam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.xmlgraphics.image.codec.png.PNGEncodeParam
PNGEncodeParam.Gray, PNGEncodeParam.Palette, PNGEncodeParam.RGB -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]private booleanprivate static final longprivate int[]Fields inherited from class org.apache.xmlgraphics.image.codec.png.PNGEncodeParam
bitDepth, bitDepthSet, chunkData, chunkType, INTENT_ABSOLUTE, INTENT_PERCEPTUAL, INTENT_RELATIVE, INTENT_SATURATION, PNG_FILTER_AVERAGE, PNG_FILTER_NONE, PNG_FILTER_PAETH, PNG_FILTER_SUB, PNG_FILTER_UP, transparencySet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the RGB value of the suggested background color.int[]Returns the RGB value to be used to denote transparency.booleanReturns 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.voidSuppresses the 'bKGD' chunk from being output.Methods inherited from class org.apache.xmlgraphics.image.codec.png.PNGEncodeParam
addPrivateChunk, filterRow, getBitDepth, getChromaticity, getCompressedText, getDefaultEncodeParam, getGamma, getICCProfileData, getInterlacing, getModificationTime, getNumPrivateChunks, getPaletteHistogram, getPhysicalDimension, getPrivateChunkData, getPrivateChunkType, getSignificantBits, getSRGBIntent, getSuggestedPalette, getText, isChromaticitySet, isCompressedTextSet, isGammaSet, isICCProfileDataSet, isModificationTimeSet, isPaletteHistogramSet, isPhysicalDimensionSet, isSignificantBitsSet, isSRGBIntentSet, isSuggestedPaletteSet, isTextSet, isTransparencySet, paethPredictor, removeAllPrivateChunks, removeUnsafeToCopyPrivateChunks, setChromaticity, setChromaticity, setCompressedText, setGamma, setICCProfileData, setInterlacing, setModificationTime, setPaletteHistogram, setPhysicalDimension, setPhysicalDimension, setSignificantBits, setSRGBIntent, setSuggestedPalette, setText, unsetBitDepth, unsetChromaticity, unsetCompressedText, unsetGamma, unsetICCProfileData, unsetModificationTime, unsetPaletteHistogram, unsetPhysicalDimension, unsetSignificantBits, unsetSRGBIntent, unsetSuggestedPalette, unsetText, unsetTransparency
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
backgroundSet
private boolean backgroundSet -
backgroundRGB
private int[] backgroundRGB -
transparency
private int[] transparency
-
-
Constructor Details
-
RGB
public RGB()Constructs an instance ofPNGEncodeParam.RGB.
-
-
Method Details
-
unsetBackground
public void unsetBackground()Suppresses the 'bKGD' chunk from being output.- Overrides:
unsetBackgroundin classPNGEncodeParam
-
isBackgroundSet
public boolean isBackgroundSet()Returns true if a 'bKGD' chunk will be output.- Overrides:
isBackgroundSetin classPNGEncodeParam
-
setBitDepth
public void setBitDepth(int bitDepth) Sets the desired bit depth for an RGB image. The bit depth must be 8 or 16.- Specified by:
setBitDepthin classPNGEncodeParam
-
setBackgroundRGB
public void setBackgroundRGB(int[] rgb) Sets the RGB value of the suggested background color. Thergbparameter should have 3 entries.The 'bKGD' chunk will encode this information.
-
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
IllegalStateExceptionwill be thrown.- Throws:
IllegalStateException- if the background color is not set.
-
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.
-
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
IllegalStateExceptionwill be thrown.- Throws:
IllegalStateException- if the transparent color is not set.
-