Extract a bit from the pixels.
The operator bit_slice 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, 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.
Image (input_object) |
image(-array) -> object : byte / int1 / int2 / int4 |
Input image |
ImageSlice (output_object) |
image(-array) -> object : byte / int1 / int2 / int4 |
Result of extraction |
Bit (input_control) |
integer -> integer |
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 | |
Range of values: 1 <= Bit <= 32 | |
Minimum increment: 1 | |
Recommended increment: 1 | |
Restriction: (Bit >= 1) && (Bit <= 32) |
read_image(&ByteImage,"fabrik"); for (bit=1; bit<=8; i++) { bit_slice(ByteImage,&Slice,bit); threshold__(Slice,&Region,0,255); disp_region(Region); clear(bit_slice); clear(Slice); clear(Region); }
If the images are correct (type) and Bit has a valid value, the operator bit_slice returns the value 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.