Skip to content

bit_maskBitMaskBitMaskbit_maskbit_maskπŸ”—

Short descriptionπŸ”—

bit_maskBitMaskBitMaskbit_maskbit_mask β€” Logical β€œAND” of each pixel using a bit mask.

SignatureπŸ”—

bit_mask( image Image, out image ImageMask, integer BitMask )void BitMask( const HObject& Image, HObject* ImageMask, const HTuple& BitMask )static void HOperatorSet.BitMask( HObject image, out HObject imageMask, HTuple bitMask )def bit_mask( image: HObject, bit_mask: int ) -> HObject

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

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

HImage HImage::BitMask( Hlong BitMask ) const

HImage HImage.BitMask( int bitMask )

DescriptionπŸ”—

The operator bit_maskBitMask 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.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

  • Automatically parallelized on domain level.

ParametersπŸ”—

Imageimageimage (input_object) (multichannel-)image(-array) β†’ object (byte / direction / cyclic / int1 / int2 / uint2 / int4)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Input image(s).

ImageMaskimageMaskimage_mask (output_object) (multichannel-)image(-array) β†’ object (byte / direction / cyclic / int1 / int2 / uint2 / int4)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4)Hobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4)

Result image(s) by combination with mask.

BitMaskbitMaskbit_mask (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Bit field

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

ResultπŸ”—

If the images are correct (type) the operator bit_maskBitMask 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>:) If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

thresholdThreshold, bit_orBitOr

Alternatives

bit_sliceBitSlice

See also

bit_andBitAnd, bit_lshiftBitLshift

ModuleπŸ”—

Foundation