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, double n) PdfType2Function(float[] domain, float[] range, float[] c0, float[] c1, double 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 doublegetN()Gets value of N field.final intGets output size of function.final voidsetC0(double[] value) Sets values of C0 array.final voidsetC1(double[] value) Sets values of C1 array.final voidsetN(double value) sets value of N field.Methods inherited from class com.itextpdf.kernel.pdf.function.AbstractPdfFunction
calculateFromByteArray, calculateFromByteArray, checkCompatibilityWithColorSpace, clip, clipInput, clipOutput, convertFloatArrayToDoubleArray, getAsPdfObject, getDomain, getFunctionType, getInputSize, getRange, isWrappedObjectMustBeIndirect, normalize, setDomain, setRangeMethods 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, double n) -
PdfType2Function
public PdfType2Function(float[] domain, float[] range, float[] c0, float[] c1, double n)
-
-
Method Details
-
calculate
public double[] calculate(double[] input) Description copied from interface:IPdfFunctionCalculates 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:
-
getOutputSizein interfaceIPdfFunction - Overrides:
-
getOutputSizein 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(double value) sets value of N field.- Parameters:
-
value- the value of N field
-