Package com.itextpdf.kernel.pdf.function
Class PdfType2Function
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper
com.itextpdf.kernel.pdf.function.AbstractPdfFunction<PdfDictionary>
com.itextpdf.kernel.pdf.function.PdfType2Function
- All Implemented Interfaces:
-
IPdfFunction
This class represents Pdf type 2 function that defines an exponential interpolation of one input value to n output values.
For more info see ISO 32000-1, section 7.10.3 "Type 2 (Exponential Interpolation) Functions".
-
Constructor Summary
ConstructorsConstructorDescriptionPdfType2Function
(double[] domain, double[] range, double[] c0, double[] c1, int n) Instantiates a new PdfType2Function 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.final double[]
getC0()
Gets values of C0 array.final double[]
getC1()
Gets values of C1 array.final double
getN()
Gets value of N field.final int
Gets output size of function.protected boolean
Defines if the object behind this wrapper must be an indirect object in the resultant document.final void
setC0
(double[] value) Sets values of C0 array.final void
setC1
(double[] value) Sets values of C1 array.final void
setN
(int value) sets value of N field.Methods inherited from class com.itextpdf.kernel.pdf.function.AbstractPdfFunction
calculateFromByteArray, calculateFromByteArray, checkCompatibilityWithColorSpace, 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
-
PdfType2Function
Instantiates a new PdfType2Function instance based on passed PdfDictionary instance.- Parameters:
-
dict
- the function dictionary
-
PdfType2Function
public PdfType2Function(double[] domain, double[] range, double[] c0, double[] c1, int n)
-
-
Method Details
-
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
-
getOutputSize
public final int getOutputSize()Gets output size of function.If Range field is absent, the size of C0 array will be returned.
- Specified by:
-
getOutputSize
in interfaceIPdfFunction
- Overrides:
-
getOutputSize
in classAbstractPdfFunction<PdfDictionary>
- Returns:
- output size of function
-
getC0
public final double[] getC0()Gets values of C0 array.- Returns:
- the values of C0 array
-
setC0
public final void setC0(double[] value) Sets values of C0 array.- Parameters:
-
value
- the values of C0 array
-
getC1
public final double[] getC1()Gets values of C1 array.- Returns:
- the values of C1 array
-
setC1
public final void setC1(double[] value) Sets values of C1 array.- Parameters:
-
value
- the values of C1 array
-
getN
public final double getN()Gets value of N field.- Returns:
- the value of N field
-
setN
public final void setN(int value) sets value of N field.- Parameters:
-
value
- the value of N field
-
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.
-