bit_lshiftbit_lshiftBitLshiftBitLshiftbit_lshift位左移(算子)

名称

bit_lshiftbit_lshiftBitLshiftBitLshiftbit_lshift — 图像所有像素的左移。

签名

bit_lshift(Image : ImageLShift : Shift : )

Herror bit_lshift(const Hobject Image, Hobject* ImageLShift, const Hlong Shift)

Herror T_bit_lshift(const Hobject Image, Hobject* ImageLShift, const Htuple Shift)

void BitLshift(const HObject& Image, HObject* ImageLShift, const HTuple& Shift)

HImage HImage::BitLshift(Hlong Shift) const

static void HOperatorSet.BitLshift(HObject image, out HObject imageLShift, HTuple shift)

HImage HImage.BitLshift(int shift)

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

描述

算子 bit_lshiftbit_lshiftBitLshiftBitLshiftBitLshiftbit_lshift 对输入图像的所有像素进行逐位“左移”运算。该“左移”运算符的语义对应于 C 语言中相应类型(有符号字符、无符号字符、短整型、无符号短整型、整型/长整型)的 “<<” 运算符。若发生溢出,结果将限制在相应像素类型的最大值范围内。仅处理图像定义范围内的像素。

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

执行信息

参数

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

输入图像。

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

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

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

位移值。

默认值: 3

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

最小增量: 1

建议增量: 1

示例(C)

read_image(&ByteImage,"fabrik");
convert_image_type(ByteImage,&Int2Image,"int2");
bit_lshift(Int2Image,&FullInt2Image,8);

结果

如果图像类型正确且 ShiftShiftShiftShiftshiftshift 具有有效值,则算子 bit_lshiftbit_lshiftBitLshiftBitLshiftBitLshiftbit_lshift 返回值 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_rshiftbit_rshiftBitRshiftBitRshiftBitRshiftbit_rshift

模块

基础