Urgent Help ~!! Convert Lab to RGB
-
Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..
-
Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..
azusakt wrote:
I have no much idea on the calculations or algorithms.
You don't have much idea or you have absolutely no idea? Tell us what you've tried.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..
azusakt wrote:
I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms.
But documentation exists http://en.wikipedia.org/wiki/Lab_color_space#Advantages_of_Lab[^]. There is also the very nice Guillaume Leparmentier's article [^] here at
CP
. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..
I guess, by using an array structure you can do this. For Example:
static COLORREF arColors[] = { RGB(0,255,0), RGB(0,255,255) }; char* arNames[] = { "green", "cyan" }; for(int i=0; i<2; i++) { arColors[i] = i; // you can try "atof" arNames[i] = atof(i); }
modified on Wednesday, January 30, 2008 4:09:09 AM
-
azusakt wrote:
I have no much idea on the calculations or algorithms.
You don't have much idea or you have absolutely no idea? Tell us what you've tried.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Actually, I'm a beginner in writting Graphic related program. especially in C++. I have no idea on the calculation for processing & converting the LAB to RGB. So I hope to find some examples with codings that I can easily to learn and understand . Could you provide me some program examples if you have this experience. Thanks a lot.
modified on Tuesday, January 29, 2008 10:04:23 PM
-
I guess, by using an array structure you can do this. For Example:
static COLORREF arColors[] = { RGB(0,255,0), RGB(0,255,255) }; char* arNames[] = { "green", "cyan" }; for(int i=0; i<2; i++) { arColors[i] = i; // you can try "atof" arNames[i] = atof(i); }
modified on Wednesday, January 30, 2008 4:09:09 AM
-
Thanks for you reply. Can you provide me a sample code for converting Lab value to RGB value? I've read some documents, they said the step should 1. convert Lab -> XYZ 2. convert XYZ -> RGB I don't know how to write such calculations.
This is a constant RGB macros of the COLORREF structure. Anyway, from 0 to 255 numeric values are equivalence a 24-Bit COLORREF's scope. If you want to chance only RGB macros, you can use the typedef struct tagCOLORREF structure. Forexample:
#define XYZ(int i1, int i2, int i3) 0 int* pNewInt = new int[255]; pNewInt = NULL; #ifdef COLORREF for(int i=0; i<255; i++) { // I'm not sure just as already it will be defined a XYZ macro. RGB(pNewInt[i],pNewInt[i],pNewInt[i]) = XYZ(pNewInt[i],pNewInt[i],pNewInt[i]); } delete []pNewInt; #endif
That is must be a defined tagpoint struct what own yourself.modified on Thursday, January 31, 2008 6:05:14 AM