Operator Library: Debugging
The operator ImageInjector allows you to inject images into the image data output of the operator. The images can be injected directly from file (file format: *.tif). You can give the command for injecting via Framegrabber API or via the Framegrabber SDK tool microDisplay.
Availability | |
---|---|
To use the ImageInjector operator, you need either an Expert license, a Debugging Module license, or the VisualApplets 4 license. |
The operator ImageInjector works like the Simulation Sources you use when simulating a design in VisualApplets - only that the operator ImageInjector is used for testing during runtime.
Two ways of injection are supported: insertion and replacement.
Insert modes: When one of the insert modes is active, the input link is blocked.
Replacement modes: When one of the replacement modes is active, the operator acts as an image sink during image injection. The input link is not blocked.
The injected image data is inserted pixel-by-pixel via writing to the WritePixel and WriteFlag registers. The write registers are only enabled, if the parameter ReadyForInjection is switched to "yes". (To understand when the parameter ReadyForInjection is set to "yes", see parameter Mode .)
At the end of each line of the injected image (except the last line), an EndOfLine flag must be written to the WriteFlag register. When the end of the last line is reached, an EndOfFrame flag must be written to the WriteFlag register.
The CurrXPos and CurrYPos parameters point to the currently active pixel position.
The parameter EnableInsertModes changes the type of the operator from M-type to P-type | |
---|---|
The operator ImageInjector is an M-type operator. However, if you set EnableInsertModes to "no", the operator is handled like a P-Type operator by VisualApplets. |
Deactivating Injection Modes | |
---|---|
Switching back to default mode FlowThrough (i.e., deactivating all kinds of injection) is only allowed when the parameter ReadyForFlowThrough is set to "yes". |
Runtime Testing | |
---|---|
This operator is designed for testing and analyzing your design during runtime: You need to build (synthesize) the design, load it onto the target hardware, and start actual image processing, before you can use the operator for debugging. The operator is not intended for design simulation within VisualApplets. |
Property | Value |
---|---|
Operator Type | M |
Input Link | I, Image data input |
Output Link | O, Image data output |
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 |
Mode | |
---|---|
Type | dynamic write parameter |
Default | FlowThrough |
Range | {FlowThrough, InsertAfterEof, InsertAfterEol, ReplaceAfterEof, ReplaceAfterEol} |
This mode parameter enables and disables image injection. During image injection, the operator either blocks the input link (InsertAfterEof, InsertAfterEol) or discards the image data that come in during injection (ReplaceAfterEof, ReplaceAfterEol). Inject: In this mode, the operator immediately blocks the input link and sets the parameter ReadyForInjection to "yes". As soon as ReadyForInjection is set to "yes", you can inject an image from file. FlowThrough: Image injection is disabled. Switching back to default mode FlowThrough (i.e., deactivating all kinds of injection) is only allowed when the parameter ReadyForFlowThrough is set to "yes". InsertAfterEof: When set to this mode, the operator looks for an End-of-Frame (EoF) flag. As soon as it finds an EoF flag (i.e., when the end of the current image is reached), the operator blocks the input link and sets the parameter ReadyForInjection to "yes". As soon as ReadyForInjection is set to "yes", you can inject an image from file. This mode is not available with the LINE-1D image protocol. This mode is only available, if the parameter EnableInsertModes is set to "yes", which also implies that the operator is of type M. InsertAfterEol: When set to this mode, the operator looks for an End-of-Line (EoL) flag. As soon as it finds an EoL flag (i.e., when the end of the current line is reached), the operator blocks the input link and sets the parameter ReadyForInjection to "yes". As soon as ReadyForInjection is set to "yes", you can inject an image from file. This mode is only available, if the parameter EnableInsertModes is set to "yes", which also implies that the operator is of type M. When set to one of the two available relacement modes, the operator acts as an image sink during image injection. ReplaceAfterEof: The operator waits for the current image to end. As soon as it finds an EoF flag, the operator sets the parameter ReadyForInjection to "yes". As soon as ReadyForInjection is set to "yes", you can inject an image from file. During injection, incoming image data are discarded. Not available with the LINE-1D image protocol. ReplaceAfterEol: The operator waits for the current line to end. As soon as it finds an EoL flag, the operator sets the parameter ReadyForInjection to "yes". As soon as ReadyForInjection is set to "yes", you can inject an image from file. During injection, incoming image data are discarded. |
EnableInsertModes | |
---|---|
Type | static write parameter |
Default | no |
Range | {yes, no} |
If set to "yes", the parameter Mode can be set to the insert modes InsertAfterEof or InsertAfterEol. In this case, the operator is of type M. If set to "no", these two insert modes are not allowed for the parameter Mode and the operator is of type P. |
ReadyForInjection | |
---|---|
Type | dynamic read parameter |
Default | no |
Range | {yes, no} |
Indicates readiness to write a pixel or a flag when the parameter Mode is in insert or replace mode. It must be set to "yes" in order to enable the parameters WritePixel and WriteFlag. |
ReadyForFlowThrough | |
---|---|
Type | dynamic read parameter |
Default | no |
Range | {yes, no} |
Indicates readiness to switch back to FlowThrough mode (of the parameter Mode). The parameter is automatically set to "yes" when to parameter WriteFlag
|
CurrXPos | |
---|---|
Type | dynamic read parameter |
Default | 0 |
Range | [0, MaxImageWidth-1] |
Displays the current line position. |
CurrYPos | |
---|---|
Type | dynamic read parameter |
Default | 0 |
Range | [0, MaxImageHeight-1] |
Displays the current image height position. |
WritePixel | |
---|---|
Type | dynamic write parameter |
Default | 0 |
Range | [0, 2^BitWidth-1] |
Pixel value. If 24 bit color format is used, the following bit mapping must be applied: Red = [0, 7], Green = [9,15], Blue = [16,23]. |
WriteFlag | ||||
---|---|---|---|---|
Type | dynamic write parameter | |||
Default | EndOfLine | |||
Range | {EndOfLine, EndOfFrame} | |||
You need to write an EndOfLine flag at the end of each injected line, except at the end of the last line of an image. You need to write an EndOfFrame flag at the end of the last line of an injected image. This parameter also influences the parameter ReadyForFlowThrough: The parameter ReadyForFlowThrough is set to "yes", when
|
ImageFile | |
---|---|
Type | dynamic write parameter |
Default | image.tif |
Range | |
Image file to be injected. The image dimensions must be equal or smaller than the ouput link properties. The pixel depth of the image file can be 8 bit or 16 bit per component. If the image pixel depth per component is not equal to the bit width per component defined by the link property, the image components are shifted so that they are most significant bit (MSB)-aligned to the pixel components defined by the link property. For the file selection in microDisplay, set the file path manually or right-click this parameter to open a file selection menu. |
InjectFromFile | |
---|---|
Type | dynamic write parameter |
Default | no |
Range | {no, yes} |
When set to "yes", the image file is injected into the output link. Disabled in FlowThrough mode (i.e., when parameter Mode is set to FlowThrough). |
The use of operator ImageInjector is shown in the following examples:
-
'Functional Example for Loading Test Images Using ImageInjector '
Examples - Demonstration of how to use the operator
-
Example - For debugging purposes images can be inserted manually.