チャネル別画像ソート

Namespace: fvalgcli
Assembly: 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 imageCopy
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 imageCopy
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