gen_circlegen_circleGenCircleGenCirclegen_circle (Operator)

Name

gen_circlegen_circleGenCircleGenCirclegen_circle — Create a circle.

Signature

gen_circle( : Circle : Row, Column, Radius : )

Herror gen_circle(Hobject* Circle, double Row, double Column, double Radius)

Herror T_gen_circle(Hobject* Circle, const Htuple Row, const Htuple Column, const Htuple Radius)

void GenCircle(HObject* Circle, const HTuple& Row, const HTuple& Column, const HTuple& Radius)

void HRegion::HRegion(const HTuple& Row, const HTuple& Column, const HTuple& Radius)

void HRegion::HRegion(double Row, double Column, double Radius)

void HRegion::GenCircle(const HTuple& Row, const HTuple& Column, const HTuple& Radius)

void HRegion::GenCircle(double Row, double Column, double Radius)

static void HOperatorSet.GenCircle(out HObject circle, HTuple row, HTuple column, HTuple radius)

public HRegion(HTuple row, HTuple column, HTuple radius)

public HRegion(double row, double column, double radius)

void HRegion.GenCircle(HTuple row, HTuple column, HTuple radius)

void HRegion.GenCircle(double row, double column, double radius)

def gen_circle(row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], radius: MaybeSequence[Union[int, float]]) -> HObject

Description

The operator gen_circlegen_circleGenCircleGenCirclegen_circle generates one or more circles described by the center and RadiusRadiusRadiusradiusradius. If several circles shall be generated the coordinates must be passed in the form of tuples.

gen_circlegen_circleGenCircleGenCirclegen_circle only creates symmetric circles. To achieve this, the radius is internally rounded down to a multiple of 0.5. If an integer number is specified for the radius (i.e., 1, 2, 3, ...) an even diameter is obtained, and hence the circle can only be symmetric with respect to a center with coordinates that have a fractional part of 0.5. Consequently, internally the coordinates of the center are adapted to the closest coordinates that have a fractional part of 0.5. Here, integer coordinates are rounded down to the next smaller values with a fractional part of 0.5. For odd diameters (i.e., radius = 1.5, 2.5, 3.5, ...), the circle can only be symmetric with respect to a center with integer coordinates. Hence, internally the coordinates of the center are rounded to the nearest integer coordinates. It should be noted that the above algorithm may lead to the fact that circles with an even diameter are not contained in circles with the next larger odd diameter, even if the coordinates specified in RowRowRowrowrow and ColumnColumnColumncolumncolumn are identical.

If the circle extends beyond the image edge it is clipped to the current image format if the value of the system flag 'clip_region'"clip_region""clip_region""clip_region""clip_region" is set to 'true'"true""true""true""true" (set_systemset_systemSetSystemSetSystemset_system).

Parameter Broadcasting

This operator supports parameter broadcasting. This means that each parameter can be given as a tuple of length 1 or 'N'"N""N""N""N". Parameters with tuple length 1 will be repeated internally such that the number of created items is always 'N'"N""N""N""N".

Attention

For speed reasons, the resulting region may contain additional pixels at the border and some individual pixels at the border may be missing. This may lead to an inconsistency between the operators smallest_circlesmallest_circleSmallestCircleSmallestCirclesmallest_circle and gen_circlegen_circleGenCircleGenCirclegen_circle.

Execution Information

Parameters

CircleCircleCirclecirclecircle (output_object)  region(-array) objectHRegionHObjectHObjectHobject *

Generated circle.

RowRowRowrowrow (input_control)  circle.center.y(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Line index of center.

Default: 200.0

Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0

Value range: 1.0 ≤ Row Row Row row row ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

ColumnColumnColumncolumncolumn (input_control)  circle.center.x(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column index of center.

Default: 200.0

Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0

Value range: 1.0 ≤ Column Column Column column column ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

RadiusRadiusRadiusradiusradius (input_control)  circle.radius(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Radius of circle.

Default: 100.5

Suggested values: 1.0, 1.5, 2.0, 2.5, 3, 3.5, 4, 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 15.5, 20.5, 25.5, 31.5, 50.5

Value range: Radius Radius Radius radius radius (lin)

Restriction: Radius > 0.0

Example (HDevelop)

read_image(Image,'fabrik')
gen_circle(Circle,300.0,200.0,150.5)
reduce_domain(Image,Circle,Mask)
dev_clear_window ()
dev_display (Mask)

Complexity

Runtime complexity: O(RadiusRadiusRadiusradiusradius * 2)

Storage complexity (byte): O(RadiusRadiusRadiusradiusradius * 8)

Result

If the parameter values are correct, the operator gen_circlegen_circleGenCircleGenCirclegen_circle 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">). If an empty region is created by clipping (the circle is completely outside of the image format) the operator set_system('store_empty_region',<'true'/'false'>)set_system("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)set_system("store_empty_region",<"true"/"false">) determines whether the empty region is put out.

Possible Successors

paint_regionpaint_regionPaintRegionPaintRegionpaint_region, reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain

Alternatives

gen_ellipsegen_ellipseGenEllipseGenEllipsegen_ellipse, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsgen_region_runs, draw_circledraw_circleDrawCircleDrawCircledraw_circle

See also

disp_circledisp_circleDispCircleDispCircledisp_circle, set_shapeset_shapeSetShapeSetShapeset_shape, smallest_circlesmallest_circleSmallestCircleSmallestCirclesmallest_circle, reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain

Module

Foundation