Skip to content

get_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rectget_image_pointer1_rectget_image_pointer1_rect🔗

Short description🔗

get_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rectget_image_pointer1_rectget_image_pointer1_rect — 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 Image, out pointer PixelPointer, out extent.x Width, out extent.y Height, out integer VerticalPitch, out integer HorizontalBitPitch, out integer BitsPerPixel )void GetImagePointer1Rect( const HObject& Image, HTuple* PixelPointer, HTuple* Width, HTuple* Height, HTuple* VerticalPitch, HTuple* HorizontalBitPitch, HTuple* 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 )def get_image_pointer1_rect( image: HObject ) -> Tuple[int, int, int, int, int, int]

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 )

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

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

Description🔗

The operator get_image_pointer1_rectGetImagePointer1Rect returns the pointer PixelPointerpixelPointerpixel_pointer which points to the beginning of the image data inside the smallest rectangle of the domain of Imageimageimage. VerticalPitchverticalPitchvertical_pitch corresponds to the width of the input image Imageimageimage multiplied with the number of bytes per pixel (HorizontalBitPitchhorizontalBitPitchhorizontal_bit_pitch / 8). Widthwidthwidth and Heightheightheight correspond to the size of the smallest rectangle of the input region. HorizontalBitPitchhorizontalBitPitchhorizontal_bit_pitch is the horizontal distance (in bits) between two neighboring pixels. BitsPerPixelbitsPerPixelbits_per_pixel is the number of used bits per pixel. get_image_pointer1_rectGetImagePointer1Rect is symmetrical to gen_image1_rectGenImage1Rect.

Attention🔗

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Imageimageimage (input_object) singlechannelimage → object (byte / uint2 / int4)HObject (byte / uint2 / int4)HImage (byte / uint2 / int4)HObject (byte / uint2 / int4)Hobject (byte / uint2 / int4)

Input image (HImage).

PixelPointerpixelPointerpixel_pointer (output_control) pointer → (integer)HTuple (Hlong)HTuple (IntPtr)intHtuple (Hlong)

Pointer to the image data.

Widthwidthwidth (output_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the output image.

Heightheightheight (output_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the output image.

VerticalPitchverticalPitchvertical_pitch (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

HorizontalBitPitchhorizontalBitPitchhorizontal_bit_pitch (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Distance between two neighboring pixels in bits .

BitsPerPixelbitsPerPixelbits_per_pixel (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of used bits per pixel.

Example🔗

(C)

Hobject       image,reg,imagereduced\;
char          typ[128]\;
Hlong          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,(Hlong*)&ptr,&width,&height,
                        &vert_pitch,&hori_bit_pitch,&bits_per_pix)\;

Result🔗

The operator get_image_pointer1_rectGetImagePointer1Rect 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 is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_imageReadImage, gen_image1_rectGenImage1Rect

Alternatives

set_grayvalSetGrayval, get_grayvalGetGrayval, get_image_pointer3GetImagePointer3, get_image_pointer1GetImagePointer1

See also

paint_regionPaintRegion, paint_grayPaintGray, gen_image1_rectGenImage1Rect

Module🔗

Foundation