paint_xldpaint_xldPaintXldPaintXld (Operator)

Name

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

Beschreibung

paint_xldpaint_xldPaintXldPaintXldPaintXld zeichnet die XLD-Objekte XLDXLDXLDXLDXLD vom Typ Contour oder Polygon in die einzelnen Bildkanäle des Hintergrundbildes ImageImageImageImageimage mit den vorgegebenen Grauwerten GrayvalGrayvalGrayvalGrayvalgrayval ein und liefert das Ergebnis in ImageResultImageResultImageResultImageResultimageResult 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_systemSetSystemSetSystemSetSystem Parameter 'neighborhood' definiert, ob auch diagonal oder nur orthogonal benachbarte Pixel gefüllt werden.

GrayvalGrayvalGrayvalGrayvalgrayval 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

XLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHobject

XLD-Objekte, die eingezeichnet werden sollen.

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

Bild, in das die XLD-Objekte eingezeichnet werden.

ImageResultImageResultImageResultImageResultimageResult (output_object)  image objectHImageHImageHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Bild, in das die XLD-Objekte eingezeichnet wurden.

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

Mit diesen Grauwerten werden die XLD-Objekte in ImageResultImageResultImageResultImageResultimageResult 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_xldPaintXldPaintXldPaintXld 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>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_imageread_imageReadImageReadImageReadImage, gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst, gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProto, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXld, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPix

Alternativen

set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayval, paint_graypaint_grayPaintGrayPaintGrayPaintGray, paint_regionpaint_regionPaintRegionPaintRegionPaintRegion

Siehe auch

gen_image_constgen_image_constGenImageConstGenImageConstGenImageConst

Modul

Foundation