チャネル別画像ソート
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_img_sort_ch(
FHANDLE hsrc,
FHANDLE hdst
) |
Visual Basic |
---|
Public Shared Function fnFIE_img_sort_ch (
hsrc As FHANDLE,
hdst As FHANDLE
) As Integer |
Parameters
- hsrc
- Type: fvalgcli..::..FHANDLE
入力画像 ( type: uc8, s16, us16, double, i32, ui32, float )
- hdst
- Type: fvalgcli..::..FHANDLE
出力画像 ( type: uc8, s16, us16, double, i32, ui32, float )
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_NOMEMORY | メモリ不足 |
F_ERR_INVALID_IMAGE | 不正な画像オブジェクト |
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_sort_ch()
{
int status = (int)f_err.F_ERR_NONE;
FHANDLE hsrc = FHANDLE.Zero;
FHANDLE hdst = FHANDLE.Zero;
try
{
api.fnFIE_load_img_file(TestImageDir + "/testdata/text_RGB.png",
ref hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8);
int width = api.fnFIE_img_get_width(hsrc);
int height = api.fnFIE_img_get_height(hsrc);
int channels = api.fnFIE_img_get_channels(hsrc);
int type = api.fnFIE_img_get_type(hsrc);
hdst = api.fnFIE_img_root_alloc(type, channels, width, height);
status = api.fnFIE_img_sort_ch(hsrc, hdst);
if (status != 0)
throw new FvException(status);
api.fnFIE_save_png(ResultDir + "/fnFIE_img_sort_ch.png", hdst, -1);
}
finally
{
hsrc.Dispose();
hdst.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_img_sort_ch()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim hsrc As FHANDLE = FHANDLE.Zero
Dim hdst As FHANDLE = FHANDLE.Zero
Try
api.fnFIE_load_img_file(TestImageDir & "/testdata/text_RGB.png", _
hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8)
Dim width As Integer = api.fnFIE_img_get_width(hsrc)
Dim height As Integer = api.fnFIE_img_get_height(hsrc)
Dim channels As Integer = api.fnFIE_img_get_channels(hsrc)
Dim type As Integer = api.fnFIE_img_get_type(hsrc)
hdst = api.fnFIE_img_root_alloc(type, channels, width, height)
status = api.fnFIE_img_sort_ch(hsrc, hdst)
If status <> 0 Then
Throw New FvException(status)
End If
api.fnFIE_save_png(ResultDir & "/fnFIE_img_sort_ch.png", hdst, -1)
Finally
hsrc.Dispose()
hdst.Dispose()
End Try
End Sub
End Class |
See Also