ClassesClassesClassesClasses | | | | Operators

overpaint_regionoverpaint_regionOverpaintRegionoverpaint_regionOverpaintRegionOverpaintRegion (Operator)

Name

overpaint_regionoverpaint_regionOverpaintRegionoverpaint_regionOverpaintRegionOverpaintRegion — Overpaint regions in an image.

Signature

overpaint_region(Image, Region : : Grayval, Type : )

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)

Herror overpaint_region(Hobject Image, Hobject Region, const HTuple& Grayval, const HTuple& Type)

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

void OverpaintRegion(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 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 HOperatorSetX.OverpaintRegion(
[in] IHUntypedObjectX* Image, [in] IHUntypedObjectX* Region, [in] VARIANT Grayval, [in] VARIANT Type)

void HImageX.OverpaintRegion(
[in] IHRegionX* Region, [in] VARIANT Grayval, [in] BSTR Type)

void HRegionX.OverpaintRegion(
[in] IHImageX* Image, [in] VARIANT Grayval, [in] BSTR Type)

static void HOperatorSet.OverpaintRegion(HObject image, HObject region, HTuple grayval, HTuple type)

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_regionoverpaint_regionOverpaintRegionoverpaint_regionOverpaintRegionOverpaintRegion paints the regions given in RegionRegionRegionRegionRegionregion with a constant gray value into the image given in ImageImageImageImageImageimage. 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 TypeTypeTypeTypeTypetype determines whether the region should be painted filled ('fill'"fill""fill""fill""fill""fill") or whether only its boundary should be painted ('margin'"margin""margin""margin""margin""margin").

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

Attention

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

Parallelization

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

ImageImageImageImageImageimage (input_object, state is modified)  (multichannel-)image objectHImageHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)

Image in which the regions are to be painted.

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be painted into the input image.

GrayvalGrayvalGrayvalGrayvalGrayvalgrayval (input_control)  number(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Desired gray values of the regions.

Default value: 255.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.0

TypeTypeTypeTypeTypetype (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Paint regions filled or as boundaries.

Default value: 'fill' "fill" "fill" "fill" "fill" "fill"

List of values: 'fill'"fill""fill""fill""fill""fill", 'margin'"margin""margin""margin""margin""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')

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

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')

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')

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')

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')

Result

overpaint_regionoverpaint_regionOverpaintRegionoverpaint_regionOverpaintRegionOverpaintRegion 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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

read_imageread_imageReadImageread_imageReadImageReadImage, gen_image_constgen_image_constGenImageConstgen_image_constGenImageConstGenImageConst, gen_image_protogen_image_protoGenImageProtogen_image_protoGenImageProtoGenImageProto, reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain

Alternatives

set_grayvalset_grayvalSetGrayvalset_grayvalSetGrayvalSetGrayval, paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion, paint_xldpaint_xldPaintXldpaint_xldPaintXldPaintXld

See also

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, set_drawset_drawSetDrawset_drawSetDrawSetDraw, paint_graypaint_grayPaintGraypaint_grayPaintGrayPaintGray, overpaint_grayoverpaint_grayOverpaintGrayoverpaint_grayOverpaintGrayOverpaintGray, gen_image_constgen_image_constGenImageConstgen_image_constGenImageConstGenImageConst

Module

Foundation


ClassesClassesClassesClasses | | | | Operators