public class

Function

extends Object
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 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
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object

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 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

public int getInputCardinality ()

Get the input cardinality.

Returns
  • the number of input components required by the function

public int getOutputCardinality ()

Get the output cardinality.

Returns
  • the number of output components returned by the function

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

Protected Methods

protected void finalize ()

Throws
Throwable