ClassesClassesClassesClasses | | | | Operators

bit_maskbit_maskBitMaskbit_maskBitMaskBitMask (Operator)


bit_maskbit_maskBitMaskbit_maskBitMaskBitMask — Logical “AND” of each pixel using a bit mask.


bit_mask(Image : ImageMask : BitMask : )

Herror bit_mask(const Hobject Image, Hobject* ImageMask, const Hlong BitMask)

Herror T_bit_mask(const Hobject Image, Hobject* ImageMask, const Htuple BitMask)

Herror bit_mask(Hobject Image, Hobject* ImageMask, const HTuple& BitMask)

HImage HImage::BitMask(const HTuple& BitMask) const

HImageArray HImageArray::BitMask(const HTuple& BitMask) const

void BitMask(const HObject& Image, HObject* ImageMask, const HTuple& BitMask)

HImage HImage::BitMask(Hlong BitMask) const

void HOperatorSetX.BitMask(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageMask, [in] VARIANT BitMask)

IHImageX* HImageX.BitMask([in] Hlong BitMask)

static void HOperatorSet.BitMask(HObject image, out HObject imageMask, HTuple bitMask)

HImage HImage.BitMask(int bitMask)


The operator bit_maskbit_maskBitMaskbit_maskBitMaskBitMask carries out an “and” operation of each pixel with a fixed mask. The semantics of the “and” operation corresponds to that of C for the respective types (signed char, unsigned char, unsigned short, short, int/long). Only the pixels within the definition range of the image are processed.

Several images can be processed in one call. An output image is generated for every input image.



ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Input image(s).

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

Result image(s) by combination with mask.

BitMaskBitMaskBitMaskBitMaskBitMaskbitMask (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Bit field

Default value: 128

List of values: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096

Suggested values: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096


If the images are correct (type) the operator bit_maskbit_maskBitMaskbit_maskBitMaskBitMask returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>) If necessary an exception is raised.

Possible Successors

thresholdthresholdThresholdthresholdThresholdThreshold, bit_orbit_orBitOrbit_orBitOrBitOr



See also

bit_andbit_andBitAndbit_andBitAndBitAnd, bit_lshiftbit_lshiftBitLshiftbit_lshiftBitLshiftBitLshift



ClassesClassesClassesClasses | | | | Operators