Define grayvalues for region output.
::set_gray defines the grayvalues for region output. Grayvalues are defined as the range of the color lookup table that is used for grayvalue output with ::disp_image in conjunction with ::set_paint(WindowHandle,'gray'). These entries can be modified by ::set_lut. So a 'grayvalue' is the color in which a pixel with the same value is displayed (not necessarily really gray). In general, when changing the color lookup table with ::set_lut, the colors of the displayed image will change too.
If a grayvalue is needed as a color for image output (i.e. no color changes with ::set_lut are possible), it can be set with ::set_color(WindowHandle,'gray').
If only a single grayvalue is passed, all output will take place in that grayvalue. If a tuple of grayvalues is passed, all output will take place in grayvalues modulo the number of tuple elements. In the example below, the first circle is displayed with grayvalue 100, the second with 200 and the third with 100 again. Every output procedure starts with the first grayvalue. Note, that the number of output grayvalues depends on the number of objects that are displayed in one procedure call. If only single objects are displayed, they always appear in the first grayvalue, even if the consist of more than one connected components.
When the procedures ::set_gray, ::set_color, ::set_rgb, ::set_hsi are called, the overwrite the existing values. If not all grayvalues are displayable on the output device, the number range of GrayValues (0..255) is dithered to the range of displayable grayvalues. In any case 0 is displayed as black and 255 as white. The displayable grayvalues can be queried with the procedure ::query_gray. Furthermore, the number of actually displayed grayvalues can be changed with ::set_system('num_gray_*',...). This must be done before opening the first window. With set_check(::'~color':) error messages can be suppressed if a grayvalue can't be displayed on the screen. In that case, a similar grayvalue is displayed.
|
WindowHandle (input_control) |
window -> HTuple.long |
| Window_id. | |
|
GrayValues (input_control) |
integer(-array) -> HTuple.long |
| Grayvalues for region output. | |
| Default value: 255 | |
| Suggested values: 0, 1, 2, 10, 16, 32, 64, 100, 120, 128, 250, 251, 252, 253, 254, 255 | |
| Typical range of values: 0 <= GrayValues <= 255 | |
Htuple GrayValues ; create_tuple(&GrayValues,2) ; set_i(GrayValues,100,0) ; set_i(GrayValues,200,0) ; T_set_gray(WindowHandle,GrayValues) ; disp_circle(WindowHandle,(double)100.0,(double)200.0,(double)100.0) ; disp_circle(WindowHandle,(double)200.0,(double)300.0,(double)100.0) ; disp_circle(WindowHandle,(double)300.0,(double)100.0,(double)100.0) ;
::set_gray returns H_MSG_TRUE if GrayValues is displayable and the window is valid. Otherwise an exception handling is raised.
System