|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.functions.Function
public abstract class Function
The class Function is factory responsible for creating the correct
function type for the given "FunctionType" dictionary entry.
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:
In PDF functions, all the input values and all the output values are numbers.
Each function definition includes a domain, the set of legal
values for the input. Some functions also define a range, the
set of legal values for the output. Input and output values are clipped to
the respective domain and range.
This function factory currently support the following function types:
| Field Summary | |
|---|---|
protected float[] |
domain
An array of 2 x m numbers, where m is the number of input values. |
protected int |
functionType
Function type associated with this function. |
protected float[] |
range
An array of 2 x n numbers, where n is the number of output values. |
| Constructor Summary | |
|---|---|
protected |
Function(Dictionary d)
Creates a new instance of Function object. |
| Method Summary | |
|---|---|
abstract float[] |
calculate(float[] m)
Evaluates the input values specified by m. |
float[] |
getDomain()
|
static Function |
getFunction(Library l,
java.lang.Object o)
Creates a new instance of a Function object. |
int |
getFunctionType()
Gets the function type number. |
float[] |
getRange()
|
static float |
interpolate(float x,
float xmin,
float xmax,
float ymin,
float ymax)
Interpolation function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected float[] domain
protected float[] range
protected int functionType
| Constructor Detail |
|---|
protected Function(Dictionary d)
Function object.
d - dictionary containing a vaild function dictionary.| Method Detail |
|---|
public static Function getFunction(Library l,
java.lang.Object o)
Creates a new instance of a Function object. Possible function types are:
l - document library.o - dictionary or Hashtable containing Function type entries.
public int getFunctionType()
Gets the function type number.
public static float interpolate(float x,
float xmin,
float xmax,
float ymin,
float ymax)
Interpolation function. For the given value of x, the interpolate calculates the y value on the line defined by the two points (xmin, ymin) and (xmax, ymax).
x - value we want to find a y value for.xmin - point 1, x value.xmax - point 2, x value.ymin - point 1, y value.ymax - oint 2, y value.
public abstract float[] calculate(float[] m)
Evaluates the input values specified by m. In general, a
function can take any number (m) of input values and produce any
number (n) of output values:
m - input values to put through function.
public float[] getDomain()
public float[] getRange()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||