get_image_pointer__ ( Image : : : Pointer, Type, Width, Height )

Access the pointer of a channel.

The operator get_image_pointer__ 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 HORUS data bank from the HORUS host language via the pointer is possible. An image is stored in HORUS as a vector of image lines. The operator get_image_pointer__ is only of interest for HORUS/C.


Attention

The operator get_image_pointer__ should only be used for entry into newly created images, since otherwise the gray values of other images might be overwritten (see relational structure).


Parameters

Image (input_object)
image -> object
Input image.

Pointer (output_control)
pointer -> integer
Pointer to the image data in the HORUS data bank.

Type (output_control)
string -> string
Type of image.
List of values: 'int1', 'int2', 'int4', 'byte', 'real', 'direction', 'cyclic', 'complex', 'dvf', 'lut'

Width (output_control)
extent.x -> integer
Width of image.

Height (output_control)
extent.y -> integer
Height of image.


Example
ObjType  Bild;
char     typ[128];
long     width,height;
unsigned char *ptr;

read_image(&Bild,"fabrik");
get_image_pointer__(Bild,(long*)&ptr,typ,&width,&height);

Result

The operator get_image_pointer__ returns the value 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 is raised.


Possible Predecessors

read_image, read_picture


Alternatives

set_greyval__, get_greyval__, get_image_pointer3


See also

paint_region__, paint_grey__



Copyright © 1996-1997 MVTec Software GmbH