Skip to content

set_partSetPartSetPartset_partT_set_partπŸ”—

Short descriptionπŸ”—

set_partSetPartSetPartset_partT_set_part β€” Modify the displayed image part.

SignatureπŸ”—

set_part( window WindowHandle, rectangle.origin.y Row1, rectangle.origin.x Column1, rectangle.corner.y Row2, rectangle.corner.x Column2 )void SetPart( const HTuple& WindowHandle, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 )static void HOperatorSet.SetPart( HTuple windowHandle, HTuple row1, HTuple column1, HTuple row2, HTuple column2 )def set_part( window_handle: HHandle, row_1: Union[int, float], column_1: Union[int, float], row_2: Union[int, float], column_2: Union[int, float] ) -> None

Herror T_set_part( const Htuple WindowHandle, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2 )

void HWindow::SetPart( const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 ) const

void HWindow::SetPart( Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2 ) const

void HWindow.SetPart( HTuple row1, HTuple column1, HTuple row2, HTuple column2 )

void HWindow.SetPart( int row1, int column1, int row2, int column2 )

DescriptionπŸ”—

set_partSetPart modifies the image part that is displayed in the window. (Row1row1row_1,Column1column1column_1) denotes the upper left corner and (Row2row2row_2,Column2column2column_2) the lower right corner of the image part to display. The changed values are used by gray value output operators (disp_imageDispImage, disp_colorDispColor) as well as region output operators (disp_regionDispRegion).

If only part of an image is displayed, it will be zoomed to full window size. The zooming interpolation method can be set with set_part_styleSetPartStyle. get_partGetPart returns the values of the image part to display. Adapting the size of the window to the size of the image part to be displayed will prevent slowing down the display due to necessary interpolations. Thus, the window preferably has the same size as the image part to be displayed, or otherwise half its size, quarter its size, etc.

Beside setting the image part directly, the following special modes are supported:

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πŸ”—

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

Row1row1row_1 (input_control) rectangle.origin.y β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[int, float]Htuple (Hlong / double)

Row of the upper left corner of the chosen image part.

Default: 00

Column1column1column_1 (input_control) rectangle.origin.x β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[int, float]Htuple (Hlong / double)

Column of the upper left corner of the chosen image part.

Default: 00

Row2row2row_2 (input_control) rectangle.corner.y β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[int, float]Htuple (Hlong / double)

Row of the lower right corner of the chosen image part.

Default: -1-1
Restriction: Row2 >= Row1 || Row2 == -1 || (Row1 == 0 && Row2 == -2)

Column2column2column_2 (input_control) rectangle.corner.x β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[int, float]Htuple (Hlong / double)

Column of the lower right corner of the chosen image part.

Default: -1-1
Restriction: Column2 >= Column1 || Column2 == -1 || (Column1 == 0 && Column2 == -2)

ExampleπŸ”—

(HDevelop)

get_system('width',Width)
get_system('height',Height)
set_part(WindowHandle,0,0,Height-1,Width-1)
disp_image(Image,WindowHandle)
draw_rectangle1(WindowHandle,Row1,Column1,Row2,Column2)
set_part(WindowHandle,Row1,Column1,Row2,Column2)
disp_image(Image,WindowHandle)
(C)
get_system("width",width)\;
get_system("height",height)\;
create_tuple_i(&twidth, width-1)\;
create_tuple_i(&theight, height-1)\;
create_tuple_i(&zero, 0)\;
T_set_part(WindowHandle,zero,zero,theight,twidth)\;
destroy_tuple(twidth)\; destroy_tuple(theight)\; destroy_tuple(zero)\;
T_disp_image(Image,WindowHandle)\;
T_draw_rectangle1(WindowHandle,&Row1,&Col1,&Row2,&Col2)\;
T_set_part(WindowHandle,Row1,Col1,Row2,Col2)\;
T_disp_image(Image,WindowHandle)\;
destroy_tuple(Row1)\; destroy_tuple(Col1)\;
destroy_tuple(Row2)\; destroy_tuple(Col2)\;

ResultπŸ”—

set_partSetPart returns 2 (H_MSG_TRUE) if the window is valid. Otherwise an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

get_partGetPart

Possible successors

set_part_styleSetPartStyle, disp_imageDispImage, disp_regionDispRegion

Alternatives

affine_trans_imageAffineTransImage

See also

get_partGetPart, set_part_styleSetPartStyle, disp_regionDispRegion, disp_imageDispImage, disp_colorDispColor

ModuleπŸ”—

Foundation