Skip to content

gen_region_polygonGenRegionPolygonGenRegionPolygongen_region_polygonT_gen_region_polygon🔗

Short description🔗

gen_region_polygonGenRegionPolygonGenRegionPolygongen_region_polygonT_gen_region_polygon — Store a polygon as a region.

Signature🔗

gen_region_polygon( out region Region, polygon.y Rows, polygon.x Columns )void GenRegionPolygon( HObject* Region, const HTuple& Rows, const HTuple& Columns )static void HOperatorSet.GenRegionPolygon( out HObject region, HTuple rows, HTuple columns )def gen_region_polygon( rows: Sequence[int], columns: Sequence[int] ) -> HObject

Herror T_gen_region_polygon( Hobject* Region, const Htuple Rows, const Htuple Columns )

void HRegion::GenRegionPolygon( const HTuple& Rows, const HTuple& Columns )

void HRegion.GenRegionPolygon( HTuple rows, HTuple columns )

Description🔗

The operator gen_region_polygonGenRegionPolygon creates a region from a polygon row described by a series of line and column coordinates. The created region consists of the pixels of the routes defined thereby, wherein it is linearly interpolated between the base points.

Attention🔗

The region is not automatically closed and not filled.

Execution information🔗

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

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

  • Automatically parallelized on internal data level.

Parameters🔗

Regionregionregion (output_object) region → objectHObjectHRegionHObjectHobject *

Created region.

Rowsrowsrows (input_control) polygon.y-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Line indices of the base points of the region contour.

Default: 100100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 5000, 10, 30, 50, 100, 200, 300, 500
Value range: Rows (lin)
Minimum increment: 1
Recommended increment: 1

Columnscolumnscolumns (input_control) polygon.x-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Column indices of the base points of the region contour.

Number of elements: Columns == Rows
Default: 100100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 5000, 10, 30, 50, 100, 200, 300, 500
Value range: Columns (lin)
Minimum increment: 1
Recommended increment: 1

Example🔗

(HDevelop)


* Polygon-approximation
get_region_polygon(Region,7,Row,Column)
* store it as a region
gen_region_polygon(Pol,Row,Column)
* fill up the hole
fill_up(Pol,Filled)
(C)
/* Polygon-approximation */
T_get_region_polygon(Region,7,&Row,&Column)\;
/* store it as a region */
T_gen_region_polygon(&Pol,Row,Column)\;
destroy_tuple(Row)\;
destroy_tuple(Column)\;
/* fill up the hole */
fill_up(Pol,&Filled)\;

Result🔗

If the base points are correct the operator gen_region_polygonGenRegionPolygon returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised. The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>). If an empty region is created (by the clipping or by an empty input) the operator set_system('store_empty_region',<'true'/'false'>) determines whether the region is returned or an empty object tuple.

Combinations with other operators🔗

Combinations

Possible predecessors

get_region_polygonGetRegionPolygon, draw_polygonDrawPolygon

Alternatives

gen_region_polygon_filledGenRegionPolygonFilled, gen_region_pointsGenRegionPoints, gen_region_runsGenRegionRuns

See also

fill_upFillUp, reduce_domainReduceDomain, get_region_polygonGetRegionPolygon, draw_polygonDrawPolygon

Module🔗

Foundation