疑似カラー表示用マップ生成(double版)

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static int fnFIE_make_pseudo_colormap_dbl(
	DOUBLE_PTR r,
	DOUBLE_PTR g,
	DOUBLE_PTR b,
	int size,
	double scale,
	f_colormap_type type
)
Visual Basic
Public Shared Function fnFIE_make_pseudo_colormap_dbl ( 
	r As DOUBLE_PTR,
	g As DOUBLE_PTR,
	b As DOUBLE_PTR,
	size As Integer,
	scale As Double,
	type As f_colormap_type
) As Integer

Parameters

r
Type: fvalgcli..::..DOUBLE_PTR
赤色テーブル(配列)
g
Type: fvalgcli..::..DOUBLE_PTR
緑色テーブル(配列)
b
Type: fvalgcli..::..DOUBLE_PTR
青色テーブル(配列)
size
Type: System..::..Int32
テーブルサイズ( 1 ≦ size )
scale
Type: System..::..Double
色スケール
type
Type: fvalgcli..::..f_colormap_type
カラーマップタイプ。下記の何れかを指定。
  • F_COLORMAP_GRAY 濃淡カラーマップ
  • F_COLORMAP_RED 赤色カラーマップ
  • F_COLORMAP_GREEN 緑色カラーマップ
  • F_COLORMAP_BLUE 青色カラーマップ
  • F_COLORMAP_RAINBOW7 虹色7色カラーマップ
  • F_COLORMAP_RAINBOW4 虹色4色カラーマップ
  • F_COLORMAP_RAINBOW 虹色カラーマップ
  • F_COLORMAP_LAND 地形図カラーマップ
  • F_COLORMAP_HOTCOLD 赤青カラーマップ
  • F_COLORMAP_LEAF 葉色カラーマップ
  • F_COLORMAP_KAKI 柿色カラーマップ
  • F_COLORMAP_OCEAN 海色カラーマップ

Return Value

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

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_NOMEMORYメモリ不足エラー
F_ERR_INVALID_PARAMパラメータ異常
F_ERR_NO_LICENCEライセンスエラー、または未初期化エラー

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

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

namespace TC
{
    public partial class FIE
    {
        /// <summary>
        /// 疑似カラー表示用マップ生成(double版).
        /// </summary>
        [FvPluginExecute]
        public void fnFIE_make_pseudo_colormap_dbl()
        {
            int status = (int)f_err.F_ERR_NONE;

            FHANDLE hdst = FHANDLE.Zero;    // 出力画像.
            DOUBLE_PTR r = IntPtr.Zero;
            DOUBLE_PTR g = IntPtr.Zero;
            DOUBLE_PTR b = IntPtr.Zero;

            try
            {
                r = DOUBLE_PTR.alloc(256);
                g = DOUBLE_PTR.alloc(256);
                b = DOUBLE_PTR.alloc(256);

                // 出力画像の生成.
                hdst = api.fnFIE_img_root_alloc((int)f_imgtype.F_IMG_DOUBLE, 1, 256, 3);

                // 処理の実行.
                status = api.fnFIE_make_pseudo_colormap_dbl(r, g, b, 256, 1.0, f_colormap_type.F_COLORMAP_GRAY);

                // エラー判定.
                Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);

                // 擬似カラー表示用マップを出力画像領域に配置.
                api.fnFIE_img_clear(hdst, 0.0);
                int height = api.fnFIE_img_get_height(hdst);
                int width = api.fnFIE_img_get_width(hdst);

                DOUBLE_PTR p = api.fnFIE_img_get_adrs(hdst);
                for (int y = 0; y < height; y++)
                {
                    switch (y)
                    {
                        case 0:
                            for (int x = 0; x < width; x++) p[x] = r[x];
                            break;
                        case 1:
                            for (int x = 0; x < width; x++) p[x + 256] = g[x];
                            break;
                        case 2:
                            for (int x = 0; x < width; x++) p[x + 512] = b[x];
                            break;
                    }
                }

                // 出力画像の保存.
                api.fnFIE_save_tiff(ResultDir + "/fnFIE_make_pseudo_colormap_dbl.tiff", hdst, f_tiff_compression.F_TIFF_COMPRESSION_NONE, -1);
            }
            finally
            {
                // オブジェクトの開放.
                hdst.Dispose();
                r.Dispose();
                g.Dispose();
                b.Dispose();
            }
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    ''' <summary>
    ''' 疑似カラー表示用マップ生成(double版).
    ''' </summary>
    <FvPluginExecute> _
    Public Sub fnFIE_make_pseudo_colormap_dbl()
        Dim status As Integer = CInt(f_err.F_ERR_NONE)

        Dim hdst As FHANDLE = FHANDLE.Zero
        ' 出力画像.
        Dim r As DOUBLE_PTR = IntPtr.Zero
        Dim g As DOUBLE_PTR = IntPtr.Zero
        Dim b As DOUBLE_PTR = IntPtr.Zero

        Try
            r = DOUBLE_PTR.alloc(256)
            g = DOUBLE_PTR.alloc(256)
            b = DOUBLE_PTR.alloc(256)

            ' 出力画像の生成.
            hdst = api.fnFIE_img_root_alloc(CInt(f_imgtype.F_IMG_DOUBLE), 1, 256, 3)

            ' 処理の実行.
            status = api.fnFIE_make_pseudo_colormap_dbl(r, g, b, 256, 1.0, f_colormap_type.F_COLORMAP_GRAY)

            ' エラー判定.
            Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))

            ' 擬似カラー表示用マップを出力画像領域に配置.
            api.fnFIE_img_clear(hdst, 0.0)
            Dim height As Integer = api.fnFIE_img_get_height(hdst)
            Dim width As Integer = api.fnFIE_img_get_width(hdst)

            Dim p As DOUBLE_PTR = api.fnFIE_img_get_adrs(hdst)
            For y As Integer = 0 To height - 1
                Select Case y
                    Case 0
                        For x As Integer = 0 To width - 1
                            p(x) = r(x)
                        Next
                        Exit Select
                    Case 1
                        For x As Integer = 0 To width - 1
                            p(x + 256) = g(x)
                        Next
                        Exit Select
                    Case 2
                        For x As Integer = 0 To width - 1
                            p(x + 512) = b(x)
                        Next
                        Exit Select
                End Select
            Next

            ' 出力画像の保存.
            api.fnFIE_save_tiff(ResultDir & "/fnFIE_make_pseudo_colormap_dbl.tiff", hdst, f_tiff_compression.F_TIFF_COMPRESSION_NONE, -1)
        Finally
            ' オブジェクトの開放.
            hdst.Dispose()
            r.Dispose()
            g.Dispose()
            b.Dispose()
        End Try
    End Sub
End Class

See Also