Operator IF

Operator Library: Logic

The IF operator checks if a condition input is true and forwards the corresponding values of the data input. The operator is equipped with a parameterizable number of input links I0..In-1. With each input link comes a conditional input Condition. If a condition is true, the data of its corresponding input is forwarded to the output. If all condition inputs are false, the Else input is used. If more than one condition input is true, all corresponding input links are forwarded to the output and combined using a logic OR operation. The operator can be used with kernels. Each kernel component is selected independently.

I/O Properties

Property Value
Operator Type O
Input Links I0, data input
I1..In-1, data input
Else, data input
Condition0..n-1, data input
Output Link O, data output

Supported Link Format

Link Parameter Input Link I0 Input Link I1..In-1 Input Link Else Input Link Condition0..n-1 Output Link O
Bit Width [1, 64]1 as I0 as I0 1 as I0
Arithmetic {unsigned, signed} as I0 as I0 unsigned as I0
Parallelism any as I0 as I0 as I0 as I0
Kernel Columns any as I0 as I0 as I0 as I0
Kernel Rows any as I0 as I0 as I0 as I0
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D, VALT_SIGNAL} as I0 as I0 as I0 as I0
Color Format any as I0 as I0 VAF_GRAY as I0
Color Flavor any as I0 as I0 FL_NONE as I0
Max. Img Width any as I0 as I0 as I0 as I0
Max. Img Height any as I0 as I0 as I0 as I0


The range of the input bit width is [1, 64] for unsigned values. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63].



Examples of Use

The use of operator IF is shown in the following examples: