overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionoverpaint_region (Operator)

Name

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionoverpaint_region — Zeichnet Regionen in ein Bild ein.

Signatur

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)

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 HImage::OverpaintRegion(const HRegion& Region, double Grayval, const wchar_t* Type) const   (Nur Windows)

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   (Nur Windows)

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)

def overpaint_region(image: HObject, region: HObject, grayval: MaybeSequence[Union[int, float]], type: str) -> None

Beschreibung

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region zeichnet die Regionen aus RegionRegionRegionRegionregionregion in das Bild ImageImageImageImageimageimage mit den vorgegebenen Grauwerten GrayvalGrayvalGrayvalGrayvalgrayvalgrayval ein. Die Grauwerte können entweder einmal für jeden Bildkanal, geltend für alle Regionen, definiert werden, oder für jede Region und jeden Bildkanal einzeln. Um Letzteres zu definieren, werden die Kanal-Grauwerte g zu jeder Region gruppiert und zu einem Tupel entsprechend der Reihenfolge der Regionen verknüpft, z.B. für ein dreikanaliges Bild: [g(channel1,region1), g(channel2,region1), g(channel3,region1), g(channel1,region2), ... ]. Ist das Bild vom Typ direction, werden Grauwerte, die nicht innerhalb des für direction-Bilder erlaubten Wertebereichs liegen, auf den Wert 255 gesetzt, um sie als ungültig zu kennzeichnen. Der Parameter TypeTypeTypeTypetypetype gibt an, ob die Regionen ausgefüllt ('fill'"fill""fill""fill""fill""fill") oder nur der Rand ('margin'"margin""margin""margin""margin""margin") eingetragen werden soll.

Als Alternative zu overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region zeichnet der Operator paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region die Regionen nicht direkt in ImageImageImageImageimageimage ein, sondern gibt das Ergebnis in einem neu erzeugten Bild zurück.

Achtung

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region verändert den Inhalt eines bereits bestehenden Bildes (ImageImageImageImageimageimage). Zudem können aber auch andere Bildobjekte betroffen sein: Wenn man z.B. ImageImageImageImageimageimage mit Hilfe von copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj aus einem anderen Bildobjekt erzeugt hat (oder umgekehrt), wird auch dessen Bildmatrix überschrieben. Deshalb sollte overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region nur zum Einzeichnen in neu erzeugte Bildobjekte verwendet werden. Typische Operatoren hierfür sind z.B. gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const (erzeugt ein neues Bild mit angegebener Größe), gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto (erzeugt ein Bild mit der Größe eines angegebenen Prototyp-Bildes) oder copy_imagecopy_imageCopyImageCopyImageCopyImagecopy_image (erzeugt ein Bild als Kopie eines angegebenen Bildes).

Ausführungsinformationen

Dieser Operator modifiziert den Zustand des folgenden Eingabeparameters:

Während der Ausführung dieses Operators muss der Zugriff auf den Wert dieses Parameters synchronisiert werden, wenn er über mehrere Threads hinweg verwendet wird.

Parameter

ImageImageImageImageimageimage (input_object, Zustand wird modifiziert)  (multichannel-)image objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)

Bild, in das die Regionen eingezeichnet werden.

RegionRegionRegionRegionregionregion (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regionen, die eingezeichnet werden soll.

GrayvalGrayvalGrayvalGrayvalgrayvalgrayval (input_control)  number(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Mit diesen Grauwerten werden die Regionen in ImageImageImageImageimageimage eingetragen.

Defaultwert: 255.0

Wertevorschläge: 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 HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Regionen ausfüllen oder nur den Rand eintragen.

Defaultwert: 'fill' "fill" "fill" "fill" "fill" "fill"

Werteliste: 'fill'"fill""fill""fill""fill""fill", 'margin'"margin""margin""margin""margin""margin"

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

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

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

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

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

Ergebnis

Sind die Parameterwerte korrekt, dann liefert overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegionoverpaint_region den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer Eingabe (keine Eingaberegionen vorhanden) lässt sich mittels set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_imageread_imageReadImageReadImageReadImageread_image, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const, gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

Alternativen

set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval, paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, paint_xldpaint_xldPaintXldPaintXldPaintXldpaint_xld

Siehe auch

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, set_drawset_drawSetDrawSetDrawSetDrawset_draw, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGrayoverpaint_gray, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const

Modul

Foundation