ClassesClassesClassesClasses | | | | Operators

gen_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse (Operator)

Name

gen_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse — Create an ellipse.

Signature

gen_ellipse( : Ellipse : Row, Column, Phi, Radius1, Radius2 : )

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)

Herror gen_ellipse(Hobject* Ellipse, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2)

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

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

void GenEllipse(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 HOperatorSetX.GenEllipse(
[out] IHUntypedObjectX*Ellipse, [in] VARIANT Row, [in] VARIANT Column, [in] VARIANT Phi, [in] VARIANT Radius1, [in] VARIANT Radius2)

void HRegionX.GenEllipse(
[in] VARIANT Row, [in] VARIANT Column, [in] VARIANT Phi, [in] VARIANT Radius1, [in] VARIANT Radius2)

static void HOperatorSet.GenEllipse(out HObject ellipse, HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple 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_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse generates one or more ellipses with the center (RowRowRowRowRowrow, ColumnColumnColumnColumnColumncolumn), the orientation PhiPhiPhiPhiPhiphi and the half-radii Radius1Radius1Radius1Radius1Radius1radius1 and Radius2Radius2Radius2Radius2Radius2radius2. 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_systemget_systemGetSystemget_systemGetSystemGetSystem and reset_obj_dbreset_obj_dbResetObjDbreset_obj_dbResetObjDbResetObjDb 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' (set_systemset_systemSetSystemset_systemSetSystemSetSystem).

Parallelization

Parameters

EllipseEllipseEllipseEllipseEllipseellipse (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Created ellipse(s).

RowRowRowRowRowrow (input_control)  ellipse.center.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Line index of center.

Default value: 200.0

Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0

Typical range of values: 1.0 ≤ Row Row Row Row Row row ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

ColumnColumnColumnColumnColumncolumn (input_control)  ellipse.center.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column index of center.

Default value: 200.0

Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0

Typical range of values: 1.0 ≤ Column Column Column Column Column column ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

PhiPhiPhiPhiPhiphi (input_control)  ellipse.angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Orientation of the longer radius (Radius1).

Default value: 0.0

Suggested values: -1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097

Typical range of values: -1.178097 ≤ Phi Phi Phi Phi Phi phi ≤ 1.178097 (lin)

Radius1Radius1Radius1Radius1Radius1radius1 (input_control)  ellipse.radius1(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Longer radius.

Default value: 100.0

Suggested values: 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0

Typical range of values: 1.0 ≤ Radius1 Radius1 Radius1 Radius1 Radius1 radius1 ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: Radius1 > 0

Radius2Radius2Radius2Radius2Radius2radius2 (input_control)  ellipse.radius2(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Shorter radius.

Default value: 60.0

Suggested values: 1.0, 2.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0

Typical range of values: 1.0 ≤ Radius2 Radius2 Radius2 Radius2 Radius2 radius2 ≤ 1024.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: Radius2 > 0 && Radius2 <= Radius1

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)

Example (C)

open_window(0,0,-1,-1,"root","visible","",&WindowHandle);
set_insert(WindowHandle,"xor");
do {
  get_mbutton(WindowHandle,&Row,&Column,&Button);
  gen_ellipse(&Ellipse,(double)Row,(double)Column,Column / 300.0,
         (Row % 100)+1.0,(Column % 50) + 1.0);
  disp_region(Ellipse,WindowHandle);
  clear_obj(Ellipse);
} while(Button != 1);

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)

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)

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)

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(Radius1Radius1Radius1Radius1Radius1radius1 * 2)

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

Result

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

Possible Successors

paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion, reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain

Alternatives

gen_circlegen_circleGenCirclegen_circleGenCircleGenCircle, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled, draw_ellipsedraw_ellipseDrawEllipsedraw_ellipseDrawEllipseDrawEllipse

See also

disp_ellipsedisp_ellipseDispEllipsedisp_ellipseDispEllipseDispEllipse, set_shapeset_shapeSetShapeset_shapeSetShapeSetShape, smallest_circlesmallest_circleSmallestCirclesmallest_circleSmallestCircleSmallestCircle, reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain

Module

Foundation


ClassesClassesClassesClasses | | | | Operators