# arrayfire.library module

Module containing enums and other constants.

class `arrayfire.library.``BACKEND`

  Bases: `arrayfire.library._Enum`

  Backend libraries

  `CPU` = <arrayfire.library.BACKEND object>
  `CUDA` = <arrayfire.library.BACKEND object>
  `DEFAULT` = <arrayfire.library.BACKEND object>
  `OPENCL` = <arrayfire.library.BACKEND object>

class `arrayfire.library.``COLORMAP`

  Bases: `arrayfire.library._Enum`

  Colormaps

  `BLUE` = <arrayfire.library.COLORMAP object>
  `COLORS` = <arrayfire.library.COLORMAP object>
  `DEFAULT` = <arrayfire.library.COLORMAP object>
  `HEAT` = <arrayfire.library.COLORMAP object>
  `MOOD` = <arrayfire.library.COLORMAP object>
  `RED` = <arrayfire.library.COLORMAP object>
  `SPECTRUM` = <arrayfire.library.COLORMAP object>

class `arrayfire.library.``CONNECTIVITY`

  Bases: `arrayfire.library._Enum`

  Neighborhood connectivity

  `EIGHT` = <arrayfire.library.CONNECTIVITY object>
  `FOUR` = <arrayfire.library.CONNECTIVITY object>

class `arrayfire.library.``CONV_DOMAIN`

  Bases: `arrayfire.library._Enum`

  Convolution domain

  `AUTO` = <arrayfire.library.CONV_DOMAIN object>
  `FREQ` = <arrayfire.library.CONV_DOMAIN object>
  `SPATIAL` = <arrayfire.library.CONV_DOMAIN object>

class `arrayfire.library.``CONV_MODE`

  Bases: `arrayfire.library._Enum`

  Convolution mode

  `DEFAULT` = <arrayfire.library.CONV_MODE object>
  `EXPAND` = <arrayfire.library.CONV_MODE object>

class `arrayfire.library.``CSPACE`

  Bases: `arrayfire.library._Enum`

  Colorspace formats

  `GRAY` = <arrayfire.library.CSPACE object>
  `HSV` = <arrayfire.library.CSPACE object>
  `RGB` = <arrayfire.library.CSPACE object>
  `YCbCr` = <arrayfire.library.CSPACE object>

class `arrayfire.library.``Dtype`

  Bases: `arrayfire.library._Enum`

  Error values. For internal use only.

  `b8` = <arrayfire.library.Dtype object>
  `c32` = <arrayfire.library.Dtype object>
  `c64` = <arrayfire.library.Dtype object>
  `f32` = <arrayfire.library.Dtype object>
  `f64` = <arrayfire.library.Dtype object>
  `s16` = <arrayfire.library.Dtype object>
  `s32` = <arrayfire.library.Dtype object>
  `s64` = <arrayfire.library.Dtype object>
  `u16` = <arrayfire.library.Dtype object>
  `u32` = <arrayfire.library.Dtype object>
  `u64` = <arrayfire.library.Dtype object>
  `u8` = <arrayfire.library.Dtype object>

class `arrayfire.library.``ERR`

  Bases: `arrayfire.library._Enum`

  Error values. For internal use only.

  `ARG` = <arrayfire.library.ERR object>
  `ARR_BKND_MISMATCH` = <arrayfire.library.ERR object>
  `BATCH` = <arrayfire.library.ERR object>
  `DEVICE` = <arrayfire.library.ERR object>
  `DIFF_TYPE` = <arrayfire.library.ERR object>
  `DRIVER` = <arrayfire.library.ERR object>
  `INTERNAL` = <arrayfire.library.ERR object>
  `INVALID_ARRAY` = <arrayfire.library.ERR object>
  `LOAD_LIB` = <arrayfire.library.ERR object>
  `LOAD_SYM` = <arrayfire.library.ERR object>
  `NONE` = <arrayfire.library.ERR object>
  `NONFREE` = <arrayfire.library.ERR object>
  `NOT_CONFIGURED` = <arrayfire.library.ERR object>
  `NOT_SUPPORTED` = <arrayfire.library.ERR object>
  `NO_DBL` = <arrayfire.library.ERR object>
  `NO_GFX` = <arrayfire.library.ERR object>
  `NO_MEM` = <arrayfire.library.ERR object>
  `RUNTIME` = <arrayfire.library.ERR object>
  `SIZE` = <arrayfire.library.ERR object>
  `TYPE` = <arrayfire.library.ERR object>
  `UNKNOWN` = <arrayfire.library.ERR object>

class `arrayfire.library.``HOMOGRAPHY`

  Bases: `arrayfire.library._Enum`

  Homography Types

  `LMEDS` = <arrayfire.library.HOMOGRAPHY object>
  `RANSAC` = <arrayfire.library.HOMOGRAPHY object>

class `arrayfire.library.``IMAGE_FORMAT`

  Bases: `arrayfire.library._Enum`

  Image Formats

  `BMP` = <arrayfire.library.IMAGE_FORMAT object>
  `EXR` = <arrayfire.library.IMAGE_FORMAT object>
  `HDR` = <arrayfire.library.IMAGE_FORMAT object>
  `ICO` = <arrayfire.library.IMAGE_FORMAT object>
  `JNG` = <arrayfire.library.IMAGE_FORMAT object>
  `JP2` = <arrayfire.library.IMAGE_FORMAT object>
  `JPEG` = <arrayfire.library.IMAGE_FORMAT object>
  `PNG` = <arrayfire.library.IMAGE_FORMAT object>
  `PPM` = <arrayfire.library.IMAGE_FORMAT object>
  `PPMRAW` = <arrayfire.library.IMAGE_FORMAT object>
  `PSD` = <arrayfire.library.IMAGE_FORMAT object>
  `RAW` = <arrayfire.library.IMAGE_FORMAT object>
  `TIFF` = <arrayfire.library.IMAGE_FORMAT object>

class `arrayfire.library.``INTERP`

  Bases: `arrayfire.library._Enum`

  Interpolation method

  `BILINEAR` = <arrayfire.library.INTERP object>
  `CUBIC` = <arrayfire.library.INTERP object>
  `LINEAR` = <arrayfire.library.INTERP object>
  `LOWER` = <arrayfire.library.INTERP object>
  `NEAREST` = <arrayfire.library.INTERP object>

class `arrayfire.library.``MARKER`

  Bases: `arrayfire.library._Enum`

  Markers used for different points in graphics plots

  `CIRCLE` = <arrayfire.library.MARKER object>
  `CROSS` = <arrayfire.library.MARKER object>
  `NONE` = <arrayfire.library.MARKER object>
  `PLUS` = <arrayfire.library.MARKER object>
  `POINT` = <arrayfire.library.MARKER object>
  `SQUARE` = <arrayfire.library.MARKER object>
  `STAR` = <arrayfire.library.MARKER object>
  `TRIANGE` = <arrayfire.library.MARKER object>

class `arrayfire.library.``MATCH`

  Bases: `arrayfire.library._Enum`

  Match type

  `LSAD` = <arrayfire.library.MATCH object>

    Sum of squared differences

  `LSSD` = <arrayfire.library.MATCH object>

    Normalized cross correlation

  `NCC` = <arrayfire.library.MATCH object>

    Zero mean NCC

  `SAD` = <arrayfire.library.MATCH object>

    Zero mean SAD

  `SHD` = <arrayfire.library.MATCH object>
  `SSD` = <arrayfire.library.MATCH object>

    Zero mean SSD

  `ZNCC` = <arrayfire.library.MATCH object>

    Sum of hamming distances

  `ZSAD` = <arrayfire.library.MATCH object>

    Locally scaled SAD

  `ZSSD` = <arrayfire.library.MATCH object>

    Locally scaled SSD

class `arrayfire.library.``MATPROP`

  Bases: `arrayfire.library._Enum`

  Matrix properties

  `BLOCK_DIAG` = <arrayfire.library.MATPROP object>
  `CTRANS` = <arrayfire.library.MATPROP object>

    Upper triangular matrix.

  `DIAG_UNIT` = <arrayfire.library.MATPROP object>

    Symmetric matrix.

  `LOWER` = <arrayfire.library.MATPROP object>

    Treat diagonal as units.

  `NONE` = <arrayfire.library.MATPROP object>

    Transposed.

  `ORTHOG` = <arrayfire.library.MATPROP object>

    Tri diagonal matrix.

  `POSDEF` = <arrayfire.library.MATPROP object>

    Orthogonal matrix.

  `SYM` = <arrayfire.library.MATPROP object>

    Positive definite matrix.

  `TRANS` = <arrayfire.library.MATPROP object>

    Conjugate transposed.

  `TRI_DIAG` = <arrayfire.library.MATPROP object>

    Block diagonal matrix.

  `UPPER` = <arrayfire.library.MATPROP object>

    Lower triangular matrix.

class `arrayfire.library.``NORM`

  Bases: `arrayfire.library._Enum`

  Norm types

  `EUCLID` = <arrayfire.library.NORM object>
  `MATRIX_1` = <arrayfire.library.NORM object>
  `MATRIX_2` = <arrayfire.library.NORM object>
  `MATRIX_INF` = <arrayfire.library.NORM object>
  `MATRIX_L_PQ` = <arrayfire.library.NORM object>
  `VECTOR_1` = <arrayfire.library.NORM object>
  `VECTOR_2` = <arrayfire.library.NORM object>
  `VECTOR_INF` = <arrayfire.library.NORM object>
  `VECTOR_P` = <arrayfire.library.NORM object>

class `arrayfire.library.``PAD`

  Bases: `arrayfire.library._Enum`

  Edge padding types

  `SYM` = <arrayfire.library.PAD object>
  `ZERO` = <arrayfire.library.PAD object>

class `arrayfire.library.``Source`

  Bases: `arrayfire.library._Enum`

  Source of the pointer

  `device` = <arrayfire.library.Source object>
  `host` = <arrayfire.library.Source object>

class `arrayfire.library.``YCC_STD`

  Bases: `arrayfire.library._Enum`

  YCC Standard formats

  `BT_2020` = <arrayfire.library.YCC_STD object>
  `BT_601` = <arrayfire.library.YCC_STD object>
  `BT_709` = <arrayfire.library.YCC_STD object>

`arrayfire.library.``get_active_backend`()

  Get the current active backend

  name
  : str.
    Backend name

`arrayfire.library.``get_available_backends`()

  Get names of available backends

  Returns:

  names : tuple of strings

  > Names of available backends

`arrayfire.library.``get_backend`()

  Return the name of the backend

`arrayfire.library.``get_backend_count`()

  Get number of available backends

  Returns:

  count : int

  > Number of available backends

`arrayfire.library.``get_backend_id`(A)

  Get backend name of an array

  Parameters: | A : af.Array

  Returns:

  name : str.

  > Backend name

`arrayfire.library.``get_device_id`(A)

  Get the device id of the array

  Parameters: | A : af.Array

  Returns:

  dev : Integer

  > id of the device array was created on

`arrayfire.library.``set_backend`(name, unsafe=False)

  Set a specific backend by name

  Parameters:

  name : str.

  unsafe : optional: bool. Default: False.

  > If False, does not switch backend if current backend is not unified backend.