org.pdfbox.pdmodel.common.function
Class PDFunctionType0
- COSObjectable
public class PDFunctionType0
This class represents a type 0 function in a PDF document.
PDFunctionType0
protected PDFunctionType0(PDDocument doc)
Constructor to create a new blank type 0 function.
doc
- The document that the function will be part of.
PDFunctionType0
public PDFunctionType0(PDStream functionDictionary)
Constructor.
functionDictionary
- The prepopulated function dictionary.
getBitsPerSample
public int getBitsPerSample()
Get the number of bits that the output value will take up. Valid values
are 1,2,4,8,12,16,24,32.
- Number of bits for each output value.
getDecodeForParameter
public PDRange getDecodeForParameter(int paramNum)
Get the decode for the input parameter.
paramNum
- The function parameter number.
- The decode parameter range or null if none is set.
getEncodeForParameter
public PDRange getEncodeForParameter(int paramNum)
Get the encode for the input parameter.
paramNum
- The function parameter number.
- The encode parameter range or null if none is set.
getNumberOfSamples
public List getNumberOfSamples()
The "Size" entry, which is the number of samples in
each input dimension of the sample table.
- A List of java.lang.Integer objects.
setBitsPerSample
public void setBitsPerSample(int bps)
Set the number of bits that the output value will take up. Valid values
are 1,2,4,8,12,16,24,32.
bps
- The number of bits for each output value.
setDecodeForParameter
public void setDecodeForParameter(int paramNum,
PDRange range)
Set the decode range for the param number.
paramNum
- The parameter number to set then decode values.range
- The range value to set.
setEncodeForParameter
public void setEncodeForParameter(int paramNum,
PDRange range)
Set the encode range for the param number.
paramNum
- The parameter number to set then encode values.range
- The range value to set.
setNumberOfSamples
public void setNumberOfSamples(List samples)
Set the samples data, the "Size" entry in the type 0 function.
samples
- The samples data.