Skip to content

overpaint_grayOverpaintGrayOverpaintGrayoverpaint_grayoverpaint_gray🔗

Short description🔗

overpaint_grayOverpaintGrayOverpaintGrayoverpaint_grayoverpaint_gray — Overpaint the gray values of an image.

Signature🔗

overpaint_gray( image ImageDestination, image ImageSource )void OverpaintGray( const HObject& ImageDestination, const HObject& ImageSource )static void HOperatorSet.OverpaintGray( HObject imageDestination, HObject imageSource )def overpaint_gray( image_destination: HObject, image_source: HObject ) -> None

Herror overpaint_gray( const Hobject ImageDestination, const Hobject ImageSource )

Herror T_overpaint_gray( const Hobject ImageDestination, const Hobject ImageSource )

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

void HImage.OverpaintGray( HImage imageSource )

Description🔗

overpaint_grayOverpaintGray copies the gray values of the image given in ImageSourceimageSourceimage_source into the image in ImageDestinationimageDestinationimage_destination. Only the gray values of the domain of ImageSourceimageSourceimage_source are copied (see reduce_domainReduceDomain).

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

Attention🔗

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

ImageDestinationimageDestinationimage_destination (input_object, state is modified) (multichannel-)image → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)

Input image to be painted over.

ImageSourceimageSourceimage_source (input_object) (multichannel-)image → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex / vector_field)Hobject (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)
(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)\;

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

read_imageReadImage, gen_image_constGenImageConst, gen_image_protoGenImageProto

Alternatives

get_image_pointer1GetImagePointer1, paint_grayPaintGray, set_grayvalSetGrayval, copy_imageCopyImage

See also

paint_regionPaintRegion, overpaint_regionOverpaintRegion

Module🔗

Foundation