DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# Arith_ComplexSeparated

arithmetic function

## SYNOPSIS

dip_Error dip_Arith ( in1_real, in2_imag, in2_real, in2_imag, out_real, out_imag, op, dt )

## DATA TYPES

binary, integer, float

## FUNCTION

This function computes `out` = `in1` `op` `in2` on a pixel by pixel basis. The data types of the `in1` and `in2` image may be of different types. The two input images and the output images have the complex portion of the data as a separate image, that is, `in1` = `in1_real` + i`in1_imag`. `in1_imag` and `in2_imag` may be `0`. `dt` may be any of DIPlib's data types, or the constants `DIP_DT_MINIMUM` or `DIP_DT_FLEX`, and determines what the output data type will be. `DIP_DT_MINIMUM` selects a data type according to the default for dyadic operations, see Information about dyadic operations for more information. `DIP_DT_FLEX` will choose a floating point (real or complex) type, the precision depends on the input types.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in1_real` | First input, real part
`dip_Image` | `in1_imag` | First input, imaginary part (or `NULL`)
`dip_Image` | `in2_real` | Second input, real part
`dip_Image` | `in2_imag` | Second input, imaginary part (or `NULL`)
`dip_Image` | `out_real` | Output, real part
`dip_Image` | `out_imag` | Output, imaginary part
`dipf_ArithOperation` | `op` | Dyadic arithmetic operation
`dip_DataType` | `dt` | Data type for output

The `dipf_ArithOperation` flag can be one of:

Name | Description
`DIP_ARITHOP_ADD` | Addition (`in1+in2`)
`DIP_ARITHOP_SUB` | Subtraction (`in1-in2`)
`DIP_ARITHOP_MUL` | Multiplication (`in1*in2`)
`DIP_ARITHOP_DIV` | Division (`in1/in2`)
`DIP_ARITHOP_MUL_CONJUGATE` | Conjugate multiplication (`in1*conj(in2)`)

## SEE ALSO

`Arith`, `Add`, `Sub`, `Mul`, `MulConjugate`, `Div`, `AddInteger`, `AddFloat`, `AddComplex`, `SubInteger`, `SubFloat`, `SubComplex`, `MulInteger`, `MulFloat`, `MulComplex`, `MulConjugateComplex`, `DivInteger`, `DivFloat`, `DivComplex`