Access the pointer of a channel.
The operator ::get_image_pointer1 returns a C pointer to the first channel of the image Image. Additionally the image type (Type = 'byte', 'integer', 'float' etc.) and the image size (width and height) are returned. Consequently a direct access to the image data in the HALCON databank from the HALCON host language via the pointer is possible. An image is stored in HALCON as a vector of image lines. The operator ::get_image_pointer1 is only of interest for HALCON/C.
The operator ::get_image_pointer1 should only be used for entry into newly created images, since otherwise the gray values of other images might be overwritten (see relational structure).
|
Image (input_object) |
image -> Hobject: HImage |
| Input image. | |
|
Pointer (output_control) |
pointer -> long * |
| Pointer to the image data in the HALCON databank. | |
|
Type (output_control) |
string -> char * |
| Type of image. | |
| List of values: 'int1', 'int2', 'int4', 'byte', 'real', 'direction', 'cyclic', 'complex', 'dvf', 'lut' | |
|
Width (output_control) |
extent.x -> long * |
| Width of image. | |
|
Height (output_control) |
extent.y -> long * |
| Height of image. | |
Hobject Bild; char typ[128]; long width,height; unsigned char *ptr; read_image(&Bild,"fabrik"); get_image_pointer1(Bild,(long*)&ptr,typ,&width,&height);
The operator ::get_image_pointer1 returns the value H_MSG_TRUE if exactly one image was passed. The behavior in case of empty input (no input images available) is set via the operator ::set_system('no_object_result',<Result>). If necessary an exception handling is raised.
::set_grayval, ::get_grayval, ::get_image_pointer3
Image / region / XLD management