PdfFunction Class
PDF provides several types of function objects (PDF 1.2) that represent parameterized classes of functions, including mathematical formulas and sampled representations with arbitrary resolution.
Functions in PDF represent static, self-contained numerical transformations.
In general, a function can take any number (m) of input values and produce any number (n) of output values: f(x[0], ..., x[m-1]) = y[0], ..., y[n-1]
In PDF functions, all the input values and all the output values shall be numbers, and functions shall have no side effects.
public abstract class PdfFunction : PdfObject
Public MustInherit Class PdfFunction
Inherits PdfObject
- Inheritance:
- System.ObjectPdfFunction
- Derived
Remarks
Each function definition includes a Domain, the set of legal values for the input. Some types of functions also define a Range, the set of legal values for the output. Input values passed to the function shall be clipped to the Domain, and output values produced by the function shall be clipped to the Range.
Properties
Domain
(Required) A collection of mPdfNumberRanges, where m shall be the number of input values. For each i from 0 to m − 1, Domain[i].First shall be less than or equal to Domain[i].Last, and the ith input value, x[i], shall lie in the interval Domain[i].First ≤ x[i] ≤ Domain[i].Last. Input values outside the declared domain shall be clipped to the nearest boundary value.
public PdfNumberRangeCollection Domain { get; set; }
Public Property Domain As PdfNumberRangeCollection
Property Value
A collection of mPdfNumberRanges, where m shall be the number of input values.
Exceptions
- System.ArgumentNullException
Value is null.
See Also
FunctionType
Gets the type of the function.
public abstract PdfFunctionType FunctionType { get; }
Public MustOverride ReadOnly Property FunctionType As PdfFunctionType
Property Value
The type of the function.
See Also
Range
(Required for PdfSampledFunctions and PdfPostScriptCalculatorFunctions, optional otherwise) A collection of nPdfNumberRanges, where n shall be the number of output values. For each j from 0 to n − 1, Range[j].First shall be less than or equal to Range[j].Last, and the jth output value, y[j] , shall lie in the interval Range[j].First ≤ y[j] ≤ Range[j].Last. Output values outside the declared range shall be clipped to the nearest boundary value. If this entry is absent, no clipping shall be done.
public PdfNumberRangeCollection Range { get; set; }
Public Property Range As PdfNumberRangeCollection
Property Value
A collection of nPdfNumberRanges, where n shall be the number of output values.
See Also
Methods
Compile()
Compiles the PDF function described by this PdfFunction instance into executable code and produces a delegate that represents the PDF function.
public Action<double[], double[]> Compile()
Public Function Compile As Action(Of Double(), Double())
Returns
- System.Action<System.Double[], System.Double[]>
A delegate of type System.Action<, > that represents the compiled PDF function described by this PdfFunction instance.
Remarks
The Compile() method produces a delegate of type System.Action<, > at runtime. When that delegate is executed, it has the behavior described by the semantics of this PdfFunction instance.
The Compile() method can be used to obtain the value of any PDF function. First, create a PDF function by using any of the PdfFunction-derived types. Then call Compile() to obtain a delegate, and execute the delegate to obtain the value of the PDF function.
Compile(Boolean)
Compiles the PDF function described by this PdfFunction instance into executable code and produces a delegate that represents the PDF function.
public Func<double[], double[]> Compile(bool cacheOutput)
Public Function Compile(cacheOutput As Boolean) As Func(Of Double(), Double())
Parameters
cacheOutput
- System.Boolean
If set to true the output array is cached in the compiled form of a PDF function and used for subsequent calculations; otherwise, false to return a new output array instance for each calculation.
Returns
- System.Func<System.Double[], System.Double[]>
A delegate of type System.Func<, > that represents the compiled PDF function described by this PdfFunction instance.
Remarks
The Compile() method produces a delegate of type System.Func<, > at runtime. When that delegate is executed, it has the behavior described by the semantics of this PdfFunction instance.
The Compile() method can be used to obtain the value of any PDF function. First, create a PDF function by using any of the PdfFunction-derived types. Then call Compile() to obtain a delegate, and execute the delegate to obtain the value of the PDF function.
Inherited Properties
Metadata | (Optional; PDF 1.4) A metadata stream containing metadata for the component. (Inherited from PdfObject) |