名称
get_image_pointer1_rect - 在输入图像域(ROI)的最小外接矩形内访问图像数据指针和图像数据。
用法
get_image_pointer1_rect(Image : : : PixelPointer, Width, Height, VerticalPitch, HorizontalBitPitch, BitsPerPixel)
描述
算子get_image_pointer1_rect返回指针PixelPointer,它指向Image域的最小矩形内的图像数据的起始内存。 VerticalPitch对应于输入图像的宽度Image乘以每个像素的字节数(HorizontalBitPitch / 8)。 宽度和高度对应于输入区域的最小外接矩形的大小。 HorizontalBitPitch是两个相邻像素之间的水平距离(以位为单位)。 BitsPerPixel是每像素使用的位数。 get_image_pointer1_rect与gen_image1_rect相对称。
注意
算子get_image_pointer1_rect只能用于输入新创建的图像,否则其他图像的灰度值可能会被覆盖(overwritten)(请参阅关系结构)。
并行
● 多线程类型:可重入(与非独占算子并行运行)。
● 多线程范围:全局(可以从任何线程调用)。
● 不并行处理。
参数
Image (input_object) 单通道图像 → object (byte / uint2 / int4)
输入图像(Himage).
PixelPointer (output_control) pointer → (integer)
指向图像数据的指针。
Width (output_control) extent.x → (integer)
输出图像的宽度。
Height (output_control) extent.y → (integer)
输出图像的高度。
VerticalPitch (output_control) integer → (integer)
Width(输入图像)*(HorizontalBitPitch / 8)。
HorizontalBitPitch (output_control) integer → (integer)
两个相邻像素之间的距离
BitsPerPixel (output_control) integer → (integer)
每像素使用的位数。
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(®,winID); reduce_domain(image,reg,&imagereduced); get_image_pointer1_rect(imagereduced,(Hlong*)&ptr,&width,&height, &vert_pitch,&hori_bit_pitch,&bits_per_pix);
结果
算子get_image_pointer1_rect返回值2(H_MSG_TRUE),如果只有一个图像被传递。 空输入(无可用输入图像)时的行为通过算子set_system('no_object_result',<Result>)设置。 如有必要,会引发异常。
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
模块
Foundation