paint_xldpaint_xldPaintXldPaintXldpaint_xld (Operator)

Name

paint_xldpaint_xldPaintXldPaintXldpaint_xld — Zeichnet XLD-Objekte in ein Bild ein.

Signatur

paint_xld(XLD, Image : ImageResult : Grayval : )

Herror paint_xld(const Hobject XLD, const Hobject Image, Hobject* ImageResult, double Grayval)

Herror T_paint_xld(const Hobject XLD, const Hobject Image, Hobject* ImageResult, const Htuple Grayval)

void PaintXld(const HObject& XLD, const HObject& Image, HObject* ImageResult, const HTuple& Grayval)

HImage HImage::PaintXld(const HXLD& XLD, const HTuple& Grayval) const

HImage HImage::PaintXld(const HXLD& XLD, double Grayval) const

HImage HXLD::PaintXld(const HImage& Image, const HTuple& Grayval) const

HImage HXLD::PaintXld(const HImage& Image, double Grayval) const

static void HOperatorSet.PaintXld(HObject XLD, HObject image, out HObject imageResult, HTuple grayval)

HImage HImage.PaintXld(HXLD XLD, HTuple grayval)

HImage HImage.PaintXld(HXLD XLD, double grayval)

HImage HXLD.PaintXld(HImage image, HTuple grayval)

HImage HXLD.PaintXld(HImage image, double grayval)

def paint_xld(xld: HObject, image: HObject, grayval: MaybeSequence[Union[int, float]]) -> HObject

Beschreibung

paint_xldpaint_xldPaintXldPaintXldPaintXldpaint_xld zeichnet die XLD-Objekte XLDXLDXLDXLDXLDxld vom Typ Contour oder Polygon in die einzelnen Bildkanäle des Hintergrundbildes ImageImageImageImageimageimage mit den vorgegebenen Grauwerten GrayvalGrayvalGrayvalGrayvalgrayvalgrayval ein und liefert das Ergebnis in ImageResultImageResultImageResultImageResultimageResultimage_result zurück. Offene XLD-Objekte werden zuvor geschlossen und die eingeschlossene Region gefüllt. Die Ränder der subpixelgenauen XLD-Objekte werden im Anti-Aliasing-Verfahren auf den Hintergrund gezeichnet.

Beachten Sie, dass XLD-Objekte, die sich selbst schneiden oder bei denen Segmente sehr nah beisammen sind (in benachbarten Pixeln liegen), nicht korrekt gefüllt werden können; es entstehen Artefakte. Der set_systemset_systemSetSystemSetSystemSetSystemset_system Parameter 'neighborhood'"neighborhood""neighborhood""neighborhood""neighborhood""neighborhood" definiert, ob auch diagonal oder nur orthogonal benachbarte Pixel gefüllt werden.

GrayvalGrayvalGrayvalGrayvalgrayvalgrayval legt den Grauwert fest, mit welchem jedes XLD-Objekt in den entsprechenden Bildkanal gezeichnet werden soll. Die Grauwerte können entweder einmal für jeden Bildkanal, geltend für alle XLD-Objekte, definiert werden, oder für jedes XLD-Objekt und jeden Bildkanal einzeln. Um Letzteres zu definieren, werden die Kanal-Grauwerte g zu jedem XLD-Objekt gruppiert und zu einem Tupel entsprechend der Reihenfolge der XLD-Objekte verknüpft, z.B. für ein dreikanaliges Bild: [g(channel1,xld1), g(channel2,xld1), g(channel3,xld1), g(channel1,xld2), ... ]. Ist das Eingabebild 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.

Ausführungsinformationen

Parameter

XLDXLDXLDXLDXLDxld (input_object)  xld(-array) objectHXLDHObjectHXLDHobject

XLD-Objekte, die eingezeichnet werden sollen.

ImageImageImageImageimageimage (input_object)  (multichannel-)image objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Bild, in das die XLD-Objekte eingezeichnet werden.

ImageResultImageResultImageResultImageResultimageResultimage_result (output_object)  image objectHImageHObjectHImageHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Bild, in das die XLD-Objekte eingezeichnet wurden.

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

Mit diesen Grauwerten werden die XLD-Objekte in ImageResultImageResultImageResultImageResultimageResultimage_result 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

Beispiel (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g., blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Beispiel (C)

/* Paint colored xld objects into a gray image */

/* read and copy image to generate a three channel image */
read_image(&Image1,"green-dot");
copy_image(Image1,&Image2);
copy_image(Image1,&Image3);
compose3(Image1,Image2,Image3,&Image);
/* extract subpixel border */
threshold_sub_pix(Image1,&Border,128);
/* select the circle and the arrows */
select_obj(Border,&circle,14);
select_obj(Border,&arrows,16);
concat_obj(circle,arrows,&green_dot);
/* paint a green circle and white arrows,
 * therefore define tuple grayval:=[0,255,0,255,255,255].
 * (to paint all objects e.g., blue define grayval:=[0,0,255]) */
T_paint_xld(green_dot,Image,&ImageResult,grayval);

Beispiel (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g., blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Beispiel (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g., blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Beispiel (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g., blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Ergebnis

Sind die Parameterwerte korrekt, dann liefert paint_xldpaint_xldPaintXldPaintXldPaintXldpaint_xld den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer Eingabe (keine Eingabe-XLD-Objekte 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, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix

Alternativen

set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region

Siehe auch

gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const

Modul

Foundation