Operator Library: Debugging
運算子 ImageInjector 允許您將影像植入至運算子的影像資料輸出中。 這些影像可以直接從檔案植入(檔案格式:*.tif)。 您可以通过 Framegrabber API 或透過 Framegrabber SDK 工具 microDisplay 發送植入指令。
運算子 ImageInjector 的運作方式類似於您在 VisualApplets 中模擬設計時所使用的 Simulation Sources — 只是運算子 ImageInjector 用於執行階段的測試。
支援兩種植入方式:插入與取代。
Insert modes:當其中一個插入模式啟用時,輸入連結將被封鎖。
Replacement modes:當其中一個取代模式啟用時, 該運算子 在影像植入期間會充當影像儲集區。 輸入連結不會被封鎖。
植入的影像資料透過寫入 WritePixel 與 WriteFlag 暫存器逐像素進行插入。 只有在參數 ReadyForInjection 切換為 "yes" 時,寫入暫存器才會啟用。(若要了解參數 ReadyForInjection 何時設為 "yes",請參閱參數 Mode 。)
在植入影像的每一行結尾(最後一行除外),必須將 EndOfLine 旗標寫入 WriteFlag 暫存器。 當到達最後一行的結尾時,必須將 EndOfFrame 旗標 寫入 WriteFlag 暫存器。
CurrXPos 與 CurrYPos 參數 指向目前作用中的像素位置。
![]() |
參數 EnableInsertModes 會將運算子的類型從 M 類型變更為 P 類型 |
|---|---|
|
運算子 ImageInjector 是一個 M 類型運算子。然而,如果您將 EnableInsertModes 設為 "no",VisualApplets 將會把該運算子當作 P 類型運算子處理。 |
![]() |
停用植入模式 |
|---|---|
|
切換回預設模式 FlowThrough(即停用所有類型的植入) 僅在 參數 ReadyForFlowThrough 設為 "yes" 時允許。 |
![]() |
執行階段測試 |
|---|---|
|
此 operator 旨在於執行階段測試和分析您的設計:您需要建置(合成)設計、將其載入目標硬體,並啟動實際的影像處理,然後才能使用該 operator 進行偵錯。 此 operator 並非用於 VisualApplets 內的設計模擬。 |
| Link Parameter | Input Link I | Output Link O |
|---|---|---|
| Bit Width | [1, 64] | as I |
| Arithmetic | {unsigned, signed} | as I |
| Parallelism | 1 | as I |
| Kernel Columns | 1 | 1 |
| Kernel Rows | 1 | 1 |
| Img Protocol | {VALT_IMAGE2D, VALT_LINE1D} | as I |
| Color Format | any | as I |
| Color Flavor | any | as I |
| Max. Img Width | any | as I |
| Max. Img Height | any | as I |
| 模式 | |
|---|---|
| Type | 動態寫入參數 |
| Default | FlowThrough |
| Range | {FlowThrough, InsertAfterEof, InsertAfterEol, ReplaceAfterEof, ReplaceAfterEol} |
|
此模式參數用於啟用和停用影像植入。 在影像植入期間,運算子會封鎖輸入連結(InsertAfterEof、InsertAfterEol) 或捨棄在植入期間進入的影像資料(ReplaceAfterEof、ReplaceAfterEol)。 Inject:在此模式下,運算子會立即封鎖輸入連結,並將參數 ReadyForInjection 設為 "yes"。 一旦 ReadyForInjection 設為 "yes",您就可以從檔案植入影像。 FlowThrough:影像植入已停用。 切換回預設模式 FlowThrough(即停用所有類型的植入)僅在參數 ReadyForFlowThrough 設為 "yes" 時允許。 InsertAfterEof:設定為此模式時,運算子會尋找畫面結尾 (EoF) 旗標。 一旦找到 EoF 旗標(即達到目前影像結尾時), 運算子會封鎖輸入連結並將參數 ReadyForInjection 設為 "yes"。一旦 ReadyForInjection 設為 "yes",您就可以從檔案植入影像。 此模式不適用於 LINE-1D 影像協定。 此模式僅在參數 EnableInsertModes 設為 "yes" 時可用, 這也暗示該運算子屬於 M 類型。 InsertAfterEol:設定為此模式時,運算子會尋找行結尾 (EoL) 旗標。 一旦找到 EoL 旗標(即達到目前行結尾時), 運算子會封鎖輸入連結並將參數 ReadyForInjection 設為 "yes"。一旦 ReadyForInjection 設為 "yes",您就可以從檔案植入影像。 此模式僅在參數 EnableInsertModes 設為 "yes" 時可用, 這也暗示該運算子屬於 M 類型。 當設定為兩個可用取代模式之一時,運算子在影像植入期間會充當影像儲集區。 ReplaceAfterEof:運算子會等待目前影像結束。 一旦找到 EoF 旗標,運算子就會將參數 ReadyForInjection 設為 "yes"。一旦 ReadyForInjection 設為 "yes",您就可以從檔案植入影像。 在植入期間,會捨棄傳入的影像資料。 不適用於 LINE-1D 影像協定。 ReplaceAfterEol:運算子會等待目前行結束。 一旦找到 EoL 旗標,運算子就會將參數 ReadyForInjection 設為 "yes"。一旦 ReadyForInjection 設為 "yes",您就可以從檔案植入影像。 在植入期間,會捨棄傳入的影像資料。 |
|
| EnableInsertModes | |
|---|---|
| Type | 靜態寫入參數 |
| Default | 否 |
| Range | {yes, no} |
|
如果設為 "yes",參數 Mode 可以設為插入模式 InsertAfterEof 或 InsertAfterEol。在此情況下, 該運算子屬於 M 類型。 如果設為 "no",參數 Mode 將不允許使用這兩個插入模式, 且該運算子屬於 P 類型。 |
|
| ReadyForInjection | |
|---|---|
| Type | 動態讀取參數 |
| Default | 否 |
| Range | {yes, no} |
|
當參數 Mode 處於插入或取代模式時, 表示已準備好寫入像素或旗標。 必須將其設為 "yes" 才能啟用參數 WritePixel 與 WriteFlag。 |
|
| ReadyForFlowThrough | |
|---|---|
| Type | 動態讀取參數 |
| Default | 否 |
| Range | {yes, no} |
|
指示是否準備好切回 FlowThrough 模式 (參數 Mode 的模式)。 當參數 WriteFlag
|
|
| CurrXPos | |
|---|---|
| Type | 動態讀取參數 |
| Default | 0 |
| Range | [0, MaxImageWidth-1] |
|
顯示目前的行位置。 |
|
| CurrYPos | |
|---|---|
| Type | 動態讀取參數 |
| Default | 0 |
| Range | [0, MaxImageHeight-1] |
|
顯示目前的影像高度位置。 |
|
| WritePixel | |
|---|---|
| Type | 動態寫入參數 |
| Default | 0 |
| Range | [0, 2^BitWidth-1] |
|
像素值。如果使用 24 bit Color Format, 則必須套用以下位元對應: Red = [0, 7], Green = [9,15], Blue = [16,23]。 |
|
| WriteFlag | ||||
|---|---|---|---|---|
| Type | 動態寫入參數 | |||
| Default | EndOfLine | |||
| Range | {EndOfLine, EndOfFrame} | |||
|
您需要在每個注入行的結尾寫入一個 EndOfLine 旗標, 但影像最後一行結尾除外。 您需要在注入影像的最後一行結尾寫入一個 EndOfFrame 旗標。 此參數也會影響參數 ReadyForFlowThrough: 當以下情況時,參數 ReadyForFlowThrough 會設為 "yes"
|
||||
| ImageFile | |
|---|---|
| Type | 動態寫入參數 |
| Default | image.tif |
| Range | |
|
要注入的影像檔案。影像尺寸必須小於或等於輸出鏈結屬性。 影像檔案的像素深度可以是每個元件 8 bit 或 16 bit。如果每個元件的影像像素深度 不等於鏈結屬性定義的 Bit Width,影像元件將會進行位移,使其 對齊 鏈結屬性所定義像素元件的最高有效位元 (MSB)。 若要在 microDisplay 中選取檔案,請手動設定檔案路徑,或以滑鼠右鍵按一下此參數以開啟檔案選取 功能表。 |
|
| InjectFromFile | |
|---|---|
| Type | 動態寫入參數 |
| Default | 否 |
| Range | {no, yes} |
|
當設定為 "yes" 時, 影像檔案將會注入輸出連結中。 在 FlowThrough 模式下停用(即當參數 Mode 設定為 FlowThrough 時)。 |
|
以下範例顯示了 ImageInjector 運算子的使用方式:
-
'使用 ImageInjector 載入 Test Images 的功能範例 '
範例 - 如何使用此運算子的示範
-
範例 - 基於偵錯目的,可以手動插入影像。

![[備註]](../common/images/admon/note.png)
![[重要]](../common/images/admon/important.png)
上一頁

