Class PngImagingParameters
- java.lang.Object
-
- org.apache.commons.imaging.ImagingParameters<E>
-
- org.apache.commons.imaging.common.XmpImagingParameters<PngImagingParameters>
-
- org.apache.commons.imaging.formats.png.PngImagingParameters
-
public class PngImagingParameters extends XmpImagingParameters<PngImagingParameters>
PNG format parameters.- Since:
- 1.0-alpha3
-
-
Field Summary
Fields Modifier and Type Field Description private bytebitDepthBit depth.static byteDEFAULT_BIT_DEPTHprivate booleanforceIndexedColorprivate booleanforceTrueColorprivate PhysicalScalephysicalScaleUsed in write operations to indicate the Physical Scale - sCAL.private booleanpredictorEnabledprivate java.util.List<? extends AbstractPngText>textChunksOnly used when writing PNG images.
-
Constructor Summary
Constructors Constructor Description PngImagingParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetBitDepth()PhysicalScalegetPhysicalScale()java.util.List<? extends AbstractPngText>getTextChunks()booleanisForceIndexedColor()booleanisForceTrueColor()booleanisPredictorEnabled()Indicates that the PNG write operation should enable the predictor.PngImagingParameterssetBitDepth(byte bitDepth)PngImagingParameterssetForceIndexedColor(boolean forceIndexedColor)PngImagingParameterssetForceTrueColor(boolean forceTrueColor)PngImagingParameterssetPhysicalScale(PhysicalScale physicalScale)PngImagingParameterssetPredictorEnabled(boolean predictorEnabled)Sets the enabled status of the predictor.PngImagingParameterssetTextChunks(java.util.List<? extends AbstractPngText> textChunks)-
Methods inherited from class org.apache.commons.imaging.common.XmpImagingParameters
getXmpXml, setXmpXml
-
Methods inherited from class org.apache.commons.imaging.ImagingParameters
asThis, getBufferedImageFactory, getFileName, getPixelDensity, isStrict, setBufferedImageFactory, setFileName, setPixelDensity, setStrict
-
-
-
-
Field Detail
-
DEFAULT_BIT_DEPTH
public static final byte DEFAULT_BIT_DEPTH
- See Also:
- Constant Field Values
-
bitDepth
private byte bitDepth
Bit depth. Default value is 8.
-
forceIndexedColor
private boolean forceIndexedColor
-
forceTrueColor
private boolean forceTrueColor
-
predictorEnabled
private boolean predictorEnabled
-
physicalScale
private PhysicalScale physicalScale
Used in write operations to indicate the Physical Scale - sCAL.Valid values: PhysicalScale
- See Also:
PhysicalScale
-
textChunks
private java.util.List<? extends AbstractPngText> textChunks
Only used when writing PNG images.
Valid values: a list of WriteTexts.
-
-
Method Detail
-
getBitDepth
public byte getBitDepth()
-
getPhysicalScale
public PhysicalScale getPhysicalScale()
-
getTextChunks
public java.util.List<? extends AbstractPngText> getTextChunks()
-
isForceIndexedColor
public boolean isForceIndexedColor()
-
isForceTrueColor
public boolean isForceTrueColor()
-
isPredictorEnabled
public boolean isPredictorEnabled()
Indicates that the PNG write operation should enable the predictor.- Returns:
- true if the predictor is enabled; otherwise, false.
-
setBitDepth
public PngImagingParameters setBitDepth(byte bitDepth)
-
setForceIndexedColor
public PngImagingParameters setForceIndexedColor(boolean forceIndexedColor)
-
setForceTrueColor
public PngImagingParameters setForceTrueColor(boolean forceTrueColor)
-
setPhysicalScale
public PngImagingParameters setPhysicalScale(PhysicalScale physicalScale)
-
setPredictorEnabled
public PngImagingParameters setPredictorEnabled(boolean predictorEnabled)
Sets the enabled status of the predictor. When performing data compression on an image, a PNG predictor often results in a reduced file size. Predictors are particularly effective on photographic images, but may also work on graphics. The specification of a predictor may result in an increased processing time when writing an image, but will not affect the time required to read an image.- Parameters:
predictorEnabled- true if a predictor is enabled; otherwise, false.- Returns:
thisinstance.
-
setTextChunks
public PngImagingParameters setTextChunks(java.util.List<? extends AbstractPngText> textChunks)
-
-