Skip to content

test_region_pointTestRegionPointTestRegionPointtest_region_pointtest_region_point🔗

Short description🔗

test_region_pointTestRegionPointTestRegionPointtest_region_pointtest_region_point — Test if the region contains a given point.

Signature🔗

test_region_point( region Regions, point.y Row, point.x Column, out integer IsInside )void TestRegionPoint( const HObject& Regions, const HTuple& Row, const HTuple& Column, HTuple* IsInside )static void HOperatorSet.TestRegionPoint( HObject regions, HTuple row, HTuple column, out HTuple isInside )def test_region_point( regions: HObject, row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]] ) -> int

Herror test_region_point( const Hobject Regions, const Hlong Row, const Hlong Column, Hlong* IsInside )

Herror T_test_region_point( const Hobject Regions, const Htuple Row, const Htuple Column, Htuple* IsInside )

Hlong HRegion::TestRegionPoint( const HTuple& Row, const HTuple& Column ) const

Hlong HRegion::TestRegionPoint( Hlong Row, Hlong Column ) const

int HRegion.TestRegionPoint( HTuple row, HTuple column )

int HRegion.TestRegionPoint( int row, int column )

Description🔗

If an array of regions and one test point is provided, test_region_pointTestRegionPoint tests if at least one input region of Regionsregionsregions contains the single test point given in (Rowrowrow,Columncolumncolumn). If this is the case, IsInsideisInsideis_inside is set to TRUE, else to FALSE. Alternatively, if a single region and several test points are provided, test_region_pointTestRegionPoint tests if at least one of the test points (given in Rowrowrow,Columncolumncolumn) is contained in the input region given in Regionsregionsregions. If this is the case, IsInsideisInsideis_inside is set to TRUE, otherwise it is set to FALSE. If (Rowrowrow,Columncolumncolumn) are real-valued, rounding is performed internally since regions are pixel precise.

To test, which points exactly are contained in a region, use the operator test_region_pointsTestRegionPoints.

Attention🔗

The test pixel is not contained in an empty region (no pixel of the region corresponds to the pixel). If all regions are empty IsInsideisInsideis_inside is set to FALSE.

In case of an empty input object (empty tuple) Regionsregionsregions and set_system('no_object_result','true'), an empty tuple is returned in IsInsideisInsideis_inside. If set_system('no_object_result','false') was set, an exception is raised.

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🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Region(s) to be examined.

Rowrowrow (input_control) point.y(-array) → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[int, float]]Htuple (Hlong / double)

Row index of the test pixel(s).

Default: 100100

Columncolumncolumn (input_control) point.x(-array) → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[int, float]]Htuple (Hlong / double)

Column index of the test pixel(s).

Number of elements: Row == Column
Default: 100100

IsInsideisInsideis_inside (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Boolean result value.

Complexity🔗

If \(F\) is the area of one region, \(N\) is the number of regions, and \(M\) is the number of test points, the runtime complexity is \(O(\ln(\sqrt{F}) * N)\) in the case of one test point and several regions and \(O(\ln(\sqrt{F}) * M)\) in the case of one region and several test points.

Result🔗

The operator test_region_pointTestRegionPoint returns the value 2 (H_MSG_TRUE) if the parameters are correct. The behavior in case of an empty object is set via the operator set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

Alternatives

union1Union1, intersectionIntersection, area_centerAreaCenter, test_region_pointsTestRegionPoints

See also

select_region_pointSelectRegionPoint, test_region_pointsTestRegionPoints

Module🔗

Foundation