Skip to content

gen_ellipseGenEllipseGenEllipsegen_ellipsegen_ellipseπŸ”—

Short descriptionπŸ”—

gen_ellipseGenEllipseGenEllipsegen_ellipsegen_ellipse β€” Create an ellipse.

SignatureπŸ”—

gen_ellipse( out region Ellipse, ellipse.center.y Row, ellipse.center.x Column, ellipse.angle.rad Phi, ellipse.radius1 Radius1, ellipse.radius2 Radius2 )void GenEllipse( HObject* Ellipse, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2 )static void HOperatorSet.GenEllipse( out HObject ellipse, HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple radius2 )def gen_ellipse( row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], radius_1: MaybeSequence[Union[int, float]], radius_2: MaybeSequence[Union[int, float]] ) -> HObject

Herror gen_ellipse( Hobject* Ellipse, double Row, double Column, double Phi, double Radius1, double Radius2 )

Herror T_gen_ellipse( Hobject* Ellipse, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Radius1, const Htuple Radius2 )

void HRegion::GenEllipse( const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2 )

void HRegion::GenEllipse( double Row, double Column, double Phi, double Radius1, double Radius2 )

void HRegion.GenEllipse( HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple radius2 )

void HRegion.GenEllipse( double row, double column, double phi, double radius1, double radius2 )

DescriptionπŸ”—

The operator gen_ellipseGenEllipse generates one or more ellipses with the center (Rowrowrow, Columncolumncolumn), the orientation Phiphiphi and the half-radii (half axes) Radius1radius1radius_1 and Radius2radius2radius_2. The angle is indicated in arc measure according toΒ the \(x\) axis in mathematically positive direction. More than one region can be created by passing tuples of parameter values.

The center must be located within the image coordinates. The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See get_systemGetSystem and reset_obj_dbResetObjDb in this context. If the ellipse reaches beyond the edge of the image it is clipped to the current image format according to the value of the system flag 'clip_region'"clip_region" (set_systemSetSystem).

Parameter BroadcastingπŸ”—

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

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

Ellipseellipseellipse (output_object) region(-array) β†’ objectHObjectHRegionHObjectHobject *

Created ellipse(s).

Rowrowrow (input_control) ellipse.center.y(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Line index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.00.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Row (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Columncolumncolumn (input_control) ellipse.center.x(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Column index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.00.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Column (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Phiphiphi (input_control) ellipse.angle.rad(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Orientation of the longer radius (Radius1).

Default: 0.00.0
Suggested values: -1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097-1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097
Value range: Phi (lin)

Radius1radius1radius_1 (input_control) ellipse.radius1(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Longer radius.

Default: 100.0100.0
Suggested values: 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.02.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Radius1 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius1 > 0

Radius2radius2radius_2 (input_control) ellipse.radius2(-array) β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Shorter radius.

Default: 60.060.0
Suggested values: 1.0, 2.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.01.0, 2.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Radius2 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius2 > 0

ExampleπŸ”—

(HDevelop)


read_image (Image, 'fabrik')
gen_ellipse (Ellipse, 200, 200, rad(10), 160, 90)
reduce_domain (Image, Ellipse, ImageReduced)
dev_clear_window ()
dev_display (ImageReduced)

ComplexityπŸ”—

Runtime complexity: \(O(\textrm{Radius1} * 2)\)

Storage complexity (byte): \(O(\textrm{Radius1} * 8)\)

ResultπŸ”—

If the parameter values are correct, the operator gen_ellipseGenEllipse 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

paint_regionPaintRegion, reduce_domainReduceDomain

Alternatives

gen_circleGenCircle, gen_region_polygon_filledGenRegionPolygonFilled, draw_ellipseDrawEllipse

See also

disp_ellipseDispEllipse, set_shapeSetShape, smallest_circleSmallestCircle, reduce_domainReduceDomain

ModuleπŸ”—

Foundation