HALCON Reference Manual 10.0.2
Table of Contents / Image / Access ClassesClassesClasses | | | Operators

get_image_pointer1_rectget_image_pointer1_rectget_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rect (Operator)

Name

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

Signature

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

Herror get_image_pointer1_rect(const Hobject Image, Hlong* PixelPointer, Hlong* Width, Hlong* Height, Hlong* VerticalPitch, Hlong* HorizontalBitPitch, Hlong* BitsPerPixel)

Herror T_get_image_pointer1_rect(const Hobject Image, Htuple* PixelPointer, Htuple* Width, Htuple* Height, Htuple* VerticalPitch, Htuple* HorizontalBitPitch, Htuple* BitsPerPixel)

Herror get_image_pointer1_rect(Hobject Image, Hlong* PixelPointer, Hlong* Width, Hlong* Height, Hlong* VerticalPitch, Hlong* HorizontalBitPitch, Hlong* BitsPerPixel)

Hlong HImage::GetImagePointer1Rect(HTuple* Width, HTuple* Height, HTuple* VerticalPitch, HTuple* HorizontalBitPitch, HTuple* BitsPerPixel) const

void HOperatorSetX.GetImagePointer1Rect(
[in] IHUntypedObjectX* Image, [out] VARIANT* PixelPointer, [out] VARIANT* Width, [out] VARIANT* Height, [out] VARIANT* VerticalPitch, [out] VARIANT* HorizontalBitPitch, [out] VARIANT* BitsPerPixel)

Hlong HImageX.GetImagePointer1Rect(
[out] Hlong* Width, [out] Hlong* Height, [out] Hlong* VerticalPitch, [out] Hlong* HorizontalBitPitch, [out] Hlong* BitsPerPixel)

static void HOperatorSet.GetImagePointer1Rect(HObject image, out HTuple pixelPointer, out HTuple width, out HTuple height, out HTuple verticalPitch, out HTuple horizontalBitPitch, out HTuple bitsPerPixel)

IntPtr HImage.GetImagePointer1Rect(out int width, out int height, out int verticalPitch, out int horizontalBitPitch, out int bitsPerPixel)

Description

The operator get_image_pointer1_rectget_image_pointer1_rectget_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rect returns the pointer PixelPointerPixelPointerPixelPointerPixelPointerpixelPointer which points to the beginning of the image data inside the smallest rectangle of the domain of ImageImageImageImageimage. VerticalPitchVerticalPitchVerticalPitchVerticalPitchverticalPitch corresponds to the width of the input image ImageImageImageImageimage multiplied with the number of bytes per pixel (HorizontalBitPitchHorizontalBitPitchHorizontalBitPitchHorizontalBitPitchhorizontalBitPitch / 8). WidthWidthWidthWidthwidth and HeightHeightHeightHeightheight correspond to the size of the smallest rectangle of the input region. HorizontalBitPitchHorizontalBitPitchHorizontalBitPitchHorizontalBitPitchhorizontalBitPitch is the horizontal distance (in bits) between two neighboring pixels. BitsPerPixelBitsPerPixelBitsPerPixelBitsPerPixelbitsPerPixel is the number of used bits per pixel. get_image_pointer1_rectget_image_pointer1_rectget_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rect is symmetrical to gen_image1_rectgen_image1_rectgen_image1_rectGenImage1RectGenImage1Rect.

Attention

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

Parallelization

Parameters

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte / uint2 / int4)

Input image (Himage).

PixelPointerPixelPointerPixelPointerPixelPointerpixelPointer (output_control)  pointer HTupleHTupleVARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Pointer to the image data.

WidthWidthWidthWidthwidth (output_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of the output image.

HeightHeightHeightHeightheight (output_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of the output image.

VerticalPitchVerticalPitchVerticalPitchVerticalPitchverticalPitch (output_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width(input image)*(HorizontalBitPitch/8).

HorizontalBitPitchHorizontalBitPitchHorizontalBitPitchHorizontalBitPitchhorizontalBitPitch (output_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Distance between two neighboring pixels in bits .

BitsPerPixelBitsPerPixelBitsPerPixelBitsPerPixelbitsPerPixel (output_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of used bits per pixel.

Example (C)

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_rectget_image_pointer1_rectget_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rect 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>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

read_imageread_imageread_imageReadImageReadImage, gen_image1_rectgen_image1_rectgen_image1_rectGenImage1RectGenImage1Rect

Alternatives

set_grayvalset_grayvalset_grayvalSetGrayvalSetGrayval, get_grayvalget_grayvalget_grayvalGetGrayvalGetGrayval, get_image_pointer3get_image_pointer3get_image_pointer3GetImagePointer3GetImagePointer3, get_image_pointer1get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1

See also

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion, paint_graypaint_graypaint_grayPaintGrayPaintGray, gen_image1_rectgen_image1_rectgen_image1_rectGenImage1RectGenImage1Rect

Module

Foundation


Table of Contents / Image / Access ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH