org.pdfbox.pdmodel.common.function

Class PDFunctionType0

Implemented Interfaces:
COSObjectable

public class PDFunctionType0
extends PDStreamFunction

This class represents a type 0 function in a PDF document.
Version:
$Revision: 1.2 $
Author:
Ben Litchfield

Constructor Summary

PDFunctionType0(PDDocument doc)
Constructor to create a new blank type 0 function.
PDFunctionType0(PDStream functionDictionary)
Constructor.

Method Summary

int
getBitsPerSample()
Get the number of bits that the output value will take up.
PDRange
getDecodeForParameter(int paramNum)
Get the decode for the input parameter.
PDRange
getEncodeForParameter(int paramNum)
Get the encode for the input parameter.
List
getNumberOfSamples()
The "Size" entry, which is the number of samples in each input dimension of the sample table.
void
setBitsPerSample(int bps)
Set the number of bits that the output value will take up.
void
setDecodeForParameter(int paramNum, PDRange range)
Set the decode range for the param number.
void
setEncodeForParameter(int paramNum, PDRange range)
Set the encode range for the param number.
void
setNumberOfSamples(List samples)
Set the samples data, the "Size" entry in the type 0 function.

Methods inherited from class org.pdfbox.pdmodel.common.function.PDStreamFunction

getCOSObject, getCOSStream, getDomainForInput, getNumberOfInputParameters, getNumberOfOutputParameters, getRangeForOutput, setDomainForInput, setRangeForOutput

Methods inherited from class org.pdfbox.pdmodel.common.function.PDFunction

create, getDomainForInput, getNumberOfInputParameters, getNumberOfOutputParameters, getRangeForOutput, setDomainForInput, setRangeForOutput

Constructor Details

PDFunctionType0

protected PDFunctionType0(PDDocument doc)
Constructor to create a new blank type 0 function.
Parameters:
doc - The document that the function will be part of.

PDFunctionType0

public PDFunctionType0(PDStream functionDictionary)
Constructor.
Parameters:
functionDictionary - The prepopulated function dictionary.

Method Details

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.
Returns:
Number of bits for each output value.

getDecodeForParameter

public PDRange getDecodeForParameter(int paramNum)
Get the decode for the input parameter.
Parameters:
paramNum - The function parameter number.
Returns:
The decode parameter range or null if none is set.

getEncodeForParameter

public PDRange getEncodeForParameter(int paramNum)
Get the encode for the input parameter.
Parameters:
paramNum - The function parameter number.
Returns:
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.
Returns:
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.
Parameters:
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.
Parameters:
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.
Parameters:
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.
Parameters:
samples - The samples data.