gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegiongen_checker_region (算子)

名称

gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegiongen_checker_region — 创建一个方格区域。

签名

gen_checker_region( : RegionChecker : WidthRegion, HeightRegion, WidthPattern, HeightPattern : )

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 GenCheckerRegion(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)

static void HOperatorSet.GenCheckerRegion(out HObject regionChecker, HTuple widthRegion, HTuple heightRegion, HTuple widthPattern, HTuple heightPattern)

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

def gen_checker_region(width_region: int, height_region: int, width_pattern: int, height_pattern: int) -> HObject

描述

算子 gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegionGenCheckerRegiongen_checker_region 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 WidthRegionWidthRegionWidthRegionWidthRegionwidthRegionwidth_region, HeightRegionHeightRegionHeightRegionHeightRegionheightRegionheight_region respectively, the size of the fields of the checkerboard by WidthPatternWidthPatternWidthPatternWidthPatternwidthPatternwidth_pattern * HeightPatternHeightPatternHeightPatternHeightPatternheightPatternheight_pattern

注意

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

执行信息

参数

RegionCheckerRegionCheckerRegionCheckerRegionCheckerregionCheckerregion_checker (输出对象)  region objectHRegionHObjectHRegionHobject *

Created checkerboard region.

WidthRegionWidthRegionWidthRegionWidthRegionwidthRegionwidth_region (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Largest occurring x value of the region.

默认值: 511

建议值: 10, 20, 31, 63, 127, 255, 300, 400, 511

值范围: 1 ≤ WidthRegion WidthRegion WidthRegion WidthRegion widthRegion width_region (lin)

最小增量: 1

建议增量: 10

HeightRegionHeightRegionHeightRegionHeightRegionheightRegionheight_region (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Largest occurring y value of the region.

默认值: 511

建议值: 10, 20, 31, 63, 127, 255, 300, 400, 511

值范围: 1 ≤ HeightRegion HeightRegion HeightRegion HeightRegion heightRegion height_region (lin)

最小增量: 1

建议增量: 10

WidthPatternWidthPatternWidthPatternWidthPatternwidthPatternwidth_pattern (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of a field of the checkerboard.

默认值: 64

建议值: 1, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 500

值范围: 1 ≤ WidthPattern WidthPattern WidthPattern WidthPattern widthPattern width_pattern (lin)

最小增量: 1

建议增量: 10

限制: WidthPattern < WidthRegion

HeightPatternHeightPatternHeightPatternHeightPatternheightPatternheight_pattern (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of a field of the checkerboard.

默认值: 64

建议值: 1, 2, 4, 8, 16, 20, 32, 64, 100, 128, 200, 300, 500

值范围: 1 ≤ HeightPattern HeightPattern HeightPattern HeightPattern heightPattern height_pattern (lin)

最小增量: 1

建议增量: 10

限制: HeightPattern < HeightRegion

示例(HDevelop)

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

复杂度

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

O((WidthRegionWidthRegionWidthRegionWidthRegionwidthRegionwidth_region * HeightRegionHeightRegionHeightRegionHeightRegionheightRegionheight_region) / WidthPatternWidthPatternWidthPatternWidthPatternwidthPatternwidth_pattern)

结果

算子 gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegionGenCheckerRegiongen_checker_region 在参数值正确时返回值 2 ( H_MSG_TRUE )。否则将抛出异常。 The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)

可能的后继

paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region

替代

gen_grid_regiongen_grid_regionGenGridRegionGenGridRegionGenGridRegiongen_grid_region, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsGenRegionRunsgen_region_runs, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, concat_objconcat_objConcatObjConcatObjConcatObjconcat_obj, gen_random_regiongen_random_regionGenRandomRegionGenRandomRegionGenRandomRegiongen_random_region, gen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegionsGenRandomRegionsgen_random_regions

另见

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

模块

基础