Herror ::gen_rectangle2 (
    Hobject *Rectangle,
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Phi,
    const HTuple &Length1,
    const HTuple &Length2
)
HRegion HRegion::GenRectangle2 (
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Phi,
    const HTuple &Length1,
    const HTuple &Length2
)
HRegionArray HRegionArray::GenRectangle2 (
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Phi,
    const HTuple &Length1,
    const HTuple &Length2
)

Create a rectangle of any orientation.

The operator ::gen_rectangle2 generates one or more rectangles with the center (Row, Column) , the orientation Phi and the half edge lengths Length1 and Length2. The orientation is given in arc measure and indicates the angle between the horizontal axis and Length1 (mathematically positive). The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See ::get_system and ::reset_obj_db in this context. More than one region can be created by passing one tuple of corner points.


Attention

The gray values of the output objects are undefined.


Parameters

Rectangle (output_object)
region(-array) -> Hobject * : HRegion(Array)
Created rectangle.

Row (input_control)
rectangle2.center.y(-array) -> HTuple.double / long
Line index of the center.
Default value: 50.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 <= Row <= 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Column (input_control)
rectangle2.center.x(-array) -> HTuple.double / long
Column index of the center.
Default value: 100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 <= Column <= 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Phi (input_control)
rectangle2.angle.rad(-array) -> HTuple.double / long
Angle of longitudinal axis to horizontal (arc measure).
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 <= 1.178097 (lin)
Minimum increment: 0.001
Recommended increment: 0.1
Restriction: ((- pi / 2) < Phi) && (Phi <= (pi / 2))

Length1 (input_control)
rectangle2.hwidth(-array) -> HTuple.double / long
Half width.
Default value: 200.0
Suggested values: 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0, 300.0, 500.0
Typical range of values: 0.0 <= Length1 <= 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Length2 (input_control)
rectangle2.hheight(-array) -> HTuple.double / long
Half height.
Default value: 100.0
Suggested values: 1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0
Typical range of values: 0.0 <= Length2 <= 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Length2 <= Length1


Result

If the parameter values are correct the operator ::gen_rectangle2 returns the value H_MSG_TRUE. Otherwise an exception handling is raised. The clipping according to the current image format is set via the operator ::set_system('clip_region',<'true'/'false'>).


Possible Successors

::paint_region, ::reduce_domain


Alternatives

::gen_rectangle1, ::gen_region_polygon_filled, ::gen_region_polygon, ::gen_region_points, ::fill_up


See also

::draw_rectangle2, ::reduce_domain, ::smallest_rectangle2, ::gen_ellipse


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH