Summary: Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Function

extends Object
implements AutoCloseable

java.lang.Object
↳ | com.pdftron.pdf.Function

## Class Overview

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.

## Summary

Constants
int | e_exponential | The Constant e_exponential.
int | e_postscript | The Constant e_postscript.
int | e_sampled | The Constant e_sampled.
int | e_stitching | The Constant e_stitching.

Public Constructors
| Function(Obj funct_dict) Create a PDF.Function object from an existing SDF function dictionary.

Public Methods
void | close() Frees the native memory of the object.
void | destroy() Frees the native memory of the object.
double[] | eval(double[] in) Evaluate the function at a given point.
int | getInputCardinality() Get the input cardinality.
int | getOutputCardinality() Get the output cardinality.
Obj | getSDFObj() Get the SDFObj.
int | getType() Get the current function type

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## Constants

#### public static final int e_exponential

The Constant e_exponential.

Constant Value: 2 (0x00000002)

#### public static final int e_postscript

The Constant e_postscript.

Constant Value: 4 (0x00000004)

#### public static final int e_sampled

The Constant e_sampled.

Constant Value: 0 (0x00000000)

#### public static final int e_stitching

The Constant e_stitching.

Constant Value: 3 (0x00000003)

## Public Constructors

#### public Function (Obj funct_dict)

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

##### Parameters

funct_dict | the funct_dict

## Public Methods

#### public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public void destroy ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

#### public double[] eval (double[] in)

Evaluate the function at a given point.

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

##### Parameters

in | the input point

##### Returns

- the result

##### Throws

PDFNetException |

#### public int getInputCardinality ()

Get the input cardinality.

##### Returns

- the number of input components required by the function

##### Throws

PDFNetException |

#### public int getOutputCardinality ()

Get the output cardinality.

##### Returns

- the number of output components returned by the function

##### Throws

PDFNetException |

#### public Obj getSDFObj ()

Get the SDFObj.

##### Returns

- the underlying SDF/Cos object

#### public int getType ()

Get the current function type

##### Returns

- the current function type

##### Throws

PDFNetException |