bit_xorbit_xorBitXorBitXorbit_xor (Operator)

Name

bit_xorbit_xorBitXorBitXorbit_xor — Bit-by-bit XOR of all pixels of the input images.

Signature

bit_xor(Image1, Image2 : ImageXor : : )

Herror bit_xor(const Hobject Image1, const Hobject Image2, Hobject* ImageXor)

Herror T_bit_xor(const Hobject Image1, const Hobject Image2, Hobject* ImageXor)

void BitXor(const HObject& Image1, const HObject& Image2, HObject* ImageXor)

HImage HImage::BitXor(const HImage& Image2) const

static void HOperatorSet.BitXor(HObject image1, HObject image2, out HObject imageXor)

HImage HImage.BitXor(HImage image2)

def bit_xor(image_1: HObject, image_2: HObject) -> HObject

Description

The operator bit_xorbit_xorBitXorBitXorbit_xor calculates the “xor” of all pixels of the input images bit by bit. The semantics of the “xor” operation corresponds to that of C for the respective types (signed char, unsigned char, short, unsigned short, int/long). The images must have the same size and pixel type. The pixels within the definition range of the image in the first parameter are processed.

Several images can be processed in one call. In this case both input parameters contain the same number of images which are then processed in pairs. An output image is generated for every pair.

Execution Information

Parameters

Image1Image1Image1image1image_1 (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Input image(s) 1.

Image2Image2Image2image2image_2 (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Input image(s) 2.

ImageXorImageXorImageXorimageXorimage_xor (output_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Result image(s) by XOR-operation.

Example (HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
bit_xor(Image1,Image2,ImageBitXor)
dev_display (ImageBitXor)

Example (C)

read_image(&Image0,"monkey");
disp_image(Image0,WindowHandle);
read_image(&Image1,"fabrik");
disp_image(Image1,WindowHandle);
bit_xor(Image0,Image1,&ImageBitX);
disp_image(ImageBitX,WindowHandle);

Example (HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
bit_xor(Image1,Image2,ImageBitXor)
dev_display (ImageBitXor)

Example (HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
bit_xor(Image1,Image2,ImageBitXor)
dev_display (ImageBitXor)

Result

If the parameter values are correct the operator bit_xorbit_xorBitXorBitXorbit_xor returns the value 2 ( H_MSG_TRUE) . The behavior in case of empty input (no input images available) can be determined by the operator set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) If necessary an exception is raised.

Alternatives

bit_orbit_orBitOrBitOrbit_or, bit_andbit_andBitAndBitAndbit_and, add_imageadd_imageAddImageAddImageadd_image

See also

bit_orbit_orBitOrBitOrbit_or, bit_andbit_andBitAndBitAndbit_and

Module

Foundation