Operator Reference

gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region (Operator)

gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region — Create a region from lines or pixels.

Signature

gen_grid_region( : RegionGrid : RowSteps, ColumnSteps, Type, Width, Height : )

Herror gen_grid_region(Hobject* RegionGrid, const Hlong RowSteps, const Hlong ColumnSteps, const char* Type, const Hlong Width, const Hlong Height)

Herror T_gen_grid_region(Hobject* RegionGrid, const Htuple RowSteps, const Htuple ColumnSteps, const Htuple Type, const Htuple Width, const Htuple Height)

void GenGridRegion(HObject* RegionGrid, const HTuple& RowSteps, const HTuple& ColumnSteps, const HTuple& Type, const HTuple& Width, const HTuple& Height)

void HRegion::GenGridRegion(const HTuple& RowSteps, const HTuple& ColumnSteps, const HString& Type, Hlong Width, Hlong Height)

void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const HString& Type, Hlong Width, Hlong Height)

void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const char* Type, Hlong Width, Hlong Height)

void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const wchar_t* Type, Hlong Width, Hlong Height)   ( Windows only)

static void HOperatorSet.GenGridRegion(out HObject regionGrid, HTuple rowSteps, HTuple columnSteps, HTuple type, HTuple width, HTuple height)

void HRegion.GenGridRegion(HTuple rowSteps, HTuple columnSteps, string type, int width, int height)

void HRegion.GenGridRegion(int rowSteps, int columnSteps, string type, int width, int height)

def gen_grid_region(row_steps: Union[float, int], column_steps: Union[float, int], type: str, width: int, height: int) -> HObject

Description

The operator gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region creates a grid constructed of lines (TypeTypeTypetypetype = 'lines') or pixels (TypeTypeTypetypetype = 'points'). In case of 'lines' continuous lines are returned, in case of 'points' only the intersections of the lines. Starting from the pixel (0,0) to the pixel (HeightHeightHeightheightheight-1,WidthWidthWidthwidthwidth-1) the grid is built up at stepping width RowStepsRowStepsRowStepsrowStepsrow_steps in row direction and ColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps in column direction. The step widths have to be greater than 1. Exceptions are in 'lines' mode RowStepsRowStepsRowStepsrowStepsrow_steps, where RowStepsRowStepsRowStepsrowStepsrow_steps or ColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps can be set equal to 0. In such a case, only columns, rows respectively, are created.

Attention

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

In the 'points' mode RowStepsRowStepsRowStepsrowStepsrow_steps and ColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps must not be set to zero.

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

RegionGridRegionGridRegionGridregionGridregion_grid (output_object)  region objectHRegionHObjectHObjectHobject *

Created lines/pixel region.

RowStepsRowStepsRowStepsrowStepsrow_steps (input_control)  extent.y HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Step width in line direction or zero.

Default: 10

Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100

Value range: RowSteps RowSteps RowSteps rowSteps row_steps (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: RowSteps > 1 || RowSteps == 0

ColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps (input_control)  extent.x HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Step width in column direction or zero.

Default: 10

Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100

Value range: ColumnSteps ColumnSteps ColumnSteps columnSteps column_steps (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: ColumnSteps > 1 || ColumnSteps == 0

TypeTypeTypetypetype (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of created pattern.

Default: 'lines' "lines" "lines" "lines" "lines"

List of values: 'lines'"lines""lines""lines""lines", 'points'"points""points""points""points"

WidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum width of pattern.

Default: 512

Suggested values: 128, 256, 512, 1024

Value range: 1 ≤ Width Width Width width width (lin)

Minimum increment: 1

Recommended increment: 10

HeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum height of pattern.

Default: 512

Suggested values: 128, 256, 512, 1024

Value range: 1 ≤ Height Height Height height height (lin)

Minimum increment: 1

Recommended increment: 10

Example (HDevelop)

read_image(Image,'fabrik')
gen_grid_region(Raster,10,10,'lines',512,512)
reduce_domain(Image,Raster,Mask)
sobel_amp(Mask,GridSobel,'sum_abs',3)
dev_display(GridSobel)

Example (C)

read_image(&Image,"fabrik");
gen_grid_region(&Raster,10,10,"lines",512,512);
reduce_domain(Image,Raster,&Mask);
sobel_amp(Mask,GridSobel,"sum_abs",3);
T_disp_image(GridSobel,WindowHandle);

Example (HDevelop)

read_image(Image,'fabrik')
gen_grid_region(Raster,10,10,'lines',512,512)
reduce_domain(Image,Raster,Mask)
sobel_amp(Mask,GridSobel,'sum_abs',3)
dev_display(GridSobel)

Example (HDevelop)

read_image(Image,'fabrik')
gen_grid_region(Raster,10,10,'lines',512,512)
reduce_domain(Image,Raster,Mask)
sobel_amp(Mask,GridSobel,'sum_abs',3)
dev_display(GridSobel)

Complexity

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

O((ImageWidth / ColumnSteps) * (ImageHeight / RowSteps))

Result

If the parameter values are correct the operator gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region 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'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">).

Possible Successors

reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain, paint_regionpaint_regionPaintRegionPaintRegionpaint_region

Alternatives

gen_region_linegen_region_lineGenRegionLineGenRegionLinegen_region_line, gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygongen_region_polygon, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsgen_region_runs

See also

gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegiongen_checker_region, reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain

Module

Foundation