Operators |
set_grayval — Set single gray values in an image.
set_grayval sets the gray values of the input image Image at the positions (Row,Column) to the values specified by Grayval. If Image is a multi-channel image, you can either set a single gray value for a pixel and thus set it for all available channels, or you can set the gray values g for all channels individually by concatenating them within Grayval. For example, for a three-channel image three gray values (according to the order of the channels) are specified for each pixel:
[g(channel0,pixel0), g(channel1,pixel0), g(channel2,pixel0), g(channel0,pixel1), ... ].Please note that for complex or vector field images, two gray values per pixel must be specified (per channel).
If the image is of type 'direction', gray values that are not in the value range that is valid for 'direction' images are set to the value 255 to mark them as invalid.
The operator set_grayval produces quite some overhead. Typically, it is used to set single gray values of an image. It is not suitable for programming image processing operations such as filters. In this case it is more useful to use the operator get_image_pointer1 and to directly use the C or C++ interface for integrating own procedures.
Note also that set_grayval modifies the content of an already existing image (Image). Besides, even other image objects may be affected: For example, if you created Image via copy_obj from another image object, set_grayval will also modify the image matrix of this other image object. Therefore, set_grayval should only be used to overpaint newly created image objects.
This operator modifies the state of the following input parameter:
The value of this parameter may not be shared across multiple threads without external synchronization.Image to be modified.
Row coordinates of the pixels to be modified.
Default value: 0
Suggested values: 0, 10, 50, 127, 255, 511
Typical range of values: 0 ≤ Row
Restriction: 0 <= Row && Row < height(Image)
Column coordinates of the pixels to be modified.
Default value: 0
Suggested values: 0, 10, 50, 127, 255, 511
Typical range of values: 0 ≤ Column
Restriction: 0 <= Column && Column < width(Image)
Gray values to be used.
Default value: 255.0
Suggested values: 0.0, 1.0, 10.0, 128.0, 255.0
set_grayval returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.
read_image, get_image_pointer1, gen_image_proto, gen_image1
get_image_pointer1, paint_gray, paint_region
get_grayval, gen_image_const, gen_image1, gen_image_proto
Foundation
Operators |