Operator ImageInjector

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 SDK or via the GUI of the tool microDisplay.

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.

[Note] 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.

[Note] 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".

[Important] 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.

I/O Properties

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

Supported Link Format

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

Parameters

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

  • in IMAGE-2D mode an EndOfFrame is written, or
  • in LINE-1D mode an EndOfLine is written.

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

  • in IMAGE-2D mode an EndOfFrame is written, or
  • in LINE-1D mode an EndOfLine is written.

[Note] Use only one flag at a time

At the end of an image, only write an EndOfFrame flag to this parameter.

Do not write an EoL together with an EoF. EoF always includes EoL+EoF.

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.

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).

Examples of Use

The use of operator ImageInjector is shown in the following examples: