approx2

- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
approx2
Complete List of ArrayFire Functions ArrayFire Functions by Category » Signal Processing » | Interpolation and approximation

approx2 performs interpolation on data along the first and second dimensions. More...

## Functions
AFAPI array | approx2 (const array &in, const array &pos0, const array &pos1, const interpType method=AF_INTERP_LINEAR, const float offGrid=0.0f)
| C++ Interface for data interpolation on two dimensional signals. More...
AFAPI af_err | af_approx2 (af_array *out, const af_array in, const af_array pos0, const af_array pos1, const af_interp_type method, const float offGrid)
| C Interface for signals interpolation on two dimensional signals. More...

## Detailed Description

approx2 performs interpolation on data along the first and second dimensions.

It has three options for the type of interpolation to perform:

- Nearest neighbor - AF_INTERP_NEAREST
- Linear interpolation - AF_INTERP_LINEAR
- Bilinear interpolation - AF_INTERP_BILINEAR
- Cubic interpolation - AF_INTERP_CUBIC

## Function Documentation

AFAPI af_err af_approx2 | ( | af_array * | out,
|  | const af_array | in,
|  | const af_array | pos0,
|  | const af_array | pos1,
|  | const af_interp_type | method,
|  | const float | offGrid
| ) |  |

C Interface for signals interpolation on two dimensional signals.

Parameters

  [out] | out | is the array with interpolated values
  [in] | in | is the input array
  [in] | pos0 | array contains the interpolation locations for first dimension
  [in] | pos1 | array contains the interpolation locations for second dimension
  [in] | method | is the interpolation type, it can take one of the values defined by the enum af_interp_type
  [in] | offGrid | is the value that will set in the output array when certain index is out of bounds

Returns
  AF_SUCCESS if the interpolation operation is successful, otherwise an appropriate error code is returned.

AFAPI array af::approx2 | ( | const array & | in,
|  | const array & | pos0,
|  | const array & | pos1,
|  | const interpType | method = `AF_INTERP_LINEAR`,
|  | const float | offGrid = `0.0f`
| ) |  |

C++ Interface for data interpolation on two dimensional signals.

Parameters

  [in] | in | is the input array
  [in] | pos0 | array contains the interpolation locations for first dimension
  [in] | pos1 | array contains the interpolation locations for second dimension
  [in] | method | is the interpolation type, it can take one of the values defined by the enum af_interp_type
  [in] | offGrid | is the value that will set in the output array when certain index is out of bounds

Returns
  the array with interpolated values