L_RemapBitmapIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RemapBitmapIntensity(pBitmap, pLUT, uLUTLen, uChannel)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_UINT L_FAR * pLUT;

/* table of uLUTLen integers containing lookup values */

L_UINT uLUTLen;

/* length of the lookup table */

L_UINT uChannel;

/* color plane indicator */

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

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the bitmap to be changed.

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

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 L_SetStatusCallback.

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

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.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_GetUserLookUpTable, L_GetFunctionalLookUpTable, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

 

Changing Brightness and Contrast

 

Raster Image Functions: Changing Brightness and Contrast

Example

/* This example will invert loaded bitmap by using lookup table affected by linear function*/

L_UINT LookupTable[256];  /* Array to hold lookup table*/
BITMAPHANDLE LeadBitmap; /*Bitmap handle to hold the loaded image */

/* Load the bitmap, forced to 24 per pixel */
L_LoadBitmap
 (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL); 
/*Get Lookup table where the array calculated by the linear function for all the items of the array is from 0 - 255*/
LookupTable[0] = 255;
LookupTable[255] = 0; 
L_GetFunctionalLookupTable
 (LookupTable, 256,0, 255, 0, FLT_LINEAR);
L_RemapBitmapIntensity
(&LeadBitmap, LookupTable, 256, CHANNEL_MASTER);