ArrayFire: resize
Resize an input image. More...
Functions | |
| AFAPI array | resize (const array &in, const dim_t odim0, const dim_t odim1, const interpType method=AF_INTERP_NEAREST) |
| C++ Interface for resizing an image to specified dimensions. More... | |
| AFAPI array | resize (const float scale0, const float scale1, const array &in, const interpType method=AF_INTERP_NEAREST) |
| C++ Interface for resizing an image to specified scales. More... | |
| AFAPI array | resize (const float scale, const array &in, const interpType method=AF_INTERP_NEAREST) |
| C++ Interface for resizing an image to specified scale. More... | |
| AFAPI af_err | af_resize (af_array *out, const af_array in, const dim_t odim0, const dim_t odim1, const af_interp_type method) |
| C Interface for resizing an image to specified dimensions. More... | |
Resize an input image.
Resizing an input image can be done using either AF_INTERP_NEAREST, AF_INTERP_BILINEAR or AF_INTERP_LOWER, interpolations. Nearest interpolation will pick the nearest value to the location, bilinear interpolation will do a weighted interpolation for calculate the new size and lower interpolation is similar to the nearest, except it will use the floor function to get the lower neighbor.
This function does not differentiate between images and data. As long as the array is defined and the output dimensions are not 0, it will resize any type or size of array.
array in = iota(dim4(5, 3));
@ AF_INTERP_NEAREST
Nearest Interpolation.
@ AF_INTERP_BILINEAR
Bilinear Interpolation.
◆ af_resize()
C Interface for resizing an image to specified dimensions.
- Parameters
-
[out] out will contain the resized image of specified by odim0andodim1[in] in is input image [in] odim0 is the size for the first output dimension [in] odim1 is the size for 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.
◆ resize() [1/3]
C++ Interface for resizing an image to specified dimensions.
- Parameters
-
[in] in is input image [in] odim0 is the size for the first output dimension [in] odim1 is the size for the second output dimension [in] method is the interpolation type (Nearest by default)
- Returns
- the resized image of specified by
odim0andodim1
◆ resize() [2/3]
C++ Interface for resizing an image to specified scale.
- Parameters
-
[in] scale is scale used for both input dimensions [in] in is input image [in] method is the interpolation type (Nearest by default)
- Returns
- the image scaled by the specified by
scale
◆ resize() [3/3]
C++ Interface for resizing an image to specified scales.
- Parameters
-
[in] scale0 is scale used for first input dimension [in] scale1 is scale used for second input dimension [in] in is input image [in] method is the interpolation type (Nearest by default)
- Returns
- the image scaled by the specified by
scale0andscale1