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

Namespaces | Macros | Typedefs | Enumerations
defines.h File Reference
`#include <stdbool.h>`
`#include <stdlib.h>`
`#include <af/version.h>`

Go to the source code of this file.

## Namespaces
| af

## Macros
#define | AFAPI __attribute__((visibility("default")))
#define | SIZE_T_FRMT_SPECIFIER "%zu"
#define | DEPRECATED(msg) __attribute__((deprecated))
#define | AF_MAX_DIMS 4

## Typedefs
typedef long long | dim_t
typedef long long | intl
typedef unsigned long long | uintl
typedef void * | af_array
typedef af_dtype | dtype
typedef af_source | source
typedef af_interp_type | interpType
typedef af_border_type | borderType
typedef af_connectivity | connectivity
typedef af_match_type | matchType
typedef af_cspace_t | CSpace
typedef af_someenum_t | SomeEnum
typedef af_mat_prop | trans
typedef af_conv_mode | convMode
typedef af_conv_domain | convDomain
typedef af_mat_prop | matProp
typedef af_colormap | ColorMap
typedef af_norm_type | normType
typedef af_ycc_std | YCCStd
typedef af_image_format | imageFormat

## Enumerations
enum | af_err { AF_SUCCESS = 0, AF_ERR_NO_MEM = 101, AF_ERR_DRIVER = 102, AF_ERR_RUNTIME = 103, AF_ERR_INVALID_ARRAY = 201, AF_ERR_ARG = 202, AF_ERR_SIZE = 203, AF_ERR_TYPE = 204, AF_ERR_DIFF_TYPE = 205, AF_ERR_BATCH = 207, AF_ERR_NOT_SUPPORTED = 301, AF_ERR_NOT_CONFIGURED = 302, AFF_ERR_NONFREE = 303, AF_ERR_NO_DBL = 401, AF_ERR_NO_GFX = 402, AF_ERR_INTERNAL = 998, AF_ERR_UNKNOWN = 999 }
enum | af_dtype { f32, c32, f64, c64, b8, s32, u32, u8, s64, u64 }
enum | af_source { afDevice, afHost }
enum | af_interp_type { AF_INTERP_NEAREST, AF_INTERP_LINEAR, AF_INTERP_BILINEAR, AF_INTERP_CUBIC, AF_INTERP_LOWER }
enum | af_border_type { AF_PAD_ZERO = 0, AF_PAD_SYM }
enum | af_connectivity { AF_CONNECTIVITY_4 = 4, AF_CONNECTIVITY_8 = 8 }
enum | af_conv_mode { AF_CONV_DEFAULT, AF_CONV_EXPAND }
enum | af_conv_domain { AF_CONV_AUTO, AF_CONV_SPATIAL, AF_CONV_FREQ }
enum | af_match_type { AF_SAD = 0, AF_ZSAD, AF_LSAD, AF_SSD, AF_ZSSD, AF_LSSD, AF_NCC, AF_ZNCC, AF_SHD }
enum | af_ycc_std { AF_YCC_601 = 601, AF_YCC_709 = 709, AF_YCC_2020 = 2020 }
enum | af_cspace_t { AF_GRAY = 0, AF_RGB, AF_HSV, AF_YCbCr }
enum | af_mat_prop { AF_MAT_NONE = 0, AF_MAT_TRANS = 1, AF_MAT_CTRANS = 2, AF_MAT_CONJ = 4, AF_MAT_UPPER = 32, AF_MAT_LOWER = 64, AF_MAT_DIAG_UNIT = 128, AF_MAT_SYM = 512, AF_MAT_POSDEF = 1024, AF_MAT_ORTHOG = 2048, AF_MAT_TRI_DIAG = 4096, AF_MAT_BLOCK_DIAG = 8192 }
enum | af_norm_type { AF_NORM_VECTOR_1, AF_NORM_VECTOR_INF, AF_NORM_VECTOR_2, AF_NORM_VECTOR_P, AF_NORM_MATRIX_1, AF_NORM_MATRIX_INF, AF_NORM_MATRIX_2, AF_NORM_MATRIX_L_PQ, AF_NORM_EUCLID = AF_NORM_VECTOR_2 }
enum | af_colormap { AF_COLORMAP_DEFAULT = 0, AF_COLORMAP_SPECTRUM = 1, AF_COLORMAP_COLORS = 2, AF_COLORMAP_RED = 3, AF_COLORMAP_MOOD = 4, AF_COLORMAP_HEAT = 5, AF_COLORMAP_BLUE = 6 }
enum | af_image_format { AF_FIF_BMP = 0, AF_FIF_ICO = 1, AF_FIF_JPEG = 2, AF_FIF_JNG = 3, AF_FIF_PNG = 13, AF_FIF_PPM = 14, AF_FIF_PPMRAW = 15, AF_FIF_TIFF = 18, AF_FIF_PSD = 20, AF_FIF_HDR = 26, AF_FIF_EXR = 29, AF_FIF_JP2 = 31, AF_FIF_RAW = 34 }
enum | af_someenum_t { AF_ID = 0 }

## Macro Definition Documentation

#define AF_MAX_DIMS 4

#define AFAPI __attribute__((visibility("default")))

#define DEPRECATED | ( |  | msg | ) | __attribute__((deprecated))

#define SIZE_T_FRMT_SPECIFIER "%zu"

## Typedef Documentation

typedef void* af_array

typedef long long dim_t

typedef long long intl

typedef unsigned long long uintl

## Enumeration Type Documentation

enum af_border_type

Enumerator
AF_PAD_ZERO | Out of bound values are 0.
AF_PAD_SYM | Out of bound values are symmetric over the edge.

enum af_colormap

Enumerator
AF_COLORMAP_DEFAULT | Default grayscale map.
AF_COLORMAP_SPECTRUM | Spectrum map.
AF_COLORMAP_COLORS | Colors.
AF_COLORMAP_RED | Red hue map.
AF_COLORMAP_MOOD | Mood map.
AF_COLORMAP_HEAT | Heat map.
AF_COLORMAP_BLUE | Blue hue map.

enum af_connectivity

Enumerator
AF_CONNECTIVITY_4 | Connectivity includes neighbors, North, East, South and West of current pixel.
AF_CONNECTIVITY_8 | Connectivity includes 4-connectivity neigbors and also those on Northeast, Northwest, Southeast and Southwest.

enum af_conv_domain

Enumerator
AF_CONV_AUTO | ArrayFire automatically picks the right convolution algorithm.
AF_CONV_SPATIAL | Perform convolution in spatial domain.
AF_CONV_FREQ | Perform convolution in frequency domain.

enum af_conv_mode

Enumerator
AF_CONV_DEFAULT | Output of the convolution is the same size as input.
AF_CONV_EXPAND | Output of the convolution is signal_len + filter_len - 1.

enum af_cspace_t

Enumerator
AF_GRAY | Grayscale.
AF_RGB | 3-channel RGB
AF_HSV | 3-channel HSV
AF_YCbCr | 3-channel YCbCr

enum af_dtype

Enumerator
f32 | 32-bit floating point values
c32 | 32-bit complex floating point values
f64 | 64-bit complex floating point values
c64 | 64-bit complex floating point values
b8 | 8-bit boolean values
s32 | 32-bit signed integral values
u32 | 32-bit unsigned integral values
u8 | 8-bit unsigned integral values
s64 | 64-bit signed integral values
u64 | 64-bit unsigned integral values

Examples:
  convolve.cpp, fft.cpp, and histogram.cpp.

enum af_err

Enumerator
AF_SUCCESS | The function returned successfully.
AF_ERR_NO_MEM | The system or device ran out of memory.
AF_ERR_DRIVER | There was an error in the device driver.
AF_ERR_RUNTIME | There was an error with the runtime environment.
AF_ERR_INVALID_ARRAY | The input array is not a valid af_array object.
AF_ERR_ARG | One of the function arguments is incorrect.
AF_ERR_SIZE | The size is incorrect.
AF_ERR_TYPE | The type is not suppported by this function.
AF_ERR_DIFF_TYPE | The type of the input arrays are not compatible.
AF_ERR_BATCH | Function does not support GFOR / batch mode.
AF_ERR_NOT_SUPPORTED | The option is not supported.
AF_ERR_NOT_CONFIGURED | This build of ArrayFire does not support this feature.
AFF_ERR_NONFREE | This build of ArrayFire is not compiled with "nonfree" algorithms.
AF_ERR_NO_DBL | This device does not support double.
AF_ERR_NO_GFX | This build of ArrayFire was not built with graphics or this device does not support graphics.
AF_ERR_INTERNAL | There was an internal error either in ArrayFire or in a project upstream.
AF_ERR_UNKNOWN | Unknown Error.

enum af_image_format

Enumerator
AF_FIF_BMP | FreeImage Enum for Bitmap File.
AF_FIF_ICO | FreeImage Enum for Windows Icon File.
AF_FIF_JPEG | FreeImage Enum for JPEG File.
AF_FIF_JNG | FreeImage Enum for JPEG Network Graphics File.
AF_FIF_PNG | FreeImage Enum for Portable Network Graphics File.
AF_FIF_PPM | FreeImage Enum for Portable Pixelmap (ASCII) File.
AF_FIF_PPMRAW | FreeImage Enum for Portable Pixelmap (Binary) File.
AF_FIF_TIFF | FreeImage Enum for Tagged Image File Format File.
AF_FIF_PSD | FreeImage Enum for Adobe Photoshop File.
AF_FIF_HDR | FreeImage Enum for High Dynamic Range File.
AF_FIF_EXR | FreeImage Enum for ILM OpenEXR File.
AF_FIF_JP2 | FreeImage Enum for JPEG-2000 File.
AF_FIF_RAW | FreeImage Enum for RAW Camera Image File.

enum af_interp_type

Enumerator
AF_INTERP_NEAREST | Nearest Interpolation.
AF_INTERP_LINEAR | Linear Interpolation.
AF_INTERP_BILINEAR | Bilinear Interpolation.
AF_INTERP_CUBIC | Cubic Interpolation.
AF_INTERP_LOWER | Floor Indexed.

enum af_mat_prop

Enumerator
AF_MAT_NONE | Default.
AF_MAT_TRANS | Data needs to be transposed.
AF_MAT_CTRANS | Data needs to be conjugate tansposed.
AF_MAT_CONJ | Data needs to be conjugate.
AF_MAT_UPPER | Matrix is upper triangular.
AF_MAT_LOWER | Matrix is lower triangular.
AF_MAT_DIAG_UNIT | Matrix diagonal contains unitary values.
AF_MAT_SYM | Matrix is symmetric.
AF_MAT_POSDEF | Matrix is positive definite.
AF_MAT_ORTHOG | Matrix is orthogonal.
AF_MAT_TRI_DIAG | Matrix is tri diagonal.
AF_MAT_BLOCK_DIAG | Matrix is block diagonal.

enum af_match_type

Enumerator
AF_SAD | Match based on Sum of Absolute Differences (SAD)
AF_ZSAD | Match based on Zero mean SAD.
AF_LSAD | Match based on Locally scaled SAD.
AF_SSD | Match based on Sum of Squared Differences (SSD)
AF_ZSSD | Match based on Zero mean SSD.
AF_LSSD | Match based on Locally scaled SSD.
AF_NCC | Match based on Normalized Cross Correlation (NCC)
AF_ZNCC | Match based on Zero mean NCC.
AF_SHD | Match based on Sum of Hamming Distances (SHD)

enum af_norm_type

Enumerator
AF_NORM_VECTOR_1 | treats the input as a vector and returns the sum of absolute values
AF_NORM_VECTOR_INF | treats the input as a vector and returns the max of absolute values
AF_NORM_VECTOR_2 | treats the input as a vector and returns euclidean norm
AF_NORM_VECTOR_P | treats the input as a vector and returns the p-norm
AF_NORM_MATRIX_1 | return the max of column sums
AF_NORM_MATRIX_INF | return the max of row sums
AF_NORM_MATRIX_2 | returns the max singular value). Currently NOT SUPPORTED
AF_NORM_MATRIX_L_PQ | returns Lpq-norm
AF_NORM_EUCLID | The default. Same as AF_NORM_VECTOR_2.

enum af_someenum_t

Enumerator
AF_ID |

enum af_source

Enumerator
afDevice | Device pointer.
afHost | Host pointer.

enum af_ycc_std

Enumerator
AF_YCC_601 | ITU-R BT.601 (formerly CCIR 601) standard.
AF_YCC_709 | ITU-R BT.709 standard.
AF_YCC_2020 | ITU-R BT.2020 standard.