get_image_pointer1_rect ( Image : : : PixelPointer, Width, Height, VerticalPitch, HorizontalBitPitch, BitsPerPixel )

Access to the image data pointer and the image data inside the smallest rectangle of the domain of the input image.

The operator get_image_pointer1_rect returns the pointer PixelPointer which points to the beginning of the image data inside the smallest rectangle of the domain of Image. VerticalPitch corresponds to the width of the input image Image multiplied with the number of bytes per pixel (HorizontalBitPitch / 8). Width and Height correspond to the size of the smallest rectangle of the input region. HorizontalBitPitch is the horizontal distance (in bits) between two neighbouring pixels. BitsPerPixel is the number of used bits per pixel. get_image_pointer1_rect is symmetrical to gen_image1_rect.


Attention

The operator get_image_pointer1_rect 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 : byte / uint2 / int4
Input image (Himage).

PixelPointer (output_control)
pointer -> integer
Pointer to the image data.

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

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

VerticalPitch (output_control)
integer -> integer
Width(input image)*(HorizontalBitPitch/8).

HorizontalBitPitch (output_control)
integer -> integer
Distance between two neighbouring pixels in bits .
Default value: 8
List of values: 8, 16, 32

BitsPerPixel (output_control)
integer -> integer
Number of used bits per pixel.
Default value: 8
List of values: 8, 16, 32


Example
Hobject	image,reg,imagereduced;
char		typ[128];
long		width,height,vert_pitch,hori_bit_pitch,bits_per_pix, winID;
unsigned char	*ptr;

open_window(0,0,512,512,"black",winID);
read_image(&image,"monkey");
draw_region(&reg,winID);
reduce_domain(image,reg,&imagereduced);
get_image_pointer1_rect(imagereduced,(long*)&ptr,&width,&height,
                        &vert_pitch,&hori_bit_pitch,&bits_per_pix);

Result

The operator get_image_pointer1_rect returns the value 2 (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.


Parallelization Information

get_image_pointer1_rect is reentrant and processed without parallelization.


Possible Predecessors

read_image, gen_image1_rect


Alternatives

set_grayval, get_grayval, get_image_pointer3, get_image_pointer1


See also

paint_region, paint_gray, gen_image1_rect


Module

Image / region / XLD management



Copyright © 1996-2005 MVTec Software GmbH