set_rgbT_set_rgbSetRgbSetRgbset_rgb (算子)

名称

set_rgbT_set_rgbSetRgbSetRgbset_rgb — 通过 RGB 值设置颜色定义。

签名

set_rgb( : : WindowHandle, Red, Green, Blue : )

Herror T_set_rgb(const Htuple WindowHandle, const Htuple Red, const Htuple Green, const Htuple Blue)

void SetRgb(const HTuple& WindowHandle, const HTuple& Red, const HTuple& Green, const HTuple& Blue)

void HWindow::SetRgb(const HTuple& Red, const HTuple& Green, const HTuple& Blue) const

void HWindow::SetRgb(Hlong Red, Hlong Green, Hlong Blue) const

static void HOperatorSet.SetRgb(HTuple windowHandle, HTuple red, HTuple green, HTuple blue)

void HWindow.SetRgb(HTuple red, HTuple green, HTuple blue)

void HWindow.SetRgb(int red, int green, int blue)

def set_rgb(window_handle: HHandle, red: MaybeSequence[int], green: MaybeSequence[int], blue: MaybeSequence[int]) -> None

描述

set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb sets the output color(s) or the gray values, respectively, for region output for the window. The colors are defined with the red, green and blue components. If only one combination is passed, all output takes place in that color. If a tuple is passed, region output and output of geometric objects takes place modulo the passed colors.

For every call of an output operator, output is started with the first color. If only one object is displayed per call, it will always be displayed in the first color. This is even true for objects with multiple connection components. If multiple objects are displayed per operator call, multiple colors are used. The defined colors are used until set_colorset_colorSetColorSetColorSetColorset_color, set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb or set_grayset_graySetGraySetGraySetGrayset_gray is called again. The values are used by operators like disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, disp_linedisp_lineDispLineDispLineDispLinedisp_line, disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1DispRectangle1disp_rectangle1, disp_rectangle2disp_rectangle2DispRectangle2DispRectangle2DispRectangle2disp_rectangle2, disp_arrowdisp_arrowDispArrowDispArrowDispArrowdisp_arrow, etc.

注意

If a passed color is not available, an exception is raised. If set_check(::'~color':)set_check("~color")SetCheck("~color")SetCheck("~color")SetCheck("~color")set_check("~color") was called before, HALCON uses a similar color and suppresses the error.

执行信息

参数

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (输入控制)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

窗口句柄。

RedRedRedRedredred (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Red component of the color.

默认值: 255

值范围: 0 ≤ Red Red Red Red red red ≤ 255

GreenGreenGreenGreengreengreen (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Green component of the color.

默认值: 0

值范围: 0 ≤ Green Green Green Green green green ≤ 255

BlueBlueBlueBlueblueblue (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Blue component of the color.

默认值: 0

值范围: 0 ≤ Blue Blue Blue Blue blue blue ≤ 255

结果

set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb 返回 2 ( H_MSG_TRUE ) 表示窗口有效且所有传递的颜色均可用且可显示。否则将抛出异常。

可能的后继

disp_imagedisp_imageDispImageDispImageDispImagedisp_image, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region

替代

set_hsiset_hsiSetHsiSetHsiSetHsiset_hsi, set_colorset_colorSetColorSetColorSetColorset_color, set_grayset_graySetGraySetGraySetGrayset_gray

另见

disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region

模块

基础