Operator ABS

Operator Library: Arithmetics

此運算子會計算輸入值的絕對值,也就是

請注意,最小負值的絕對值所需的位元數,與其正值 相當的絕對值所需的位元數相同。 因此,輸出位元寬度等於輸入位元寬度。 例如,在 8 位元表示法中,最小值為 -128,而最大值為 127。 經過絕對值運算後,-128 變成 +128,這仍然需要 8 位元。

I/O Properties

Property Value
Operator Type O
Input Link I,資料輸入
Output Link O,資料輸出

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width [2, 64] as I
Arithmetic 有號 as I
Parallelism any as I
Kernel Columns any as I
Kernel Rows any as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format VAF_GRAY、VAF_COLOR as I
Color Flavor FL_NONE as I
Max. Img Width any as I
Max. Img Height any as I

Parameters

無

Examples of Use

以下範例展示了 ABS 運算子的用法: