GetFunctionalLookupTable method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int GetFunctionalLookupTable(int nStart, int nEnd, int nFactor, int nFlag);

Delphi Syntax

Function GetFunctionalLookupTable (nStart: Integer; nEnd: Integer; nFactor: Integer; nFlag: Integer): Integer;

Overview

Refer to Using Histograms.

Remarks

Updates a range of entries in the HistogramTable property array, based on the specified mathematical method.

The nFactor parameter is used for log and exp functions only.

If uFlag is FLT_EXP the value of nFactor modifies the lookup table values according to the following equations:

image\Equ1.gif

where :

nFirstValue = exp(nFactor * nStart/nEnd).

nLastValue = exp(nFactor)

x = the intensity value of the selected point

If uFlag is FLT_LN the value of nFactor modifies the lookup table values according to the following equations:

image\Equ2.gif

where:

nFirstValue = ln(1+ (nFactor * nStart/nEnd)).

nLastValue = ln(1 + nFactor)

x = the intensity value of the selected point

In the case of linear function, nFactor has no effect. The method performs a linear interpolation between the two points nStart and nEnd and stores the results in the lookup table. The user determines the two points nStart and nEnd and their new values, nFirstValue and nLastValue. The value nFirstValue should be stored in the lookup table at the nStart position and nLastValue at the nEnd position of the lookup table before calling this method.

As an example, suppose a user wants to select a point, change the intensity value of that point (x), and then perform two linear interpolations:

image\sqrblit.gif from 0 to the intensity value x

image\sqrblit.gif from intensity value x to the end of the range

To accomplish this, the user would proceed by doing the following:

image\sqrblit.gif Select the point and get its intensity value (x)

image\sqrblit.gif Change the intensity value of the selected point to some new value (newCol).

image\sqrblit.gif Store the new intensity value in the Lookup table by assignment:

RemapTable(x) = newCol

image\sqrblit.gif Call GetFunctionalLookupTable with nStart set to 0, nEnd set to x, and uFlag set to FLT_LINEAR.

image\sqrblit.gif Call GetFunctionalLookupTable with nStart set to x, nEnd set to 255, and uFlag set to FLT_LINEAR. (For the example, assume the image is 8-bits per pixel.)

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

GetUserLookUpTable method, RemapIntensity method, RemapTable property, RemapTableSize property

Topics:

Changing Brightness and Contrast