Operator ShiftRight

Operator Library: Arithmetics

此運算子會將輸入資料向右進行算術移位。 移位位元數由參數Shift 定義。 輸入端的每個位元都會向右移位參數所指定的位元數。

位元移位通常用於將數值按二的冪次進行縮放。 例如,向右移位一位元會將輸入值除以 2。 向右移位 2 位元會將輸入值除以 4。

每個色彩成分都會分別進行偏移。

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 [1, 64] 無號數,[2, 64] 有號數 auto1
Arithmetic {unsigned, signed} 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 any as I
Color Flavor any as I
Max. Img Width any as I
Max. Img Height any as I

1

輸出的位元寬度等於輸入位元寬度減去參數Shift 的值。

Parameters

Shift
Type 靜態參數
Default 0
Range

[0, 輸入位寬 - 1](針對無符號數)

[0, 輸入位寬 - 2](有符號)

此參數定義輸入值向右移位多少位元。

Examples of Use

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