Class PDFunctionType0.Rinterpol
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.common.function.PDFunctionType0.Rinterpol
-
- Enclosing class:
- PDFunctionType0
private class PDFunctionType0.Rinterpol extends java.lang.Object
Inner class do to an interpolation in the Nth dimension by comparing the content size of N-1 dimensional objects. This is done with the help of recursive calls. To understand the algorithm without recursion, here is a bilinear interpolation and here's a trilinear interpolation (external links).
-
-
Field Summary
Fields Modifier and Type Field Description private float[]
in
private int[]
inNext
private int[]
inPrev
private int
numberOfInputValues
private int
numberOfOutputValues
-
Constructor Summary
Constructors Constructor Description Rinterpol(float[] input, int[] inputPrev, int[] inputNext)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
calcSampleIndex(int[] vector)
calculate array index (structure described in p.171 PDF spec 1.7) in multiple dimensions.private int[][]
getSamples()
Get all sample values of this function.private float[]
rinterpol(int[] coord, int step)
Do a linear interpolation if the two coordinates can be known, or call itself recursively twice.(package private) float[]
rinterpolate()
Calculate the interpolation.
-
-
-
Method Detail
-
rinterpolate
float[] rinterpolate()
Calculate the interpolation.- Returns:
- interpolated result sample
-
rinterpol
private float[] rinterpol(int[] coord, int step)
Do a linear interpolation if the two coordinates can be known, or call itself recursively twice.- Parameters:
coord
- coord partially set coordinate (not set from step upwards); gets fully filled in the last call ("leaf"), where it is used to get the correct samplestep
- between 0 (first call) and dimension - 1- Returns:
- interpolated result sample
-
calcSampleIndex
private int calcSampleIndex(int[] vector)
calculate array index (structure described in p.171 PDF spec 1.7) in multiple dimensions.- Parameters:
vector
- with coordinates- Returns:
- index in flat array
-
getSamples
private int[][] getSamples()
Get all sample values of this function.- Returns:
- an array with all samples.
-
-