# Class: Function

## PDFNet. Function

#### new 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.

### Methods

#### <static> create(funct_dict)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `funct_dict` | PDFNet.Obj |

  ##### Returns:

  A promise that resolves to an object of type: "Function"

  Type
    PDFNet.Function

#### assign(right)

  Copy Constructor

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `right` | PDFNet.Function |

#### destroy()

  Frees the native memory of the object.

#### eval(inval, outval)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `inval` | number |
  `outval` | number |

#### getInputCardinality()

  ##### Returns:

  A promise that resolves to the number of input components required by the function

  Type
    number

#### getOutputCardinality()

  ##### Returns:

  A promise that resolves to the number of output components returned by the function

  Type
    number

#### getSDFObj()

  ##### Returns:

  A promise that resolves to the underlying SDF/Cos object

  Type
    PDFNet.Obj

#### getType()

  ##### Returns:

  A promise that resolves to the function type

  Type
    number

  ##### Example

      Return value enum:
      <pre>
      PDFNet.Function.Type = {
      	e_sampled : 0
      	e_exponential : 2
      	e_stitching : 3
      	e_postscript : 4
      }
      </pre>

#### Search results