ClassesClassesClassesClasses | | | | Operators

bit_slicebit_sliceBitSlicebit_sliceBitSliceBitSlice (Operator)

Name

bit_slicebit_sliceBitSlicebit_sliceBitSliceBitSlice — Extract a bit from the pixels.

Signature

bit_slice(Image : ImageSlice : Bit : )

Herror bit_slice(const Hobject Image, Hobject* ImageSlice, const Hlong Bit)

Herror T_bit_slice(const Hobject Image, Hobject* ImageSlice, const Htuple Bit)

Herror bit_slice(Hobject Image, Hobject* ImageSlice, const HTuple& Bit)

HImage HImage::BitSlice(const HTuple& Bit) const

HImageArray HImageArray::BitSlice(const HTuple& Bit) const

void BitSlice(const HObject& Image, HObject* ImageSlice, const HTuple& Bit)

HImage HImage::BitSlice(Hlong Bit) const

void HOperatorSetX.BitSlice(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageSlice, [in] VARIANT Bit)

IHImageX* HImageX.BitSlice([in] Hlong Bit)

static void HOperatorSet.BitSlice(HObject image, out HObject imageSlice, HTuple bit)

HImage HImage.BitSlice(int bit)

Description

The operator bit_slicebit_sliceBitSlicebit_sliceBitSliceBitSlice extracts a bit level from the input image. The semantics of the “and” operation corresponds to that of C for the respective types (signed char, unsigned char, short, unsigned 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.

Parallelization

Parameters

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

Input image(s).

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

Result image(s) by extraction.

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

Bit to be selected.

Default value: 8

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 32

Typical range of values: 1 ≤ Bit Bit Bit Bit Bit bit ≤ 32

Minimum increment: 1

Recommended increment: 1

Restriction: Bit >= 1 && Bit <= 32

Example (HDevelop)

read_image(Image,'fabrik')
for I:= 1 to 8 by 1
    bit_slice (Image, ImageSlice, I)
    threshold (ImageSlice, Region, 1, 255)
    dev_display (Region)
endfor

Example (C)

read_image(&ByteImage,"fabrik");
for (bit=1; bit<=8; i++)
{
  bit_slice(ByteImage,&Slice,bit);
  threshold(Slice,&Region,1,255);
  disp_region(Region,WindowHandle);
  clear(bit_slice); clear(Slice); clear(Region);
}

Example (HDevelop)

read_image(Image,'fabrik')
for I:= 1 to 8 by 1
    bit_slice (Image, ImageSlice, I)
    threshold (ImageSlice, Region, 1, 255)
    dev_display (Region)
endfor

Example (HDevelop)

read_image(Image,'fabrik')
for I:= 1 to 8 by 1
    bit_slice (Image, ImageSlice, I)
    threshold (ImageSlice, Region, 1, 255)
    dev_display (Region)
endfor

Example (HDevelop)

read_image(Image,'fabrik')
for I:= 1 to 8 by 1
    bit_slice (Image, ImageSlice, I)
    threshold (ImageSlice, Region, 1, 255)
    dev_display (Region)
endfor

Example (HDevelop)

read_image(Image,'fabrik')
for I:= 1 to 8 by 1
    bit_slice (Image, ImageSlice, I)
    threshold (ImageSlice, Region, 1, 255)
    dev_display (Region)
endfor

Result

If the images are correct (type) and BitBitBitBitBitbit has a valid value, the operator bit_slicebit_sliceBitSlicebit_sliceBitSliceBitSlice 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

Alternatives

bit_maskbit_maskBitMaskbit_maskBitMaskBitMask

See also

bit_andbit_andBitAndbit_andBitAndBitAnd, bit_lshiftbit_lshiftBitLshiftbit_lshiftBitLshiftBitLshift

Module

Foundation


ClassesClassesClassesClasses | | | | Operators