|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdmodel.common.function.PDFunction
public abstract class PDFunction
This class represents a function in a PDF document.
Constructor Summary | |
---|---|
PDFunction(COSBase function)
Constructor. |
Method Summary | |
---|---|
protected COSArray |
clipToRange(COSArray inputArray)
Clip the given input values to the ranges. |
protected float |
clipToRange(float x,
float rangeMin,
float rangeMax)
Clip the given input value to the given range. |
static PDFunction |
create(COSBase function)
Create the correct PD Model function based on the COS base function. |
abstract COSArray |
eval(COSArray input)
Evaluates the function at the given input. |
COSBase |
getCOSObject()
Returns the COSObject. |
COSDictionary |
getDictionary()
Returns the stream. |
PDRange |
getDomainForInput(int n)
This will get the range for a certain input parameter. |
abstract int |
getFunctionType()
Returns the function type. |
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. |
protected PDStream |
getPDStream()
Returns the underlying PDStream. |
PDRange |
getRangeForOutput(int n)
This will get the range for a certain output parameters. |
protected COSArray |
getRangeValues()
Returns all ranges for the output values as COSArray . |
protected float |
interpolate(float x,
float xRangeMin,
float xRangeMax,
float yRangeMin,
float yRangeMax)
For a given value of x, interpolate calculates the y value on the line defined by the two points (xRangeMin , xRangeMax ) and (yRangeMin , yRangeMax ). |
void |
setDomainValues(COSArray domainValues)
This will set the domain values. |
void |
setRangeValues(COSArray rangeValues)
This will set the range values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFunction(COSBase function)
functionStream
- The function stream.Method Detail |
---|
public abstract int getFunctionType()
public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public COSDictionary getDictionary()
protected PDStream getPDStream()
public static PDFunction create(COSBase function) throws IOException
function
- The COS function dictionary.
IOException
- If we are unable to create the PDFunction object.public int getNumberOfOutputParameters()
public PDRange getRangeForOutput(int n)
n
- The output parameter number to get the range for.
public void setRangeValues(COSArray rangeValues)
range
- The new range values.public int getNumberOfInputParameters()
public PDRange getDomainForInput(int n)
n
- The parameter number to get the domain for.
public void setDomainValues(COSArray domainValues)
range
- The new domain values.public abstract COSArray eval(COSArray input) throws IOException
input
- The array of input values for the function. In many cases will be an array of a single value, but not always.
IOException
protected COSArray getRangeValues()
protected COSArray clipToRange(COSArray inputArray)
inputArray
- the input values
protected float clipToRange(float x, float rangeMin, float rangeMax)
x
- the input valuerangeMin
- the min value of the rangerangeMax
- the max value of the range
protected float interpolate(float x, float xRangeMin, float xRangeMax, float yRangeMin, float yRangeMax)
x
- xRangeMin
- xRangeMax
- yRangeMin
- yRangeMax
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |