Do more. Code less. Free software for GPU computing.
<scroll to top>
Enumerations | Functions

Transform: rotate, resize

Image and Signal Processing

Enumerations

enum  af_resize_t { AF_RSZ_Nearest = 0, AF_RSZ_Bilinear = 1 }
 

Resize interpolation method.

More...

Functions

array rotate (const array &image, const float theta, bool iscrop=true)
 Image rotation.
array resize (const array &image, float scale, af_resize_t type=AF_RSZ_Nearest)
 Resize an image uniformly.
array resize (const array &image, float height, float width, af_resize_t type=AF_RSZ_Nearest)
 Resize an image.

Enumeration Type Documentation

enum af_resize_t

Resize interpolation method.

Enumerator:
AF_RSZ_Nearest 

Use value of nearest neighbor.

AF_RSZ_Bilinear 

Linearly interpolate between four nearest neighbors.


Function Documentation

array af::rotate ( const array &  image,
const float  theta,
bool  iscrop = true 
)

Image rotation.

Parameters:
[in]image
[in]thetaclockwise rotation angle in radians.
[in]iscropUse in-place rotation and crop outlying pixels (true, default), else enlarge image domain to fit rotation (false)
Returns:
rotated image (same size as input when crop=true)
Note:
rotations in increments of pi/2 are fast
Examples:
examples/image/image_demo.cpp.
array af::resize ( const array &  image,
float  scale,
af_resize_t  type = AF_RSZ_Nearest 
)

Resize an image uniformly.

Parameters:
[in]image
[in]typetype of image interpolation (default AF_RSZ_Nearest, see af_resize_t)
[in]scaleScaled image size (e.g. "1.1" scales image up 10%). Height and width scaled uniformly.
Returns:
resized image
Examples:
examples/image/gfor_hist_demo.cpp, and examples/image/image_demo.cpp.
array af::resize ( const array &  image,
float  height,
float  width,
af_resize_t  type = AF_RSZ_Nearest 
)

Resize an image.

Parameters:
[in]image
[in]typetype of image interpolation (default AF_RSZ_Nearest, see af_resize_t)
[in]heightoutput image height scale
[in]widthoutput image width scale
Returns:
resized image
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines