ガンマ変換用ルックアップテーブルの作成

Namespace: FVIL.Enhance
Assembly: FVILbasic (in FVILbasic.dll) Version: 3.1.0.0 (3.1.0.17)

Syntax

C#
public virtual void CreateGamma(
	ImageType in_type,
	ImageType out_type,
	double gamma
)
Visual Basic
Public Overridable Sub CreateGamma ( 
	in_type As ImageType,
	out_type As ImageType,
	gamma As Double
)

Parameters

in_type
Type: FVIL..::..ImageType
入力画像種別
out_type
Type: FVIL..::..ImageType
出力画像種別
gamma
Type: System..::..Double
ガンマ値 (0より大きい値)

Remarks

ユーザが任意に設定したガンマ値でルックアップテーブルを生成し、 このクラスが保有するルックアップテーブルを更新します。

確保されるテーブルの要素数は、入力画像種別(in_type)に依存します。
テーブルの内容は、下式の通り、ガンマ変換をした後に出力画像型の最大値でスケーリングし、四捨五入しています。

入力画像種別(in_type)要素数変換式
UC8256 table[index] = (index / 255)1/γ * (out_type の最大値)
US1665536 table[index] = (index / 65535)1/γ * (out_type の最大値)
S1665536
  • index が 0~32767 の時
    table[index] = 0
  • index が 32768~65535 の時
    table[index] = ((index-32768) / 32767)1/γ * (out_type の最大値)

処理に失敗した場合は例外を発行します。 例外の原因と発生位置を特定するには、発行された例外クラスの ErrorCode メンバと Function メンバを参照してください。


エラーコード:
ErrorCode メンバ内容
51FVIL.ErrorCode.LICENSE_ERROR ライセンスキーが見つからない為、実行できません。 または、FVIL._SetUp.InitVisionLibrary が実行されていません。
1FVIL.ErrorCode.FAILED_TO_ALLOCATE領域の確保に失敗しました。
11FVIL.ErrorCode.INVALID_PARAMETER引数に指定された値が不正です。

関連する FIE 関数:

fnFIE_lut_set_gamma

Exceptions

ExceptionCondition
FVIL..::..CFviExceptionこの例外の原因については、上記のエラーコード表をご参照ください。

See Also