public abstract class PDFunction extends Object implements COSObjectable
Constructor and Description |
---|
PDFunction(COSBase function)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected float[] |
clipToRange(float[] inputValues)
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.
|
COSArray |
eval(COSArray input)
Deprecated.
Replaced by
eval(float[] input) |
abstract float[] |
eval(float[] input)
Evaluates the function at the given input.
|
COSDictionary |
getCOSObject()
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.
|
String |
toString() |
public PDFunction(COSBase function)
function
- The function stream.public abstract int getFunctionType()
public COSDictionary getCOSObject()
getCOSObject
in interface COSObjectable
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)
rangeValues
- 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)
domainValues
- The new domain values.@Deprecated public COSArray eval(COSArray input) throws IOException
eval(float[] input)
input
- The array of input values for the function.IOException
- if something went wrong.public abstract float[] eval(float[] 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
- an IOExcpetion is thrown if something went wrong processing the function.protected COSArray getRangeValues()
protected float[] clipToRange(float[] inputValues)
inputValues
- the input valuesprotected float clipToRange(float x, float rangeMin, float rangeMax)
x
- the input valuerangeMin
- the min value of the rangerangeMax
- the max value of the rangeprotected float interpolate(float x, float xRangeMin, float xRangeMax, float yRangeMin, float yRangeMax)
x
- the to be interpolated value.xRangeMin
- the min value of the x rangexRangeMax
- the max value of the x rangeyRangeMin
- the min value of the y rangeyRangeMax
- the max value of the y rangeCopyright © 2002–2018 The Apache Software Foundation. All rights reserved.