A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
scale
ArrayFire Functions | ArrayFire Functions by Category » Image Processing » Image transformations

## Functions
AFAPI array | scale (const array &in, const float scale0, const float scale1, const dim_t odim0=0, const dim_t odim1=0, const interpType method=AF_INTERP_NEAREST)
| C++ Interface for scaling an image.
AFAPI af_err | af_scale (af_array *out, const af_array in, const float scale0, const float scale1, const dim_t odim0, const dim_t odim1, const af_interp_type method)
| C Interface for scaling an image.

## Detailed Description

Scale an input image

Scale is the same functionality as af::resize except that the scale function uses the transform kernels. The other difference is that scale does not set boundary values to be the boundary of the input array. Instead these are set to 0.

Scale is a special case of the af::transform function.

## Function Documentation

## ◆ af_scale()

AFAPI af_err af_scale | ( | af_array * | out,
|  | const af_array | in,
|  | const float | scale0,
|  | const float | scale1,
|  | const dim_t | odim0,
|  | const dim_t | odim1,
|  | const af_interp_type | method )

C Interface for scaling an image.

Parameters

  [out] | out | will contain the scaled image
  [in] | in | is input image
  [in] | scale0 | is amount by which the first dimension is scaled
  [in] | scale1 | is amount by which the second dimension is scaled
  [in] | odim0 | is the first output dimension
  [in] | odim1 | is the second output dimension
  [in] | method | is the interpolation type (Nearest by default)

Returns
  AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.

## ◆ scale()

AFAPI array scale | ( | const array & | in,
|  | const float | scale0,
|  | const float | scale1,
|  | const dim_t | odim0 = 0,
|  | const dim_t | odim1 = 0,
|  | const interpType | method = AF_INTERP_NEAREST )

C++ Interface for scaling an image.

Parameters

  [in] | in | is input image
  [in] | scale0 | is amount by which the first dimension is scaled
  [in] | scale1 | is amount by which the second dimension is scaled
  [in] | odim0 | is the first output dimension
  [in] | odim1 | is the second output dimension
  [in] | method | is the interpolation type (Nearest by default)

Returns
  the scaled image