Package com.ribs.pdf
Class PDFFunction
java.lang.Object
com.ribs.pdf.PDFFunction
- Direct Known Subclasses:
- ArrayFunction,- PDFInterpolationFunction,- PDFSampledFunction,- PDFStitchingFunction
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intintfloat[]float[]float[]static final intfloat[]static final intstatic final int
- 
Constructor SummaryConstructorsConstructorDescriptionPDFFunction(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 SummaryModifier and TypeMethodDescriptionvoidclipToRange(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 voidfunction_implementation(float[] in, float[] out) static PDFFunctiongetInstance(Object function, PDFFile srcFile) Reads the function dictionary and creates an instance of the appropriate PDFFunction subclassvoidinitializeParameters(Map functionDict, PDFFile srcFile) Read the function parametersintReturns the number of parameters this function takes as inputintReturns the number of values this function returns.
- 
Field Details- 
Sampledpublic static final int Sampled- See Also:
 
- 
ExponentialInterpolationpublic static final int ExponentialInterpolation- See Also:
 
- 
Stitchingpublic static final int Stitching- See Also:
 
- 
PostScriptCalculatorpublic static final int PostScriptCalculator- See Also:
 
- 
functionTypepublic int functionType
- 
inputDomainpublic float[] inputDomain
- 
outputRangepublic float[] outputRange
- 
returnValuespublic float[] returnValues
- 
inputValuespublic float[] inputValues
 
- 
- 
Constructor Details- 
PDFFunctionpublic PDFFunction()
- 
PDFFunctionConstructor - takes the pdf function dictionary and the file it came from.
- 
PDFFunctionConstructor for functions which take a stream
 
- 
- 
Method Details- 
getInstanceReads the function dictionary and creates an instance of the appropriate PDFFunction subclass
- 
initializeParametersRead the function parameters
- 
numInputValuespublic int numInputValues()Returns the number of parameters this function takes as input
- 
numOutputValuespublic int numOutputValues()Returns the number of values this function returns. Should be overridden by subclasses that don't require outputRange.
- 
evaluatepublic 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.
- 
clipToRangepublic 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_implementationpublic abstract void function_implementation(float[] in, float[] out) 
 
-