Skip to content

get_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rectget_image_pointer1_rectget_image_pointer1_rect🔗

説明🔗

get_image_pointer1_rectGetImagePointer1RectGetImagePointer1Rectget_image_pointer1_rectget_image_pointer1_rect — 入力画像中の最小矩形内の画像データのポインタへアクセスする。

書式🔗

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 )

説明🔗

オペレーター get_image_pointer1_rectGetImagePointer1Rect は Imageimageimage 領 域の最小矩形内にある画像データの先頭を指すポインタ PixelPointerpixelPointerpixel_pointer を返します。VerticalPitchverticalPitchvertical_pitch は 1 ピク セル毎のバイト数 (HorizontalBitPitchhorizontalBitPitchhorizontal_bit_pitch / 8) を乗じた入力画 像 Imageimageimage の幅に対応します。Widthwidthwidth と Heightheightheight は入力領域の最小矩形サイズに対応します。 HorizontalBitPitchhorizontalBitPitchhorizontal_bit_pitch は2つの隣接ピクセル間の水平距離(ビ ット単位)です。BitsPerPixelbitsPerPixelbits_per_pixel は1ピクセルあたりの使用ビ ット数となります。get_image_pointer1_rectGetImagePointer1Rect は、 gen_image1_rectGenImage1Rect と正反対のオペレーターです。

注意🔗

オペレーター get_image_pointer1_rectGetImagePointer1Rect は新しく生成された画 像へのエントリとしてのみ使用されるべきです。なぜなら、他の画像のグ レイ値が上書きされてしまうためです(関連構造を参照してください )。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

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

入力画像 (HImage)

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

画像データへのポインタ

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

出力画像の幅

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

出力画像の高さ

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

幅(入力画像*(HorizontalBitPitch/8))

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

隣あう2つのピクセル間のビット単位での距離

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

ピクセルあたりの使用ビット数

例🔗

(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)\;

結果🔗

正しく画像が渡されると、オペレーター get_image_pointer1_rectGetImagePointer1Rect は、値 2 (H_MSG_TRUE) を返します。 入力が空だった場合(入力画像が得られない場合)の動作は、オペレー ター set_system('no_object_result',<Result>) で設定されま す。 必要に応じて、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

read_imageReadImage, gen_image1_rectGenImage1Rect

他の選択候補

set_grayvalSetGrayval, get_grayvalGetGrayval, get_image_pointer3GetImagePointer3, get_image_pointer1GetImagePointer1

関連項目

paint_regionPaintRegion, paint_grayPaintGray, gen_image1_rectGenImage1Rect

モジュール🔗

Foundation