ClassesClasses | | Operators

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGray (Operator)

Name

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGray — Overpaint the gray values of an image.

Signature

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)

Description

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGray copies the gray values of the image given in ImageSourceImageSourceImageSourceImageSourceimageSource into the image in ImageDestinationImageDestinationImageDestinationImageDestinationimageDestination. Only the gray values of the domain of ImageSourceImageSourceImageSourceImageSourceimageSource are copied (see reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain).

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

Attention

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

Execution Information

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

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

Input image to be painted over.

ImageSourceImageSourceImageSourceImageSourceimageSource (input_object)  (multichannel-)image objectHImageHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)

Input image containing the desired gray values.

Example (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)

Example (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);

Example (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)

Example (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)

Example (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)

Result

overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGray returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

read_imageread_imageReadImageReadImageReadImage, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst, gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProto

Alternatives

get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1, paint_graypaint_grayPaintGrayPaintGrayPaintGray, set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayval, copy_imagecopy_imageCopyImageCopyImageCopyImage

See also

paint_regionpaint_regionPaintRegionPaintRegionPaintRegion, overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegion

Module

Foundation


ClassesClasses | | Operators