Skip to content

gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2gen_rectangle2🔗

Short description🔗

gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2gen_rectangle2 — Create a rectangle of any orientation.

Signature🔗

gen_rectangle2( out region Rectangle, rectangle2.center.y Row, rectangle2.center.x Column, rectangle2.angle.rad Phi, rectangle2.hwidth Length1, rectangle2.hheight Length2 )void GenRectangle2( HObject* Rectangle, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2 )static void HOperatorSet.GenRectangle2( out HObject rectangle, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2 )def gen_rectangle2( row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], length_1: MaybeSequence[Union[int, float]], length_2: MaybeSequence[Union[int, float]] ) -> HObject

Herror gen_rectangle2( Hobject* Rectangle, double Row, double Column, double Phi, double Length1, double Length2 )

Herror T_gen_rectangle2( Hobject* Rectangle, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Length1, const Htuple Length2 )

void HRegion::GenRectangle2( const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2 )

void HRegion::GenRectangle2( double Row, double Column, double Phi, double Length1, double Length2 )

void HRegion.GenRectangle2( HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2 )

void HRegion.GenRectangle2( double row, double column, double phi, double length1, double length2 )

Description🔗

The operator gen_rectangle2GenRectangle2 generates one or more rectangles with the center (Rowrowrow, Columncolumncolumn) , the orientation Phiphiphi and the half edge lengths Length1length1length_1 and Length2length2length_2. The orientation is given in arc measure and indicates the angle between the horizontal axis and the edge (with Length1length1length_1) (mathematically positive). 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. More than one region can be created by passing one tuple of corner points.

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.

Attention🔗

The gray values of the output objects are undefined. 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_rectangle2SmallestRectangle2 and gen_rectangle2GenRectangle2.

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🔗

Rectanglerectanglerectangle (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Created rectangle.

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

Line index of the center.

Default: 300.0300.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.010.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Value range: Row (lin)
Minimum increment: 1.0
Recommended increment: 10.0

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

Column index of the center.

Default: 200.0200.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.010.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Value range: Column (lin)
Minimum increment: 1.0
Recommended increment: 10.0

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

Angle of the first edge to the horizontal (in radians).

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)
Restriction: -pi / 2 < Phi && Phi <= pi / 2

Length1length1length_1 (input_control) rectangle2.hwidth(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Half width.

Default: 100.0100.0
Suggested values: 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0, 300.0, 500.03.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0, 300.0, 500.0
Value range: Length1 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Length2length2length_2 (input_control) rectangle2.hheight(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Half height.

Default: 20.020.0
Suggested values: 1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.01.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0
Value range: Length2 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Result🔗

If the parameter values are correct the operator gen_rectangle2GenRectangle2 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_rectangle1GenRectangle1, gen_region_polygon_filledGenRegionPolygonFilled, gen_region_polygonGenRegionPolygon, gen_region_pointsGenRegionPoints, fill_upFillUp

See also

draw_rectangle2DrawRectangle2, reduce_domainReduceDomain, smallest_rectangle2SmallestRectangle2, gen_ellipseGenEllipse

Module🔗

Foundation