Skip to content

gen_grid_regionGenGridRegionGenGridRegiongen_grid_regiongen_grid_regionπŸ”—

Short descriptionπŸ”—

gen_grid_regionGenGridRegionGenGridRegiongen_grid_regiongen_grid_region β€” Create a region from lines or pixels.

SignatureπŸ”—

gen_grid_region( out region RegionGrid, extent.y RowSteps, extent.x ColumnSteps, string Type, extent.x Width, extent.y Height )void GenGridRegion( HObject* RegionGrid, const HTuple& RowSteps, const HTuple& ColumnSteps, const HTuple& Type, const HTuple& Width, const HTuple& Height )static void HOperatorSet.GenGridRegion( out HObject regionGrid, HTuple rowSteps, HTuple columnSteps, HTuple type, HTuple width, HTuple height )def gen_grid_region( row_steps: Union[float, int], column_steps: Union[float, int], type: str, width: int, height: int ) -> HObject

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

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 )

DescriptionπŸ”—

The operator gen_grid_regionGenGridRegion creates a grid constructed of lines (Typetypetype = β€˜lines’) or pixels (Typetypetype = β€˜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 (Heightheightheight-1,Widthwidthwidth-1) the grid is built up at stepping width RowStepsrowStepsrow_steps in row direction and ColumnStepscolumnStepscolumn_steps in column direction. The step widths have to be greater than 11. Exceptions are in β€˜lines’ mode RowStepsrowStepsrow_steps, where RowStepsrowStepsrow_steps or ColumnStepscolumnStepscolumn_steps can be set equal to 00. In such a case, only columns, rows respectively, are created.

AttentionπŸ”—

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

In the β€˜points’ mode RowStepsrowStepsrow_steps and ColumnStepscolumnStepscolumn_steps must not be set to zero.

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πŸ”—

RegionGridregionGridregion_grid (output_object) region β†’ objectHObjectHRegionHObjectHobject *

Created lines/pixel region.

RowStepsrowStepsrow_steps (input_control) extent.y β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[float, int]Htuple (Hlong / double)

Step width in line direction or zero.

Default: 1010
Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 1000, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
Value range: RowSteps (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: RowSteps > 1 || RowSteps == 0

ColumnStepscolumnStepscolumn_steps (input_control) extent.x β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[float, int]Htuple (Hlong / double)

Step width in column direction or zero.

Default: 1010
Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 1000, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
Value range: ColumnSteps (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: ColumnSteps > 1 || ColumnSteps == 0

Typetypetype (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of created pattern.

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

Widthwidthwidth (input_control) extent.x β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum width of pattern.

Default: 512512
Suggested values: 128, 256, 512, 1024128, 256, 512, 1024
Value range: 1 ≀ Width (lin)
Minimum increment: 1
Recommended increment: 10

Heightheightheight (input_control) extent.y β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum height of pattern.

Default: 512512
Suggested values: 128, 256, 512, 1024128, 256, 512, 1024
Value range: 1 ≀ 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)
(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)\;

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_regionGenGridRegion 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'>).

Combinations with other operatorsπŸ”—

Combinations

Possible successors

reduce_domainReduceDomain, paint_regionPaintRegion

Alternatives

gen_region_lineGenRegionLine, gen_region_polygonGenRegionPolygon, gen_region_pointsGenRegionPoints, gen_region_runsGenRegionRuns

See also

gen_checker_regionGenCheckerRegion, reduce_domainReduceDomain

ModuleπŸ”—

Foundation