ルート画像のコピー

Namespace: fvalgcli
Assembly: fvalgcli_fga (in fvalgcli_fga.dll) Version: 3.1.0.0 (3.1.0.3)

Syntax

C#
public static int fnFGA_img_root_copy(
	FHANDLE hsrc,
	ref FHANDLE hdst
)
Visual Basic
Public Shared Function fnFGA_img_root_copy ( 
	hsrc As FHANDLE,
	ByRef hdst As FHANDLE
) As Integer

Parameters

hsrc
Type: fvalgcli..::..FHANDLE
コピー元のルート画像のハンドル( type: all )
hdst
Type: fvalgcli..::..FHANDLE%
コピーされたルート画像のハンドル
関数エントリー時 *hdst == NULL でなければなりません。

Return Value

Type: Int32
以下のエラーコードを返します。

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_NOMEMORYメモリ不足エラー
F_ERR_INVALID_IMAGE画像オブジェクトの異常
F_ERR_INVALID_PARAMパラメータ異常
F_ERR_NO_LICENCEライセンスエラー、または未初期化エラー

Examples

C# Copy imageCopy
//    $Revision: 1.2 $

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        [FvPluginExecute]
        public void fnFGA_img_root_copy()
        {
            int status = (int)f_err.F_ERR_NONE;

            FHANDLE hsrc = FHANDLE.Zero;    // 処理画像.
            FHANDLE hdst = FHANDLE.Zero;    // 出力画像.

            try
            {
                // 入出力画像の生成.
                hsrc = fga.fnFGA_img_root_alloc(f_imgtype.F_IMG_US16, 3, 320, 240);    // FGA 用.

                // 処理の実行.
                status = fga.fnFGA_img_root_copy(hsrc, ref hdst);
                if (status != (int)f_err.F_ERR_NONE)
                    throw new FvException(status, "エラーが発生しました。");

                // 入力画像の情報取得.
                if (fga.fnFGA_img_get_width(hsrc) != fga.fnFGA_img_get_width(hdst))
                    throw new FvException(f_err.F_ERR_INVALID_IMAGE, "エラーが発生しました。");
                if (fga.fnFGA_img_get_height(hsrc) != fga.fnFGA_img_get_height(hdst))
                    throw new FvException(f_err.F_ERR_INVALID_IMAGE, "エラーが発生しました。");
                if (fga.fnFGA_img_get_channels(hsrc) != fga.fnFGA_img_get_channels(hdst))
                    throw new FvException(f_err.F_ERR_INVALID_IMAGE, "エラーが発生しました。");
                if (fga.fnFGA_img_get_type(hsrc) != fga.fnFGA_img_get_type(hdst))
                    throw new FvException(f_err.F_ERR_INVALID_IMAGE, "エラーが発生しました。");
            }
            finally
            {
                // オブジェクトの開放.
                hsrc.Dispose();
                hdst.Dispose();
            }
        }
    }
}

Exceptions

ExceptionCondition
System.IO..::..FileNotFoundException 実行環境に NVIDIA CUDA Runtime が存在しない場合、FGA ライブラリのロードが失敗し、この例外が発行されます。
必要な環境については FGA ライブラリ説明書 をご参照ください。
例外メッセージの例 (32bit 日本語 O/S の場合):
DLL 'fgamt.x86.3.0.0.dll' を読み込めません: 指定されたモジュールが見つかりません。 (HRESULT からの例外: 0x8007007E)

See Also