Class FunctionType3
java.lang.Object
org.openpdf.renderer.function.PDFFunction
org.openpdf.renderer.function.FunctionType3
3.9.3 - A stitching function define a stitching of the subdomains of
several 1-input functions to produce a single new 1-input function.
Since the resulting stitching function is a 1-input function, the
domain is given by a two-element array, [ Domain0 Domain1 ].
Example 4.25 5 0 obj % Shading dictionary invalid input: '<'invalid input: '<' /ShadingType 3 /ColorSpace /DeviceCMYK /Coords [ 0.0 0.0 0.096 0.0 0.0 1.0 00]% Concentric circles /Function 10 0 R /Extend [ true true ] >> endobj 10 0 obj % Color function invalid input: '<'invalid input: '<' /FunctionType 3 /Domain [ 0.0 1.0 ] /Functions [ 11 0 R 12 0 R ] /Bounds [ 0.708 ] /Encode [ 1.0 0.0 0.0 1.0 ] >> endobj 11 0 obj % First subfunction invalid input: '<'invalid input: '<' /FunctionType 2 /Domain [ 0.0 1.0 ] /C0 [ 0.929 0.357 1.000 0.298 ] /C1 [ 0.631 0.278 1.000 0.027 ] /N 1.048 >> endobj 12 0 obj % Second subfunction invalid input: '<'invalid input: '<' /FunctionType 2 /Domain [ 0.0 1.0 ] /C0 [ 0.929 0.357 1.000 0.298 ] /C1 [ 0.941 0.400 1.000 0.102 ] /N 1.374 >> endobj
-
Field Summary
FieldsFields inherited from class PDFFunction
TYPE_0, TYPE_2, TYPE_3, TYPE_4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Subclasses must implement this method to perform the actual function on the given set of data.intGet the number of inputs, m, required by this functionintGet the number of outputs, n, returned by this functionprotected voidRead the function information from a PDF Object.Methods inherited from class PDFFunction
calculate, calculate, getDomain, getFunction, getRange, getType, interpolate, setDomain, setRange
-
Field Details
-
functions
-
bounds
private float[] bounds -
encode
private float[] encode
-
-
Constructor Details
-
FunctionType3
protected FunctionType3()Creates a new instance of FunctionType3
-
-
Method Details
-
parse
Read the function information from a PDF Object.
Required entries ( Table 3.38) (3200-1:2008:7.10.4, table: 41) are:
- Functions array (Required) An array of k 1-input functions making up the stitching function. The output dimensionality of all functions must be the same, and compatible with the value of Range if Range is present.
- Domainarray (Required) A 2 element array where Domain0 is less than Domain1. This is read by the
PDFFunctionsuperclass.- Bounds array (Required) An array of k-1 numbers that, in combination with Domain, define the intervals to which each function from the Functions array applies. Bounds elements must be in order of increasing value, and each value must be within the domain defined by >b>Domain.
- Encode array (Required) An array of 2 * k numbers that, taken in pairs, map each subset of the domain defined by invalid input: '<'bDomain and the Bounds array to the domain of the corresponding function.
- Specified by:
parsein classPDFFunction- Throws:
IOException
-
doFunction
protected void doFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Description copied from class:PDFFunctionSubclasses must implement this method to perform the actual function on the given set of data. Note that the inputs are guaranteed to be clipped to the domain, while the outputs will be automatically clipped to the range after being returned from this function.- Specified by:
doFunctionin classPDFFunction- Parameters:
inputs- an array of 1 input valuesinputOffset- the offset into the inputs array to read fromoutputs- an array of size n which will be filled with the output values, or null to return a new arrayoutputOffset- the offset into the output array to write to
-
getNumInputs
public int getNumInputs()Description copied from class:PDFFunctionGet the number of inputs, m, required by this function- Overrides:
getNumInputsin classPDFFunction- Returns:
- the number of input values expected by this function
-
getNumOutputs
public int getNumOutputs()Description copied from class:PDFFunctionGet the number of outputs, n, returned by this function- Overrides:
getNumOutputsin classPDFFunction- Returns:
- the number of output values this function will return
-