ImageGear for C and C++ on Windows v20.0 - Updated
IG_dspl_LUT_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_LUT_set

This function assigns new values to red, green, and blue look-up tables.

Declaration:

 
Copy Code
AT_ERRCOUNT  ACCUAPI  IG_dspl_LUT_set(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] AT_MODE nFlags,
        [IN] const LPBYTE lpRLUT,
        [IN] const LPBYTE lpGLUT,
        [IN] const LPBYTE lpBLUT
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of group in which to set LUT options.
nFlags AT_MODE Specify which look-up tables to set. Possible value is 0 or a combination of flags IG_DSPL_R_CHANNEL - if this flag is set then the lpRLUT parameter of this function is not ignored IG_DSPL_G_CHANNEL - if this flag is set then the lpGLUT parameter of this function is not ignored IG_DSPL_B_CHANNEL - if this flag is set then the lpBLUT parameter of this function is not ignored The constant IG_DSPL_ALL_CHANNELS is defined for convenience and can be used to set all three channels.
 
Copy Code
#define IG_DSPL_ALL_CHANNELS
(IG_DSPL_R_CHANNEL|IG_DSPL_G_CHANNEL|IG_
DSPL_B_CHANNEL)
lpRLUT const LPBYTE Pointer to a 256 element array of a red look-up table to set. If NULL, then identity the array is assigned to RedLut option.
lpGLUT const LPBYTE Pointer to a 256 element array of a green look-up table to set. If NULL, then identity the array is assigned to GreenLut option.
lpBLUT const LPBYTE Pointer to a 256 element array of a blue look-up table to set. If NULL, then identity the array is assigned to BlueLut option.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

None

Example:

 
Copy Code
HIGEAR    hIGear;         /* HIGEAR handle of image  */ 
DWORD    nGrpID;        /* display group identifier  */
BYTE     lut[256];      /* lookup array  */
INT      i;
 ...
/* set inverted look-up table */
for( i = 0; i<256; i++ )
        lut[i] = 255 - i;
IG_dspl_LUT_set( hIGear, nGrpID, IG_DSPL_ALL_CHANNELS, lut, lut, lut );

Remarks:

ImageGear always makes a copy of lpRLUT, lpGLUT and lpBLUT in case they are needed, but does not assign pointers directly so that the application should cleanup the memory allocated for them.
Is this page helpful?
Yes No
Thanks for your feedback.