指定座標の濃度値取得
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_img_get_dens(
FHANDLE himg,
int ch,
int x,
int y,
ref double dens
) |
Visual Basic |
---|
Public Shared Function fnFIE_img_get_dens (
himg As FHANDLE,
ch As Integer,
x As Integer,
y As Integer,
ByRef dens As Double
) As Integer |
Parameters
- himg
- Type: fvalgcli..::..FHANDLE
濃度を取得する画像( type: bin, uc8, s16, us16, i32, ui32, double, float, rgbq, rgbtri )
- ch
- Type: System..::..Int32
対象チャネル
- x
- Type: System..::..Int32
対象画素のX座標
- y
- Type: System..::..Int32
対象画素のY座標
- dens
- Type: System..::..Double%
濃度値
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 |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnFIE_img_get_dens()
{
int status = (int)f_err.F_ERR_NONE;
FHANDLE himg = FHANDLE.Zero;
const int ch = 0;
const int x = 10;
const int y = 20;
double dens = 0;
const double dens_init = 100;
try
{
himg = api.fnFIE_img_root_alloc((int)f_imgtype.F_IMG_UC8, ch + 1, x * 2, y * 2);
api.fnFIE_img_clear(himg, dens_init);
status = api.fnFIE_img_get_dens(himg, ch, x, y, ref dens);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
Assert.IsTrue(dens_init == dens, "期待値と一致しません.");
}
finally
{
himg.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_img_get_dens()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim himg As FHANDLE = FHANDLE.Zero
Const ch As Integer = 0
Const x As Integer = 10
Const y As Integer = 20
Dim dens As Double = 0
Const dens_init As Double = 100
Try
himg = api.fnFIE_img_root_alloc(CInt(f_imgtype.F_IMG_UC8), ch + 1, x * 2, y * 2)
api.fnFIE_img_clear(himg, dens_init)
status = api.fnFIE_img_get_dens(himg, ch, x, y, dens)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
Assert.IsTrue(dens_init = dens, "期待値と一致しません.")
Finally
himg.Dispose()
End Try
End Sub
End Class |
See Also