Package com.ribs.pdf
Class PDFFunction
java.lang.Object
com.ribs.pdf.PDFFunction
- Direct Known Subclasses:
ArrayFunction
,PDFInterpolationFunction
,PDFSampledFunction
,PDFStitchingFunction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
int
float[]
float[]
float[]
static final int
float[]
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionPDFFunction
(PDFStream functionStream, PDFFile srcFile) Constructor for functions which take a streamPDFFunction
(Map functionDict, PDFFile srcFile) Constructor - takes the pdf function dictionary and the file it came from. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
(Object function, PDFFile srcFile) Reads the function dictionary and creates an instance of the appropriate PDFFunction subclassvoid
initializeParameters
(Map functionDict, PDFFile srcFile) Read the function parametersint
Returns the number of parameters this function takes as inputint
Returns the number of values this function returns.
-
Field Details
-
Sampled
public static final int Sampled- See Also:
-
ExponentialInterpolation
public static final int ExponentialInterpolation- See Also:
-
Stitching
public static final int Stitching- See Also:
-
PostScriptCalculator
public static final int PostScriptCalculator- See Also:
-
functionType
public int functionType -
inputDomain
public float[] inputDomain -
outputRange
public float[] outputRange -
returnValues
public float[] returnValues -
inputValues
public float[] inputValues
-
-
Constructor Details
-
PDFFunction
public PDFFunction() -
PDFFunction
Constructor - takes the pdf function dictionary and the file it came from. -
PDFFunction
Constructor for functions which take a stream
-
-
Method Details
-
getInstance
Reads the function dictionary and creates an instance of the appropriate PDFFunction subclass -
initializeParameters
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)
-