Skip to content

gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegiongen_checker_regiongen_checker_region🔗

Short description🔗

gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegiongen_checker_regiongen_checker_region — Create a checkered region.

Signature🔗

gen_checker_region( out region RegionChecker, extent.x WidthRegion, extent.y HeightRegion, extent.x WidthPattern, extent.y HeightPattern )gen_checker_region( : RegionChecker : WidthRegion, HeightRegion, WidthPattern, HeightPattern : )void GenCheckerRegion( HObject* RegionChecker, const HTuple& WidthRegion, const HTuple& HeightRegion, const HTuple& WidthPattern, const HTuple& HeightPattern )static void HOperatorSet.GenCheckerRegion( out HObject regionChecker, HTuple widthRegion, HTuple heightRegion, HTuple widthPattern, HTuple heightPattern )def gen_checker_region( width_region: int, height_region: int, width_pattern: int, height_pattern: int ) -> HObject

Herror gen_checker_region( Hobject* RegionChecker, const Hlong WidthRegion, const Hlong HeightRegion, const Hlong WidthPattern, const Hlong HeightPattern )

Herror T_gen_checker_region( Hobject* RegionChecker, const Htuple WidthRegion, const Htuple HeightRegion, const Htuple WidthPattern, const Htuple HeightPattern )

void HRegion::GenCheckerRegion( Hlong WidthRegion, Hlong HeightRegion, Hlong WidthPattern, Hlong HeightPattern )

void HRegion.GenCheckerRegion( int widthRegion, int heightRegion, int widthPattern, int heightPattern )

Description🔗

The operator gen_checker_regionGenCheckerRegion returns a checkered region. Every black field of the checkerboard belongs to the region. The horizontal and vertical expansion of the region is limited by WidthRegionwidthRegionwidth_region, HeightRegionheightRegionheight_region respectively, the size of the fields of the checkerboard by WidthPatternwidthPatternwidth_pattern * HeightPatternheightPatternheight_pattern.

Attention🔗

If a very small pattern is chosen (WidthPatternwidthPatternwidth_pattern \(<\) 4) the created region requires much storage.

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🔗

RegionCheckerregionCheckerregion_checker (output_object) region → objectobjectHObjectHRegionHObjectHobject *

Created checkerboard region.

WidthRegionwidthRegionwidth_region (input_control) extent.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Largest occurring \(x\) value of the region.

Default: 511511
Suggested values: 10, 20, 31, 63, 127, 255, 300, 400, 51110, 20, 31, 63, 127, 255, 300, 400, 511
Value range: 1 ≤ WidthRegion (lin)
Minimum increment: 1
Recommended increment: 10

HeightRegionheightRegionheight_region (input_control) extent.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Largest occurring \(y\) value of the region.

Default: 511511
Suggested values: 10, 20, 31, 63, 127, 255, 300, 400, 51110, 20, 31, 63, 127, 255, 300, 400, 511
Value range: 1 ≤ HeightRegion (lin)
Minimum increment: 1
Recommended increment: 10

WidthPatternwidthPatternwidth_pattern (input_control) extent.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of a field of the checkerboard.

Default: 6464
Suggested values: 1, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 5001, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 500
Value range: 1 ≤ WidthPattern (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: WidthPattern < WidthRegion

HeightPatternheightPatternheight_pattern (input_control) extent.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of a field of the checkerboard.

Default: 6464
Suggested values: 1, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 5001, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 500
Value range: 1 ≤ HeightPattern (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: HeightPattern < HeightRegion

Example🔗

(HDevelop)


gen_checker_region(Checker,512,512,32,64)
dev_set_draw('fill')
dev_display (Checker)

Complexity🔗

The required storage (in bytes) for the region is:

\(O((\textrm{WidthRegion} * \textrm{HeightRegion}) / \textrm{WidthPattern})\)

Result🔗

The operator gen_checker_regionGenCheckerRegion returns the value 2 (H_MSG_TRUE) if the parameter values are correct. Otherwise an exception is raised. 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 successors

paint_regionPaintRegion

Alternatives

gen_grid_regionGenGridRegion, gen_region_polygon_filledGenRegionPolygonFilled, gen_region_pointsGenRegionPoints, gen_region_runsGenRegionRuns, gen_rectangle1GenRectangle1, concat_objConcatObj, gen_random_regionGenRandomRegion, gen_random_regionsGenRandomRegions

See also

reduce_domainReduceDomain

Module🔗

Foundation