Package com.itextpdf.kernel.pdf.function
Class PdfType3Function
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper
com.itextpdf.kernel.pdf.function.AbstractPdfFunction<PdfDictionary>
com.itextpdf.kernel.pdf.function.PdfType3Function
- All Implemented Interfaces:
-
IPdfFunction
This class represents Pdf type 3 function that defines a stitching of the subdomains of several 1-input functions to produce a single new 1-input function.
For more info see ISO 32000-1, section 7.10.4 "Type 3 (Stitching) Functions".
-
Constructor Summary
ConstructorDescriptionPdfType3Function
(double[] domain, double[] range, List<AbstractPdfFunction extends PdfDictionary>> functions, double[] bounds, double[] encode) (see ISO-320001 Table 41).Instantiates a new PdfType3Function instance based on passed PdfDictionary instance. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
calculate
(double[] input) Calculates one set of input components to one set of output components.boolean
checkCompatibilityWithColorSpace
(PdfColorSpace alternateSpace) Chacks wether the output of the function matches in components with the passed by color space.double[]
An array of k − 1 numbers that, in combination with Domain, shall define the intervals to which each function from the Functions array shall apply.double[]
An array of 2 × k numbers that, taken in pairs, shall map each subset of the domain defined by Domain and the Bounds array to the domain of the corresponding function.(Required) An array of k 1-input functions that shall make up the stitching function.int
Gets output size of function.protected boolean
Defines if the object behind this wrapper must be an indirect object in the resultant document.void
setBounds
(double[] value) (Required) An array of k − 1 numbers that, in combination with Domain, shall define the intervals to which each function from the Functions array shall apply.void
setEncode
(double[] value) (Required) An array of 2 × k numbers that, taken in pairs, shall map each subset of the domain defined by Domain and the Bounds array to the domain of the corresponding function.void
setFunctions
(Iterable<AbstractPdfFunction extends PdfDictionary>> value) (Required) An array of k 1-input functions that shall make up the stitching function.Methods inherited from class com.itextpdf.kernel.pdf.function.AbstractPdfFunction
calculateFromByteArray, calculateFromByteArray, clip, clipInput, clipOutput, getAsPdfObject, getDomain, getFunctionType, getInputSize, getRange, normalize, setDomain, setRange
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
PdfType3Function
Instantiates a new PdfType3Function instance based on passed PdfDictionary instance.- Parameters:
-
dict
- the function dictionary
-
PdfType3Function
public PdfType3Function(double[] domain, double[] range, List<AbstractPdfFunction extends PdfDictionary>> functions, double[] bounds, double[] encode) (see ISO-320001 Table 41).- Parameters:
-
domain
- the valid input domain, input will be clipped to this domain contains a min max pair per input component -
range
- the valid output range, oputput will be clipped to this range contains a min max pair per output component -
functions
- The list of functions to stitch* -
bounds
- (Required) An array of k − 1 numbers that, in combination with Domain, shall define the intervals to which each function from the Functions array shall apply. Bounds elements shall be in order of increasing value, and each value shall be within the domain defined by Domain. -
encode
- (Required) An array of 2 × k numbers that, taken in pairs, shall map each subset of the domain defined by Domain and the Bounds array to the domain of the corresponding function.
-
-
Method Details
-
getFunctions
(Required) An array of k 1-input functions that shall make up the stitching function. The output dimensionality of all functions shall be the same, and compatible with the value of Range if Range is present.(see ISO-320001 Table 41)
- Returns:
- the list of functions
-
setFunctions
(Required) An array of k 1-input functions that shall make up the stitching function. The output dimensionality of all functions shall be the same, and compatible with the value of Range if Range is present.(see ISO-320001 Table 41)
- Parameters:
-
value
- the list of functions
-
getBounds
public double[] getBounds()An array of k − 1 numbers that, in combination with Domain, shall define the intervals to which each function from the Functions array shall apply. Bounds elements shall be in order of increasing value, and each value shall be within the domain defined by Domain.(see ISO-320001 Table 41)
- Returns:
- the bounds
-
setBounds
public void setBounds(double[] value) (Required) An array of k − 1 numbers that, in combination with Domain, shall define the intervals to which each function from the Functions array shall apply. Bounds elements shall be in order of increasing value, and each value shall be within the domain defined by Domain.(see ISO-320001 Table 41)
- Parameters:
-
value
- the new set of bounds
-
getEncode
public double[] getEncode()An array of 2 × k numbers that, taken in pairs, shall map each subset of the domain defined by Domain and the Bounds array to the domain of the corresponding function.(see ISO-320001 Table 41)
- Returns:
- the encode values
-
setEncode
public void setEncode(double[] value) (Required) An array of 2 × k numbers that, taken in pairs, shall map each subset of the domain defined by Domain and the Bounds array to the domain of the corresponding function.(see ISO-320001 Table 41)
- Parameters:
-
value
- the new set of encodings
-
checkCompatibilityWithColorSpace
Description copied from class:AbstractPdfFunction
Chacks wether the output of the function matches in components with the passed by color space.- Specified by:
-
checkCompatibilityWithColorSpace
in interfaceIPdfFunction
- Overrides:
-
checkCompatibilityWithColorSpace
in classAbstractPdfFunction<PdfDictionary>
- Parameters:
-
alternateSpace
- The color space to verify against - Returns:
- True when compatible
-
getOutputSize
public int getOutputSize()Gets output size of function.If Range field is absent, the output size of functions will be returned.
- Specified by:
-
getOutputSize
in interfaceIPdfFunction
- Overrides:
-
getOutputSize
in classAbstractPdfFunction<PdfDictionary>
- Returns:
- output size of function
-
calculate
public double[] calculate(double[] input) Description copied from interface:IPdfFunction
Calculates one set of input components to one set of output components.- Parameters:
-
input
- The input values size must containIPdfFunction.getInputSize()
items - Returns:
-
an array the size of
IPdfFunction.getOutputSize()
items containing the result
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapper
Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
-
isWrappedObjectMustBeIndirect
in classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-