The Color Conversion C++ Class Library provides a color space dialog that can be used to initialize a conversion. To do a dialog based initialization follow the steps below:
Define the following global variables:
LColor clr;
L_UCHAR *pRGBData;
L_UCHAR *pLABData;
L_INT nWidth;
L_INT nHeight;
L_INT nInAlign;
L_INT nOutAlign;
Display the color space dialog box to initialize as follows:
clr.ClrDlg(DLG_LAB, NULL, NULL);
Convert from RGB to CIELab as follows:
clr.Convert(pRGBData, pLABData, nWidth, nHeight, nInAlign, nOutAlign);
At the end, free the color conversion object:
clr.Free();