org.pdfbox.pdmodel.common.function

Class PDStreamFunction

Implemented Interfaces:
COSObjectable
Known Direct Subclasses:
PDFunctionType0, PDFunctionType4

public abstract class PDStreamFunction
extends PDFunction

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

Constructor Summary

PDStreamFunction(PDDocument doc, int functionType)
Constructor to create a new blank function, should only be called by subclasses.
PDStreamFunction(PDStream functionDictionary)
Constructor.

Method Summary

COSBase
getCOSObject()
Convert this standard java object to a COS object.
COSStream
getCOSStream()
This will get the underlying array value.
PDRange
getDomainForInput(int n)
This will get the range for a certain input parameter.
int
getNumberOfInputParameters()
This will get the number of input parameters that have a domain specified.
int
getNumberOfOutputParameters()
This will get the number of output parameters that have a range specified.
PDRange
getRangeForOutput(int n)
This will get the range for a certain output parameters.
void
setDomainForInput(PDRange range, int n)
This will set the domain for the input values.
void
setRangeForOutput(PDRange range, int n)
This will set the a range for output parameter.

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

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

Constructor Details

PDStreamFunction

protected PDStreamFunction(PDDocument doc,
                           int functionType)
Constructor to create a new blank function, should only be called by subclasses.
Parameters:
doc - The document that this function is part of.
functionType - An integer describing the function type, only 0,2,3,4 are defined by the PDF sepc.

PDStreamFunction

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

Method Details

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.
Specified by:
getCOSObject in interface COSObjectable
Returns:
The cos object that matches this Java object.

getCOSStream

public COSStream getCOSStream()
This will get the underlying array value.
Returns:
The cos object that this object wraps.

getDomainForInput

public PDRange getDomainForInput(int n)
This will get the range for a certain input parameter. This is will never return null. If it is not present then the range 0 to 0 will be returned.
Overrides:
getDomainForInput in interface PDFunction
Parameters:
n - The parameter number to get the domain for.
Returns:
The domain range for this component.

getNumberOfInputParameters

public int getNumberOfInputParameters()
This will get the number of input parameters that have a domain specified.
Overrides:
getNumberOfInputParameters in interface PDFunction
Returns:
The number of input parameters that have a domain specified.

getNumberOfOutputParameters

public int getNumberOfOutputParameters()
This will get the number of output parameters that have a range specified. A range for output parameters is optional so this may return zero for a function that does have output parameters, this will simply return the number that have the rnage specified.
Overrides:
getNumberOfOutputParameters in interface PDFunction
Returns:
The number of input parameters that have a range specified.

getRangeForOutput

public PDRange getRangeForOutput(int n)
This will get the range for a certain output parameters. This is will never return null. If it is not present then the range 0 to 0 will be returned.
Overrides:
getRangeForOutput in interface PDFunction
Parameters:
n - The output parameter number to get the range for.
Returns:
The range for this component.

setDomainForInput

public void setDomainForInput(PDRange range,
                              int n)
This will set the domain for the input values.
Overrides:
setDomainForInput in interface PDFunction
Parameters:
range - The new range for the input.
n - The number of the input parameter to set the domain for.

setRangeForOutput

public void setRangeForOutput(PDRange range,
                              int n)
This will set the a range for output parameter.
Overrides:
setRangeForOutput in interface PDFunction
Parameters:
range - The new range for the output parameter.
n - The ouput parameter number to set the range for.