ClassesClasses | | Operators

set_shapeset_shapeSetShapeSetShape (Operator)

Name

set_shapeset_shapeSetShapeSetShape — Define the region output shape.

Signature

set_shape( : : WindowHandle, Shape : )

Herror set_shape(const Hlong WindowHandle, const char* 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

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

void HWindow.SetShape(string shape)

Description

set_shapeset_shapeSetShapeSetShapeSetShape defines the shape for region output. It is only valid for the window with the logical window number WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. The output shape is used by disp_regiondisp_regionDispRegionDispRegionDispRegion. The available shapes can be queried with query_shapequery_shapeQueryShapeQueryShapeQueryShape.

Available modes:

'original':

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

'outer_circle':

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

'inner_circle':

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

'ellipse':

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

'rectangle1':

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

'rectangle2':

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

'convex':

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

'icon'

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

Attention

Caution is advised for gray value output operators with output parameter settings that use region output, e.g. disp_imagedisp_imageDispImageDispImageDispImage with set_paint(::WindowHandle,'histogram':)set_paint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram") and set_shape(::WindowHandle,'convex':)set_shape(WindowHandle,"convex")SetShape(WindowHandle,"convex")SetShape(WindowHandle,"convex")SetShape(WindowHandle,"convex"). In that case the convex hull of the gray value histogram is displayed.

Execution Information

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Window handle.

ShapeShapeShapeShapeshape (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Region output mode.

Default value: '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)

Example (C)

read_image(&Image,"fabrik");
regiongrowing(Image,&Seg,5,5,6.0,100);
set_colored(WindowHandle,12);
set_shape(WindowHandle,"rectangle2");
disp_region(Seg,WindowHandle);

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)

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)

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_shapeSetShapeSetShapeSetShape returns 2 (H_MSG_TRUE) if the parameter is correct and the window is valid. Otherwise an exception is raised.

Possible Predecessors

set_iconset_iconSetIconSetIconSetIcon, query_shapequery_shapeQueryShapeQueryShapeQueryShape, get_shapeget_shapeGetShapeGetShapeGetShape

Possible Successors

disp_regiondisp_regionDispRegionDispRegionDispRegion

See also

get_shapeget_shapeGetShapeGetShapeGetShape, query_shapequery_shapeQueryShapeQueryShapeQueryShape, disp_regiondisp_regionDispRegionDispRegionDispRegion

Module

Foundation


ClassesClasses | | Operators