LBitmap::RemapIntensity

#include "ltwrappr.h"

virtual L_INT LBitmap::RemapIntensity(pLUT, uLUTLen, uChannel)

L_UINT * pLUT;

/* table of uLUTLen integers containing lookup values */

L_UINT uLUTLen;

/* length of the lookup table */

L_UINT uChannel;

/* flag that indicates the color channel to be affected */

Uses a lookup table to change the class object's bitmap intensity values. You can apply the change to red, green, blue, or all color channels.

Parameter

Description

pLUT

Table of uLUTLen integers containing lookup values.

uLUTLen

Length of the lookup table. Possible values are:

 

Value

Meaning

 

65536

16-bit / sample image

 

4096

12-bit / sample image

 

256

8-bit / sample image

uChannel

Flag that indicates the color channel to be affected. Possible values are:

 

Value

Meaning

 

CHANNEL_MASTER

[0] All channels.

 

CHANNEL_RED

[1] Red channel only.

 

CHANNEL_GREEN

[2] Green channel only.

 

CHANNEL_BLUE

[3] Blue channel only.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The current intensity values correspond to the table indexes. The values of the entries are the new values to be applied.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The bitmap intensity level range depends on the resolution of the image. For 64-bit, 48-bit, and 16-bit bitmaps, the intensity levels range form 0 to 2^16-1. For 12-bit bitmaps, the intensity levels range from 0 to 2^12-1. For other resolutions, the intensity levels range from 0 to 255.

Be sure that pLUT contains the number of the bitmap intensity levels. For example if the bitmap is 16-bit (the maximum bitmap intensity level is 2^16 – 1).

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LBitmap::GetUserLookupTable, LBitmap::GetFunctionalLookupTable, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::ChangeHue, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members

Topics:

Raster Image Functions: Modifying Intensity Values

 

Changing Brightness and Contrast

 

Raster Image Functions: Changing Brightness and Contrast

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
   L_UINT LookupTable[256];
   
   Bitmap.Load(pszFile);

   LookupTable[0] = 255;
   LookupTable[255] = 0;

   Bitmap.GetFunctionalLookupTable(LookupTable, 256, 0, 255, 0, 
                                   FLT_LINEAR);
   Bitmap.RemapIntensity(LookupTable, 256, CHANNEL_MASTER);
}