ImageGear for C and C++ on Windows v20.1 - Updated
MED_display_color_set
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Display Functions > MED_display_color_set

This function allows applications to apply pseudo-color to 8-16-bit grayscale images.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_display_color_set(
        HIGEAR hIGear, 
        const DWORD dwGrpID,        
        const LPAT_PIXEL lpRLUT, 
        const LPAT_PIXEL lpGLUT, 
        const LPAT_PIXEL lpBLUT
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of the 8-16-bit grayscale image to color.
dwGrpID const DWORD Display group identifier that should be used for display operations.
lpRLUT const LPAT_PIXEL Set to a 256 byte Red table or set to NULL for ramp.
lpGLUT const LPAT_PIXEL Set to a 256 byte Green table or set to NULL for ramp.
lpBLUT const LPAT_PIXEL Set to a 256 byte Blue table or set to NULL for ramp.

Return Value:

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

Supported Raster Image Formats:

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

Example:

 
Copy Code
AT_ERRCOUNT nErrcount;
HIGEAR          hIGear;
{
AT_PIXEL                RLUT[256];
AT_PIXEL                GLUT[256];
AT_PIXEL                BLUT[256];
MED_display_color_create(DCM_PSEUDOCOLOR_SCHEME_6, 0, 0, 0, RLUT, GLUT, BLUT);
MED_display_color_set(hIGear, 0, RLUT, GLUT, BLUT);
repaint_image_and_error_check(hWnd);
}

Remarks:

The 3 LUTs can be user-defined or they can be filled by calling MED_display_color_create(). Each LUT must either be 256 bytes each or set to NULL. If a NULL is passed in as one of the LUTs, a linear 0-255 grayscale LUT is used. If a NULL is not passed in, the LUT points to an array of 256 bytes. The entries from this LUT are used to color the output of the 16x8 LUT.

The pseudo-coloring is not altered by any functions that update the 16x8 LUT. This function alters the display of a grayscale image only and does not change the pixel values of the image or any entries in the 16x8 LUT.

To turn off the pseudo-color, simply pass in NULLs for all of the LUT parameters. These three color channels will be reset to their default linear ramps.

This function does not cause the image to be displayed or repainted. It only fills the 16x8 LUT. To display the results of this function, use IG_dspl_image_draw().

Is this page helpful?
Yes No
Thanks for your feedback.