Skip to content

gen_region_contour_xldgen_region_contour_xldGenRegionContourXldGenRegionContourXldgen_region_contour_xldgen_region_contour_xld🔗

Short description🔗

gen_region_contour_xldgen_region_contour_xldGenRegionContourXldGenRegionContourXldgen_region_contour_xldgen_region_contour_xld — Create a region from an XLD contour.

Signature🔗

gen_region_contour_xld( xld_cont Contour, out region Region, string Mode )gen_region_contour_xld( Contour : Region : Mode : )void GenRegionContourXld( const HObject& Contour, HObject* Region, const HTuple& Mode )static void HOperatorSet.GenRegionContourXld( HObject contour, out HObject region, HTuple mode )def gen_region_contour_xld( contour: HObject, mode: str ) -> HObject

Herror gen_region_contour_xld( const Hobject Contour, Hobject* Region, const char* Mode )

Herror T_gen_region_contour_xld( const Hobject Contour, Hobject* Region, const Htuple Mode )

HRegion HXLDCont::GenRegionContourXld( const HString& Mode ) const

HRegion HXLDCont::GenRegionContourXld( const char* Mode ) const

HRegion HXLDCont::GenRegionContourXld( const wchar_t* Mode ) const (Windows only)

HRegion HXLDCont.GenRegionContourXld( string mode )

Description🔗

gen_region_contour_xldGenRegionContourXld creates a region Regionregionregion from a subpixel XLD contour Contourcontourcontour. The contour is sampled according to the Bresenham algorithm and influenced by the parameter 'neighborhood'"neighborhood" of the operator set_systemSetSystem. Open contours are closed before converting them to regions. Finally, the parameter Modemodemode defines whether the region is filled up ('filled'"filled") or returned by its contour ('margin'"margin").

Please note that the coordinates of the contour points are rounded to their nearest integer pixel coordinates during the conversion. This may lead to unexpected results when passing the contour obtained by the operator gen_contour_region_xldGenContourRegionXld to gen_region_contour_xldGenRegionContourXld: When setting Modemodemode of gen_contour_region_xldGenContourRegionXld to 'border'"border", the input region of gen_contour_region_xldGenContourRegionXld and the output region of gen_region_contour_xldGenRegionContourXld differ. For example, let us assume that the input region of gen_contour_region_xldGenContourRegionXld consists of the single pixel (1,1). Then, the resulting contour that is obtained when calling gen_contour_region_xldGenContourRegionXld with Modemodemode set to 'border'"border" consists of the five points (0.5,0.5), (0.5,1.5), (1.5,1.5), (1.5,0.5), and (0.5,0.5). Consequently, when passing this contour again to gen_region_contour_xldGenRegionContourXld, the resulting region consists of the points (1,1), (1,2), (2,2), and (2,1).

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Contourcontourcontour (input_object) xld_cont(-array) → objectobjectHObjectHXLDContHObjectHobject

Input contour(s).

Regionregionregion (output_object) region(-array) → objectobjectHObjectHRegionHObjectHobject *

Created region(s).

Modemodemode (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Fill mode of the region(s).

Default: 'filled'"filled"
Suggested values: 'filled', 'margin'"filled", "margin"

Result🔗

The clipping according to the global image size is set via the operator set_system('clip_region',<'true'/'false'>).

Combinations with other operators🔗

Combinations

Possible predecessors

gen_contour_polygon_xldGenContourPolygonXld, gen_contour_polygon_rounded_xldGenContourPolygonRoundedXld

Alternatives

gen_region_polygonGenRegionPolygon, gen_region_polygon_xldGenRegionPolygonXld

See also

set_systemSetSystem

Module🔗

Foundation