Operator Reference

set_shapeT_set_shapeSetShapeSetShapeset_shape (Operator)

set_shapeT_set_shapeSetShapeSetShapeset_shape — Define the region output shape.

Signature

set_shape( : : WindowHandle, Shape : )

Herror T_set_shape(const Htuple WindowHandle, const Htuple Shape)

void SetShape(const HTuple& WindowHandle, const HTuple& Shape)

void HWindow::SetShape(const HString& Shape) const

void HWindow::SetShape(const char* Shape) const

void HWindow::SetShape(const wchar_t* Shape) const   ( Windows only)

static void HOperatorSet.SetShape(HTuple windowHandle, HTuple shape)

void HWindow.SetShape(string shape)

def set_shape(window_handle: HHandle, shape: str) -> None

Description

set_shapeset_shapeSetShapeSetShapeset_shape defines the shape for region output. It is only valid for the window with the logical window number WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle. The output shape is used by disp_regiondisp_regionDispRegionDispRegiondisp_region. The available shapes can be queried with query_shapequery_shapeQueryShapeQueryShapequery_shape.

Available modes:

'original'"original""original""original""original":

The shape is displayed unchanged. Nevertheless modifications via parameters like set_line_widthset_line_widthSetLineWidthSetLineWidthset_line_width can take place. This is also true for all other modes.

'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle":

Each region is displayed by the smallest surrounding circle. (See smallest_circlesmallest_circleSmallestCircleSmallestCirclesmallest_circle.)

'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle":

Each region is displayed by the largest included circle. (See inner_circleinner_circleInnerCircleInnerCircleinner_circle.)

'ellipse'"ellipse""ellipse""ellipse""ellipse":

Each region is displayed by an ellipse with the same moments and orientation (See elliptic_axiselliptic_axisEllipticAxisEllipticAxiselliptic_axis.)

'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1":

Each region is displayed by the smallest surrounding rectangle parallel to the coordinate axes. (See smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1.)

'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2":

Each region is displayed by the smallest surrounding rectangle. (See smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2.)

'convex'"convex""convex""convex""convex":

Each region is displayed by its convex hull (See convexityconvexityConvexityConvexityconvexity.)

'icon'"icon""icon""icon""icon":

Each region is displayed by the icon set with set_iconset_iconSetIconSetIconset_icon in the center of gravity.

Attention

Caution is advised for gray value output operators with output parameter settings that use region output.

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

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

ShapeShapeShapeshapeshape (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Region output mode.

Default: 'original' "original" "original" "original" "original"

List of values: 'convex'"convex""convex""convex""convex", 'ellipse'"ellipse""ellipse""ellipse""ellipse", 'icon'"icon""icon""icon""icon", 'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle", 'original'"original""original""original""original", 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2"

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Result

set_shapeset_shapeSetShapeSetShapeset_shape returns 2 ( H_MSG_TRUE) if the parameter is correct and the window is valid. Otherwise an exception is raised.

Possible Predecessors

set_iconset_iconSetIconSetIconset_icon, query_shapequery_shapeQueryShapeQueryShapequery_shape, get_shapeget_shapeGetShapeGetShapeget_shape

Possible Successors

disp_regiondisp_regionDispRegionDispRegiondisp_region

See also

get_shapeget_shapeGetShapeGetShapeget_shape, query_shapequery_shapeQueryShapeQueryShapequery_shape, disp_regiondisp_regionDispRegionDispRegiondisp_region

Module

Foundation