Skip to content

clip_region_relclip_region_relClipRegionRelClipRegionRelclip_region_relclip_region_rel🔗

Short description🔗

clip_region_relclip_region_relClipRegionRelClipRegionRelclip_region_relclip_region_rel — Clip a region relative to its smallest surrounding rectangle.

Signature🔗

clip_region_rel( region Region, out region RegionClipped, integer Top, integer Bottom, integer Left, integer Right )clip_region_rel( Region : RegionClipped : Top, Bottom, Left, Right : )void ClipRegionRel( const HObject& Region, HObject* RegionClipped, const HTuple& Top, const HTuple& Bottom, const HTuple& Left, const HTuple& Right )static void HOperatorSet.ClipRegionRel( HObject region, out HObject regionClipped, HTuple top, HTuple bottom, HTuple left, HTuple right )def clip_region_rel( region: HObject, top: int, bottom: int, left: int, right: int ) -> HObject

Herror clip_region_rel( const Hobject Region, Hobject* RegionClipped, const Hlong Top, const Hlong Bottom, const Hlong Left, const Hlong Right )

Herror T_clip_region_rel( const Hobject Region, Hobject* RegionClipped, const Htuple Top, const Htuple Bottom, const Htuple Left, const Htuple Right )

HRegion HRegion::ClipRegionRel( Hlong Top, Hlong Bottom, Hlong Left, Hlong Right ) const

HRegion HRegion.ClipRegionRel( int top, int bottom, int left, int right )

Description🔗

clip_region_relClipRegionRel reduces the Regionregionregion by eliminating parts close to the smallest surrounding rectangle of the Regionregionregion. Specifically this means that the Regionregionregion is clipped to a rectangle that is smaller than or equal to the smallest surrounding rectangle. The resulting clipped region is returned in RegionClippedregionClippedregion_clipped.

The rectangle to which the Regionregionregion is clipped is determined by reducing the smallest surrounding axis-parallel rectangle at the top, bottom, left, and right side by the values given in Toptoptop, Bottombottombottom, Leftleftleft, and Rightrightright, respectively.

 
(1) (2)

Region with smallest surrounding rectangle (1) and clipped region (2).

These four parameters must contain numbers larger or equal to zero. If all parameters are set to zero, the region remains unchanged.

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 tuple level.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectobjectHObjectHRegionHObjectHobject

Regions to be clipped.

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

Clipped regions.

Toptoptop (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of rows clipped at the top.

Default: 11
Suggested values: 0, 1, 2, 3, 4, 5, 7, 10, 20, 30, 500, 1, 2, 3, 4, 5, 7, 10, 20, 30, 50
Value range: 0 ≤ Top (lin)
Minimum increment: 1
Recommended increment: 1

Bottombottombottom (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of rows clipped at the bottom.

Default: 11
Suggested values: 0, 1, 2, 3, 4, 5, 7, 10, 20, 30, 500, 1, 2, 3, 4, 5, 7, 10, 20, 30, 50
Value range: 0 ≤ Bottom (lin)
Minimum increment: 1
Recommended increment: 1

Leftleftleft (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of columns clipped at the left.

Default: 11
Suggested values: 0, 1, 2, 3, 4, 5, 7, 10, 20, 30, 500, 1, 2, 3, 4, 5, 7, 10, 20, 30, 50
Value range: 0 ≤ Left (lin)
Minimum increment: 1
Recommended increment: 1

Rightrightright (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of columns clipped at the right.

Default: 11
Suggested values: 0, 1, 2, 3, 4, 5, 7, 10, 20, 30, 500, 1, 2, 3, 4, 5, 7, 10, 20, 30, 50
Value range: 0 ≤ Right (lin)
Minimum increment: 1
Recommended increment: 1

Result🔗

clip_region_relClipRegionRel returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, connectionConnection, regiongrowingRegiongrowing, pouringPouring

Possible successors

select_shapeSelectShape, disp_regionDispRegion

Alternatives

smallest_rectangle1SmallestRectangle1, intersectionIntersection, gen_rectangle1GenRectangle1, clip_regionClipRegion

Module🔗

Foundation