Skip to content

overpaint_regionOverpaintRegionOverpaintRegionoverpaint_regionoverpaint_regionπŸ”—

Short descriptionπŸ”—

overpaint_regionOverpaintRegionOverpaintRegionoverpaint_regionoverpaint_region β€” Overpaint regions in an image.

SignatureπŸ”—

overpaint_region( image Image, region Region, number Grayval, string Type )void OverpaintRegion( const HObject& Image, const HObject& Region, const HTuple& Grayval, const HTuple& Type )static void HOperatorSet.OverpaintRegion( HObject image, HObject region, HTuple grayval, HTuple type )def overpaint_region( image: HObject, region: HObject, grayval: MaybeSequence[Union[int, float]], type: str ) -> None

Herror overpaint_region( const Hobject Image, const Hobject Region, double Grayval, const char* Type )

Herror T_overpaint_region( const Hobject Image, const Hobject Region, const Htuple Grayval, const Htuple Type )

void HImage::OverpaintRegion( const HRegion& Region, const HTuple& Grayval, const HString& Type ) const

void HImage::OverpaintRegion( const HRegion& Region, double Grayval, const HString& Type ) const

void HImage::OverpaintRegion( const HRegion& Region, double Grayval, const char* Type ) const

void HImage::OverpaintRegion( const HRegion& Region, double Grayval, const wchar_t* Type ) const (Windows only)

void HRegion::OverpaintRegion( const HImage& Image, const HTuple& Grayval, const HString& Type ) const

void HRegion::OverpaintRegion( const HImage& Image, double Grayval, const HString& Type ) const

void HRegion::OverpaintRegion( const HImage& Image, double Grayval, const char* Type ) const

void HRegion::OverpaintRegion( const HImage& Image, double Grayval, const wchar_t* Type ) const (Windows only)

void HImage.OverpaintRegion( HRegion region, HTuple grayval, string type )

void HImage.OverpaintRegion( HRegion region, double grayval, string type )

void HRegion.OverpaintRegion( HImage image, HTuple grayval, string type )

void HRegion.OverpaintRegion( HImage image, double grayval, string type )

DescriptionπŸ”—

overpaint_regionOverpaintRegion paints the regions given in Regionregionregion with a constant gray value into the image given in Imageimageimage. These gray values can either be specified for each channel once, valid for all regions, or for each region separately. To define the latter, group the channel gray values g of each region and concatenate them to a tuple according to the regions’ order, e.g., for a three channel image:

    [g(channel1,region1), g(channel2,region1), g(channel3,region1), g(channel1,region2), ... ].

If the input image is of type direction, gray values that are not in the value range that is valid for direction images are set to the value 255 to mark them as invalid. The parameter Typetypetype determines whether the region should be painted filled ('fill'"fill") or whether only its boundary should be painted ('margin'"margin").

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

AttentionπŸ”—

overpaint_regionOverpaintRegion modifies the content of an already existing image (Imageimageimage). Besides, even other image objects may be affected: For example, if you created Imageimageimage via copy_objCopyObj from another image object (or vice versa), overpaint_regionOverpaintRegion will also modify the image matrix of this other image object. Therefore, overpaint_regionOverpaintRegion 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πŸ”—

Imageimageimage (input_object, state is modified) (multichannel-)image β†’ object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)

Image in which the regions are to be painted.

Regionregionregion (input_object) region(-array) β†’ objectHObjectHRegionHObjectHobject

Regions to be painted into the input image.

Grayvalgrayvalgrayval (input_control) number(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Desired gray values of the regions.

Default: 255.0255.0
Suggested values: 0.0, 1.0, 2.0, 5.0, 10.0, 16.0, 32.0, 64.0, 128.0, 253.0, 254.0, 255.00.0, 1.0, 2.0, 5.0, 10.0, 16.0, 32.0, 64.0, 128.0, 253.0, 254.0, 255.0

Typetypetype (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Paint regions filled or as boundaries.

Default: 'fill'"fill"
List of values: 'fill', 'margin'"fill", "margin"

ExampleπŸ”—

(HDevelop)

* Paint a rectangle into a new image (New1)

gen_rectangle1(Rectangle,100.0,100.0,300.0,300.0)
* generate a black image
gen_image_const(New1,'byte', 768, 576)
* paint a white rectangle
overpaint_region(New1,Rectangle,255.0,'fill')
(C)
/* Paint a rectangle into a new image (New1) */

gen_rectangle1(&Rectangle,100.0,100.0,300.0,300.0)\;
/* generate a black image */
gen_image_const(&New1,"byte", 768, 576)
/* paint a white rectangle */
overpaint_region(New1,Rectangle,255.0,"fill")\;

ResultπŸ”—

overpaint_regionOverpaintRegion returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

read_imageReadImage, gen_image_constGenImageConst, gen_image_protoGenImageProto, reduce_domainReduceDomain

Alternatives

set_grayvalSetGrayval, paint_regionPaintRegion, paint_xldPaintXld

See also

reduce_domainReduceDomain, set_drawSetDraw, paint_grayPaintGray, overpaint_grayOverpaintGray, gen_image_constGenImageConst

ModuleπŸ”—

Foundation