Class PDFFunction
- java.lang.Object
-
- com.inductiveautomation.rm.pdf.reader.PDFFunction
-
- Direct Known Subclasses:
ArrayFunction
,InterpolationFunction
,SampledFunction
,StitchingFunction
public abstract class PDFFunction extends java.lang.Object
This is an abstract superclass for all objects implementing PDF functions. PDF functions come in several flavors, but their basic job is to take a set of n input values and return m output values.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ExponentialInterpolation
int
functionType
float[]
inputDomain
float[]
inputValues
float[]
outputRange
static int
PostScriptCalculator
float[]
returnValues
static int
Sampled
static int
Stitching
-
Constructor Summary
Constructors Constructor Description PDFFunction()
PDFFunction(PDFStream functionStream, PDFFile srcFile)
Constructor for functions which take a streamPDFFunction(java.util.Map functionDict, PDFFile srcFile)
Constructor - takes the pdf function dictionary and the file it came from.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clipToRange(float[] vals, float[] range, float[] clipped)
Used internally by all function types to clip both the input and the output values to the Range and Domain values.float[]
evaluate(float[] inputs)
Evaluate the function.abstract void
function_implementation(float[] in, float[] out)
static PDFFunction
getInstance(java.lang.Object function, PDFFile srcFile)
Reads the function dictionary and creates an instance of the appropriate PDFFunction subclassvoid
initializeParameters(java.util.Map functionDict, PDFFile srcFile)
Read the function parametersint
numInputValues()
Returns the number of parameters this function takes as inputint
numOutputValues()
Returns the number of values this function returns.
-
-
-
Field Detail
-
Sampled
public static final int Sampled
- See Also:
- Constant Field Values
-
ExponentialInterpolation
public static final int ExponentialInterpolation
- See Also:
- Constant Field Values
-
Stitching
public static final int Stitching
- See Also:
- Constant Field Values
-
PostScriptCalculator
public static final int PostScriptCalculator
- See Also:
- Constant Field Values
-
functionType
public int functionType
-
inputDomain
public float[] inputDomain
-
outputRange
public float[] outputRange
-
returnValues
public float[] returnValues
-
inputValues
public float[] inputValues
-
-
Constructor Detail
-
PDFFunction
public PDFFunction()
-
PDFFunction
public PDFFunction(java.util.Map functionDict, PDFFile srcFile)
Constructor - takes the pdf function dictionary and the file it came from.
-
-
Method Detail
-
getInstance
public static PDFFunction getInstance(java.lang.Object function, PDFFile srcFile)
Reads the function dictionary and creates an instance of the appropriate PDFFunction subclass
-
initializeParameters
public void initializeParameters(java.util.Map functionDict, PDFFile srcFile)
Read the function parameters
-
numInputValues
public int numInputValues()
Returns the number of parameters this function takes as input
-
numOutputValues
public int numOutputValues()
Returns the number of values this function returns. Should be overridden by subclasses that don't require outputRange.
-
evaluate
public float[] evaluate(float[] inputs)
Evaluate the function. Note that the return value array is reused, so if you need to save the results around for any length of time, you should copy them out.
-
clipToRange
public void clipToRange(float[] vals, float[] range, float[] clipped)
Used internally by all function types to clip both the input and the output values to the Range and Domain values.
-
function_implementation
public abstract void function_implementation(float[] in, float[] out)
-
-