ルート画像の確保
Namespace: fvalgcliAssembly: fvalgcli_fga (in fvalgcli_fga.dll) Version: 3.1.0.0 (3.1.0.3)
Syntax
C# |
---|
public static FHANDLE fnFGA_img_root_alloc( f_imgtype type, int channels, int width, int height ) |
Visual Basic |
---|
Public Shared Function fnFGA_img_root_alloc ( type As f_imgtype, channels As Integer, width As Integer, height As Integer ) As FHANDLE |
Parameters
- type
- Type: fvalgcli..::..f_imgtype
確保する画像種別。f_imgtype に定義された定数を指定。
- channels
- Type: System..::..Int32
チャネル数(1〜16)
- width
- Type: System..::..Int32
画像幅(1以上)
- height
- Type: System..::..Int32
画像高さ(1以上)
Return Value
Type: FHANDLE確保された画像のハンドルを返します。 ライセンスエラー、未初期化エラー、またはメモリ不足で確保に失敗した場合はNULLを返します。
Examples
C# | Copy |
---|---|
// $Revision: 1.2 $ using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using fvalgcli; namespace TC { public partial class FIE { /// <summary> /// ルート画像の確保. /// </summary> [FvPluginExecute] public void fnFGA_img_root_alloc() { FHANDLE hroot = FHANDLE.Zero; FHANDLE hchild = FHANDLE.Zero; FHANDLE _adrs0 = FHANDLE.Zero; FHANDLE _adrs1 = FHANDLE.Zero; int type = (int)f_imgtype.F_IMG_UC8; int channels = 3; int width = 640; int height = 480; try { // root 画像生成. hroot = fga.fnFGA_img_root_alloc(type, channels, width, height); if (hroot == IntPtr.Zero) throw new FvException(f_err.F_ERR_NOMEMORY, "fnFGA_img_root_alloc: エラーが発生しました。"); // パラメータ取得. { int _channels = fga.fnFGA_img_get_channels(hroot); int _type = fga.fnFGA_img_get_type(hroot); int _width = fga.fnFGA_img_get_width(hroot); int _height = fga.fnFGA_img_get_height(hroot); SIZE_T _step = fga.fnFGA_img_get_step(hroot); if (_channels != channels) throw new FvException(f_err.F_ERR_INVALID_IMAGE, "チャネル数:期待値と一致しません."); if (_type != type) throw new FvException(f_err.F_ERR_INVALID_IMAGE, "種別:期待値と一致しません."); if (_width != width) throw new FvException(f_err.F_ERR_INVALID_IMAGE, "幅:期待値と一致しません."); if (_height != height) throw new FvException(f_err.F_ERR_INVALID_IMAGE, "高さ:期待値と一致しません."); } } finally { // オブジェクトの開放. hroot.Dispose(); hchild.Dispose(); _adrs0.Dispose(); _adrs1.Dispose(); } } } } |
Exceptions
Exception | Condition |
---|---|
System.IO..::..FileNotFoundException |
実行環境に NVIDIA CUDA Runtime が存在しない場合、FGA ライブラリのロードが失敗し、この例外が発行されます。 必要な環境については FGA ライブラリ説明書 をご参照ください。 例外メッセージの例 (32bit 日本語 O/S の場合): DLL 'fgamt.x86.3.0.0.dll' を読み込めません: 指定されたモジュールが見つかりません。 (HRESULT からの例外: 0x8007007E) |