overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayoverpaint_gray (算子)

名称

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayoverpaint_gray — 覆盖图像的灰度值。

签名

overpaint_gray(ImageDestination, ImageSource : : : )

Herror overpaint_gray(const Hobject ImageDestination, const Hobject ImageSource)

Herror T_overpaint_gray(const Hobject ImageDestination, const Hobject ImageSource)

void OverpaintGray(const HObject& ImageDestination, const HObject& ImageSource)

void HImage::OverpaintGray(const HImage& ImageSource) const

static void HOperatorSet.OverpaintGray(HObject imageDestination, HObject imageSource)

void HImage.OverpaintGray(HImage imageSource)

def overpaint_gray(image_destination: HObject, image_source: HObject) -> None

描述

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray copies the gray values of the image given in ImageSourceImageSourceImageSourceImageSourceimageSourceimage_source into the image in ImageDestinationImageDestinationImageDestinationImageDestinationimageDestinationimage_destination. Only the gray values of the domain of ImageSourceImageSourceImageSourceImageSourceimageSourceimage_source are copied (see reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain).

If you do not want to modify ImageDestinationImageDestinationImageDestinationImageDestinationimageDestinationimage_destination itself, you can use the operator paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, which returns the result in a newly created image.

注意

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray modifies the content of an already existing image (ImageDestinationImageDestinationImageDestinationImageDestinationimageDestinationimage_destination). Besides, even other image objects may be affected: For example, if you created ImageDestinationImageDestinationImageDestinationImageDestinationimageDestinationimage_destination via copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj from another image object (or vice versa), overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray will also modify the image matrix of this other image object. Therefore, overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray should only be used to overpaint newly created image objects. Typical operators for this task are, e.g., gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const (creates a new image with a specified size), gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto (creates an image with the size of a specified prototype image) or copy_imagecopy_imageCopyImageCopyImageCopyImagecopy_image (creates an image as the copy of a specified image).

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

ImageDestinationImageDestinationImageDestinationImageDestinationimageDestinationimage_destination (input_object, state is modified)  (multichannel-)image objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)

Input image to be painted over.

ImageSourceImageSourceImageSourceImageSourceimageSourceimage_source (输入对象)  (multichannel-)image objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)

Input image containing the desired gray values.

示例(HDevelop)

* Copy a circular part of the image 'monkey' into a new image (New1):

read_image(Image,'monkey')
gen_circle(Circle,200,200,150)
reduce_domain(Image,Circle,Mask)
* New image with black (0) background
gen_image_proto(Image,New1,0.0)
* Copy a part of the image 'monkey' into New1
overpaint_gray(New1,Mask)

示例(C)

/* Copy a circular part of the image 'monkey' into a new image (New1): */

read_image(&Image,"monkey");
gen_circle(&Circle,200.0,200.0,150.0);
reduce_domain(Image,Circle,&Mask);
/* New image with black (0) background */
gen_image_proto(Image,&New1,0.0);
/* Copy a part of the image 'monkey' into New1 */
overpaint_gray(New1,Mask);

示例(HDevelop)

* Copy a circular part of the image 'monkey' into a new image (New1):

read_image(Image,'monkey')
gen_circle(Circle,200,200,150)
reduce_domain(Image,Circle,Mask)
* New image with black (0) background
gen_image_proto(Image,New1,0.0)
* Copy a part of the image 'monkey' into New1
overpaint_gray(New1,Mask)

示例(HDevelop)

* Copy a circular part of the image 'monkey' into a new image (New1):

read_image(Image,'monkey')
gen_circle(Circle,200,200,150)
reduce_domain(Image,Circle,Mask)
* New image with black (0) background
gen_image_proto(Image,New1,0.0)
* Copy a part of the image 'monkey' into New1
overpaint_gray(New1,Mask)

示例(HDevelop)

* Copy a circular part of the image 'monkey' into a new image (New1):

read_image(Image,'monkey')
gen_circle(Circle,200,200,150)
reduce_domain(Image,Circle,Mask)
* New image with black (0) background
gen_image_proto(Image,New1,0.0)
* Copy a part of the image 'monkey' into New1
overpaint_gray(New1,Mask)

结果

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray 在所有参数正确时返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

read_imageread_imageReadImageReadImageReadImageread_image, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const, gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto

替代

get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval, copy_imagecopy_imageCopyImageCopyImageCopyImagecopy_image

另见

paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region

模块

基础