Show / Hide Table of Contents

# Class Function

Although PDF is not a programming language it provides several types of function object that represent parameterized classes of functions, including mathematical formulas and sampled representations with arbitrary resolution. Functions are used in various ways in PDF, including device-dependent rasterization information for high-quality printing (halftone spot functions and transfer functions), color transform functions for certain color spaces, and specification of colors as a function of position for smooth shadings. Functions in PDF represent static, self-contained numerical transformations.

PDF::Function represents a single, flat interface around all PDF function types.

##### Inheritance

object
Function

##### Implements

IDisposable

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class Function : IDisposable

### Methods

#### Create(Obj)

Create a PDF::Function object from an existing SDF function dictionary.

##### Declaration

    public static Function Create(Obj function)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | function | the funct_dict

##### Returns

Type | Description
--- | ---
Function | newly created `Function` object

#### Destroy()

##### Declaration

    public void Destroy()

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### Eval(double[], double[])

Evaluate the function at a given point.

##### Declaration

    public virtual void Eval(double[] @in, double[] @out)

##### Parameters

Type | Name | Description
--- | --- | ---
double[] | in | the in
double[] | out | the double[]

##### Remarks

that size of 'in' array must be greater than or equal to function input cardinality.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### ~Function()

Releases all resources used by the Function

##### Declaration

    protected ~Function()

#### GetInputCardinality()

Gets the input cardinality.

##### Declaration

    public int GetInputCardinality()

##### Returns

Type | Description
--- | ---
int | the number of input components required by the function

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetOutputCardinality()

Gets the output cardinality.

##### Declaration

    public int GetOutputCardinality()

##### Returns

Type | Description
--- | ---
int | the number of output components returned by the function

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSDFObj()

Gets the SDFObj.

##### Declaration

    public Obj GetSDFObj()

##### Returns

Type | Description
--- | ---
Obj | the underlying SDF/Cos object

#### GetType()

Gets the type.

##### Declaration

    public virtual Function.Type GetType()

##### Returns

Type | Description
--- | ---
Function.Type | The function type

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable