overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegion (Operator)

Name

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegion — 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)

Beschreibung

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegion zeichnet die Regionen aus RegionRegionRegionRegionregion in das Bild ImageImageImageImageimage mit den vorgegebenen Grauwerten GrayvalGrayvalGrayvalGrayvalgrayval 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 TypeTypeTypeTypetype gibt an, ob die Regionen ausgefüllt ('fill'"fill""fill""fill""fill") oder nur der Rand ('margin'"margin""margin""margin""margin") eingetragen werden soll.

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

Achtung

overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegion verändert den Inhalt eines bereits bestehenden Bildes (ImageImageImageImageimage). Zudem können aber auch andere Bildobjekte betroffen sein: Wenn man z.B. ImageImageImageImageimage mit Hilfe von copy_objcopy_objCopyObjCopyObjCopyObj aus einem anderen Bildobjekt erzeugt hat (oder umgekehrt), wird auch dessen Bildmatrix überschrieben. Deshalb sollte overpaint_regionoverpaint_regionOverpaintRegionOverpaintRegionOverpaintRegion nur zum Einzeichnen in neu erzeugte Bildobjekte verwendet werden. Typische Operatoren hierfür sind z.B. gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst (erzeugt ein neues Bild mit angegebener Größe), gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProto (erzeugt ein Bild mit der Größe eines angegebenen Prototyp-Bildes) oder copy_imagecopy_imageCopyImageCopyImageCopyImage (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

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

Bild, in das die Regionen eingezeichnet werden.

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHobject

Regionen, die eingezeichnet werden soll.

GrayvalGrayvalGrayvalGrayvalgrayval (input_control)  number(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Mit diesen Grauwerten werden die Regionen in ImageImageImageImageimage 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

TypeTypeTypeTypetype (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Regionen ausfüllen oder nur den Rand eintragen.

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

Werteliste: 'fill'"fill""fill""fill""fill", '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_regionOverpaintRegionOverpaintRegionOverpaintRegion 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>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_imageread_imageReadImageReadImageReadImage, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst, gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProto, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain

Alternativen

set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayval, paint_regionpaint_regionPaintRegionPaintRegionPaintRegion, paint_xldpaint_xldPaintXldPaintXldPaintXld

Siehe auch

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain, set_drawset_drawSetDrawSetDrawSetDraw, paint_graypaint_grayPaintGrayPaintGrayPaintGray, overpaint_grayoverpaint_grayOverpaintGrayOverpaintGrayOverpaintGray, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst

Modul

Foundation