Operator SelectBitField

Operator Library: Base

透過 SelectBitField 模組,您可以從輸入連結中選取後續的位元欄位。 使用輸出連結定義所需的 Bit Width。 此外,您可以使用 BitOffset 參數定義位元偏移量。 如果輸入 arithmetic 是有號數(signed),數值將會被重新解讀並一律以無號數(unsigned)輸出。

每個色彩分量皆會被分開切割。

請參閱下圖以了解說明。 在此範例中,輸出傳輸的是從 6 bit 輸入值中切割出、偏移量為 2 的 3 bit。 例如,輸入值 20 將會變成 5。

I/O Properties

Property Value
Operator Type O
Input Link I, data input
Output Link O, data output

支援的 Link 格式

Link Parameter Input Link I Output Link O
Bit Width [1, 64] 無符號,[2, 64] 有符號 [1, 64]1
Arithmetic {unsigned, signed} unsigned
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

輸出 Bit Width 必須在

參數

BitOffset
Type static parameter
Default 0
Range [0, InputBitWidth - OutputBitWidth] (如果是灰階) [0, (InputBitWidth - OutputBitWidth) / 3] (如果是彩色)

此參數定義要使用的第一個位元的位元偏移量。此第一個位元會對應至輸出連結上的位元位置 0。 針對 Color Format,偏移量是按個別分量來處理的。

使用範例

以下範例展示了 SelectBitField operator 的使用方式: