Package com.itextpdf.kernel.pdf.function
Class PdfType2Function
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<T>
-
- com.itextpdf.kernel.pdf.function.AbstractPdfFunction<PdfDictionary>
-
- com.itextpdf.kernel.pdf.function.PdfType2Function
-
- All Implemented Interfaces:
IPdfFunction
public class PdfType2Function extends AbstractPdfFunction<PdfDictionary>
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
Constructors Constructor Description PdfType2Function(double[] domain, double[] range, double[] c0, double[] c1, double n)
PdfType2Function(float[] domain, float[] range, float[] c0, float[] c1, double n)
PdfType2Function(PdfDictionary dict)
Instantiates a new PdfType2Function instance based on passed PdfDictionary instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
calculate(double[] input)
Calculates one set of input components to one set of output components.double[]
getC0()
Gets values of C0 array.double[]
getC1()
Gets values of C1 array.double
getN()
Gets value of N field.int
getOutputSize()
Gets output size of function.private static double[]
initializeCArray(PdfArray c, PdfArray otherC, PdfArray range, double defaultValue)
void
setC0(double[] value)
Sets values of C0 array.void
setC1(double[] value)
Sets values of C1 array.void
setN(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, setRange
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Constructor Detail
-
PdfType2Function
public PdfType2Function(PdfDictionary dict)
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 Detail
-
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(double value)
sets value of N field.- Parameters:
value
- the value of N field
-
-