ShiftLeft 運算子

Operator Library: Arithmetics

此運算子會將輸入資料向左進行算術位移。 位移的位元數由參數Shift 定義。 輸入端的每個位元皆會依照參數指定的位元數向左位移。新插入的最低有效位元將 取值為零。

位元移位通常用於將數值按二的冪次進行縮放。 例如,向左移位一位元會將數值加倍。 向左移位兩位元則會將輸入數值增加至四倍。

每個色彩分量都會單獨進行移位。

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, 64 - 輸入位元寬度]

此參數定義輸入值向左移位位元的數目。

Examples of Use

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