Xor Method

NI Vision for Visual Basic

Xor Method

Syntax

CWIMAQVision.Xor SourceImage, Operand, DestImage [, Not = False]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Performs an XOR or XNOR operation on two images or an image and a constant.

Remarks

Use this method with U8, I16, RGB32, and HSL32 images. All input images must be the same image type.

This method is optimized for MMX.

Parameters

SourceImage As CWIMAQImage

The first input image.

Operand As Variant

The second input image or a constant.

DestImage As CWIMAQImage

The resulting image. It can be one of the source images.

Not As Variant

[Optional] Set this parameter to True to perform an XNOR instead of an XOR.

This parameter has a default value of False.

Example

Dim i As New CWIMAQImage

' Xor operation between a constant and an image in Viewer1.
' Store the result in i
CWIMAQVision1.Xor CWIMAQViewer1.Image, 1, i

' Xor image i with the image in Viewer1.
' Do the operation in-place (store the result in i)
CWIMAQVision1.Xor CWIMAQViewer1.Image, i, i

' NOR image i with the image in Viewer1.
' Store the result in Viewer1
CWIMAQVision1.Xor CWIMAQViewer1.Image, i, CWIMAQViewer1.Image, True