bit_rshiftbit_rshiftBitRshiftBitRshiftbit_rshift位右移(算子)

名称

bit_rshiftbit_rshiftBitRshiftBitRshiftbit_rshift — 图像所有像素的右移。

签名

bit_rshift(Image : ImageRShift : Shift : )

Herror bit_rshift(const Hobject Image, Hobject* ImageRShift, const Hlong Shift)

Herror T_bit_rshift(const Hobject Image, Hobject* ImageRShift, const Htuple Shift)

void BitRshift(const HObject& Image, HObject* ImageRShift, const HTuple& Shift)

HImage HImage::BitRshift(Hlong Shift) const

static void HOperatorSet.BitRshift(HObject image, out HObject imageRShift, HTuple shift)

HImage HImage.BitRshift(int shift)

def bit_rshift(image: HObject, shift: int) -> HObject

描述

算子 bit_rshiftbit_rshiftBitRshiftBitRshiftBitRshiftbit_rshift 对输入图像的所有像素进行逐位“右移”运算。该“右移”运算符的语义对应于 C 语言中相应类型(有符号字符、无符号字符、短整型、无符号短整型、整型/长整型)的“>>”运算符。仅处理图像定义范围内的像素。

单次调用可处理多张图像。每张输入图像将生成一张输出图像。

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4)

输入图像。

ImageRShiftImageRShiftImageRShiftImageRShiftimageRShiftimage_rshift (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4)

通过移位操作获得的结果图像。

ShiftShiftShiftShiftshiftshift (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

位移值。

默认值: 3

建议值: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 31

最小增量: 1

建议增量: 1

示例(C)

bit_rshift(Int2Image,&ReducedInt2Image,8);
convert_image_type(ReducedInt2Image,&ByteImage,"byte");

结果

如果图像类型正确且 ShiftShiftShiftShiftshiftshift 具有有效值,则算子 bit_rshiftbit_rshiftBitRshiftBitRshiftBitRshiftbit_rshift 返回值 2 ( H_MSG_TRUE )。当输入为空(无可用输入图像)时,可设置行为通过算子 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

替代

scale_imagescale_imageScaleImageScaleImageScaleImagescale_image

另见

bit_lshiftbit_lshiftBitLshiftBitLshiftBitLshiftbit_lshift

模块

基础