public class FunctionType0 extends PDFFunction
Modifier and Type | Field and Description |
---|---|
protected static int |
CUBIC_INTERPOLATION |
protected static int |
LINEAR_INTERPOLATION
the valid interpolation methods
|
TYPE_0, TYPE_2, TYPE_3, TYPE_4
Modifier | Constructor and Description |
---|---|
protected |
FunctionType0()
Creates a new instance of FunctionType0
|
Modifier and Type | Method and Description |
---|---|
protected void |
doFunction(float[] inputs,
int inputOffset,
float[] outputs,
int outputOffset)
Map from m input values to n output values.
|
protected int |
getBitsPerSample()
Get the number of bits per sample
|
protected float |
getDecode(int i)
Get the decoding for a particular input parameter
|
protected float |
getEncode(int i)
Get the encoding for a particular input parameter
|
protected int |
getOrder()
Get the interpolation type
|
protected int |
getSample(int[] values,
int od)
Get a component for a sample given m indices and output
dimension.
|
protected int |
getSize(int dimension)
Get the size of a given input dimension
|
static float |
interpolate(float x,
float xmin,
float xmax,
float ymin,
float ymax)
Perform a linear interpolation.
|
protected void |
parse(PDFObject obj)
Read the function information from a PDF Object
|
protected void |
setBitsPerSample(int bits)
Set the number of bits per sample
|
protected void |
setDecode(float[] decode)
Set the decode array
|
protected void |
setEncode(float[] encode)
Set the encode array
|
protected void |
setOrder(int order)
Set the interpolation type
|
protected void |
setSamples(int[][] samples)
Set the table of samples
|
protected void |
setSize(int[] size)
Set the size of all input dimensions
|
calculate, calculate, getDomain, getFunction, getNumInputs, getNumOutputs, getRange, getType, setDomain, setRange
protected static final int LINEAR_INTERPOLATION
protected static final int CUBIC_INTERPOLATION
protected void parse(PDFObject obj) throws java.io.IOException
parse
in class PDFFunction
java.io.IOException
protected void doFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset)
doFunction
in class PDFFunction
inputs
- an array of m input valuesoutputs
- an array of size n which will be filled
with the output values, or null to return a new arrayinputOffset
- the offset into the inputs array to read fromoutputOffset
- the offset into the output array to write toprotected int getSize(int dimension)
dimension
- the input dimension to get the size ofprotected void setSize(int[] size)
protected int getBitsPerSample()
protected void setBitsPerSample(int bits)
protected int getOrder()
protected void setOrder(int order)
protected float getEncode(int i)
i
- the index into the encoding array, which has size 2 * m.
the ith entry in the array has index 2i,
2i + 1protected void setEncode(float[] encode)
protected float getDecode(int i)
i
- the index into the decoding array, which has size 2 * n.
the ith entry in the array has index 2i,
2i + 1protected void setDecode(float[] decode)
protected int getSample(int[] values, int od)
values
- an array of m values determining which sample
to selectod
- the output dimension (0 - n) to get the sample inprotected void setSamples(int[][] samples)
public static float interpolate(float x, float xmin, float xmax, float ymin, float ymax)
x
- the x value of the inputxmin
- the minimum x valueymin
- the minimum y valuexmax
- the maximum x valueymax
- the maximum y value